M
- the model typepublic class GridRowEditing<M> extends AbstractGridEditing<M>
Modifier and Type | Class and Description |
---|---|
class |
GridRowEditing.DefaultRowEditorMessages |
static interface |
GridRowEditing.RowEditorAppearance |
static interface |
GridRowEditing.RowEditorMessages |
Constructor and Description |
---|
GridRowEditing(Grid<M> editableGrid)
Creates a new row editing instance.
|
Modifier and Type | Method and Description |
---|---|
<N,O> void |
addEditor(ColumnConfig<M,N> columnConfig,
Converter<N,O> converter,
IsField<O> field)
Adds an editor for the given column.
|
<N> void |
addRenderer(ColumnConfig<M,N> columnConfig,
SafeHtmlRenderer<N> renderer)
Adds a SafeHtml renderer for the given column.
|
void |
cancelEditing()
Cancels an active edit.
|
void |
completeEditing()
Completes the active edit.
|
ButtonBar |
getButtonBar()
Returns the row editor button bar with the Cancel and Save buttons.
|
TextButton |
getCancelButton()
Returns the cancel button.
|
GridRowEditing.RowEditorMessages |
getMessages()
Returns the row editor messages.
|
TextButton |
getSaveButton()
Returns the save button.
|
void |
removeEditor(ColumnConfig<M,?> columnConfig)
Removes the editor for the given column.
|
void |
setEditableGrid(Grid<M> editableGrid)
Sets the target grid to be edited.
|
void |
setMessages(GridRowEditing.RowEditorMessages messages)
Sets the row editor messages.
|
void |
startEditing(Grid.GridCell cell)
Starts editing for the given cell.
|
addBeforeStartEditHandler, addCancelEditHandler, addCompleteEditHandler, addEditor, addStartEditHandler, clearEditors, fireEvent, getActiveCell, getClicksToEdit, getConverter, getEditableGrid, getEditor, getMonitorPoll, isEditing, isErrorSummary, isMonitorValid, setClicksToEdit, setErrorSummary, setMonitorPoll, setMonitorValid
public <N,O> void addEditor(ColumnConfig<M,N> columnConfig, Converter<N,O> converter, IsField<O> field)
GridEditing
addEditor
in interface GridEditing<M>
addEditor
in class AbstractGridEditing<M>
columnConfig
- the column configconverter
- the converterfield
- the fieldpublic <N> void addRenderer(ColumnConfig<M,N> columnConfig, SafeHtmlRenderer<N> renderer)
columnConfig
- the column to render in this wayrenderer
- how to render the column's value as htmlpublic void cancelEditing()
GridEditing
cancelEditing
in interface GridEditing<M>
cancelEditing
in class AbstractGridEditing<M>
public void completeEditing()
GridEditing
completeEditing
in interface GridEditing<M>
completeEditing
in class AbstractGridEditing<M>
public ButtonBar getButtonBar()
Grid.getSelectionModel()
cancelEditing()
// example creating a delete button TextButton deleteBtn = new TextButton("Delete"); deleteBtn.addSelectHandler(new SelectEvent.SelectHandler() { public void onSelect(SelectEvent event) { // close the editing editing.cancelEditing(); // get the model StateModel item = grid.getSelectionModel().getSelectedItem(); } }); ButtonBar buttonBar = rowEditing.getButtonBar(); buttonBar.add(deleteBtn);
ButtonBar
.public TextButton getCancelButton()
public GridRowEditing.RowEditorMessages getMessages()
public TextButton getSaveButton()
public void removeEditor(ColumnConfig<M,?> columnConfig)
GridEditing
removeEditor
in interface GridEditing<M>
removeEditor
in class AbstractGridEditing<M>
columnConfig
- the column configpublic void setEditableGrid(Grid<M> editableGrid)
GridEditing
setEditableGrid
in interface GridEditing<M>
setEditableGrid
in class AbstractGridEditing<M>
editableGrid
- the editable gridpublic void setMessages(GridRowEditing.RowEditorMessages messages)
messages
- the messagespublic void startEditing(Grid.GridCell cell)
GridEditing
startEditing
in interface GridEditing<M>
startEditing
in class AbstractGridEditing<M>
cell
- the cellCopyright © 2015. All rights reserved.