public abstract class AbstractGrid<R extends Row> extends com.google.gwt.user.client.ui.Composite implements HasRowClickHandlers, HasRowDoubleClickHandlers, HasRowRenderHandlers, HasBeforeShowDetailsHandlers, HasShowRowDetailsHandlers, HasLoadRowDetailsHandlers, HasBeforeRowEditHandlers, HasRowEditHandlers, HasBeforeSaveRowEditionHandler, HasBeforeCancelRowEditionHandler, HasCancelRowEditionHandler, HasRowEditingHandlers
render() in their constructors.| Modifier and Type | Field and Description |
|---|---|
protected org.cruxframework.crux.core.client.collection.FastList<BeforeCancelRowEditionHandler> |
beforeCancelRowEditionHandlers |
protected org.cruxframework.crux.core.client.collection.FastList<BeforeSaveRowEditionHandler> |
beforeSaveRowEditionHandlers |
protected ColumnDefinitions |
definitions |
protected boolean |
freezeHeaders |
protected String |
generatedId |
protected Boolean |
hasFrozenColumns |
protected boolean |
highlightRowOnMouseOver |
protected RowDetailWidgetCreator |
rowDetailWidgetCreator |
protected org.cruxframework.crux.core.client.collection.FastList<R> |
rows |
protected RowSelectionModel |
rowSelection |
protected com.google.gwt.user.client.ui.ScrollPanel |
scrollingArea |
protected boolean |
showRowDetailsIcon |
protected boolean |
stretchColumns |
protected GridBaseTable |
table |
protected Map<com.google.gwt.user.client.ui.Widget,R> |
widgetsPerRow |
| Constructor and Description |
|---|
AbstractGrid(ColumnDefinitions columnDefinitions,
RowSelectionModel rowSelection,
int cellSpacing,
boolean stretchColumns,
boolean highlightRowOnMouseOver,
boolean fixedCellSize)
Full constructor
|
AbstractGrid(ColumnDefinitions columnDefinitions,
RowSelectionModel rowSelection,
int cellSpacing,
boolean stretchColumns,
boolean highlightRowOnMouseOver,
boolean fixedCellSize,
RowDetailWidgetCreator rowDetailWidgetCreator,
boolean showRowDetailsIcon,
boolean freezeHeaders)
Full constructor
|
| Modifier and Type | Method and Description |
|---|---|
com.google.gwt.event.shared.HandlerRegistration |
addBeforeCancelRowEditionHandler(BeforeCancelRowEditionHandler handler) |
com.google.gwt.event.shared.HandlerRegistration |
addBeforeRowEditHandler(BeforeRowEditHandler handler) |
com.google.gwt.event.shared.HandlerRegistration |
addBeforeSaveRowEditionHandler(BeforeSaveRowEditionHandler handler) |
com.google.gwt.event.shared.HandlerRegistration |
addBeforeShowRowDetailsHandler(BeforeShowRowDetailsHandler handler) |
com.google.gwt.event.shared.HandlerRegistration |
addCancelRowEditionHandler(CancelRowEditionHandler handler) |
com.google.gwt.event.shared.HandlerRegistration |
addLoadRowDetailsHandler(LoadRowDetailsHandler handler) |
com.google.gwt.event.shared.HandlerRegistration |
addRowClickHandler(RowClickHandler handler) |
com.google.gwt.event.shared.HandlerRegistration |
addRowDoubleClickHandler(RowDoubleClickHandler handler) |
com.google.gwt.event.shared.HandlerRegistration |
addRowEditHandler(RowEditHandler handler) |
com.google.gwt.event.shared.HandlerRegistration |
addRowEditingHandler(RowEditingHandler handler) |
com.google.gwt.event.shared.HandlerRegistration |
addRowRenderHandler(RowRenderHandler handler) |
void |
addScrollHandler(com.google.gwt.event.dom.client.ScrollHandler handler) |
com.google.gwt.event.shared.HandlerRegistration |
addShowRowDetailsHandler(ShowRowDetailsHandler handler) |
void |
clear()
Clears all grid rows
|
protected void |
clearRendering()
Resizes the grid table, according with the number of rows that will be rendered.
|
protected Cell |
createBaseCell(com.google.gwt.user.client.ui.Widget widget,
boolean fireEvents,
boolean selectRowOnclick,
boolean highlightRowOnMouseOver,
boolean wrapLine,
boolean truncate)
Creates a basic (no style) cell
|
protected Cell |
createCell(com.google.gwt.user.client.ui.Widget widget,
boolean wrapLine,
boolean truncate)
Creates a cell
|
protected Cell |
createColumnHeaderCell(ColumnDefinition columnDefinition)
Creates a cell that will be used as the header for the given column
|
protected Cell |
createHeaderCell(com.google.gwt.user.client.ui.Widget widget)
Creates a header styled cell
|
protected abstract R |
createRow(int index,
com.google.gwt.dom.client.Element element)
Creates a row
|
protected void |
ensureVisible(com.google.gwt.user.client.ui.UIObject uiObject) |
protected abstract boolean |
fireBeforeCancelRowEditionEvent(R row) |
protected abstract void |
fireBeforeRowEditEvent(R row)
Fires a before row edit event
|
protected abstract boolean |
fireBeforeSaveRowEditionEvent(R row)
Fires a row saving event
|
protected abstract void |
fireCancelRowEditionEvent(R row) |
protected abstract void |
fireRowClickEvent(R row)
Fires a row click event
|
protected abstract void |
fireRowDoubleClickEvent(R row)
Fires a row double click event
|
protected abstract void |
fireRowEditEvent(R row)
Fires a row edit event
|
protected abstract void |
fireRowEditingEvent(R row)
Fires a row editing event
|
protected abstract void |
fireRowRenderEvent(R row)
Fires a row rendering event
|
ColumnDefinition |
getColumnDefinition(String key) |
protected ColumnDefinitions |
getColumnDefinitions()
Gets the grid columns (including the invisible columns)
|
abstract List<R> |
getCurrentPageRows()
Gets all grid rows
|
R |
getRow(com.google.gwt.user.client.ui.Widget w)
Gets the row where the given widget is rendered
|
RowDetailWidgetCreator |
getRowDetailWidgetCreator() |
protected Iterator<R> |
getRowIterator()
Gets an iterator for the grid rows
|
RowSelectionModel |
getRowSelectionModel() |
protected abstract int |
getRowsToBeRendered() |
abstract List<R> |
getSelectedRows()
Gets the selected rows from the current visible page.
|
boolean |
hasFrozenCells() |
boolean |
hasFrozenColumns() |
boolean |
hasFrozenHeaders() |
protected boolean |
hasRowDetails()
Returns true if the grid has the row-details feature
|
protected boolean |
hasRowDetailsIconColumn()
Returns
true if the grid has a column containing icons that expand or collapse row's details |
protected boolean |
hasSelectionColumn() |
protected abstract void |
onBeforeRender()
Return true if the grid can be rendered
|
protected abstract void |
onBeforeRenderRows()
Callback for before rendering the rows
|
protected abstract void |
onClear()
Callback for grid clearing
|
protected abstract void |
onClearRendering()
Callback for before clearing the rows contents
|
protected abstract boolean |
onSelectRow(boolean select,
R row,
boolean fireEvents)
Callback for row selection
|
protected abstract boolean |
onShowDetails(boolean show,
Row row,
boolean fireEvents)
Executes the implementation-specific logic of showing the details of a row.
|
void |
refresh()
Repaints the grid
|
protected void |
render()
Renders the grid.
|
protected void |
renderHeaders(int rowCount)
Renders the columns headers
|
protected abstract void |
renderRow(R row)
Renders the given row cells
|
protected void |
renderRows()
Renders the grid rows
|
protected void |
resetColumnDefinitions() |
void |
selectCurrentPageRows(boolean select,
boolean fireEvents)
Selects or deselects all enabled rows
|
void |
setRowSelectionModel(RowSelectionModel rowSelectionModel) |
claimElement, getWidget, initializeClaimedElement, initWidget, isAttached, onAttach, onBrowserEvent, onDetach, render, render, resolvePotentialElement, setWidgetaddAttachHandler, addBitlessDomHandler, addDomHandler, addHandler, asWidget, asWidgetOrNull, createHandlerManager, delegateEvent, doAttachChildren, doDetachChildren, fireEvent, getHandlerCount, getLayoutData, getParent, isOrWasAttached, onLoad, onUnload, removeFromParent, setLayoutData, sinkEvents, unsinkEventsaddStyleDependentName, addStyleName, ensureDebugId, ensureDebugId, ensureDebugId, getAbsoluteLeft, getAbsoluteTop, getElement, getOffsetHeight, getOffsetWidth, getStyleElement, getStyleName, getStyleName, getStylePrimaryName, getStylePrimaryName, getTitle, isVisible, isVisible, onEnsureDebugId, removeStyleDependentName, removeStyleName, setElement, setElement, setHeight, setPixelSize, setSize, setStyleDependentName, setStyleName, setStyleName, setStyleName, setStyleName, setStylePrimaryName, setStylePrimaryName, setTitle, setVisible, setVisible, setWidth, sinkBitlessEvent, toStringprotected GridBaseTable table
protected ColumnDefinitions definitions
protected String generatedId
protected RowSelectionModel rowSelection
protected com.google.gwt.user.client.ui.ScrollPanel scrollingArea
protected boolean stretchColumns
protected boolean highlightRowOnMouseOver
protected RowDetailWidgetCreator rowDetailWidgetCreator
protected boolean showRowDetailsIcon
protected boolean freezeHeaders
protected Boolean hasFrozenColumns
protected org.cruxframework.crux.core.client.collection.FastList<BeforeSaveRowEditionHandler> beforeSaveRowEditionHandlers
protected org.cruxframework.crux.core.client.collection.FastList<BeforeCancelRowEditionHandler> beforeCancelRowEditionHandlers
public AbstractGrid(ColumnDefinitions columnDefinitions, RowSelectionModel rowSelection, int cellSpacing, boolean stretchColumns, boolean highlightRowOnMouseOver, boolean fixedCellSize)
columnDefinitions - the columns to be renderedrowSelection - the behavior of the grid about line selectioncellSpacing - the space between the cellsstretchColumns - fixedCellSize - public AbstractGrid(ColumnDefinitions columnDefinitions, RowSelectionModel rowSelection, int cellSpacing, boolean stretchColumns, boolean highlightRowOnMouseOver, boolean fixedCellSize, RowDetailWidgetCreator rowDetailWidgetCreator, boolean showRowDetailsIcon, boolean freezeHeaders)
columnDefinitions - the columns to be renderedrowSelection - the behavior of the grid about line selectioncellSpacing - the space between the cellsstretchColumns - fixedCellSize - rowDetailsDefinition - showRowDetailsIcon - protected abstract boolean onShowDetails(boolean show,
Row row,
boolean fireEvents)
show - row - fireEvents - public com.google.gwt.event.shared.HandlerRegistration addRowClickHandler(RowClickHandler handler)
addRowClickHandler in interface HasRowClickHandlersHasRowClickHandlers.addRowClickHandler(org.cruxframework.crux.widgets.client.event.row.RowClickHandler)public com.google.gwt.event.shared.HandlerRegistration addRowDoubleClickHandler(RowDoubleClickHandler handler)
public com.google.gwt.event.shared.HandlerRegistration addRowRenderHandler(RowRenderHandler handler)
addRowRenderHandler in interface HasRowRenderHandlersHasRowRenderHandlers.addRowRenderHandler(org.cruxframework.crux.widgets.client.event.row.RowRenderHandler)public com.google.gwt.event.shared.HandlerRegistration addBeforeShowRowDetailsHandler(BeforeShowRowDetailsHandler handler)
addBeforeShowRowDetailsHandler in interface HasBeforeShowDetailsHandlersbr.com.sysmap.crux.widgets.client.event.row.HasBeforeShowDetailsHandlers#addBeforeShowRowDetailsHandler(br.com.sysmap.crux.widgets.client.event.row.BeforeShowDetailsHandler)public com.google.gwt.event.shared.HandlerRegistration addShowRowDetailsHandler(ShowRowDetailsHandler handler)
addShowRowDetailsHandler in interface HasShowRowDetailsHandlersbr.com.sysmap.crux.widgets.client.event.row.HasShowRowDetailsHandlers#addShowRowDetailsHandler(br.com.sysmap.crux.widgets.client.event.row.ShowRowDetailsHandler)public com.google.gwt.event.shared.HandlerRegistration addBeforeRowEditHandler(BeforeRowEditHandler handler)
public com.google.gwt.event.shared.HandlerRegistration addCancelRowEditionHandler(CancelRowEditionHandler handler)
public com.google.gwt.event.shared.HandlerRegistration addBeforeCancelRowEditionHandler(BeforeCancelRowEditionHandler handler)
public com.google.gwt.event.shared.HandlerRegistration addRowEditHandler(RowEditHandler handler)
addRowEditHandler in interface HasRowEditHandlersHasRowEditHandlers.addRowEditHandler(org.cruxframework.crux.widgets.client.event.row.RowEditHandler)public com.google.gwt.event.shared.HandlerRegistration addRowEditingHandler(RowEditingHandler handler)
addRowEditingHandler in interface HasRowEditingHandlersHasRowEditHandlers.addRowEditHandler(org.cruxframework.crux.widgets.client.event.row.RowEditHandler)public com.google.gwt.event.shared.HandlerRegistration addLoadRowDetailsHandler(LoadRowDetailsHandler handler)
addLoadRowDetailsHandler in interface HasLoadRowDetailsHandlersbr.com.sysmap.crux.widgets.client.event.row.HasLoadRowDetailsHandlers#addLoadRowDetailsHandler(br.com.sysmap.crux.widgets.client.event.row.LoadRowDetailsHandler)public com.google.gwt.event.shared.HandlerRegistration addBeforeSaveRowEditionHandler(BeforeSaveRowEditionHandler handler)
public void addScrollHandler(com.google.gwt.event.dom.client.ScrollHandler handler)
public void clear()
public R getRow(com.google.gwt.user.client.ui.Widget w)
w - a widget rendered inside a rowRow that contains the given widget. Null if no such row found.;public abstract List<R> getSelectedRows()
List containing the selected rowspublic abstract List<R> getCurrentPageRows()
List containing the rowspublic void refresh()
public ColumnDefinition getColumnDefinition(String key)
key - protected Iterator<R> getRowIterator()
protected Cell createCell(com.google.gwt.user.client.ui.Widget widget, boolean wrapLine, boolean truncate)
widget - the content of the cellprotected Cell createColumnHeaderCell(ColumnDefinition columnDefinition)
columnDefinition - protected Cell createBaseCell(com.google.gwt.user.client.ui.Widget widget, boolean fireEvents, boolean selectRowOnclick, boolean highlightRowOnMouseOver, boolean wrapLine, boolean truncate)
widget - fireEvents - selectRowOnclick - protected Cell createHeaderCell(com.google.gwt.user.client.ui.Widget widget)
widget - the content of the cellprotected abstract R createRow(int index, com.google.gwt.dom.client.Element element)
index - the position of the row (zero based)element - the row HTML element (TR)protected ColumnDefinitions getColumnDefinitions()
protected abstract int getRowsToBeRendered()
protected boolean hasSelectionColumn()
true if grid rows must contain a special cell with a widget for selecting them.protected abstract void onClearRendering()
protected abstract void onBeforeRenderRows()
protected abstract void onClear()
protected abstract boolean onSelectRow(boolean select,
R row,
boolean fireEvents)
select - true if the row was selected, false if deselectedrow - protected void render()
protected void resetColumnDefinitions()
protected abstract void onBeforeRender()
protected abstract void renderRow(R row)
row - protected abstract void fireRowClickEvent(R row)
row - protected abstract void fireRowEditEvent(R row)
row - protected abstract void fireBeforeRowEditEvent(R row)
row - protected abstract void fireRowEditingEvent(R row)
row - protected abstract void fireRowDoubleClickEvent(R row)
row - protected abstract void fireRowRenderEvent(R row)
row - protected abstract boolean fireBeforeSaveRowEditionEvent(R row)
row - protected abstract boolean fireBeforeCancelRowEditionEvent(R row)
row - protected abstract void fireCancelRowEditionEvent(R row)
row - protected void clearRendering()
protected void renderHeaders(int rowCount)
rowCount - protected void renderRows()
public void selectCurrentPageRows(boolean select,
boolean fireEvents)
select - true for select, false for deselectfireEvents - if true, fires a BeforeRowSelectEvent for each enabled rowprotected boolean hasRowDetails()
protected boolean hasRowDetailsIconColumn()
true if the grid has a column containing icons that expand or collapse row's detailsprotected void ensureVisible(com.google.gwt.user.client.ui.UIObject uiObject)
uiObject - public RowDetailWidgetCreator getRowDetailWidgetCreator()
public boolean hasFrozenHeaders()
public boolean hasFrozenColumns()
public boolean hasFrozenCells()
public RowSelectionModel getRowSelectionModel()
public void setRowSelectionModel(RowSelectionModel rowSelectionModel)
Copyright © 2016. All rights reserved.