nl.coderight.jazz.form.field
Class ListField<V>

java.lang.Object
  extended by nl.coderight.jazz.form.FormField<V>
      extended by nl.coderight.jazz.form.FormControl<V>
          extended by nl.coderight.jazz.form.field.scrollable.ScrollableField<V>
              extended by nl.coderight.jazz.form.field.selectable.SelectableField<V>
                  extended by nl.coderight.jazz.form.field.selectable.ListSelectableField<V>
                      extended by nl.coderight.jazz.form.field.ListField<V>
All Implemented Interfaces:
DataBindable<V>, DataSelectable<V>, Selection<V>
Direct Known Subclasses:
CheckListField

public class ListField<V>
extends ListSelectableField<V>
implements Selection<V>

Implementation of a JList.

See Also:
JList

Nested Class Summary
static class ListField.ListOrientation
           
 
Nested classes/interfaces inherited from class nl.coderight.jazz.form.field.selectable.SelectableField
SelectableField.KeyTypeSearchListener
 
Nested classes/interfaces inherited from class nl.coderight.jazz.form.field.scrollable.ScrollableField
ScrollableField.ScrollBarCorner, ScrollableField.ScrollBarPolicy
 
Nested classes/interfaces inherited from interface nl.coderight.jazz.form.selection.Selection
Selection.SelectionMode
 
Field Summary
 
Fields inherited from class nl.coderight.jazz.form.FormField
Config
 
Constructor Summary
ListField(String bindID, String selectID)
           
 
Method Summary
protected  void backupSelection()
           
protected  JList createField()
           
 void deselect(int index)
           
 void deselect(int[] indices)
           
 void deselect(int startIndex, int endIndex)
           
 void deselectAll()
           
 String getDisplayID()
           
protected  JList getField()
           
 ListField.ListOrientation getLayoutOrientation()
           
protected  Dimension getPreferredViewportSize()
           
 int getRowHeight()
           
 int getSelectedIndex()
           
 int getSelectionCount()
           
 int[] getSelectionIndices()
           
 Selection.SelectionMode getSelectionMode()
           
 List<V> getSelectionValues()
          Returns selected values or empty list if none are selected.
 boolean isAlternatingColorsEnabled()
           
 boolean isSelectedIndex(int index)
           
 boolean isSelectionEnabled()
           
 int locationToIndex(Point point)
           
protected  void notifyDataChanged()
           
protected  void onDoubleClick()
           
protected  void onEdit()
           
protected  void onSelect()
           
protected  void restoreSelection()
           
 void select(int index)
           
 void select(int[] indices)
           
 void select(int startIndex, int endIndex)
           
 void selectAll()
           
 void setAlternatingColorsEnabled(boolean enabled)
           
protected  void setDefaults()
           
 void setDisplayID(String displayID)
           
 void setLayoutOrientation(ListField.ListOrientation layoutOrientation)
           
 void setOnEditAction(Action onEditAction)
           
 void setOnEditCondition(EditCondition<V> condition)
           
 void setOnEditEvent(Event onEditEvent)
           
 void setRenderer(ListCellRenderer renderer)
           
 void setRowHeight(int rowHeight)
           
 void setSelectedIndex(int index)
           
 void setSelectionBackground(Color selectionBackground)
           
 void setSelectionEnabled(boolean enabled)
           
 void setSelectionForeground(Color selectionForeground)
           
 void setSelectionMode(Selection.SelectionMode selectionMode)
           
 void setSelectionValues(List<V> values)
          Select values.
 void setVisibleRowCount(int rows)
           
 
Methods inherited from class nl.coderight.jazz.form.field.selectable.ListSelectableField
createSortComparator, delete, delete, getData, getIndex, getValue, getValueAt, getValueCount, insert, insert, onFilterChanged, onRebuildFinished, onRebuildProgress, onRebuildStart, setData, setValueAt, sort, update
 
Methods inherited from class nl.coderight.jazz.form.field.selectable.SelectableField
addFilter, dispose, filter, getBindID, getFilters, getRelationID, getSelectID, getSelectionBackground, getSelectionForeground, getSortComparator, getSortID, getSortOrder, getValue, isSortingEnabled, onChange, onFocusGained, onPopup, onSearchFinished, onSearchProgress, onSearchStart, search, search, searchAll, setOnChangeEvent, setOnSelectAction, setOnSelectCondition, setOnSelectEvent, setOnSelectGroup, setRelationID, setSelectID, setSortComparator, setSortID, setSortingEnabled, setSortOrder, setValue
 
Methods inherited from class nl.coderight.jazz.form.field.scrollable.ScrollableField
getComponent, getFocusComponent, getPreferredSize, getViewportSize, isOpaque, isScrollable, onViewportChanged, setBackground, setBackgroundImage, setBorder, setColumnHeader, setComponent, setCorner, setEnabled, setForeground, setOpaque, setPreferredSize, setRowHeader, setScrollable, setScrollBarPolicy, setTitle
 
Methods inherited from class nl.coderight.jazz.form.FormControl
addField, addField, focus, focusField, focusNextField, focusPreviousField, getFields, hasFocus, registerKeyboardAction, setComponent, setLayout
 
Methods inherited from class nl.coderight.jazz.form.FormField
dispatchEvent, focusNextField, focusPreviousField, getBackground, getBorder, getCursor, getDataBinding, getForeground, getForm, getLabel, getParent, getToolTip, isBindable, isChanged, isEnabled, isFocusable, isReadonly, isShowing, isValueChanged, isVisible, onClick, onFocusLost, onMouseEnter, onMouseLeave, setBindID, setChanged, setCursor, setDataBinding, setFocusable, setOnFocusGainedEvent, setOnFocusLostEvent, setPopupMenu, setReadonly, setToolTip, setVisible, translate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface nl.coderight.jazz.form.field.bindable.DataBindable
isReadonly
 

Constructor Detail

ListField

public ListField(String bindID,
                 String selectID)
Method Detail

createField

protected JList createField()

getField

protected JList getField()

getDisplayID

public String getDisplayID()

setDisplayID

public void setDisplayID(String displayID)

setRenderer

public void setRenderer(ListCellRenderer renderer)

setSelectionBackground

public void setSelectionBackground(Color selectionBackground)
Overrides:
setSelectionBackground in class SelectableField<V>

setSelectionForeground

public void setSelectionForeground(Color selectionForeground)
Overrides:
setSelectionForeground in class SelectableField<V>

getPreferredViewportSize

protected Dimension getPreferredViewportSize()

isAlternatingColorsEnabled

public boolean isAlternatingColorsEnabled()

setAlternatingColorsEnabled

public void setAlternatingColorsEnabled(boolean enabled)

getSelectedIndex

public int getSelectedIndex()
Specified by:
getSelectedIndex in class SelectableField<V>

setSelectedIndex

public void setSelectedIndex(int index)
Specified by:
setSelectedIndex in class SelectableField<V>

isSelectedIndex

public boolean isSelectedIndex(int index)

isSelectionEnabled

public boolean isSelectionEnabled()

setSelectionEnabled

public void setSelectionEnabled(boolean enabled)

getSelectionMode

public Selection.SelectionMode getSelectionMode()
Specified by:
getSelectionMode in interface Selection<V>

setSelectionMode

public void setSelectionMode(Selection.SelectionMode selectionMode)
Specified by:
setSelectionMode in interface Selection<V>

getSelectionCount

public int getSelectionCount()
Specified by:
getSelectionCount in interface Selection<V>
Overrides:
getSelectionCount in class SelectableField<V>

getSelectionIndices

public int[] getSelectionIndices()
Specified by:
getSelectionIndices in interface Selection<V>

select

public void select(int index)
Specified by:
select in interface Selection<V>

deselect

public void deselect(int index)
Specified by:
deselect in interface Selection<V>

select

public void select(int startIndex,
                   int endIndex)
Specified by:
select in interface Selection<V>

deselect

public void deselect(int startIndex,
                     int endIndex)
Specified by:
deselect in interface Selection<V>

select

public void select(int[] indices)
Specified by:
select in interface Selection<V>

deselect

public void deselect(int[] indices)
Specified by:
deselect in interface Selection<V>

selectAll

public void selectAll()
Specified by:
selectAll in interface Selection<V>

deselectAll

public void deselectAll()
Specified by:
deselectAll in interface Selection<V>

locationToIndex

public int locationToIndex(Point point)
Specified by:
locationToIndex in class SelectableField<V>

getSelectionValues

public List<V> getSelectionValues()
Returns selected values or empty list if none are selected.

Specified by:
getSelectionValues in interface Selection<V>

setSelectionValues

public void setSelectionValues(List<V> values)
Select values.

Specified by:
setSelectionValues in interface Selection<V>

setVisibleRowCount

public void setVisibleRowCount(int rows)

getLayoutOrientation

public ListField.ListOrientation getLayoutOrientation()

setLayoutOrientation

public void setLayoutOrientation(ListField.ListOrientation layoutOrientation)

getRowHeight

public int getRowHeight()

setRowHeight

public void setRowHeight(int rowHeight)

setOnEditEvent

public void setOnEditEvent(Event onEditEvent)

setOnEditAction

public void setOnEditAction(Action onEditAction)

setOnEditCondition

public void setOnEditCondition(EditCondition<V> condition)

onDoubleClick

protected void onDoubleClick()
Overrides:
onDoubleClick in class FormField<V>

onEdit

protected void onEdit()

onSelect

protected void onSelect()
Overrides:
onSelect in class SelectableField<V>

setDefaults

protected void setDefaults()

backupSelection

protected void backupSelection()
Overrides:
backupSelection in class ListSelectableField<V>

restoreSelection

protected void restoreSelection()
Overrides:
restoreSelection in class ListSelectableField<V>

notifyDataChanged

protected void notifyDataChanged()
Specified by:
notifyDataChanged in class ListSelectableField<V>


Copyright 2010 CodeRight, All rights reserved.