de.matthiasmann.twl
Class TableRowSelectionManager

java.lang.Object
  extended by de.matthiasmann.twl.TableRowSelectionManager
All Implemented Interfaces:
TableSelectionManager

public class TableRowSelectionManager
extends java.lang.Object
implements TableSelectionManager

A row selection model manages table selection on a per row base. Cells are never selected by this model.

See Also:
isCellSelected(int, int)

Nested Class Summary
 
Nested classes/interfaces inherited from interface de.matthiasmann.twl.TableSelectionManager
TableSelectionManager.SelectionGranularity
 
Field Summary
protected  ActionMap actionMap
           
protected static int EXTEND
           
protected static int MOVE
           
protected  TableSelectionModel selectionModel
           
protected static int SET
           
protected  TableBase tableBase
           
protected static int TOGGLE
           
 
Constructor Summary
TableRowSelectionManager()
          Creates a row selection model with a multi selection model.
TableRowSelectionManager(TableSelectionModel selectionModel)
           
 
Method Summary
 void columnInserted(int index, int count)
           
 void columnsDeleted(int index, int count)
           
 void extendSelectionToFirstRow()
           
 void extendSelectionToLastRow()
           
 void extendSelectionToNextPage()
           
 void extendSelectionToNextRow()
           
 void extendSelectionToPreviousPage()
           
 void extendSelectionToPreviousRow()
           
 int getLeadColumn()
           
 int getLeadRow()
           
protected  int getNumRows()
           
protected  int getPageSize()
           
 TableSelectionManager.SelectionGranularity getSelectionGranularity()
           
 TableSelectionModel getSelectionModel()
           
protected  void handleAbsoluteAction(int index, int mode)
           
 boolean handleKeyStrokeAction(java.lang.String action, Event event)
           
protected  boolean handleMouseClick(int row, int column, boolean isShift, boolean isCtrl)
           
protected  void handleMouseDown(int row, int column, boolean isShift, boolean isCtrl)
           
 boolean handleMouseEvent(int row, int column, Event event)
           
protected  void handleRelativeAction(int delta, int mode)
           
 boolean isCellSelected(int row, int column)
          In a row selection model no cell can be selected.
 boolean isRowSelected(int row)
           
 void modelChanged()
           
 void moveLeadToFirstRow()
           
 void moveLeadToLastRow()
           
 void moveLeadToNextPage()
           
 void moveLeadToNextRow()
           
 void moveLeadToPreviousPage()
           
 void moveLeadToPreviousRow()
           
 void rowsDeleted(int index, int count)
           
 void rowsInserted(int index, int count)
           
 void selectAll()
           
 void selectFirstRow()
           
 void selectLastRow()
           
 void selectNextPage()
           
 void selectNextRow()
           
 void selectNone()
           
 void selectPreviousPage()
           
 void selectPreviousRow()
           
 void setAssociatedTable(TableBase base)
           
 void toggleSelectionOnLeadRow()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

actionMap

protected final ActionMap actionMap

selectionModel

protected final TableSelectionModel selectionModel

tableBase

protected TableBase tableBase

TOGGLE

protected static final int TOGGLE
See Also:
Constant Field Values

EXTEND

protected static final int EXTEND
See Also:
Constant Field Values

SET

protected static final int SET
See Also:
Constant Field Values

MOVE

protected static final int MOVE
See Also:
Constant Field Values
Constructor Detail

TableRowSelectionManager

public TableRowSelectionManager(TableSelectionModel selectionModel)

TableRowSelectionManager

public TableRowSelectionManager()
Creates a row selection model with a multi selection model.

See Also:
DefaultTableSelectionModel
Method Detail

getSelectionModel

public TableSelectionModel getSelectionModel()
Specified by:
getSelectionModel in interface TableSelectionManager

setAssociatedTable

public void setAssociatedTable(TableBase base)
Specified by:
setAssociatedTable in interface TableSelectionManager

getSelectionGranularity

public TableSelectionManager.SelectionGranularity getSelectionGranularity()
Specified by:
getSelectionGranularity in interface TableSelectionManager

handleKeyStrokeAction

public boolean handleKeyStrokeAction(java.lang.String action,
                                     Event event)
Specified by:
handleKeyStrokeAction in interface TableSelectionManager

handleMouseEvent

public boolean handleMouseEvent(int row,
                                int column,
                                Event event)
Specified by:
handleMouseEvent in interface TableSelectionManager

isRowSelected

public boolean isRowSelected(int row)
Specified by:
isRowSelected in interface TableSelectionManager

isCellSelected

public boolean isCellSelected(int row,
                              int column)
In a row selection model no cell can be selected. So this method always returns false

Specified by:
isCellSelected in interface TableSelectionManager
Parameters:
row - ignored
column - ignored
Returns:
always false

getLeadRow

public int getLeadRow()
Specified by:
getLeadRow in interface TableSelectionManager

getLeadColumn

public int getLeadColumn()
Specified by:
getLeadColumn in interface TableSelectionManager

modelChanged

public void modelChanged()
Specified by:
modelChanged in interface TableSelectionManager

rowsInserted

public void rowsInserted(int index,
                         int count)
Specified by:
rowsInserted in interface TableSelectionManager

rowsDeleted

public void rowsDeleted(int index,
                        int count)
Specified by:
rowsDeleted in interface TableSelectionManager

columnInserted

public void columnInserted(int index,
                           int count)
Specified by:
columnInserted in interface TableSelectionManager

columnsDeleted

public void columnsDeleted(int index,
                           int count)
Specified by:
columnsDeleted in interface TableSelectionManager

selectNextRow

@ActionMap.Action
public void selectNextRow()

selectPreviousRow

@ActionMap.Action
public void selectPreviousRow()

selectNextPage

@ActionMap.Action
public void selectNextPage()

selectPreviousPage

@ActionMap.Action
public void selectPreviousPage()

selectFirstRow

@ActionMap.Action
public void selectFirstRow()

selectLastRow

@ActionMap.Action
public void selectLastRow()

extendSelectionToNextRow

@ActionMap.Action
public void extendSelectionToNextRow()

extendSelectionToPreviousRow

@ActionMap.Action
public void extendSelectionToPreviousRow()

extendSelectionToNextPage

@ActionMap.Action
public void extendSelectionToNextPage()

extendSelectionToPreviousPage

@ActionMap.Action
public void extendSelectionToPreviousPage()

extendSelectionToFirstRow

@ActionMap.Action
public void extendSelectionToFirstRow()

extendSelectionToLastRow

@ActionMap.Action
public void extendSelectionToLastRow()

moveLeadToNextRow

@ActionMap.Action
public void moveLeadToNextRow()

moveLeadToPreviousRow

@ActionMap.Action
public void moveLeadToPreviousRow()

moveLeadToNextPage

@ActionMap.Action
public void moveLeadToNextPage()

moveLeadToPreviousPage

@ActionMap.Action
public void moveLeadToPreviousPage()

moveLeadToFirstRow

@ActionMap.Action
public void moveLeadToFirstRow()

moveLeadToLastRow

@ActionMap.Action
public void moveLeadToLastRow()

toggleSelectionOnLeadRow

@ActionMap.Action
public void toggleSelectionOnLeadRow()

selectAll

@ActionMap.Action
public void selectAll()

selectNone

@ActionMap.Action
public void selectNone()

handleRelativeAction

protected void handleRelativeAction(int delta,
                                    int mode)

handleAbsoluteAction

protected void handleAbsoluteAction(int index,
                                    int mode)

handleMouseDown

protected void handleMouseDown(int row,
                               int column,
                               boolean isShift,
                               boolean isCtrl)

handleMouseClick

protected boolean handleMouseClick(int row,
                                   int column,
                                   boolean isShift,
                                   boolean isCtrl)

getNumRows

protected int getNumRows()

getPageSize

protected int getPageSize()