com.google.gwt.widgetideas.table.client
Class EditablePagingGrid

java.lang.Object
  extended by com.google.gwt.user.client.ui.UIObject
      extended by com.google.gwt.user.client.ui.Widget
          extended by com.google.gwt.user.client.ui.Panel
              extended by com.google.gwt.widgetideas.table.client.overrides.HTMLTable
                  extended by com.google.gwt.widgetideas.table.client.overrides.Grid
                      extended by com.google.gwt.widgetideas.table.client.SelectionGrid
                          extended by com.google.gwt.widgetideas.table.client.FixedWidthGrid
                              extended by com.google.gwt.widgetideas.table.client.SortableFixedWidthGrid
                                  extended by com.google.gwt.widgetideas.table.client.PagingGrid
                                      extended by com.google.gwt.widgetideas.table.client.EditablePagingGrid
All Implemented Interfaces:
com.google.gwt.user.client.EventListener, com.google.gwt.user.client.ui.HasWidgets, com.google.gwt.user.client.ui.SourcesTableEvents, ControllableTable, HasAutoFitColumn, HasFixedColumnWidth, HasRowPaging, HasSortableColumns, HasTableCells, SourceRowPagingEvents, SourceSortableColumnsEvents, SourceTableDataRequestEvents, SourceTableSelectionEvents

public class EditablePagingGrid
extends PagingGrid

A PagingGrid that supports editing cell contents using a cell editor. AbstractCellEditors can be assigned on a column by column basis. When the user clicks on a cell, the assigned editor will popup near the cell and allow the user to change the value of the cell. When the user accepts, the change is sent directly to the underlying TableController.


Nested Class Summary
 
Nested classes/interfaces inherited from class com.google.gwt.widgetideas.table.client.PagingGrid
PagingGrid.CellRenderer
 
Nested classes/interfaces inherited from class com.google.gwt.widgetideas.table.client.SortableFixedWidthGrid
SortableFixedWidthGrid.ColumnSorter, SortableFixedWidthGrid.ColumnSorterCallback
 
Nested classes/interfaces inherited from class com.google.gwt.widgetideas.table.client.FixedWidthGrid
FixedWidthGrid.FixedWidthGridCellFormatter, FixedWidthGrid.FixedWidthGridColumnFormatter, FixedWidthGrid.FixedWidthGridRowFormatter
 
Nested classes/interfaces inherited from class com.google.gwt.widgetideas.table.client.SelectionGrid
SelectionGrid.SelectedGridRowFormatter
 
Nested classes/interfaces inherited from class com.google.gwt.widgetideas.table.client.overrides.HTMLTable
HTMLTable.CellFormatter, HTMLTable.ColumnFormatter, HTMLTable.RowFormatter
 
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
static int HOVERING_POLICY_EDITABLE_CELL
          Enable hovering of cells that are editable.
 
Fields inherited from class com.google.gwt.widgetideas.table.client.FixedWidthGrid
DEFAULT_COLUMN_WIDTH, MIN_COLUMN_WIDTH
 
Fields inherited from class com.google.gwt.widgetideas.table.client.SelectionGrid
HOVERING_POLICY_CELL, HOVERING_POLICY_DISABLED, HOVERING_POLICY_ROW, SELECTION_POLICY_DISABLED, SELECTION_POLICY_MULTI_ROW, SELECTION_POLICY_ONE_ROW
 
Fields inherited from class com.google.gwt.user.client.ui.UIObject
DEBUG_ID_PREFIX
 
Constructor Summary
EditablePagingGrid(TableController tableController)
          Constructor.
EditablePagingGrid(TableModel tableModel)
          Constructor.
 
Method Summary
 AbstractCellEditor getCellEditor(int column)
          Get the column editor for a column.
 boolean hasCellEditor(int column)
          Check whether a column has a cell editor.
 void onBrowserEvent(com.google.gwt.user.client.Event event)
          Method to process events generated from the browser.
 void onCellClicked(int row, int cell)
          Handle cell click events.
 void setCellEditor(int column, AbstractCellEditor editor)
          Set the cell editor for a column.
 void setHoveringPolicy(int hoveringPolicy)
          Set the hovering policy.
 
Methods inherited from class com.google.gwt.widgetideas.table.client.PagingGrid
addRowPagingListener, addTableDataRequestListener, getCellRenderer, getCurrentPage, getNumPages, getNumRows, getPageSize, getRowValue, gotoFirstPage, gotoLastPage, gotoNextPage, gotoPage, gotoPreviousPage, insertAbsoluteRow, reloadPage, removeAbsoluteRow, removeRowPagingListener, removeTableDataRequestListener, setCellRenderer, setData, setData, setNumRows, setPageSize, setPagingFailure, setRowValue, sortColumn
 
Methods inherited from class com.google.gwt.widgetideas.table.client.SortableFixedWidthGrid
addSortableColumnsListener, getColumnSorter, getColumnSortList, moveRowDown, moveRowUp, removeSortableColumnsListener, reverseRows, setColumnSorter, sortColumn, swapRows
 
Methods inherited from class com.google.gwt.widgetideas.table.client.FixedWidthGrid
autoFitColumnWidth, getAutoFitColumnWidth, getColumnWidth, getDefaultColumnWidth, insertRow, removeRow, resizeColumns, resizeRows, setColumnWidth
 
Methods inherited from class com.google.gwt.widgetideas.table.client.SelectionGrid
addTableSelectionListener, deselectRow, deselectRows, getHoveringPolicy, getMinHoverRow, getSelectedRows, getSelectionPolicy, isRowSelected, removeTableSelectionListener, selectRow, selectRow, setMinHoverRow, setSelectionPolicy
 
Methods inherited from class com.google.gwt.widgetideas.table.client.overrides.Grid
getCellCount, getColumnCount, getRowCount, resize
 
Methods inherited from class com.google.gwt.widgetideas.table.client.overrides.HTMLTable
addTableListener, clear, clearAll, clearCell, getCellFormatter, getCellPadding, getCellSpacing, getColumnFormatter, getEventTargetCell, getHTML, getRowFormatter, getText, getWidget, isCellPresent, iterator, remove, removeTableListener, setBorderWidth, setCellPadding, setCellSpacing, setElement, setHTML, setText, setWidget
 
Methods inherited from class com.google.gwt.user.client.ui.Panel
add
 
Methods inherited from class com.google.gwt.user.client.ui.Widget
getParent, isAttached, removeFromParent
 
Methods inherited from class com.google.gwt.user.client.ui.UIObject
addStyleDependentName, addStyleName, ensureDebugId, getAbsoluteLeft, getAbsoluteTop, getElement, getOffsetHeight, getOffsetWidth, getStyleName, getStylePrimaryName, getTitle, isVisible, isVisible, removeStyleDependentName, removeStyleName, setHeight, setPixelSize, setSize, setStyleName, setStylePrimaryName, setTitle, setVisible, setVisible, setWidth, sinkEvents, toString, unsinkEvents
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.google.gwt.widgetideas.table.client.HasFixedColumnWidth
getColumnCount, getColumnWidth, getDefaultColumnWidth, setColumnWidth
 
Methods inherited from interface com.google.gwt.widgetideas.table.client.HasTableCells
getCellCount, getCellPadding, getCellSpacing, getEventTargetCell, setCellPadding, setCellSpacing
 

Field Detail

HOVERING_POLICY_EDITABLE_CELL

public static final int HOVERING_POLICY_EDITABLE_CELL
Enable hovering of cells that are editable.

See Also:
Constant Field Values
Constructor Detail

EditablePagingGrid

public EditablePagingGrid(TableController tableController)
Constructor.

Parameters:
tableController - the underlying TableController

EditablePagingGrid

public EditablePagingGrid(TableModel tableModel)
Constructor.

Parameters:
tableModel - the TableModel used to retrieve data
Method Detail

getCellEditor

public AbstractCellEditor getCellEditor(int column)
Get the column editor for a column.

Parameters:
column - the column index
Returns:
the cell editor

hasCellEditor

public boolean hasCellEditor(int column)
Check whether a column has a cell editor.

Parameters:
column - the column index
Returns:
true if a cell editor is assigned

onBrowserEvent

public void onBrowserEvent(com.google.gwt.user.client.Event event)
Method to process events generated from the browser.

Specified by:
onBrowserEvent in interface com.google.gwt.user.client.EventListener
Overrides:
onBrowserEvent in class SelectionGrid
Parameters:
event - the generated event
See Also:
HTMLTable

onCellClicked

public void onCellClicked(int row,
                          int cell)
Handle cell click events.

Overrides:
onCellClicked in class SelectionGrid
Parameters:
row - the row index
cell - the cell index

setCellEditor

public void setCellEditor(int column,
                          AbstractCellEditor editor)
Set the cell editor for a column.

Parameters:
column - the column index
editor - the cell editor

setHoveringPolicy

public void setHoveringPolicy(int hoveringPolicy)
Set the hovering policy.

Overrides:
setHoveringPolicy in class SelectionGrid
Parameters:
hoveringPolicy - the hovering policy to use