|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.google.gwt.user.client.ui.UIObject
com.google.gwt.user.client.ui.Widget
com.google.gwt.user.client.ui.Panel
com.google.gwt.user.client.ui.HTMLTable
com.google.gwt.user.client.ui.FlexTable
org.cafesip.gwtcomp.client.ui.SuperTable
public class SuperTable
A table for listing tabular data with many features. Very often, applications need to display a list of data in tabular format. This widget allows you to create such tables. Here are some of the features this widget supports:
SuperTableProperty object and the
column properties are set using a
ColumnProperty object. These objects
are passed to the table either through the constructor or by the
corresponding setter methods. (See the methods for important restrictions).
CSS Style Rules:
Screen-Shots:
In the above screen-shot, the top row contains a toolbar panel consisting of multiple toolbars. The left-most tool bar is the navigation toolbar for navigating between pages. The next toolbar is the command tool bar where applications can add their own actions such as "remove all selected rows". The righ-most toolbar is the user toolbar that applications can add their own widgets for specific actions. The second row is an application defined header. Applications can add zero or more such header rows. The third row is the column header. What rows are displayed or what toolbars are displayed is determined by the TableProperty and ColumnProperty objects.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class com.google.gwt.user.client.ui.FlexTable |
|---|
FlexTable.FlexCellFormatter |
| Nested classes/interfaces inherited from class com.google.gwt.user.client.ui.HTMLTable |
|---|
HTMLTable.Cell, HTMLTable.CellFormatter, HTMLTable.ColumnFormatter, HTMLTable.RowFormatter |
| Nested classes/interfaces inherited from class com.google.gwt.user.client.ui.UIObject |
|---|
UIObject.DebugIdImpl, UIObject.DebugIdImplEnabled |
| Field Summary |
|---|
| Fields inherited from class com.google.gwt.user.client.ui.UIObject |
|---|
DEBUG_ID_PREFIX |
| Constructor Summary | |
|---|---|
SuperTable()
An empty constructor for this class. |
|
SuperTable(ColumnProperty[] columnsProperty)
A constructor for this class. |
|
SuperTable(ColumnProperty[] columnsProperty,
SuperTableProperty properties)
A constructor for this class with the column and table property objects supplied as parameters. |
|
| Method Summary | |
|---|---|
void |
addRow(Widget[] row)
Add a row to the table |
void |
addRow(Widget[] row,
boolean selected)
Add a row to the table and set it to selected. |
void |
addTableListener(SuperTableListener listener)
Add a table listener. |
void |
addToUserToolbar(Widget w)
Add an entry into the user tool bar. |
void |
addUserHeader(Widget widget)
Adds a user header. |
void |
clear()
|
void |
deleteRow(int index)
Delete a row from the table. |
ColumnProperty[] |
getColumnsProperty()
Returns the column property object. |
ListBox |
getCommandList()
Returns the list box containing the application-defined list action items. |
int |
getCurrentPageRecordCount()
Returns the row count in a current page. |
int |
getFirstRowIndex()
Returns the index of the first row in the current page. |
Widget[][] |
getRows()
Returns all the rows entries (and columns) |
int |
getRowSize()
Return the number of rows. |
int[] |
getSelectedCell()
Returns the user-selected cell. |
int |
getSelectedRowIndex()
Returns the selected row index. |
int[] |
getSelectedRowIndices()
Returns the indicies of the selected rows. |
ArrayList<Widget[]> |
getTableContent()
Returns the content of the table in array list format. |
SuperTableProperty |
getTableProperty()
Returns the table property. |
ToolbarPanel |
getToolbarPanel()
Returns the toolbar panel object on the first row. |
Toolbar |
getUserBar()
Returns the user tool bar. |
boolean |
isCellSelected(int row,
int col)
Is the given cell selected? |
boolean |
isRowInPage(int row)
Check if a row is in the current page. |
boolean |
isRowSelected(int row)
Returns if the row is selected. |
void |
redraw()
In some cases, the table does not diplay the toolbar panel properly for very complex reasons. |
void |
removeTableListener(SuperTableListener listener)
Remove a table listener. |
void |
setCell(Widget w,
int row,
int col)
Replaces the widget in a given cell with a new one. |
void |
setCellSelected(int row,
int col,
boolean selected)
Select/deselect a cell. |
void |
setColumnsProperty(ColumnProperty[] columnsProperty)
Sets the column property. |
void |
setRow(Widget[] row,
int index)
Replaces a row with a new row. |
void |
setRow(Widget[] row,
int index,
Boolean selected)
Replaces a row with a new row. |
void |
setRowSelected(int row,
boolean selected)
Select or deselect a row. |
void |
setTableProperty(SuperTableProperty tableProperty)
Sets the table property. |
| Methods inherited from class com.google.gwt.user.client.ui.FlexTable |
|---|
addCell, getCellCount, getFlexCellFormatter, getRowCount, insertCell, insertRow, prepareCell, prepareRow, removeAllRows, removeCell, removeCells, removeRow |
| Methods inherited from class com.google.gwt.user.client.ui.HTMLTable |
|---|
addClickHandler, addTableListener, checkCellBounds, checkRowBounds, clear, clearCell, createCell, getBodyElement, getCellForEvent, getCellFormatter, getCellPadding, getCellSpacing, getColumnFormatter, getDOMCellCount, getDOMCellCount, getDOMRowCount, getDOMRowCount, getEventTargetCell, getHTML, getRowFormatter, getText, getWidget, insertCells, internalClearCell, isCellPresent, iterator, onEnsureDebugId, prepareColumn, remove, removeTableListener, setBorderWidth, setCellFormatter, setCellPadding, setCellSpacing, setColumnFormatter, setHTML, setRowFormatter, setText, setWidget |
| Methods inherited from class com.google.gwt.user.client.ui.Panel |
|---|
add, adopt, adopt, disown, doAttachChildren, doDetachChildren, onLoad, onUnload, orphan |
| Methods inherited from class com.google.gwt.user.client.ui.Widget |
|---|
addDomHandler, addHandler, delegateEvent, fireEvent, getHandlerCount, getLayoutData, getParent, isAttached, isOrWasAttached, onAttach, onBrowserEvent, onDetach, removeFromParent, setLayoutData, sinkEvents |
| Methods inherited from class com.google.gwt.user.client.ui.UIObject |
|---|
addStyleDependentName, addStyleName, ensureDebugId, ensureDebugId, ensureDebugId, getAbsoluteLeft, getAbsoluteTop, getElement, getOffsetHeight, getOffsetWidth, getStyleElement, getStyleName, getStyleName, getStylePrimaryName, getStylePrimaryName, getTitle, isVisible, isVisible, removeStyleDependentName, removeStyleName, setElement, setElement, setHeight, setPixelSize, setSize, setStyleName, setStyleName, setStyleName, setStylePrimaryName, setStylePrimaryName, setTitle, setVisible, setVisible, setWidth, toString, unsinkEvents |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface com.google.gwt.event.shared.HasHandlers |
|---|
fireEvent |
| Constructor Detail |
|---|
public SuperTable()
public SuperTable(ColumnProperty[] columnsProperty)
columnsProperty - column property object
public SuperTable(ColumnProperty[] columnsProperty,
SuperTableProperty properties)
columnsProperty - tableProperty for each column in the table.tableProperty - table tableProperty.| Method Detail |
|---|
public void addRow(Widget[] row)
row - widgets belonging to the row, each element in the array
contains a column entry for the row.
public void addRow(Widget[] row,
boolean selected)
row - widgets belonging to the row, each element in the array
contains a column entry for the row.selected - whether the row is selected (will only be set to selected if
SuperTableProperty.rowSelectionEnabled() is set to true).public void addTableListener(SuperTableListener listener)
listener - the listener object.public void addToUserToolbar(Widget w)
w - the widget to add.public void addUserHeader(Widget widget)
widget - the widget to add. Normally, a panel of some type is added.public void clear()
clear in interface HasWidgetsclear in class HTMLTablepublic void deleteRow(int index)
index - the index starting with 0.public ColumnProperty[] getColumnsProperty()
public ListBox getCommandList()
public int getCurrentPageRecordCount()
public int getFirstRowIndex()
public Widget[][] getRows()
public int getRowSize()
public int[] getSelectedCell()
public int getSelectedRowIndex()
public int[] getSelectedRowIndices()
public ArrayList<Widget[]> getTableContent()
public SuperTableProperty getTableProperty()
public ToolbarPanel getToolbarPanel()
public Toolbar getUserBar()
public boolean isCellSelected(int row,
int col)
row - row indexcol - column index
public boolean isRowInPage(int row)
row - the row number starting with 0.
public boolean isRowSelected(int row)
row - row number starting with 0.
public void removeTableListener(SuperTableListener listener)
listener - the listener object to remove.
public void setCell(Widget w,
int row,
int col)
w - the new widget object.row - row indexcol - column index
public void setCellSelected(int row,
int col,
boolean selected)
row - col - selected - public void setColumnsProperty(ColumnProperty[] columnsProperty)
columnsProperty - The columnsProperty to set.
public void setRow(Widget[] row,
int index)
row - the new rowindex - the row index.
public void setRow(Widget[] row,
int index,
Boolean selected)
row - the new rowindex - the row indexselected - if set to null, the row attribute is not modified; if not
null, the row is set selected or not according to the value.
public void setRowSelected(int row,
boolean selected)
row - row indexselected - true or false.public void setTableProperty(SuperTableProperty tableProperty)
tableProperty - The tableProperty to set.public void redraw()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||