public class HierarchicalGrid 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
Modifier and Type | Field and Description |
---|---|
static String |
SUBGRID_ROW_STYLE
subgrid row style name
|
Constructor and Description |
---|
HierarchicalGrid(String[] headers,
Class[] columnWidgetClasses)
Creates a new instance of this class.
|
HierarchicalGrid(String[] headers,
Class[] columnWidgetClasses,
boolean resizable)
Creates a new instance of this class.
|
Modifier and Type | Method and Description |
---|---|
void |
addExpandableCellListener(ExpandableCellListener listener)
This method adds an expandable cell listener.
|
void |
addGridPanelFactory(int column,
GridPanelFactory factory)
This method adds a grid panel factory for subgrids.
|
protected void |
collapseCell(int parentRow,
int parentColumn)
This method collapses the cell and removes an appropriate subgrid row.
|
protected void |
deleteSubgrid(EditableModelEvent event)
This method draws a subgrid on remove subgrid event.
|
protected void |
drawSubgrid(EditableModelEvent event)
This method draws a subgrid on add subgrid event.
|
protected void |
enableEvents(boolean enabled)
Enables / disables the event manager.
|
protected void |
expandCell(int parentRow,
int parentColumn)
This method expands the cell and adds a subgrid row below the current row.
|
void |
fireExpandCell(ExpandableCell cell)
This method fires the expand cell event.
|
protected Set<ExpandableCellListener> |
getExpandableCellListeners()
Getter for property 'expandableCellListeners'.
|
GridPanel |
getGridPanel(int parentRow,
int parentColumn)
This method looks for a subgrid panel and returns it if the specified cell
has been a least one time expanded.
|
protected Map<GridDataModel,GridPanel> |
getGridPanelCache()
Getter for property 'gridPanelCache'.
|
protected Map<Integer,GridPanelFactory> |
getGridPanelFactories()
Getter for property 'gridPanelFactories'.
|
protected int |
getGridRowNumber(int parentRow,
int parentColumn)
This method calculates a correct row number of the subgrid 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.
|
boolean |
isExpandable(int column)
This method checks the column for expandability.
|
protected void |
removeColumn(int column)
This method removes the specified column from the grid
Note that it doesn't remove the column from the data model.
|
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.
|
void |
resize()
This method resizes the grid making it fit as much space as possible.
|
void |
selectRows(int toRow)
This method selects the rows between the currently selected row and the specified one including both of them
into the selection.
|
void |
setColumnWidth(int column,
int size)
This method sets column size in pixels.
|
void |
setWidget(int row,
int column,
com.google.gwt.user.client.ui.Widget widget)
This method sets a widget for the cell
If the cell already contains an expandable cell widget, it adds it into this widget.
|
activateCell, addEditCellListener, addGridDecorator, addGridListener, addInvisibleColumn, addListeners, addRow, addRow, addSelectRowListener, deleteRow, deselectCell, detectCurrentSortColumn, display, drawCell, drawColumn, drawContent, drawHeaders, drawRow, 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, getGridRowByRowNumber, getGridRows, getHeaderCell, getHeaders, getInvisibleColumns, getModel, getModelColumn, getModelRow, getOriginalWidget, getReadOnlyColumns, getRowByModelRow, getRowDrawHandler, getSelectionModel, getSelectRowListeners, getSortableHeaders, getSortColumn, hasActiveCell, isAscending, isClientSortEnabled, isLocked, isMultiRowModeEnabled, isReadOnly, isSelected, isSortable, isSorted, isVisible, refreshAll, removeContent, removeEditCellListener, removeGridDecorator, removeGridListener, removeInvisibleColumn, removeSelectRowListener, runDecorators, selectRow, setAscending, setCellComparator, setCurrentCell, setCurrentRow, setDefaultSelectedRow, setFocus, setGridCellfactory, setGridPanel, setGridRenderer, setLocked, setModel, setMultiRowModeEnabled, setReadOnly, setRowDrawHandler, setSelectionModel, setSortable, setSortColumn, sortOnClient, synchronizeDataModel, synchronizeView, updateModel
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, setBodyHeight, setBodyWidth, setBorderWidth, setCellPadding, setCellSpacing, setColumnResizingAllowed, setFooterWidget, setHeaderHeight, setHeaderWidget, setHeaderWidth, setHTML, setResizable, setText, 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 static final String SUBGRID_ROW_STYLE
public HierarchicalGrid(String[] headers, Class[] columnWidgetClasses)
headers
- is a list of header labels (including invisible).columnWidgetClasses
- is a list of column widget classes.public HierarchicalGrid(String[] headers, Class[] columnWidgetClasses, boolean resizable)
headers
- is a list of header labels (including invisible).columnWidgetClasses
- is a list of column widget classes.resizable
- is a column resizability flag value.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 addGridPanelFactory(int column, GridPanelFactory factory)
column
- is a column number.factory
- is a factory instance.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 void setWidget(int row, int column, com.google.gwt.user.client.ui.Widget widget)
If the cell already contains an expandable cell widget, it adds it into this widget.
setWidget
in class SimpleGrid
row
- is a row number.column
- is a column number.widget
- is a widget to be placed in the cell.public GridPanel getGridPanel(int parentRow, int parentColumn)
parentRow
- is a parent cell parentRow.parentColumn
- is a parent cell parentColumn.public void resize()
resize
in interface Resizable
resize
in class SimpleGrid
public void setColumnWidth(int column, int size)
setColumnWidth
in class SimpleGrid
column
- is a column number.size
- is a size value in pixels.public void selectRows(int toRow)
selectRows
in class EditableGrid<Editable>
toRow
- is a right border (a row number that will the end of selection).protected void removeColumn(int column)
removeColumn
in class EditableGrid<Editable>
column
- is a column number to remove.protected void removeRow()
removeRow
in class EditableGrid<Editable>
protected void expandCell(int parentRow, int parentColumn)
parentRow
- is a row number.parentColumn
- is a column number.protected void drawSubgrid(EditableModelEvent event)
event
- is a model event to be handled.protected void collapseCell(int parentRow, int parentColumn)
parentRow
- is a row number..parentColumn
- is a column number.protected void deleteSubgrid(EditableModelEvent event)
event
- is a model event to be handled.protected int getGridRowNumber(int parentRow, int parentColumn)
parentRow
- is a row number of the expanded / collapsed cell.parentColumn
- is a column number of the expanded / collapsed cell.public boolean isExpandable(int column)
column
- is a column number.true
if the column is expandable.protected Set<ExpandableCellListener> getExpandableCellListeners()
protected void increaseRowNumbers(int startRow, int step)
increaseRowNumbers
in class EditableGrid<Editable>
startRow
- is a start row number.step
- is an increase step.protected Map<GridDataModel,GridPanel> getGridPanelCache()
protected Map<Integer,GridPanelFactory> getGridPanelFactories()
protected void enableEvents(boolean enabled)
enabled
- is a flag that means whether the manager must be enabled.Copyright © 2008–2013. All rights reserved.