|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.vaadin.client.widgets.Grid.Editor<T>
T - the row type of the gridpublic static class Grid.Editor<T>
An editor UI for Grid rows. A single Grid row at a time can be opened for editing.
| Nested Class Summary | |
|---|---|
static interface |
Grid.Editor.EventHandler<T>
A handler for events related to the Grid editor. |
protected static class |
Grid.Editor.State
|
| Field Summary | |
|---|---|
static int |
KEYCODE_HIDE
|
static int |
KEYCODE_SHOW
|
| Constructor Summary | |
|---|---|
Grid.Editor()
|
|
| Method Summary | |
|---|---|
void |
cancel()
Cancels the currently active edit and hides the editor. |
void |
clearEditorColumnErrors()
|
protected Element |
createCell(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. |
java.lang.String |
getCancelCaption()
|
protected int |
getElementColumn(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()
|
java.lang.String |
getSaveCaption()
|
protected Grid.Editor.State |
getState()
|
protected 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(java.lang.String cancelCaption)
|
void |
setEditorColumnError(Grid.Column<?,T> column,
boolean hasError)
|
void |
setEditorError(java.lang.String errorMessage,
java.util.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(java.lang.String saveCaption)
|
protected void |
setState(Grid.Editor.State state)
|
protected void |
setStylePrimaryName(java.lang.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(TableRowElement unused)
Deprecated. As of 7.5, use showOverlay() instead. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int KEYCODE_SHOW
public static final int KEYCODE_HIDE
| Constructor Detail |
|---|
public Grid.Editor()
| Method Detail |
|---|
public void setEditorError(java.lang.String errorMessage,
java.util.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 focus
java.lang.IllegalStateException - if this editor is not enabled
java.lang.IllegalStateException - if this editor is already in edit mode and in buffered
modepublic void cancel()
saved are lost.
java.lang.IllegalStateException - if this editor is not enabled
java.lang.IllegalStateException - if this editor is not in edit modepublic void save()
java.lang.IllegalStateException - if this editor is not enabled
java.lang.IllegalStateException - if this editor is not in edit modepublic EditorHandler<T> getHandler()
public void setHandler(EditorHandler<T> rowHandler)
rowHandler - the new editor handler
java.lang.IllegalStateException - if this editor is currently in edit modepublic boolean isEnabled()
public void setEnabled(boolean enabled)
enabled - true if enabled, false otherwise
java.lang.IllegalStateException - if in edit mode and trying to disable
java.lang.IllegalStateException - if the editor handler is not set
protected void show(int rowIndex,
int columnIndex)
protected void setGrid(Grid<T> grid)
protected Grid.Editor.State getState()
protected void setState(Grid.Editor.State state)
protected Widget getWidget(Grid.Column<?,T> column)
editable, returns null.
column - the column
@Deprecated protected void showOverlay(TableRowElement unused)
showOverlay() instead.
showOverlay(). The argument is ignored.
unused - ignored argumentprotected void showOverlay()
getRow().
protected void hideOverlay()
protected void setStylePrimaryName(java.lang.String primaryName)
protected Element createCell(TableCellElement td)
td - the table cell used as a reference
protected void setGridEnabled(boolean enabled)
public void setSaveCaption(java.lang.String saveCaption)
throws java.lang.IllegalArgumentException
java.lang.IllegalArgumentExceptionpublic java.lang.String getSaveCaption()
public void setCancelCaption(java.lang.String cancelCaption)
throws java.lang.IllegalArgumentException
java.lang.IllegalArgumentExceptionpublic java.lang.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()
DeferredWorker
isWorkPending in interface DeferredWorkerprotected int getElementColumn(Element e)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||