JIDE 3.5.15

com.jidesoft.grid
Class MixedTableSelectionModelGroup

java.lang.Object
  extended by com.jidesoft.grid.MixedTableSelectionModelGroup
All Implemented Interfaces:
Serializable

public class MixedTableSelectionModelGroup
extends Object
implements Serializable

This class is used to create a multiple-exclusion scope for a set of Table's selectionModel so that only one table can have selected index at a time.

To use this class, you just need to add the TableSelectionModel of the non-contiguous JideTable or ListSelectionModel of JTable depends on its current selection model to the group by calling add(Object). To remove from the group, call remove(Object).

See Also:
Serialized Form

Field Summary
protected  ListSelectionListener _listSelectionListener
           
protected  List _models
           
protected  TableSelectionListener _tableSelectionListener
           
 
Constructor Summary
MixedTableSelectionModelGroup()
          Creates a new MixedTableSelectionModelGroup.
 
Method Summary
 void add(int index, Object model)
          Adds the TableSelectionModel or ListSelectionModel to the group.
 void add(Object model)
          Adds the TableSelectionModel or ListSelectionModel to the group.
 Enumeration getElements()
          Returns all the TableSelectionModels or ListSelectionModels that are participating in this group.
 int getModelCount()
          Returns the number of selectionModels in the group.
 Object getStayModel()
          Get the stay model which will not clear selection on other model's selection change.
 Object[] getTableModels()
          Returns all the TableSelectionModels or ListSelectionModels that are participating in this group.
 void remove(Object model)
          Removes the TableSelectionModel or ListSelectionModel from the group.
 void setStayModel(Object stayModel)
          Set the stay model which will not clear selection on other model's selection change.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_models

protected List _models

_tableSelectionListener

protected TableSelectionListener _tableSelectionListener

_listSelectionListener

protected ListSelectionListener _listSelectionListener
Constructor Detail

MixedTableSelectionModelGroup

public MixedTableSelectionModelGroup()
Creates a new MixedTableSelectionModelGroup.

Method Detail

add

public void add(Object model)
Adds the TableSelectionModel or ListSelectionModel to the group.

Parameters:
model - the TableSelectionModel or ListSelectionModel to be added

add

public void add(int index,
                Object model)
Adds the TableSelectionModel or ListSelectionModel to the group.

Parameters:
index - the position
model - the TableSelectionModel or ListSelectionModel to be added

remove

public void remove(Object model)
Removes the TableSelectionModel or ListSelectionModel from the group.

Parameters:
model - the TableSelectionModel or ListSelectionModel to be removed

getTableModels

public Object[] getTableModels()
Returns all the TableSelectionModels or ListSelectionModels that are participating in this group.

Returns:
an array of all TableSelectionModels or ListSelectionModels

getElements

public Enumeration getElements()
Returns all the TableSelectionModels or ListSelectionModels that are participating in this group.

Returns:
an Enumeration of the selection models in this group

getModelCount

public int getModelCount()
Returns the number of selectionModels in the group.

Returns:
the selectionModel count
Since:
1.3

getStayModel

public Object getStayModel()
Get the stay model which will not clear selection on other model's selection change.

By default, the value is null if every table need to be synchronized. However, if you want to have a master/slave kind of table combination, and you don't want the slave table's selection change affects the master table's selection you can set the master table's selection model by using this method. We call it stay model.

Returns:
the stay model

setStayModel

public void setStayModel(Object stayModel)
Set the stay model which will not clear selection on other model's selection change.

Parameters:
stayModel - the stay model
See Also:
getStayModel()

JIDE 3.5.15