JIDE 3.5.15

com.jidesoft.list
Interface DualListModel

All Superinterfaces:
ListModel
All Known Implementing Classes:
AbstractDualListModel, DefaultDualListModel

public interface DualListModel
extends ListModel

The model class for DualList.


Field Summary
static int DISABLE_SELECTION
          A value for the selectionMode property: the selected items in the original list will be disabled
static int KEEP_SELECTION
          A value for the selectionMode property: no change to the original list when items are selected.
static int REMOVE_SELECTION
          A value for the selectionMode property: the selected items will be removed from original list.
 
Method Summary
 void addFreezeIndex(int index)
          Freezes the index.
 void addListSelectionListener(ListSelectionListener x)
          Add a listener to the list that's notified each time a change to the selection occurs.
 void addPropertyChangeListener(PropertyChangeListener x)
          Add a PropertyChangeListener to the listener list.
 void addSelectionInterval(int index0, int index1)
          Change the selection to be the set union of the current selection and the indices between index0 and index1 inclusive.
 void clearSelection()
          Change the selection to the empty set.
 int[] getFrozenIndices()
          Gets all frozen indices.
 int[] getSelectedIndices()
          Returns all selected indices in order.
 int getSelectionMode()
          Returns the current selection mode.
 boolean getValueIsAdjusting()
          Returns true if the value is undergoing a series of changes.
 boolean isFreezeIndex(int index)
          Gets if the index is froze.
 boolean isSelectedIndex(int index)
          Returns true if the specified index is selected.
 boolean isSelectionEmpty()
          Returns true if no indices are selected.
 void moveSelection(int index0, int index1, int newIndex, boolean before)
          Moves all indices of an interval to a new index.
 void removeFreezeIndex(int index)
          Unfreezes the index.
 void removeListSelectionListener(ListSelectionListener x)
          Remove a listener from the list that's notified each time a change to the selection occurs.
 void removePropertyChangeListener(PropertyChangeListener x)
          Remove a PropertyChangeListener from the listener list.
 void removeSelectionInterval(int index0, int index1)
          Change the selection to be the set difference of the current selection and the indices between index0 and index1 inclusive.
 void selectAll()
          Select all elements that exist in original list.
 void setSelectionMode(int selectionMode)
          Set the selection mode.
 void setValueIsAdjusting(boolean valueIsAdjusting)
          This property is true if upcoming changes to the value of the model should be considered a single event.
 
Methods inherited from interface javax.swing.ListModel
addListDataListener, getElementAt, getSize, removeListDataListener
 

Field Detail

REMOVE_SELECTION

static final int REMOVE_SELECTION
A value for the selectionMode property: the selected items will be removed from original list.

See Also:
setSelectionMode(int), Constant Field Values

DISABLE_SELECTION

static final int DISABLE_SELECTION
A value for the selectionMode property: the selected items in the original list will be disabled

See Also:
setSelectionMode(int), Constant Field Values

KEEP_SELECTION

static final int KEEP_SELECTION
A value for the selectionMode property: no change to the original list when items are selected.

See Also:
setSelectionMode(int), Constant Field Values
Method Detail

addSelectionInterval

void addSelectionInterval(int index0,
                          int index1)
Change the selection to be the set union of the current selection and the indices between index0 and index1 inclusive. If this represents a change to the current selection, then notify each ListSelectionListener. Note that index0 doesn't have to be less than or equal to index1.

Parameters:
index0 - one end of the interval.
index1 - other end of the interval
See Also:
addListSelectionListener(javax.swing.event.ListSelectionListener)

removeSelectionInterval

void removeSelectionInterval(int index0,
                             int index1)
Change the selection to be the set difference of the current selection and the indices between index0 and index1 inclusive. If this represents a change to the current selection, then notify each ListSelectionListener. Note that index0 doesn't have to be less than or equal to index1.

Parameters:
index0 - one end of the interval.
index1 - other end of the interval
See Also:
addListSelectionListener(javax.swing.event.ListSelectionListener)

isSelectedIndex

