|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.pivot.wtk.Component
org.apache.pivot.wtk.TableView
@DefaultProperty(value="tableData") public class TableView
Component that displays a sequence of rows partitioned into columns, optionally allowing a user to select one or more rows.
Nested Class Summary | |
---|---|
static interface |
TableView.CellRenderer
Renderer interface to customize the appearance of a cell in a TableView. |
static class |
TableView.Column
Contains information about a table column. |
class |
TableView.ColumnSequence
Column sequence implementation. |
static interface |
TableView.HeaderDataRenderer
Renderer interface to customize the appearance of the header of a TableView |
static interface |
TableView.RowEditor
Table view row editor interface. |
static interface |
TableView.SelectedRowBindMapping
Translates between selection and bind context data during data binding. |
static class |
TableView.SelectMode
Enumeration defining supported selection modes. |
static interface |
TableView.Skin
Table view skin interface. |
class |
TableView.SortDictionary
Sort dictionary implementation. |
static interface |
TableView.TableDataBindMapping
Translates between table and bind context data during data binding. |
Nested classes/interfaces inherited from class org.apache.pivot.wtk.Component |
---|
Component.DecoratorSequence, Component.StyleDictionary, Component.UserDataDictionary |
Field Summary | |
---|---|
static String |
COLUMN_NAME_KEY
|
static String |
SORT_DIRECTION_KEY
|
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 | |
---|---|
boolean |
addSelectedIndex(int index)
Adds a single index to the selection. |
Sequence<Span> |
addSelectedRange(int start,
int end)
Adds a range of indexes to the selection. |
Sequence<Span> |
addSelectedRange(Span range)
Adds a range of indexes to the selection. |
void |
clear()
Clears any bound values in the component. |
void |
clearSelection()
Clears the selection. |
void |
clearSort()
Clears the sort. |
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. |
TableView |
getColumnSource()
|
Filter<?> |
getDisabledRowFilter()
Returns the disabled row filter. |
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()
Returns the currently selected index, even when in multi-select mode. |
ImmutableList<Span> |
getSelectedRanges()
Returns the currently selected ranges. |
Object |
getSelectedRow()
|
TableView.SelectedRowBindMapping |
getSelectedRowBindMapping()
|
BindType |
getSelectedRowBindType()
|
String |
getSelectedRowKey()
|
Sequence<?> |
getSelectedRows()
|
TableView.SelectedRowBindMapping |
getSelectedRowsBindMapping()
|
BindType |
getSelectedRowsBindType()
|
String |
getSelectedRowsKey()
|
TableView.SelectMode |
getSelectMode()
Returns the current selection mode. |
TableView.SortDictionary |
getSort()
Returns the table view's sort dictionary. |
List<?> |
getTableData()
Returns the table data. |
TableView.TableDataBindMapping |
getTableDataBindMapping()
|
BindType |
getTableDataBindType()
|
String |
getTableDataKey()
|
ListenerList<TableViewBindingListener> |
getTableViewBindingListeners()
|
ListenerList<TableViewColumnListener> |
getTableViewColumnListeners()
|
ListenerList<TableViewListener> |
getTableViewListeners()
|
ListenerList<TableViewRowListener> |
getTableViewRowListeners()
|
ListenerList<TableViewSelectionListener> |
getTableViewSelectionListeners()
|
ListenerList<TableViewSortListener> |
getTableViewSortListeners()
|
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 |
load(Object context)
Copies bound values from the bind context to the component. |
boolean |
removeSelectedIndex(int index)
Removes a single index from the selection. |
Sequence<Span> |
removeSelectedRange(int start,
int end)
Removes a range of indexes from the selection. |
Sequence<Span> |
removeSelectedRange(Span range)
Removes a range of indexes from the selection. |
void |
selectAll()
Selects all rows in the table. |
void |
setColumnSource(TableView columnSource)
|
void |
setDisabledRowFilter(Filter<?> disabledRowFilter)
Sets the disabled row filter. |
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 |
setSelectedRange(int start,
int end)
Sets the selection to a single range. |
Sequence<Span> |
setSelectedRanges(Sequence<Span> selectedRanges)
Sets the selection to the given range sequence. |
Sequence<Span> |
setSelectedRanges(String selectedRanges)
Sets the selection to the given range sequence. |
void |
setSelectedRow(Object row)
|
void |
setSelectedRowBindMapping(TableView.SelectedRowBindMapping selectedRowBindMapping)
|
void |
setSelectedRowBindType(BindType selectedRowBindType)
|
void |
setSelectedRowKey(String selectedRowKey)
|
void |
setSelectedRows(Sequence<Object> rows)
|
void |
setSelectedRowsBindMapping(TableView.SelectedRowBindMapping selectedRowsBindMapping)
|
void |
setSelectedRowsBindType(BindType selectedRowsBindType)
|
void |
setSelectedRowsKey(String selectedRowsKey)
|
void |
setSelectMode(TableView.SelectMode selectMode)
Sets the selection mode. |
protected void |
setSkin(Skin skin)
Sets the skin, replacing any previous skin. |
Dictionary<String,SortDirection> |
setSort(Sequence<Dictionary.Pair<String,SortDirection>> sort)
Sets the table view's sort. |
Dictionary<String,SortDirection> |
setSort(String sort)
Sets the table view's sort. |
Dictionary<String,SortDirection> |
setSort(String columnName,
SortDirection sortDirection)
Sets the table view's sort. |
void |
setTableData(List<?> tableData)
Sets the table data. |
void |
setTableData(String tableData)
Sets the table data. |
void |
setTableData(URL tableData)
Sets the table data. |
void |
setTableDataBindMapping(TableView.TableDataBindMapping tableDataBindMapping)
|
void |
setTableDataBindType(BindType tableDataBindType)
|
void |
setTableDataKey(String tableDataKey)
|
void |
store(Object context)
Copies bound values from the component to the bind context. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final String COLUMN_NAME_KEY
public static final String SORT_DIRECTION_KEY
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 view.public final void setTableData(String tableData)
tableData
- A JSON string (must begin with [ and end with ])
denoting the data to be presented by the table view.public void setTableData(URL tableData)
tableData
- A URL referring to a JSON file containing the data to be presented by
the table view.public TableView getColumnSource()
public void setColumnSource(TableView columnSource)
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 void setSelectedRange(int start, int end)
start
- end
- public ImmutableList<Span> getSelectedRanges()
public Sequence<Span> setSelectedRanges(Sequence<Span> selectedRanges)
selectedRanges
-
public final Sequence<Span> setSelectedRanges(String selectedRanges)
selectedRanges
- A JSON-formatted string containing the ranges to select.
setSelectedRanges(Sequence)
public int getFirstSelectedIndex()
public int getLastSelectedIndex()
public boolean addSelectedIndex(int index)
index
- The index to add.
public Sequence<Span> addSelectedRange(int start, int end)
start
- The first index in the range.end
- The last index in the range.
public Sequence<Span> addSelectedRange(Span range)
range
- The range to add.
public boolean removeSelectedIndex(int index)
index
- The index to remove.
public Sequence<Span> removeSelectedRange(int start, int end)
start
- The start of the range to remove.end
- The end of the range to remove.
public Sequence<Span> removeSelectedRange(Span range)
range
- The range to remove.
public void selectAll()
public void clearSelection()
public boolean isRowSelected(int index)
index
- The index whose selection state is to be tested.
public Object getSelectedRow()
public void setSelectedRow(Object row)
public Sequence<?> getSelectedRows()
public void setSelectedRows(Sequence<Object> rows)
public TableView.SelectMode getSelectMode()
public void setSelectMode(TableView.SelectMode selectMode)
selectMode
- The new selection mode.public TableView.SortDictionary getSort()
public Dictionary<String,SortDirection> setSort(String columnName, SortDirection sortDirection)
columnName
- sortDirection
- public Dictionary<String,SortDirection> setSort(Sequence<Dictionary.Pair<String,SortDirection>> sort)
sort
- A sequence of key/value pairs representing the sort. Keys represent column names and
values represent sort direction.public final Dictionary<String,SortDirection> setSort(String sort)
sort
- A JSON list containing JSON objects representing the sort.setSort(Sequence)
public void clearSort()
public boolean isRowDisabled(int index)
index
- The index of the row whose disabled state is to be tested.
public Filter<?> getDisabledRowFilter()
public void setDisabledRowFilter(Filter<?> disabledRowFilter)
disabledRowFilter
- The disabled row filter, or null for no disabled row filter.public String getTableDataKey()
public void setTableDataKey(String tableDataKey)
public BindType getTableDataBindType()
public void setTableDataBindType(BindType tableDataBindType)
public TableView.TableDataBindMapping getTableDataBindMapping()
public void setTableDataBindMapping(TableView.TableDataBindMapping tableDataBindMapping)
public String getSelectedRowKey()
public void setSelectedRowKey(String selectedRowKey)
public BindType getSelectedRowBindType()
public void setSelectedRowBindType(BindType selectedRowBindType)
public TableView.SelectedRowBindMapping getSelectedRowBindMapping()
public void setSelectedRowBindMapping(TableView.SelectedRowBindMapping selectedRowBindMapping)
public String getSelectedRowsKey()
public void setSelectedRowsKey(String selectedRowsKey)
public BindType getSelectedRowsBindType()
public void setSelectedRowsBindType(BindType selectedRowsBindType)
public TableView.SelectedRowBindMapping getSelectedRowsBindMapping()
public void setSelectedRowsBindMapping(TableView.SelectedRowBindMapping selectedRowsBindMapping)
public void load(Object context)
Component
load
in class Component
public void store(Object context)
Component
store
in class Component
public void clear()
Component
clear
in class Component
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<TableViewSelectionListener> getTableViewSelectionListeners()
public ListenerList<TableViewSortListener> getTableViewSortListeners()
public ListenerList<TableViewBindingListener> getTableViewBindingListeners()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |