Package docking.widgets.trable
Class DefaultGTrableRowModel<T extends GTrableRow<T>>
java.lang.Object
docking.widgets.trable.AbstractGTrableRowModel<T>
docking.widgets.trable.DefaultGTrableRowModel<T>
- Type Parameters:
T- the row object type
- All Implemented Interfaces:
GTrableRowModel<T>
Default implementation for a simple
GTrable row data model.-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintcollapseRow(int lineIndex) Collapse the row at the given row index.intexpandRow(int lineIndex) Expand the row at the given row index.protected intfindNextIndexAtLowerIndentLevel(int startIndex, int indentLevel) intgetIndentLevel(int rowIndex) Returns the indent level of the row at the given index..getRow(int index) Returns the row object for the given index..intReturns the total number of rows include open child rows..booleanisExpandable(int rowIndex) Returns true if the row at the given index can be expanded.booleanisExpanded(int rowIndex) Returns true if the row at the given index is expanded..protected intremoveIndentedRows(int startIndex, int indentLevel) Methods inherited from class docking.widgets.trable.AbstractGTrableRowModel
addListener, fireModelChanged, removeListener
-
Field Details
-
rows
-
-
Constructor Details
-
DefaultGTrableRowModel
-
-
Method Details
-
getRowCount
public int getRowCount()Description copied from interface:GTrableRowModelReturns the total number of rows include open child rows..- Returns:
- the total number of rows include open child rows.
-
getRow
Description copied from interface:GTrableRowModelReturns the row object for the given index..- Parameters:
index- the index of the row to retrieve- Returns:
- the row object for the given index.
-
getIndentLevel
public int getIndentLevel(int rowIndex) Description copied from interface:GTrableRowModelReturns the indent level of the row at the given index..- Parameters:
rowIndex- the index of the row to get its indent level- Returns:
- the indent level of the row at the given index.
-
isExpanded
public boolean isExpanded(int rowIndex) Description copied from interface:GTrableRowModelReturns true if the row at the given index is expanded..- Parameters:
rowIndex- the index of the row to test for expanded- Returns:
- true if the row at the given index is expanded.
-
isExpandable
public boolean isExpandable(int rowIndex) Description copied from interface:GTrableRowModelReturns true if the row at the given index can be expanded.- Parameters:
rowIndex- the row to test if expandable- Returns:
- true if the row at the given index can be expanded
-
collapseRow
public int collapseRow(int lineIndex) Description copied from interface:GTrableRowModelCollapse the row at the given row index.- Parameters:
lineIndex- the index of the row to collapse- Returns:
- the total number of rows removed due to collapsing the row
-
removeIndentedRows
protected int removeIndentedRows(int startIndex, int indentLevel) -
findNextIndexAtLowerIndentLevel
protected int findNextIndexAtLowerIndentLevel(int startIndex, int indentLevel) -
expandRow
public int expandRow(int lineIndex) Description copied from interface:GTrableRowModelExpand the row at the given row index.- Parameters:
lineIndex- the index of the row to expand- Returns:
- the total number of rows added due to the expand
-