public class TreeGrid extends EditableGrid<Editable> implements ExpandCellEventProducer
SimpleGrid.ResizeListener, SimpleGrid.ResizeTimer
AdvancedFlexTable.AdvancedWidgetIterator, AdvancedFlexTable.ClickTimer, AdvancedFlexTable.RowsScrollPanel
com.google.gwt.user.client.ui.FlexTable.FlexCellFormatter
com.google.gwt.user.client.ui.HTMLTable.Cell, com.google.gwt.user.client.ui.HTMLTable.CellFormatter, com.google.gwt.user.client.ui.HTMLTable.ColumnFormatter, com.google.gwt.user.client.ui.HTMLTable.RowFormatter
Constructor and Description |
---|
TreeGrid(String[] headers,
Class[] columnWidgetClasses)
Creates a tree grid with resizable columns by default.
|
TreeGrid(String[] headers,
Class[] columnWidgetClasses,
boolean resizable)
Creates a tree grid with resizable columns.
|
Modifier and Type | Method and Description |
---|---|
void |
addExpandableCellListener(ExpandableCellListener listener)
This method adds an expandable cell listener.
|
void |
addRow()
This method adds a new empty row into the grid.
|
protected void |
collapseCell(TreeCell cell)
This method collapses the specified cell.
|
protected void |
deleteRow(EditableModelEvent event)
This method removes the row from the subgrid by it's model row number.
|
protected void |
drawCell(EditableModelEvent event)
This method draws a concrete cell.
|
protected void |
drawColumn(int column)
This method draws a column getting data from the data model
If the data model is not specified it does nothing.
|
protected void |
drawContent(TreeGridRow parent)
This method safely draws the subtree specified by its parent row.
|
protected void |
drawRow(EditableModelEvent event)
Draws a grid row on add row event.
|
protected void |
expandCell(TreeCell cell)
This method expands the specified cell.
|
void |
fireExpandCell(ExpandableCell cell)
This method fires the expand cell event.
|
protected List<ExpandableCellListener> |
getExpandableCellListeners()
Getter for property 'expandableCellListeners'.
|
TreeGridRow |
getGridRow(int parentIndex,
int rowIndex)
Gets a tree grid row by parent and child row indexes.
|
GridRow |
getGridRowByRowNumber(int row)
Gets a grid row by a row number in the displayed page.
|
TreeGridRow[] |
getGridRows(int parentIndex)
Gets a list of tree grid rows by the parent index.
|
int |
getRowByModelRow(EditableModelEvent event)
Gets a grid row number on the displayed page by a model row number.
|
protected List<Object> |
getSubtreeColumnData(TreeGridRow parent,
int column,
int count)
This method gets a list of column data values of the specified subtree recursively.
|
protected TreeCell |
getTreeCell(int row)
This renderer returns a tree cell for the specified row.
|
com.google.gwt.user.client.ui.Widget |
getWidget(int row,
int column)
This method returns a widget placed in the cell.
|
protected void |
increaseRowNumbers(int startRow,
int step)
This method increases row numbers in the cells.
|
protected void |
moveLeft()
This method moves the selected row to the left position decreasing its level and changing the row parent
to the super parent row.
|
protected void |
moveRight()
This method moves the selected row to the right position increasing its level and changing the row parent
to the nearest parent row having this new level.
|
void |
removeExpandableCellListener(ExpandableCellListener listener)
Removes expandable cell listener.
|
protected void |
removeRow()
This method removes the currently selected row or several rows if the multi row selection mode enabled.
|
protected void |
removeSubtree(EditableModelEvent event)
This method cleans the subtree in the grid on remove subtree event received from the data model.
|
protected void |
sortOnClient(TreeGridRow parent)
This method performs client sorting of the subtree.
|
protected void |
synchronizeDataModel()
This method invokes the data model handler to synchronize the model and persistence
storage or redraws content if the model is not lazily loadable.
|
protected void |
synchronizeView(EditableModelEvent event)
This method draws a content on the specified model event.
|
protected void |
updateModel(GridCell cell,
Object newValue)
This method updates the model with the new value of the cell on finish edit event.
|
activateCell, addEditCellListener, addGridDecorator, addGridListener, addInvisibleColumn, addListeners, addRow, addSelectRowListener, deselectCell, detectCurrentSortColumn, display, drawContent, drawHeaders, dropSelection, fireAfterDrawEvent, fireBeforeDrawEvent, fireFinishEdit, fireSort, fireStartEdit, getActiveCell, getBodyElement, getCellComparator, getColumnByModelColumn, getColumnWidgetClasses, getCurrentColumn, getCurrentGridRow, getCurrentGridRows, getCurrentRow, getCurrentRows, getCurrentSortColumn, getDecorators, getDefaultSelectedRow, getEditCellListeners, getGridCellFactory, getGridColumn, getGridColumn, getGridColumns, getGridPanel, getGridRenderer, getGridRow, getGridRows, getHeaderCell, getHeaders, getInvisibleColumns, getModel, getModelColumn, getModelRow, getOriginalWidget, getReadOnlyColumns, getRowDrawHandler, getSelectionModel, getSelectRowListeners, getSortableHeaders, getSortColumn, hasActiveCell, isAscending, isClientSortEnabled, isLocked, isMultiRowModeEnabled, isReadOnly, isSelected, isSortable, isSorted, isVisible, refreshAll, removeColumn, removeContent, removeEditCellListener, removeGridDecorator, removeGridListener, removeInvisibleColumn, removeSelectRowListener, runDecorators, selectRow, selectRows, setAscending, setCellComparator, setCurrentCell, setCurrentRow, setDefaultSelectedRow, setFocus, setGridCellfactory, setGridPanel, setGridRenderer, setLocked, setModel, setMultiRowModeEnabled, setReadOnly, setRowDrawHandler, setSelectionModel, setSortable, setSortColumn, sortOnClient
addCell, addClickHandler, addDoubleClickListener, addHeaderCells, checkCellBounds, checkRowBounds, clear, clear, clearCell, createCell, enableVerticalScrolling, getBodyTable, getCellCount, getCellForEvent, getCellFormatter, getCellPadding, getCellSpacing, getColumnFormatter, getDOMCellCount, getDOMCellCount, getDOMRowCount, getDOMRowCount, getEventTargetCell, getFlexCellFormatter, getFooterTable, getFooterTdElement, getFooterWidgets, getHeaderTable, getHeaderWidgets, getHTML, getRowCount, getRowFormatter, getScrollPanel, getTableHeight, getTableWidth, getText, getTFootElement, getTHeadElement, getThElement, getThElementWidth, insertCell, insertCells, insertHeaderCell, insertRow, internalClearCell, isCellPresent, isColumnResizingAllowed, isResizable, makeResizable, onBrowserEvent, prepareCell, prepareColumn, prepareFooterCell, prepareHeaderCell, prepareRow, prepareScrolling, remove, removeAllRows, removeCell, removeCells, removeDoubleClickListener, removeFooterWidget, removeHeaderWidget, removeRow, resize, setBodyHeight, setBodyWidth, setBorderWidth, setCellPadding, setCellSpacing, setColumnResizingAllowed, setColumnWidth, setFooterWidget, setHeaderHeight, setHeaderWidget, setHeaderWidth, setHTML, setResizable, setText, setWidget, wrapContent
addFooterCells, fireClickEvent, fireDoubleClickEvent, getCellClicked, getCellElement, getClickCount, getClickTimer, getDoubleClickListeners, getHandlerManager, isScrollable, iterator, setCellClicked, setCellFormatter, setClickCount, setClickTimer, setColumnFormatter, setDoubleClikcListeners, setHandlerManager, setRowFormatter, setScrollable
addDoubleClickHandler, addDragEndHandler, addDragEnterHandler, addDragHandler, addDragLeaveHandler, addDragOverHandler, addDragStartHandler, addDropHandler, addTableListener, onEnsureDebugId, removeTableListener, setHTML, setWidget
add, add, adopt, adopt, disown, doAttachChildren, doDetachChildren, orphan, remove
addAttachHandler, addBitlessDomHandler, addDomHandler, addHandler, asWidget, asWidgetOrNull, createHandlerManager, delegateEvent, fireEvent, getHandlerCount, getLayoutData, getParent, isAttached, isOrWasAttached, onAttach, onDetach, onLoad, onUnload, removeFromParent, setLayoutData, sinkEvents
addStyleDependentName, addStyleName, ensureDebugId, ensureDebugId, ensureDebugId, getAbsoluteLeft, getAbsoluteTop, getElement, getOffsetHeight, getOffsetWidth, getStyleElement, getStyleName, getStyleName, getStylePrimaryName, getStylePrimaryName, getTitle, isVisible, isVisible, removeStyleDependentName, removeStyleName, resolvePotentialElement, setElement, setElement, setHeight, setPixelSize, setSize, setStyleDependentName, setStyleName, setStyleName, setStyleName, setStyleName, setStylePrimaryName, setStylePrimaryName, setTitle, setVisible, setVisible, setWidth, sinkBitlessEvent, toString, unsinkEvents
public TreeGrid(String[] headers, Class[] columnWidgetClasses)
headers
- is a list of header names.columnWidgetClasses
- is a list of appropriate cell classes.public TreeGrid(String[] headers, Class[] columnWidgetClasses, boolean resizable)
headers
- is a list of header names.columnWidgetClasses
- is a list of appropriate cell classes.resizable
- is a resizability flag. if it's true
th grid will allow resize columns
by a mouse otherwise it won't.public void addExpandableCellListener(ExpandableCellListener listener)
addExpandableCellListener
in interface ExpandCellEventProducer
listener
- a listener instance.public void removeExpandableCellListener(ExpandableCellListener listener)
removeExpandableCellListener
in interface ExpandCellEventProducer
listener
- is a listener to remove.public void fireExpandCell(ExpandableCell cell)
fireExpandCell
in interface ExpandCellEventProducer
cell
- is an expanded / collapsed cell.public com.google.gwt.user.client.ui.Widget getWidget(int row, int column)
If the widget is an expandable cell it returns cell child widget.
getWidget
in class EditableGrid<Editable>
row
- is a row number.column
- is a column number.public TreeGridRow getGridRow(int parentIndex, int rowIndex)
parentIndex
- is a parent row index.rowIndex
- is a row index.public TreeGridRow[] getGridRows(int parentIndex)
parentIndex
- is a parent row index.public GridRow getGridRowByRowNumber(int row)
getGridRowByRowNumber
in class EditableGrid<Editable>
row
- is a row number.public void addRow()
addRow
in class EditableGrid<Editable>
protected void drawCell(EditableModelEvent event)
drawCell
in class EditableGrid<Editable>
event
- is an event on which cell must be drawn.protected void drawColumn(int column)
drawColumn
in class EditableGrid<Editable>
column
- is a column number.protected List<Object> getSubtreeColumnData(TreeGridRow parent, int column, int count)
parent
- is a parent row of the subtree.column
- is a column number.count
- is a current count of column cell displayed above.protected void drawRow(EditableModelEvent event)
drawRow
in class EditableGrid<Editable>
event
- is a model event containing a row number value.protected void removeRow()
removeRow
in class EditableGrid<Editable>
protected void deleteRow(EditableModelEvent event)
deleteRow
in class EditableGrid<Editable>
event
- is a model event containing a row number value and parent row.public int getRowByModelRow(EditableModelEvent event)
getRowByModelRow
in class EditableGrid<Editable>
event
- is a model event containing a row number value.protected void moveLeft()
protected void moveRight()
protected void synchronizeView(EditableModelEvent event)
synchronizeView
in class EditableGrid<Editable>
event
- is a model event.protected void synchronizeDataModel()
synchronizeDataModel
in class EditableGrid<Editable>
protected TreeCell getTreeCell(int row)
null
value.row
- is a row number.null
if there is no such row or the model applied
to this grid doesn't implement Composite
.protected void increaseRowNumbers(int startRow, int step)
increaseRowNumbers
in class EditableGrid<Editable>
startRow
- is a start row number.step
- is an increase step.protected void sortOnClient(TreeGridRow parent)
parent
- is a parent row.protected void updateModel(GridCell cell, Object newValue)
updateModel
in class EditableGrid<Editable>
cell
- is a cell that produced the event.newValue
- is a new value of the cell.protected void drawContent(TreeGridRow parent)
parent
- is a parent row of the subtree.protected void expandCell(TreeCell cell)
cell
- is a cell to expand.protected void collapseCell(TreeCell cell)
cell
- is a cell to collapse.protected void removeSubtree(EditableModelEvent event)
event
- is an event to be handled.protected List<ExpandableCellListener> getExpandableCellListeners()
Copyright © 2008–2013. All rights reserved.