Copyright © 2011 Citra Technologies. All Rights Reserved.

com.citra.treetable
Class DefaultTreeTableReorder

java.lang.Object
  extended by com.citra.table.TableReorder
      extended by com.citra.treetable.DefaultTreeTableReorder
All Implemented Interfaces:
ReorderListener, EventListener
Direct Known Subclasses:
DatabaseTreeTableReorder, DynamicTreeMapReorder

public class DefaultTreeTableReorder
extends TableReorder

DefaultTreeTableReorder acts on a TreeTable object in order to ensure that the same rows are selected after a ReorderEvent is generated.


Field Summary
protected  boolean shouldProcess
           
 
Fields inherited from class com.citra.table.TableReorder
changedIndices, scrollToSelection, selectedColumns, selectedRows, table
 
Constructor Summary
DefaultTreeTableReorder()
          Constructs a DefaultTreeTableReorder.
DefaultTreeTableReorder(TreeTable table)
          Constructs a DefaultTreeTableReorder.
 
Method Summary
protected  Set createExpansionSet()
          Returns a new instance of the set that will be used to store the tree's expanded nodes.
 int getNewEditRow()
          Determines the displaced row index of the table's editing row, after a model update.
 void reselectTableRows()
          Uses the values stored when the rowsReordered method was called in order to update the table selection.
 void reselectTableRows(int[] selRows, int[] mapIndex)
          Updates the table selection.
 void rowsReordered(ReorderEvent e)
          Called whenever the rows of a JTable have been restructured.
 void setTable(JTable newTable)
          Sets the table to newTable
 
Methods inherited from class com.citra.table.TableReorder
getScrollToSelection, restoreRowHeights, setScrollToSelection
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

shouldProcess

protected boolean shouldProcess
Constructor Detail

DefaultTreeTableReorder

public DefaultTreeTableReorder()
Constructs a DefaultTreeTableReorder.


DefaultTreeTableReorder

public DefaultTreeTableReorder(TreeTable table)
Constructs a DefaultTreeTableReorder.

Method Detail

createExpansionSet

protected Set createExpansionSet()
Returns a new instance of the set that will be used to store the tree's expanded nodes.

Returns:
the expansion set.

reselectTableRows

public void reselectTableRows()
Uses the values stored when the rowsReordered method was called in order to update the table selection.

Overrides:
reselectTableRows in class TableReorder

getNewEditRow

public int getNewEditRow()
Determines the displaced row index of the table's editing row, after a model update. If the table is not being edited, or if the editing row is removed from the view after a model update, this method returns -1.

Overrides:
getNewEditRow in class TableReorder
Returns:
the new row index of the table's editing row

reselectTableRows

public void reselectTableRows(int[] selRows,
                              int[] mapIndex)
Updates the table selection.

Overrides:
reselectTableRows in class TableReorder
Parameters:
selRows - the table's selected rows before an update to the table data was made
mapIndex - an int array showing how the rows have changed place

rowsReordered

public void rowsReordered(ReorderEvent e)
Called whenever the rows of a JTable have been restructured.

Specified by:
rowsReordered in interface ReorderListener
Overrides:
rowsReordered in class TableReorder
Parameters:
e - the ReorderEvent object

setTable

public void setTable(JTable newTable)
Sets the table to newTable

Overrides:
setTable in class TableReorder
Parameters:
newTable - the JTable to set

Copyright © 2011 Citra Technologies. All Rights Reserved.