public class Grid extends AbstractGrid<DataRow> implements Pageable, HasDataSource<PagedDataSource<?>>, HasBeforeRowSelectHandlers
| Modifier and Type | Class and Description |
|---|---|
protected static class |
Grid.ColumnHeader |
static class |
Grid.SortingType
Grid default sorting type
|
beforeCancelRowEditionHandlers, beforeSaveRowEditionHandlers| Constructor and Description |
|---|
Grid(ColumnDefinitions columnDefinitions,
int pageSize,
RowSelectionModel rowSelection,
int cellSpacing,
boolean autoLoadData,
boolean stretchColumns,
boolean highlightRowOnMouseOver,
String emptyDataFilling,
boolean fixedCellSize,
String defaultSortingColumn,
Grid.SortingType defaultSortingType) |
Grid(ColumnDefinitions columnDefinitions,
int pageSize,
RowSelectionModel rowSelection,
int cellSpacing,
boolean autoLoadData,
boolean stretchColumns,
boolean highlightRowOnMouseOver,
String emptyDataFilling,
boolean fixedCellSize,
String defaultSortingColumn,
Grid.SortingType defaultSortingType,
boolean keepEditorOnClickDisabledRows) |
Grid(ColumnDefinitions columnDefinitions,
int pageSize,
RowSelectionModel rowSelection,
int cellSpacing,
boolean autoLoadData,
boolean stretchColumns,
boolean highlightRowOnMouseOver,
String emptyDataFilling,
boolean fixedCellSize,
String defaultSortingColumn,
Grid.SortingType defaultSortingType,
boolean keepEditorOnClickDisabledRows,
boolean showEditorButtons) |
Grid(ColumnDefinitions columnDefinitions,
int pageSize,
RowSelectionModel rowSelection,
int cellSpacing,
boolean autoLoadData,
boolean stretchColumns,
boolean highlightRowOnMouseOver,
String emptyDataFilling,
boolean fixedCellSize,
String defaultSortingColumn,
Grid.SortingType defaultSortingType,
boolean keepEditorOnClickDisabledRows,
boolean showEditorButtons,
boolean freezeHeaders) |
Grid(ColumnDefinitions columnDefinitions,
int pageSize,
RowSelectionModel rowSelection,
int cellSpacing,
boolean autoLoadData,
boolean stretchColumns,
boolean highlightRowOnMouseOver,
String emptyDataFilling,
boolean fixedCellSize,
String defaultSortingColumn,
Grid.SortingType defaultSortingType,
boolean keepEditorOnClickDisabledRows,
boolean showEditorButtons,
String editButtonTooltip,
String saveButtonTooltip,
String cancelButtonTooltip) |
Grid(ColumnDefinitions columnDefinitions,
int pageSize,
RowSelectionModel rowSelection,
int cellSpacing,
boolean autoLoadData,
boolean stretchColumns,
boolean highlightRowOnMouseOver,
String emptyDataFilling,
boolean fixedCellSize,
String defaultSortingColumn,
Grid.SortingType defaultSortingType,
RowDetailWidgetCreator rowDetailsWidgetCreator,
boolean showRowDetailsIcon,
boolean freezeHeaders,
boolean caseSensitive)
Full constructor
|
Grid(ColumnDefinitions columnDefinitions,
int pageSize,
RowSelectionModel rowSelection,
int cellSpacing,
boolean autoLoadData,
boolean stretchColumns,
boolean highlightRowOnMouseOver,
String emptyDataFilling,
boolean fixedCellSize,
String defaultSortingColumn,
Grid.SortingType defaultSortingType,
RowDetailWidgetCreator rowDetailsWidgetCreator,
boolean showRowDetailsIcon,
boolean freezeHeaders,
boolean caseSensitive,
boolean keepEditorOnClickDisabledRows) |
Grid(ColumnDefinitions columnDefinitions,
int pageSize,
RowSelectionModel rowSelection,
int cellSpacing,
boolean autoLoadData,
boolean stretchColumns,
boolean highlightRowOnMouseOver,
String emptyDataFilling,
boolean fixedCellSize,
String defaultSortingColumn,
Grid.SortingType defaultSortingType,
RowDetailWidgetCreator rowDetailsWidgetCreator,
boolean showRowDetailsIcon,
boolean freezeHeaders,
boolean caseSensitive,
boolean keepEditorOnClickDisabledRows,
boolean showEditorButtons) |
Grid(ColumnDefinitions columnDefinitions,
int pageSize,
RowSelectionModel rowSelection,
int cellSpacing,
boolean autoLoadData,
boolean stretchColumns,
boolean highlightRowOnMouseOver,
String emptyDataFilling,
boolean fixedCellSize,
String defaultSortingColumn,
Grid.SortingType defaultSortingType,
RowDetailWidgetCreator rowDetailsWidgetCreator,
boolean showRowDetailsIcon,
boolean freezeHeaders,
boolean caseSensitive,
boolean keepEditorOnClickDisabledRows,
boolean showEditorButtons,
String editButtonTooltip,
String saveButtonTooltip,
String cancelButtonTooltip) |
| Modifier and Type | Method and Description |
|---|---|
com.google.gwt.event.shared.HandlerRegistration |
addBeforeRowSelectHandler(BeforeRowSelectHandler handler) |
void |
addColumnEditorValidator(String key,
ColumnEditorValidator columnEditorValidator)
Add a validator to a editable column
|
<T> void |
addRow(T dataObject) |
protected Cell |
createColumnHeaderCell(ColumnDefinition columnDefinition)
Creates a cell that will be used as the header for the given column
|
protected DataRow |
createRow(int index,
com.google.gwt.dom.client.Element element)
Creates a row
|
protected boolean |
fireBeforeCancelRowEditionEvent(DataRow row) |
protected void |
fireBeforeRowEditEvent(DataRow row)
Fires a before row edit event
|
protected boolean |
fireBeforeSaveRowEditionEvent(DataRow row)
Fires a row saving event
|
protected void |
fireCancelRowEditionEvent(DataRow row) |
protected void |
fireRowClickEvent(DataRow row)
Fires a row click event
|
protected void |
fireRowDoubleClickEvent(DataRow row)
Fires a row double click event
|
protected void |
fireRowEditEvent(DataRow row)
Fires a row edit event
|
protected void |
fireRowRenderEvent(DataRow row)
Fires a row rendering event
|
Object[] |
getCreatedDataObjects() |
List<DataRow> |
getCurrentPageRows()
Gets all grid rows
|
int |
getCurrentPageSize()
Gets the current page row count
|
PagedDataSource<?> |
getDataSource() |
Object[] |
getEditedDataObjects() |
int |
getPageCount()
Return the total number of pages
|
Object[] |
getRemovedDataObjects() |
DataRow |
getRow(com.google.gwt.user.client.ui.Widget w)
Gets the row where the given widget is rendered
|
protected int |
getRowsToBeRendered() |
Object[] |
getSelectedDataObjects()
Gets all selected data objects contained by the grid.
|
Object[] |
getSelectedDataRows()
Deprecated.
Use
getSelectedDataObjects() instead |
List<DataRow> |
getSelectedRows()
Gets the selected rows from the current visible page.
|
void |
goToPage(int page)
Moves the pageable's cursor to an arbitrary page
|
boolean |
isDataLoaded()
Checks if pageable data is already available
|
boolean |
isEditable()
Check if there is any editable column
|
boolean |
isEditing() |
boolean |
isKeepEditorOnClickDisabledRows() |
boolean |
isLoaded() |
boolean |
isShowEditorButtons() |
void |
loadData() |
void |
makeEditable(DataRow row,
Cell focusCell)
Enables edit mode for given row
|
void |
nextPage()
Moves the pageable's cursor to the next page
|
protected void |
onBeforeRender()
Return true if the grid can be rendered
|
protected void |
onBeforeRenderRows()
Callback for before rendering the rows
|
protected void |
onClear()
Callback for grid clearing
|
protected void |
onClearRendering()
Callback for before clearing the rows contents
|
protected boolean |
onSelectRow(boolean select,
DataRow row,
boolean fireEvents)
Callback for row selection
|
protected boolean |
onShowDetails(boolean show,
Row row,
boolean fireEvents)
Executes the implementation-specific logic of showing the details of a row.
|
void |
previousPage()
Moves the pageable's cursor to the previous page
|
<T> void |
removeRow(DataRow r) |
void |
removeSelectedRows() |
<T> void |
removeSelectedRows(boolean fromCurrentPageOnly) |
protected void |
renderRow(DataRow row)
Renders the given row cells
|
protected void |
renderRow(DataRow row,
DataSourceRecord<?> record,
boolean editMode,
String focusCellKey) |
void |
rollbackRowEdition(DataRow row)
Rollback the edition of the last column changed
|
void |
setDataSource(PagedDataSource<?> dataSource)
Sets the data source and re-renders the grid
|
void |
setDataSource(PagedDataSource<?> dataSource,
boolean autoLoadData) |
void |
setKeepEditorOnClickDisabledRows(boolean keepEditorOnClickDisabledRows) |
void |
setPager(Pager pager)
Sets the pager for call back
|
void |
setShowEditorButtons(boolean showEditorButtons) |
void |
setWidth(String width) |
void |
sort(String columnKey,
boolean ascending,
boolean caseSensitive)
Sorts the grid's data by the given column
|
addBeforeCancelRowEditionHandler, addBeforeRowEditHandler, addBeforeSaveRowEditionHandler, addBeforeShowRowDetailsHandler, addCancelRowEditionHandler, addLoadRowDetailsHandler, addRowClickHandler, addRowDoubleClickHandler, addRowEditHandler, addRowRenderHandler, addScrollHandler, addShowRowDetailsHandler, clear, createBaseCell, createCell, createHeaderCell, ensureVisible, getColumnDefinition, getColumnDefinitions, getRowDetailWidgetCreator, getRowIterator, getRowSelectionModel, hasFrozenCells, hasFrozenColumns, hasFrozenHeaders, hasRowDetails, hasRowDetailsIconColumn, hasSelectionColumn, refresh, render, selectCurrentPageRows, setRowSelectionModelclaimElement, 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, sinkBitlessEvent, toStringpublic Grid(ColumnDefinitions columnDefinitions, int pageSize, RowSelectionModel rowSelection, int cellSpacing, boolean autoLoadData, boolean stretchColumns, boolean highlightRowOnMouseOver, String emptyDataFilling, boolean fixedCellSize, String defaultSortingColumn, Grid.SortingType defaultSortingType)
columnDefinitions - the columns to be renderedpageSize - the number of rows per pagerowSelection - the behavior of the grid about line selectioncellSpacing - the space between the cellsautoLoadData - if true, when a data source is set, its first
page records are fetched and rendered.stretchColumns - if true, the width of the columns are auto
adjusted to fit the grid width. Prevents horizontal scrolling.highlightRowOnMouseOver - if true, rows change their styles when mouse
passed over thememptyDataFilling - an alternative text to be shown when there is no data for some
data cellfixedCellSize - equivalent of setting CSS attribute table-layout
to fixeddefaultSortingColumn - the column to be used to automatically sort the grid's data
when it is rendered for the first timedefaultSortingType - tells the grid if defaultSortingColumn should be
used ascending or descendingpublic Grid(ColumnDefinitions columnDefinitions, int pageSize, RowSelectionModel rowSelection, int cellSpacing, boolean autoLoadData, boolean stretchColumns, boolean highlightRowOnMouseOver, String emptyDataFilling, boolean fixedCellSize, String defaultSortingColumn, Grid.SortingType defaultSortingType, boolean keepEditorOnClickDisabledRows)
columnDefinitions - the columns to be renderedpageSize - the number of rows per pagerowSelection - the behavior of the grid about line selectioncellSpacing - the space between the cellsautoLoadData - if true, when a data source is set, its first
page records are fetched and rendered.stretchColumns - if true, the width of the columns are auto
adjusted to fit the grid width. Prevents horizontal scrolling.highlightRowOnMouseOver - if true, rows change their styles when mouse
passed over thememptyDataFilling - an alternative text to be shown when there is no data for some
data cellfixedCellSize - equivalent of setting CSS attribute table-layout
to fixeddefaultSortingColumn - the column to be used to automatically sort the grid's data
when it is rendered for the first timedefaultSortingType - tells the grid if defaultSortingColumn should be
used ascending or descendingkeepEditorOnClickDisabledRows - Keep row's editor opened even when clicking on a disabled datarowpublic Grid(ColumnDefinitions columnDefinitions, int pageSize, RowSelectionModel rowSelection, int cellSpacing, boolean autoLoadData, boolean stretchColumns, boolean highlightRowOnMouseOver, String emptyDataFilling, boolean fixedCellSize, String defaultSortingColumn, Grid.SortingType defaultSortingType, boolean keepEditorOnClickDisabledRows, boolean showEditorButtons)
columnDefinitions - the columns to be renderedpageSize - the number of rows per pagerowSelection - the behavior of the grid about line selectioncellSpacing - the space between the cellsautoLoadData - if true, when a data source is set, its first
page records are fetched and rendered.stretchColumns - if true, the width of the columns are auto
adjusted to fit the grid width. Prevents horizontal scrolling.highlightRowOnMouseOver - if true, rows change their styles when mouse
passed over thememptyDataFilling - an alternative text to be shown when there is no data for some
data cellfixedCellSize - equivalent of setting CSS attribute table-layout
to fixeddefaultSortingColumn - the column to be used to automatically sort the grid's data
when it is rendered for the first timedefaultSortingType - tells the grid if defaultSortingColumn should be
used ascending or descendingkeepEditorOnClickDisabledRows - Keep row's editor opened even when clicking on a disabled datarowshowEditorButtons - Displays a column with three buttons: edit, save and cancelpublic Grid(ColumnDefinitions columnDefinitions, int pageSize, RowSelectionModel rowSelection, int cellSpacing, boolean autoLoadData, boolean stretchColumns, boolean highlightRowOnMouseOver, String emptyDataFilling, boolean fixedCellSize, String defaultSortingColumn, Grid.SortingType defaultSortingType, boolean keepEditorOnClickDisabledRows, boolean showEditorButtons, boolean freezeHeaders)
public Grid(ColumnDefinitions columnDefinitions, int pageSize, RowSelectionModel rowSelection, int cellSpacing, boolean autoLoadData, boolean stretchColumns, boolean highlightRowOnMouseOver, String emptyDataFilling, boolean fixedCellSize, String defaultSortingColumn, Grid.SortingType defaultSortingType, boolean keepEditorOnClickDisabledRows, boolean showEditorButtons, String editButtonTooltip, String saveButtonTooltip, String cancelButtonTooltip)
public Grid(ColumnDefinitions columnDefinitions, int pageSize, RowSelectionModel rowSelection, int cellSpacing, boolean autoLoadData, boolean stretchColumns, boolean highlightRowOnMouseOver, String emptyDataFilling, boolean fixedCellSize, String defaultSortingColumn, Grid.SortingType defaultSortingType, RowDetailWidgetCreator rowDetailsWidgetCreator, boolean showRowDetailsIcon, boolean freezeHeaders, boolean caseSensitive)
columnDefinitions - the columns to be renderedpageSize - the number of rows per pagerowSelection - the behavior of the grid about line selectioncellSpacing - the space between the cellsautoLoadData - if true, when a data source is set, its first
page records are fetched and rendered.stretchColumns - if true, the width of the columns are auto
adjusted to fit the grid width. Prevents horizontal scrolling.highlightRowOnMouseOver - if true, rows change their styles when mouse
passed over thememptyDataFilling - an alternative text to be shown when there is no data for some
data cellfixedCellSize - equivalent of setting CSS attribute table-layout
to fixeddefaultSortingColumn - the column to be used to automatically sort the grid's data
when it is rendered for the first timedefaultSortingType - tells the grid if defaultSortingColumn should be
used ascending or descendingrowDetailsWidgetCreator - used to create on-demand row detailsshowRowDetailsIcon - if true, the second column of the grid will
contain icons for expanding or collapsing the row's detailscaseSensitive - indicate if the columns sort are or not key sensitivepublic Grid(ColumnDefinitions columnDefinitions, int pageSize, RowSelectionModel rowSelection, int cellSpacing, boolean autoLoadData, boolean stretchColumns, boolean highlightRowOnMouseOver, String emptyDataFilling, boolean fixedCellSize, String defaultSortingColumn, Grid.SortingType defaultSortingType, RowDetailWidgetCreator rowDetailsWidgetCreator, boolean showRowDetailsIcon, boolean freezeHeaders, boolean caseSensitive, boolean keepEditorOnClickDisabledRows)
columnDefinitions - pageSize - rowSelection - cellSpacing - autoLoadData - stretchColumns - highlightRowOnMouseOver - emptyDataFilling - fixedCellSize - defaultSortingColumn - defaultSortingType - rowDetailsWidgetCreator - showRowDetailsIcon - freezeHeaders - caseSensitive - keepEditorOnClickDisabledRows - Keep row's editor opened even when clicking on a disabled datarowpublic Grid(ColumnDefinitions columnDefinitions, int pageSize, RowSelectionModel rowSelection, int cellSpacing, boolean autoLoadData, boolean stretchColumns, boolean highlightRowOnMouseOver, String emptyDataFilling, boolean fixedCellSize, String defaultSortingColumn, Grid.SortingType defaultSortingType, RowDetailWidgetCreator rowDetailsWidgetCreator, boolean showRowDetailsIcon, boolean freezeHeaders, boolean caseSensitive, boolean keepEditorOnClickDisabledRows, boolean showEditorButtons)
columnDefinitions - pageSize - rowSelection - cellSpacing - autoLoadData - stretchColumns - highlightRowOnMouseOver - emptyDataFilling - fixedCellSize - defaultSortingColumn - defaultSortingType - rowDetailsWidgetCreator - showRowDetailsIcon - freezeHeaders - caseSensitive - keepEditorOnClickDisabledRows - showEditorButtons - public Grid(ColumnDefinitions columnDefinitions, int pageSize, RowSelectionModel rowSelection, int cellSpacing, boolean autoLoadData, boolean stretchColumns, boolean highlightRowOnMouseOver, String emptyDataFilling, boolean fixedCellSize, String defaultSortingColumn, Grid.SortingType defaultSortingType, RowDetailWidgetCreator rowDetailsWidgetCreator, boolean showRowDetailsIcon, boolean freezeHeaders, boolean caseSensitive, boolean keepEditorOnClickDisabledRows, boolean showEditorButtons, String editButtonTooltip, String saveButtonTooltip, String cancelButtonTooltip)
public void setDataSource(PagedDataSource<?> dataSource)
dataSource - public void setDataSource(PagedDataSource<?> dataSource, boolean autoLoadData)
setDataSource in interface HasDataSource<PagedDataSource<?>>public void loadData()
protected DataRow createRow(int index, com.google.gwt.dom.client.Element element)
AbstractGridcreateRow in class AbstractGrid<DataRow>index - the position of the row (zero based)element - the row HTML element (TR)protected int getRowsToBeRendered()
getRowsToBeRendered in class AbstractGrid<DataRow>public int getCurrentPageSize()
protected void onClear()
AbstractGridonClear in class AbstractGrid<DataRow>protected boolean onShowDetails(boolean show,
Row row,
boolean fireEvents)
AbstractGridonShowDetails in class AbstractGrid<DataRow>br.com.sysmap.crux.widgets.client.grid.AbstractGrid#onShowDetails(boolean,
br.com.sysmap.crux.widgets.client.grid.Row, boolean)protected boolean onSelectRow(boolean select,
DataRow row,
boolean fireEvents)
AbstractGridonSelectRow in class AbstractGrid<DataRow>select - true if the row was selected, false if deselectedprotected void renderRow(DataRow row)
AbstractGridrenderRow in class AbstractGrid<DataRow>protected void renderRow(DataRow row, DataSourceRecord<?> record, boolean editMode, String focusCellKey)
public void rollbackRowEdition(DataRow row)
row - protected Cell createColumnHeaderCell(ColumnDefinition columnDefinition)
AbstractGridcreateColumnHeaderCell in class AbstractGrid<DataRow>protected void onBeforeRenderRows()
AbstractGridonBeforeRenderRows in class AbstractGrid<DataRow>public int getPageCount()
PageablegetPageCount in interface Pageablepublic void nextPage()
Pageablepublic void previousPage()
PageablepreviousPage in interface Pageablepublic void setPager(Pager pager)
PageablesetPager in interface PageablePageable.setPager(org.cruxframework.crux.widgets.client.paging.Pager)protected void onClearRendering()
AbstractGridonClearRendering in class AbstractGrid<DataRow>public PagedDataSource<?> getDataSource()
getDataSource in interface HasDataSource<PagedDataSource<?>>public void sort(String columnKey, boolean ascending, boolean caseSensitive)
columnKey - public List<DataRow> getSelectedRows()
AbstractGridgetSelectedRows in class AbstractGrid<DataRow>List containing the selected rowspublic List<DataRow> getCurrentPageRows()
AbstractGridgetCurrentPageRows in class AbstractGrid<DataRow>List containing the rows@Deprecated public Object[] getSelectedDataRows()
getSelectedDataObjects() insteadpublic Object[] getSelectedDataObjects()
public com.google.gwt.event.shared.HandlerRegistration addBeforeRowSelectHandler(BeforeRowSelectHandler handler)
protected void fireCancelRowEditionEvent(DataRow row)
fireCancelRowEditionEvent in class AbstractGrid<DataRow>protected boolean fireBeforeSaveRowEditionEvent(DataRow row)
AbstractGridfireBeforeSaveRowEditionEvent in class AbstractGrid<DataRow>protected boolean fireBeforeCancelRowEditionEvent(DataRow row)
fireBeforeCancelRowEditionEvent in class AbstractGrid<DataRow>protected void fireRowRenderEvent(DataRow row)
AbstractGridfireRowRenderEvent in class AbstractGrid<DataRow>protected void fireRowClickEvent(DataRow row)
AbstractGridfireRowClickEvent in class AbstractGrid<DataRow>protected void fireRowEditEvent(DataRow row)
AbstractGridfireRowEditEvent in class AbstractGrid<DataRow>protected void fireBeforeRowEditEvent(DataRow row)
AbstractGridfireBeforeRowEditEvent in class AbstractGrid<DataRow>protected void fireRowDoubleClickEvent(DataRow row)
AbstractGridfireRowDoubleClickEvent in class AbstractGrid<DataRow>public boolean isLoaded()
public void goToPage(int page)
PageablegoToPage in interface Pageablepage - page numberPageable.goToPage(int)public boolean isDataLoaded()
PageableisDataLoaded in interface PageablePageable.isDataLoaded()public DataRow getRow(com.google.gwt.user.client.ui.Widget w)
AbstractGridgetRow in class AbstractGrid<DataRow>w - a widget rendered inside a rowRow that contains the given widget. Null if no such row found.;public boolean isEditable()
public void makeEditable(DataRow row, Cell focusCell)
row - focusCell - public boolean isEditing()
public <T> void addRow(T dataObject)
public void removeSelectedRows()
public <T> void removeSelectedRows(boolean fromCurrentPageOnly)
public <T> void removeRow(DataRow r)
public Object[] getRemovedDataObjects()
public Object[] getCreatedDataObjects()
public Object[] getEditedDataObjects()
protected void onBeforeRender()
AbstractGridonBeforeRender in class AbstractGrid<DataRow>public void addColumnEditorValidator(String key, ColumnEditorValidator columnEditorValidator)
key - columnEditorValidator - public boolean isShowEditorButtons()
public boolean isKeepEditorOnClickDisabledRows()
public void setKeepEditorOnClickDisabledRows(boolean keepEditorOnClickDisabledRows)
public void setShowEditorButtons(boolean showEditorButtons)
public void setWidth(String width)
setWidth in class com.google.gwt.user.client.ui.UIObjectCopyright © 2014. All rights reserved.