| net.mygwt.ui.client.widget.Component net.mygwt.ui.client.widget.table.Table
Table | public class Table extends Component implements ITable(Code) | | The table is used to display two-dimensional table of cells.
- Styles:
- SINGLE, MULTI, HORIZONTAL
- Events:
- BeforeAdd : (widget, item add)
Fires before a item is added or inserted. Listeners can set the
doit field to false to cancel the action.
- widget : this
- item : the item being added
- index : the index at which the item will be added
- BeforeRemove : (widget, item)
Fires before a item is removed. Listeners can set the doit
field to false to cancel the action.
- widget : this
- item : the item being removed
- Add : (widget, item)
Fires after a item has been added or inserted.
- widget : this
- item : the item that was added
- index : the index at which the item will be added
- Remove : (widget this, item)
Fires after a item has been removed.
- widget : this
- item : the item being removed
- SelectionChange : (widget this)
Fired after the selection has changed
- ContextMenu : (widget)
Fires before the tables context menu is shown. Listeners can set the
doit field to false to cancel the action.
- CellClick : (widget, rowIndex, index, event)
Fired after a cell is clicked
- widget : this
- rowIndex : row index
- index : cell index
- event : the dom event
- CellDoubleClick : (widget, rowIndex, index, event)
Fired after a cell is double clicked
- widget : this
- rowIndex : row index
- index : cell index
- event : the dom event
- ColumnClick : (widget, index column index)
Fired after a column is clicked
- widget : this
- index : the column index
- RowClick : (widget, rowIndex, index cell index, event)
Fired after a row is clicked
- widget : this
- rowIndex : the row index
- index : the cell index
- event : the dom event
- RowDoubleClick : (widget, rowIndex, index cell index, event)
Fired after a row is double clicked
- widget : this
- rowIndex : the row index
- index : the cell index
- event : the dom event
- SortChange : (widget, index, size)
Fires before the table is sorted. Listeners can set the
doit field to false to cancel the action.
- widget : this
- index : the column index
- size : the sort direction
Note: Only one of the styles SINGLE and MULTI may be specified.
See Also: TableColumn See Also: TableColumnModel |
Constructor Summary | |
public | Table() Creates a new single select table. | public | Table(int style, TableColumnModel cm) Creates a new table. |
verticalLines | boolean verticalLines(Code) | | |
Table | public Table()(Code) | | Creates a new single select table. A column model must be set before the
table is rendered.
|
Table | public Table(int style, TableColumnModel cm)(Code) | | Creates a new table.
Parameters: style - the style information Parameters: cm - the column model |
add | public void add(TableItem item)(Code) | | Adds a item to the table.
Parameters: item - the item to be added |
deselect | public void deselect(int index)(Code) | | Deselects the item at the given index.
Parameters: index - the item to deselect |
deselectAll | public void deselectAll()(Code) | | Deselects all items.
|
doAttachChildren | protected void doAttachChildren()(Code) | | |
doDetachChildren | protected void doDetachChildren()(Code) | | |
findItem | public TableItem findItem(Element element)(Code) | | Returns the item using the specified target.
Parameters: element - the element or child element the item |
getColumn | public TableColumn getColumn(int index)(Code) | | Returns the column at the specified index.
Parameters: index - the column index the column |
getColumn | public TableColumn getColumn(String id)(Code) | | Returns the column with the given id.
Parameters: id - the column id the column |
getColumnContextMenu | public boolean getColumnContextMenu()(Code) | | Returns the column context menu enabed state.
true if enabled, false otherwise. |
getColumnCount | public int getColumnCount()(Code) | | Returns the number of columns contained in the table.
the number of columns |
getColumnModel | public TableColumnModel getColumnModel()(Code) | | Returns the table's column model.
the column model |
getItem | public TableItem getItem(int index)(Code) | | Returns the item at the given index.
Parameters: index - the index of the item to return the item at the given index or null |
getItemCount | public int getItemCount()(Code) | | Returns the number of items contained in the table.
the number of items |
getItems | public List getItems()(Code) | | Returns the table's items.
the table items |
getSelectedItem | public TableItem getSelectedItem()(Code) | | Returns the selected item. If the list is multi-select, returns the first
selected item.
the item or null if no selections |
getSelection | public TableItem[] getSelection()(Code) | | Returns an array of TableItems that are currently selected.
a list of selected items |
getSelectionModel | public RowSelectionModel getSelectionModel()(Code) | | Returns the table's selection model.
the selection model |
getStyle | public int getStyle()(Code) | | Returns the table's style information.
the style information |
getTableHeader | public TableHeader getTableHeader()(Code) | | Returns the table's header.
the table header |
getVerticalLines | public boolean getVerticalLines()(Code) | | Returns true if vertical lines are enabled.
the vertical line state |
indexOf | public int indexOf(TableItem item)(Code) | | Returns the index of the item or -1 if not found.
Parameters: item - the search item the index of the item or -1 if not found |
init | protected void init()(Code) | | |
initSelectionModel | protected void initSelectionModel()(Code) | | |
insert | public void insert(TableItem item, int index)(Code) | | Inserts a item into the table.
Parameters: item - the item to insert Parameters: index - the insert location |
isHighlight | public boolean isHighlight()(Code) | | |
onBrowserEvent | public void onBrowserEvent(Event event)(Code) | | |
onRender | protected void onRender()(Code) | | |
onResize | protected void onResize(int width, int height)(Code) | | |
onShowContextMenu | protected void onShowContextMenu(int x, int y)(Code) | | |
recalculate | public void recalculate()(Code) | | Recalculates the ui based on the table's current size.
|
remove | public void remove(TableItem item)(Code) | | Removes the item from the table.
Parameters: item - the item to be removed |
removeAll | public void removeAll()(Code) | | Removes all the item's.
|
scrollIntoView | public void scrollIntoView(TableItem item)(Code) | | Scrolls the item into view.
Parameters: item - the item |
select | public void select(int index)(Code) | | Selects the item at the given index.
Parameters: index - the row to select |
select | public void select(TableItem item)(Code) | | Selects the the item.
Parameters: item - the item to be selected |
setColumnContextMenu | public void setColumnContextMenu(boolean enabled)(Code) | | Sets whether the column context menu is enabled. Initial value is
true .
Parameters: enabled - the enabled state |
setContextMenu | public void setContextMenu(Menu menu)(Code) | | |
setHighlight | public void setHighlight(boolean highlight)(Code) | | |
setSelectionModel | public void setSelectionModel(RowSelectionModel sm)(Code) | | Sets the table's selection model.
Parameters: sm - the selection model |
setStyle | public void setStyle(int style)(Code) | | Sets the table's style. Has no effect if called after the table has been
rendered. See the class documentation for a list of valid style.
Parameters: style - the style |
setTableHeader | public void setTableHeader(TableHeader header)(Code) | | Sets the table's header. Should only be called when providing a custom
table header. Has no effect if called after the table has been rendered.
Parameters: header - the table header |
setVerticalLines | public void setVerticalLines(boolean show)(Code) | | Sets whether cells should have have a horizontal border. Default value is
false .
Parameters: show - true to display horizontal borders |
setView | public void setView(TableView view)(Code) | | Sets the table's view. Provides a way to provide specialized views. table
views.
Parameters: view - the view |
sort | public void sort(int index, int direction)(Code) | | Sorts the table using the specified column index.
Parameters: index - the column index Parameters: direction - the direction to sort (NONE, ASC, DESC) |
Methods inherited from net.mygwt.ui.client.widget.Component | public void addListener(int eventType, Listener listener)(Code)(Java Doc) public void addStyleName(String style)(Code)(Java Doc) public void addWidgetListener(WidgetListener listener)(Code)(Java Doc) protected void afterRender()(Code)(Java Doc) protected Component blur()(Code)(Java Doc) public void disable()(Code)(Java Doc) protected void disableContextMenu(boolean disable)(Code)(Java Doc) public void disableTextSelection(boolean disable)(Code)(Java Doc) public void dispose()(Code)(Java Doc) public void enable()(Code)(Java Doc) public void enableEvents(boolean enable)(Code)(Java Doc) public boolean fireEvent(int type)(Code)(Java Doc) public boolean fireEvent(int type, BaseEvent be)(Code)(Java Doc) public boolean fireEvent(int eventType, Widget widget, Widget item)(Code)(Java Doc) public boolean fireEvent(int eventType, Widget widget, Widget item, int index)(Code)(Java Doc) public Component focus()(Code)(Java Doc) public Rectangle getBounds()(Code)(Java Doc) public Rectangle getBounds(boolean content)(Code)(Java Doc) protected Menu getContextMenu()(Code)(Java Doc) public Object getData()(Code)(Java Doc) public Object getData(String key)(Code)(Java Doc) public String getDisabledStyle()(Code)(Java Doc) public Element getElement()(Code)(Java Doc) protected Element getFocusElement()(Code)(Java Doc) public int getHeight()(Code)(Java Doc) public int getHeight(boolean content)(Code)(Java Doc) public String getId()(Code)(Java Doc) public int getStyle()(Code)(Java Doc) public ToolTip getToolTip()(Code)(Java Doc) public int getWidth()(Code)(Java Doc) public int getWidth(boolean content)(Code)(Java Doc) public void hide()(Code)(Java Doc) public boolean isDisposed()(Code)(Java Doc) public boolean isEnabled()(Code)(Java Doc) public boolean isRendered()(Code)(Java Doc) public boolean isVisible()(Code)(Java Doc) protected void onAttach()(Code)(Java Doc) public void onBaseEvent(BaseEvent be)(Code)(Java Doc) public void onBrowserEvent(Event event)(Code)(Java Doc) protected void onDestroy()(Code)(Java Doc) protected void onDetach()(Code)(Java Doc) protected void onDisable()(Code)(Java Doc) protected void onEnable()(Code)(Java Doc) protected void onHide()(Code)(Java Doc) protected void onHideContextMenu()(Code)(Java Doc) protected void onLoad()(Code)(Java Doc) protected void onRender()(Code)(Java Doc) protected void onResize(int width, int height)(Code)(Java Doc) protected void onRightClick(BaseEvent be)(Code)(Java Doc) protected void onShow()(Code)(Java Doc) protected void onShowContextMenu(int x, int y)(Code)(Java Doc) public void recalculate()(Code)(Java Doc) public void removeAllListeners()(Code)(Java Doc) public void removeFromParent()(Code)(Java Doc) public void removeListener(int eventType, Listener listener)(Code)(Java Doc) public void removeStyleName(String style)(Code)(Java Doc) public void removeWidgetListener(WidgetListener listener)(Code)(Java Doc) protected void render()(Code)(Java Doc) public void setBorders(boolean show)(Code)(Java Doc) public void setBounds(int x, int y, int width, int height)(Code)(Java Doc) public void setBounds(Rectangle rect)(Code)(Java Doc) protected void setContextMenu(Menu menu)(Code)(Java Doc) public void setData(Object data)(Code)(Java Doc) public void setData(String key, Object data)(Code)(Java Doc) public void setDisabledStyle(String style)(Code)(Java Doc) public void setElement(Element elem)(Code)(Java Doc) public void setEnabled(boolean enabled)(Code)(Java Doc) public void setHeight(int height)(Code)(Java Doc) public void setHeight(String height)(Code)(Java Doc) public void setId(String id)(Code)(Java Doc) public void setIntStyleAttribute(String attr, int value)(Code)(Java Doc) public void setPagePosition(int x, int y)(Code)(Java Doc) public void setPixelSize(int width, int height)(Code)(Java Doc) public void setSize(int width, int height)(Code)(Java Doc) public void setSize(String width, String height)(Code)(Java Doc) public void setStyleAttribute(String attr, String value)(Code)(Java Doc) public void setStyleName(String style)(Code)(Java Doc) public void setTitle(String title)(Code)(Java Doc) public void setToolTip(String text)(Code)(Java Doc) public void setToolTip(String title, String text)(Code)(Java Doc) public void setVisible(boolean visible)(Code)(Java Doc) public void setWidth(int width)(Code)(Java Doc) public void setWidth(String width)(Code)(Java Doc) public void show()(Code)(Java Doc) public void unhook(int type, EventListener listener)(Code)(Java Doc)
|
|
|