boolean isSelectedIndex(int index)
Returns true if the specified index is selected.

Parameters:
index - the specified index
Returns:
true if the specified index is selected.

getSelectedIndices

int[] getSelectedIndices()
Returns all selected indices in order. Note that the return value may have duplicated indices

Returns:
all selected indices in order

moveSelection

void moveSelection(int index0,
                   int index1,
                   int newIndex,
                   boolean before)
Moves all indices of an interval to a new index. note this index is relative to the selected index, not in the original list model.

Parameters:
index0 - one end of the interval.
index1 - other end of the interval
newIndex - new index
before - true if moving the indices before the new index

clearSelection

void clearSelection()
Change the selection to the empty set. If this represents a change to the current selection then notify each ListSelectionListener.

See Also:
addListSelectionListener(javax.swing.event.ListSelectionListener)

isSelectionEmpty

boolean isSelectionEmpty()
Returns true if no indices are selected.

Returns:
true if no indices are selected.

selectAll

void selectAll()
Select all elements that exist in original list.


setValueIsAdjusting

void setValueIsAdjusting(boolean valueIsAdjusting)
This property is true if upcoming changes to the value of the model should be considered a single event. For example if the model is being updated in response to a user drag, the value of the valueIsAdjusting property will be set to true when the drag is initiated and be set to false when the drag is finished. This property allows listeners to to update only when a change has been finalized, rather than always handling all of the intermediate values.

Parameters:
valueIsAdjusting - The new value of the property.
See Also:
getValueIsAdjusting()

getValueIsAdjusting

boolean getValueIsAdjusting()
Returns true if the value is undergoing a series of changes.

Returns:
true if the value is currently adjusting
See Also:
setValueIsAdjusting(boolean)

setSelectionMode

void setSelectionMode(int selectionMode)
Set the selection mode. The following selectionMode values are allowed:

Parameters:
selectionMode - the selection mode
See Also:
getSelectionMode()

getSelectionMode

int getSelectionMode()
Returns the current selection mode.

Returns:
The value of the selectionMode property.
See Also:
setSelectionMode(int)

addFreezeIndex

void addFreezeIndex(int index)
Freezes the index. No matter if the index is selected, the item would not be able to move left or right.

Parameters:
index - the index

removeFreezeIndex

void removeFreezeIndex(int index)
Unfreezes the index.

Parameters:
index - the index

getFrozenIndices

int[] getFrozenIndices()
Gets all frozen indices.

Returns:
the frozen index array

isFreezeIndex

boolean isFreezeIndex(int index)
Gets if the index is froze.

Parameters:
index - the index
Returns:
true if the index is froze. Otherwise false.

addListSelectionListener

void addListSelectionListener(ListSelectionListener x)
Add a listener to the list that's notified each time a change to the selection occurs.

Parameters:
x - the ListSelectionListener
See Also:
removeListSelectionListener(javax.swing.event.ListSelectionListener), addSelectionInterval(int, int), removeSelectionInterval(int, int), clearSelection()

removeListSelectionListener

void removeListSelectionListener(ListSelectionListener x)
Remove a listener from the list that's notified each time a change to the selection occurs.

Parameters:
x - the ListSelectionListener
See Also:
addListSelectionListener(javax.swing.event.ListSelectionListener)

addPropertyChangeListener

void addPropertyChangeListener(PropertyChangeListener x)
Add a PropertyChangeListener to the listener list. The listener is registered for all properties. The same listener object may be added more than once, and will be called as many times as it is added. If listener is null, no exception is thrown and no action is taken.

Parameters:
x - The PropertyChangeListener to be added

removePropertyChangeListener

void removePropertyChangeListener(PropertyChangeListener x)
Remove a PropertyChangeListener from the listener list. This removes a PropertyChangeListener that was registered for all properties. If listener was added more than once to the same event source, it will be notified one less time after being removed. If listener is null, or was never added, no exception is thrown and no action is taken.

Parameters:
x - The PropertyChangeListener to be removed

JIDE 3.5.15