|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectpivot.wtk.Component
pivot.wtk.TableView
public class TableView
Component that displays a sequence of items partitioned into columns, optionally allowing a user to select one or more rows.
Nested Class Summary | |
---|---|
static interface |
TableView.CellRenderer
Table cell renderer interface. |
static class |
TableView.Column
Contains information about a table column. |
class |
TableView.ColumnSequence
Column sequence implementation. |
static class |
TableView.RowComparator
Compares two rows. |
static interface |
TableView.RowEditor
Table row editor interface. |
static class |
TableView.SelectMode
Enumeration defining supported selection modes. |
static interface |
TableView.Skin
Table view skin interface. |
static class |
TableView.SortHandler
Default sort handler class. |
Nested classes/interfaces inherited from class pivot.wtk.Component |
---|
Component.Attributes, Component.ComponentDictionary, Component.DecoratorSequence, Component.StyleDictionary |
Constructor Summary | |
---|---|
TableView()
Creates a new table view populated with an empty array list. |
|
TableView(List<?> tableData)
Creates a new table view populated with the given table data. |
Method Summary | |
---|---|
void |
addSelectedIndex(int index)
Adds a single index to the selection. |
void |
addSelectedRange(int rangeStart,
int rangeEnd)
Adds a range of indexes to the selection. |
void |
addSelectedRange(Span range)
Adds a range of indexes to the selection. |
void |
clearSelection()
Clears the selection. |
Bounds |
getCellBounds(int rowIndex,
int columnIndex)
Returns the bounding area of a given cell. |
int |
getColumnAt(int x)
Returns the index of the column at a given location. |
Bounds |
getColumnBounds(int columnIndex)
Returns the bounding area of a given column. |
TableView.ColumnSequence |
getColumns()
Returns the table column sequence. |
Sequence<java.lang.Integer> |
getDisabledIndexes()
|
int |
getFirstSelectedIndex()
Returns the first selected index. |
int |
getLastSelectedIndex()
Returns the last selected index. |
int |
getRowAt(int y)
Returns the index of the row at a given location. |
Bounds |
getRowBounds(int rowIndex)
Returns the bounding area of a given row. |
TableView.RowEditor |
getRowEditor()
Returns the editor used to edit rows in this table. |
int |
getSelectedIndex()
When in single-select mode, returns the currently selected index. |
Sequence<Span> |
getSelectedRanges()
Returns the table's current selection. |
java.lang.Object |
getSelectedRow()
|
Sequence<java.lang.Object> |
getSelectedRows()
|
TableView.SelectMode |
getSelectMode()
Returns the current selection mode. |
List<?> |
getTableData()
Returns the table data. |
ListenerList<TableViewColumnListener> |
getTableViewColumnListeners()
|
ListenerList<TableViewListener> |
getTableViewListeners()
|
ListenerList<TableViewRowListener> |
getTableViewRowListeners()
|
ListenerList<TableViewRowStateListener> |
getTableViewRowStateListeners()
|
ListenerList<TableViewSelectionListener> |
getTableViewSelectionListeners()
|
boolean |
isRangeSelected(int rangeStart,
int rangeEnd)
Returns the selection state of a given range. |
boolean |
isRangeSelected(Span range)
Returns the selection state of a given range. |
boolean |
isRowDisabled(int index)
Returns the disabled state of a given row. |
boolean |
isRowSelected(int index)
Returns the selection state of a given index. |
void |
removeSelectedIndex(int index)
Removes a single index from the selection. |
void |
removeSelectedRange(int rangeStart,
int rangeEnd)
Removes a range of indexes from the selection. |
void |
removeSelectedRange(Span range)
Removes a range of indexes from the selection. |
void |
setRowDisabled(int index,
boolean disabled)
Sets the disabled state of a row. |
void |
setRowEditor(TableView.RowEditor rowEditor)
Sets the editor used to edit rows in this table. |
void |
setSelectedIndex(int index)
Sets the selection to a single index. |
void |
setSelectedRanges(Sequence<Span> selectedRanges)
Sets the selection to the given span sequence. |
void |
setSelectMode(java.lang.String selectMode)
|
void |
setSelectMode(TableView.SelectMode selectMode)
Sets the selection mode. |
protected void |
setSkin(Skin skin)
Sets the skin, replacing any previous skin. |
void |
setTableData(List<?> tableData)
Sets the table data. |
void |
setTableData(java.lang.String tableData)
Sets the table data. |
Methods inherited from class java.lang.Object |
---|
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public TableView()
public TableView(List<?> tableData)
tableData
- Method Detail |
---|
protected void setSkin(Skin skin)
Component
setSkin
in class Component
skin
- The new skin.public TableView.ColumnSequence getColumns()
public List<?> getTableData()
public void setTableData(List<?> tableData)
tableData
- The data to be presented by the table.public void setTableData(java.lang.String tableData)
tableData
- A JSON string (must begin with [ and end with ])
denoting the data to be presented by this table.public TableView.RowEditor getRowEditor()
public void setRowEditor(TableView.RowEditor rowEditor)
rowEditor
- The row editor for the list.public int getSelectedIndex()
public void setSelectedIndex(int index)
index
- The index to select, or -1 to clear the selection.public Sequence<Span> getSelectedRanges()
public void setSelectedRanges(Sequence<Span> selectedRanges)
selectedRanges
- The new selectionpublic int getFirstSelectedIndex()
public int getLastSelectedIndex()
public void addSelectedIndex(int index)
index
- The index to add.public void addSelectedRange(int rangeStart, int rangeEnd)
rangeStart
- The first index in the range.rangeEnd
- The last index in the range.public void addSelectedRange(Span range)
range
- The range to add.public void removeSelectedIndex(int index)
index
- The index to remove.public void removeSelectedRange(int rangeStart, int rangeEnd)
rangeStart
- The start of the range to remove.rangeEnd
- The end of the range to remove.public void removeSelectedRange(Span range)
range
- The range to remove.public void clearSelection()
public boolean isRowSelected(int index)
index
- The index whose selection state is to be tested.
public boolean isRangeSelected(int rangeStart, int rangeEnd)
rangeStart
- The first index in the range.rangeEnd
- The last index in the range.
public boolean isRangeSelected(Span range)
range
- The range whose selection state is to be tested.
public java.lang.Object getSelectedRow()
public Sequence<java.lang.Object> getSelectedRows()
public TableView.SelectMode getSelectMode()
public void setSelectMode(TableView.SelectMode selectMode)
selectMode
- The new selection mode.public void setSelectMode(java.lang.String selectMode)
public boolean isRowDisabled(int index)
index
- The index of the row whose disabled state is to be tested.
public void setRowDisabled(int index, boolean disabled)
index
- The index of the row whose disabled state is to be set.disabled
- true to disable the row; false, otherwise.public Sequence<java.lang.Integer> getDisabledIndexes()
public int getRowAt(int y)
y
- The y-coordinate of the row to identify.
public int getColumnAt(int x)
x
- The x-coordinate of the column to identify.
public Bounds getRowBounds(int rowIndex)
rowIndex
- The row index.
public Bounds getColumnBounds(int columnIndex)
columnIndex
- The column index.
public Bounds getCellBounds(int rowIndex, int columnIndex)
rowIndex
- The row index of the cell.columnIndex
- The column index of the cell.
public ListenerList<TableViewListener> getTableViewListeners()
public ListenerList<TableViewColumnListener> getTableViewColumnListeners()
public ListenerList<TableViewRowListener> getTableViewRowListeners()
public ListenerList<TableViewRowStateListener> getTableViewRowStateListeners()
public ListenerList<TableViewSelectionListener> getTableViewSelectionListeners()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |