|
||||||||||
| 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.Composite
org.cruxframework.crux.widgets.client.grid.AbstractGrid<R>
public abstract class AbstractGrid<R extends Row>
Base class for implementing grids.
All subclasses must invoke the method render() in their constructors.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class com.google.gwt.user.client.ui.UIObject |
|---|
com.google.gwt.user.client.ui.UIObject.DebugIdImpl, com.google.gwt.user.client.ui.UIObject.DebugIdImplEnabled |
| Field Summary | |
|---|---|
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
|
| Fields inherited from class com.google.gwt.user.client.ui.UIObject |
|---|
DEBUG_ID_PREFIX |
| Constructor Summary | |
|---|---|
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 |
|
| Method Summary | |
|---|---|
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)
|
| Methods inherited from class com.google.gwt.user.client.ui.Composite |
|---|
claimElement, getWidget, initializeClaimedElement, initWidget, isAttached, onAttach, onBrowserEvent, onDetach, render, render, resolvePotentialElement, setWidget |
| Methods inherited from class com.google.gwt.user.client.ui.Widget |
|---|
addAttachHandler, addBitlessDomHandler, addDomHandler, addHandler, asWidget, asWidgetOrNull, createHandlerManager, delegateEvent, doAttachChildren, doDetachChildren, fireEvent, getHandlerCount, getLayoutData, getParent, isOrWasAttached, onLoad, onUnload, removeFromParent, setLayoutData, sinkEvents, unsinkEvents |
| 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, onEnsureDebugId, removeStyleDependentName, removeStyleName, setElement, setElement, setHeight, setPixelSize, setSize, setStyleDependentName, setStyleName, setStyleName, setStyleName, setStyleName, setStylePrimaryName, setStylePrimaryName, setTitle, setVisible, setVisible, setWidth, sinkBitlessEvent, toString |
| 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 |
| Field Detail |
|---|
protected GridBaseTable table
protected ColumnDefinitions definitions
protected String generatedId
protected org.cruxframework.crux.core.client.collection.FastList<R extends Row> rows
protected Map<com.google.gwt.user.client.ui.Widget,R extends Row> widgetsPerRow
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
| Constructor Detail |
|---|
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 - | Method Detail |
|---|
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)
addRowDoubleClickHandler in interface HasRowDoubleClickHandlersHasRowDoubleClickHandlers.addRowDoubleClickHandler(org.cruxframework.crux.widgets.client.event.row.RowDoubleClickHandler)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)
addBeforeRowEditHandler in interface HasBeforeRowEditHandlersHasBeforeRowEditHandlers.addBeforeRowEditHandler(org.cruxframework.crux.widgets.client.event.row.BeforeRowEditHandler)public com.google.gwt.event.shared.HandlerRegistration addCancelRowEditionHandler(CancelRowEditionHandler handler)
addCancelRowEditionHandler in interface HasCancelRowEditionHandlerHasCancelRowEditionHandler.addCancelRowEditionHandler(org.cruxframework.crux.widgets.client.event.row.CancelRowEditionHandler)public com.google.gwt.event.shared.HandlerRegistration addBeforeCancelRowEditionHandler(BeforeCancelRowEditionHandler handler)
addBeforeCancelRowEditionHandler in interface HasBeforeCancelRowEditionHandlerHasBeforeCancelRowEditionHandler.addBeforeCancelRowEditionHandler(org.cruxframework.crux.widgets.client.event.row.BeforeCancelRowEditionHandler)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)
addBeforeSaveRowEditionHandler in interface HasBeforeSaveRowEditionHandlerHasBeforeSaveRowEditionHandler.addBeforeSaveRowEditionHandler(org.cruxframework.crux.widgets.client.event.row.BeforeSaveRowEditionHandler)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 row
Row 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 cell
protected 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 cell
protected 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 details
protected 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)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||