T - the row type of the gridpublic static class Grid.Editor<T> extends Object implements DeferredWorker
| Modifier and Type | Class and Description |
|---|---|
static interface |
Grid.Editor.EventHandler<T>
A handler for events related to the Grid editor.
|
protected static class |
Grid.Editor.State |
| Modifier and Type | Field and Description |
|---|---|
static int |
KEYCODE_HIDE |
static int |
KEYCODE_SHOW |
| Constructor and Description |
|---|
Editor() |
| Modifier and Type | Method and Description |
|---|---|
void |
cancel()
Cancels the currently active edit and hides the editor.
|
void |
clearEditorColumnErrors() |
protected com.google.gwt.dom.client.Element |
createCell(com.google.gwt.dom.client.TableCellElement td)
Creates an editor cell corresponding to the given table cell.
|
void |
editRow(int rowIndex)
If a cell of this Grid had focus once this editRow call was
triggered, the editor component at the previously focused column
index will be focused.
|
void |
editRow(int rowIndex,
int columnIndex)
Opens the editor over the row with the given index and attempts to
focus the editor widget in the given column index.
|
String |
getCancelCaption() |
protected int |
getElementColumn(com.google.gwt.dom.client.Element e) |
Grid.Editor.EventHandler<T> |
getEventHandler()
Returns the event handler of this Editor.
|
EditorHandler<T> |
getHandler()
Returns the handler responsible for binding data and editor widgets
to this editor.
|
int |
getRow() |
String |
getSaveCaption() |
protected Grid.Editor.State |
getState() |
protected com.google.gwt.user.client.ui.Widget |
getWidget(Grid.Column<?,T> column)
Returns the editor widget associated with the given column.
|
protected void |
hideOverlay() |
boolean |
isBuffered() |
boolean |
isEditorColumnError(Grid.Column<?,T> column) |
boolean |
isEnabled() |
boolean |
isWorkPending()
Checks whether there are operations pending for this widget or connector
that must be executed before reaching a steady state.
|
void |
save()
Saves any unsaved changes to the data source and hides the editor.
|
void |
setBuffered(boolean buffered) |
void |
setCancelCaption(String cancelCaption) |
void |
setEditorColumnError(Grid.Column<?,T> column,
boolean hasError) |
void |
setEditorError(String errorMessage,
Collection<Grid.Column<?,T>> errorColumns) |
void |
setEnabled(boolean enabled)
Sets the enabled state of this editor.
|
void |
setEventHandler(Grid.Editor.EventHandler<T> handler)
Sets the event handler for this Editor.
|
protected void |
setGrid(Grid<T> grid) |
protected void |
setGridEnabled(boolean enabled) |
void |
setHandler(EditorHandler<T> rowHandler)
Sets the handler responsible for binding data and editor widgets to
this editor.
|
void |
setSaveCaption(String saveCaption) |
protected void |
setState(Grid.Editor.State state) |
protected void |
setStylePrimaryName(String primaryName) |
protected void |
show(int rowIndex,
int columnIndex) |
protected void |
showOverlay()
Opens the editor overlay over the table row indicated by
getRow(). |
protected void |
showOverlay(com.google.gwt.dom.client.TableRowElement unused)
Deprecated.
As of 7.5, use
showOverlay() instead. |
public static final int KEYCODE_SHOW
public static final int KEYCODE_HIDE
public void setEditorError(String errorMessage, Collection<Grid.Column<?,T>> errorColumns)
public int getRow()
public void editRow(int rowIndex)
editRow(rowIndex, -1).editRow(int, int)public void editRow(int rowIndex,
int columnIndex)
rowIndex - the index of the row to be editedcolumnIndex - the column index of the editor widget that should be
initially focused or -1 to not set focusIllegalStateException - if this editor is not enabledIllegalStateException - if this editor is already in edit mode and in buffered
modepublic void cancel()
saved are lost.IllegalStateException - if this editor is not enabledIllegalStateException - if this editor is not in edit modepublic void save()
IllegalStateException - if this editor is not enabledIllegalStateException - if this editor is not in edit modepublic EditorHandler<T> getHandler()
public void setHandler(EditorHandler<T> rowHandler)
rowHandler - the new editor handlerIllegalStateException - if this editor is currently in edit modepublic boolean isEnabled()
public void setEnabled(boolean enabled)
enabled - true if enabled, false otherwiseIllegalStateException - if in edit mode and trying to disableIllegalStateException - if the editor handler is not setprotected void show(int rowIndex,
int columnIndex)
protected Grid.Editor.State getState()
protected void setState(Grid.Editor.State state)
protected com.google.gwt.user.client.ui.Widget getWidget(Grid.Column<?,T> column)
editable, returns null.column - the column@Deprecated protected void showOverlay(com.google.gwt.dom.client.TableRowElement unused)
showOverlay() instead.showOverlay(). The argument is ignored.unused - ignored argumentprotected void showOverlay()
getRow().protected void hideOverlay()
protected void setStylePrimaryName(String primaryName)
protected com.google.gwt.dom.client.Element createCell(com.google.gwt.dom.client.TableCellElement td)
td - the table cell used as a referenceprotected void setGridEnabled(boolean enabled)
public void setSaveCaption(String saveCaption) throws IllegalArgumentException
IllegalArgumentExceptionpublic String getSaveCaption()
public void setCancelCaption(String cancelCaption) throws IllegalArgumentException
IllegalArgumentExceptionpublic String getCancelCaption()
public void setEditorColumnError(Grid.Column<?,T> column, boolean hasError)
public void clearEditorColumnErrors()
public boolean isEditorColumnError(Grid.Column<?,T> column)
public void setBuffered(boolean buffered)
public boolean isBuffered()
public void setEventHandler(Grid.Editor.EventHandler<T> handler)
handler - the new event handlerpublic Grid.Editor.EventHandler<T> getEventHandler()
public boolean isWorkPending()
DeferredWorkerisWorkPending in interface DeferredWorkerprotected int getElementColumn(com.google.gwt.dom.client.Element e)
Copyright © 2016 Vaadin Ltd. All rights reserved.