public abstract class AbstractGridEditing<M> extends Object implements GridEditing<M>
Modifier and Type | Class and Description |
---|---|
protected class |
AbstractGridEditing.AbstractGridEditingKeyNav |
protected class |
AbstractGridEditing.Handler |
Modifier and Type | Field and Description |
---|---|
protected Grid.GridCell |
activeCell |
protected boolean |
bound |
protected Grid.Callback |
callback |
protected ColumnModel<M> |
columnModel |
protected Map<ColumnConfig<M,?>,Converter<?,?>> |
converterMap |
protected Grid<M> |
editableGrid |
protected Map<ColumnConfig<M,?>,IsField<?>> |
editorMap |
protected GroupingHandlerRegistration |
groupRegistration |
protected AbstractGridEditing.Handler |
handler |
protected KeyNav |
keyNav |
protected boolean |
lastValid |
protected Timer |
monitorTimer |
protected ToolTip |
tooltip |
Constructor and Description |
---|
AbstractGridEditing() |
Modifier and Type | Method and Description |
---|---|
HandlerRegistration |
addBeforeStartEditHandler(BeforeStartEditEvent.BeforeStartEditHandler<M> handler) |
HandlerRegistration |
addCancelEditHandler(CancelEditEvent.CancelEditHandler<M> handler) |
HandlerRegistration |
addCompleteEditHandler(CompleteEditEvent.CompleteEditHandler<M> handler) |
<N,O> void |
addEditor(ColumnConfig<M,N> columnConfig,
Converter<N,O> converter,
IsField<O> field)
Adds an editor for the given column.
|
<N> void |
addEditor(ColumnConfig<M,N> columnConfig,
IsField<N> field)
Adds an editor for the given column.
|
HandlerRegistration |
addStartEditHandler(StartEditEvent.StartEditHandler<M> handler) |
protected void |
bindHandler() |
abstract void |
cancelEditing()
Cancels an active edit.
|
void |
clearEditors()
Clears the editors.
|
abstract void |
completeEditing()
Completes the active edit.
|
protected HandlerManager |
ensureHandlers() |
protected KeyNav |
ensureInternalKeyNav() |
protected AbstractGridEditing.Handler |
ensureInternHandler() |
protected Grid.GridCell |
findCell(Element target) |
void |
fireEvent(<any> event) |
protected void |
focusCell(int row,
int col) |
protected void |
focusGrid() |
Grid.GridCell |
getActiveCell()
Returns the active cell.
|
ClicksToEdit |
getClicksToEdit()
Returns the clicks to edit.
|
<N,O> Converter<N,O> |
getConverter(ColumnConfig<M,N> columnConfig)
Returns the converter for the given column.
|
Grid<M> |
getEditableGrid()
Returns the target grid.
|
<O> IsField<O> |
getEditor(ColumnConfig<M,?> columnConfig)
Returns the editor for the given column.
|
protected abstract SafeHtml |
getErrorHtml() |
protected void |
getErrorMessage(IsField<?> field,
SafeHtmlBuilder sb,
SafeHtml title) |
int |
getMonitorPoll()
Returns the interval that the editor is validated.
|
protected void |
handleDoubleEdit(NativeEvent event) |
protected <N,O> void |
handleHeaderMouseDown(HeaderMouseDownEvent event) |
protected void |
handleSingleEdit(NativeEvent event) |
protected void |
hideTooltip() |
boolean |
isEditing()
Returns true if editing is active.
|
boolean |
isErrorSummary()
Returns true if a tooltip with an error summary is shown.
|
boolean |
isMonitorValid()
Returns true if valid monitoring is enabled.
|
protected abstract boolean |
isValid() |
protected void |
onAttachOrDetach(AttachEvent event) |
protected void |
onClick(ClickEvent event) |
protected void |
onDoubleClick(DoubleClickEvent event) |
protected void |
onEnter(NativeEvent evt) |
protected void |
onEsc(NativeEvent evt) |
protected void |
onMouseDown(MouseDownEvent event) |
protected void |
onMouseUp(MouseUpEvent event) |
protected void |
onReconfigure(ReconfigureEvent event) |
protected void |
onScroll(ScrollEvent event) |
void |
removeEditor(ColumnConfig<M,?> columnConfig)
Removes the editor for the given column.
|
void |
setClicksToEdit(ClicksToEdit clicksToEdit)
Sets the number of clicks to edit (defaults to ONE).
|
void |
setEditableGrid(Grid<M> editableGrid)
Sets the target grid to be edited.
|
void |
setErrorSummary(boolean errorSummary)
True to show a tooltip with an error summary (defaults to true)
|
void |
setMonitorPoll(int monitorPoll)
Sets the polling interval that the row editor validation is run (defaults to 200).
|
void |
setMonitorValid(boolean monitorValid)
True to monitor the valid status of this editor (defaults to true).
|
protected abstract void |
showTooltip(SafeHtml content) |
protected void |
startEditing(Element target)
Starts editing for the given cell.
|
abstract void |
startEditing(Grid.GridCell cell)
Starts editing for the given cell.
|
protected void |
startMonitoring() |
protected void |
stopMonitoring() |
protected Grid.GridCell activeCell
protected Grid.Callback callback
protected ColumnModel<M> columnModel
protected Map<ColumnConfig<M,?>,Converter<?,?>> converterMap
protected Map<ColumnConfig<M,?>,IsField<?>> editorMap
protected GroupingHandlerRegistration groupRegistration
protected AbstractGridEditing.Handler handler
protected KeyNav keyNav
protected boolean bound
protected boolean lastValid
protected Timer monitorTimer
protected ToolTip tooltip
public HandlerRegistration addBeforeStartEditHandler(BeforeStartEditEvent.BeforeStartEditHandler<M> handler)
addBeforeStartEditHandler
in interface BeforeStartEditEvent.HasBeforeStartEditHandlers<M>
public HandlerRegistration addCancelEditHandler(CancelEditEvent.CancelEditHandler<M> handler)
addCancelEditHandler
in interface CancelEditEvent.HasCancelEditHandlers<M>
public HandlerRegistration addCompleteEditHandler(CompleteEditEvent.CompleteEditHandler<M> handler)
addCompleteEditHandler
in interface CompleteEditEvent.HasCompleteEditHandlers<M>
public <N,O> void addEditor(ColumnConfig<M,N> columnConfig, Converter<N,O> converter, IsField<O> field)
GridEditing
addEditor
in interface GridEditing<M>
N
- the column data typeO
- the field data typecolumnConfig
- the column configconverter
- the converterfield
- the fieldpublic <N> void addEditor(ColumnConfig<M,N> columnConfig, IsField<N> field)
GridEditing
addEditor
in interface GridEditing<M>
N
- the column data typecolumnConfig
- the column configfield
- the fieldpublic HandlerRegistration addStartEditHandler(StartEditEvent.StartEditHandler<M> handler)
addStartEditHandler
in interface StartEditEvent.HasStartEditHandlers<M>
public abstract void cancelEditing()
GridEditing
cancelEditing
in interface GridEditing<M>
public void clearEditors()
public abstract void completeEditing()
GridEditing
completeEditing
in interface GridEditing<M>
public void fireEvent(<any> event)
public Grid.GridCell getActiveCell()
public ClicksToEdit getClicksToEdit()
public <N,O> Converter<N,O> getConverter(ColumnConfig<M,N> columnConfig)
GridEditing
getConverter
in interface GridEditing<M>
N
- the column data typeO
- the field data typecolumnConfig
- the column configpublic Grid<M> getEditableGrid()
GridEditing
getEditableGrid
in interface GridEditing<M>
public <O> IsField<O> getEditor(ColumnConfig<M,?> columnConfig)
GridEditing
getEditor
in interface GridEditing<M>
O
- the field data typecolumnConfig
- the column configpublic int getMonitorPoll()
public boolean isEditing()
GridEditing
isEditing
in interface GridEditing<M>
public boolean isErrorSummary()
public boolean isMonitorValid()
public void removeEditor(ColumnConfig<M,?> columnConfig)
GridEditing
removeEditor
in interface GridEditing<M>
columnConfig
- the column configpublic void setClicksToEdit(ClicksToEdit clicksToEdit)
clicksToEdit
- the clicks to editpublic void setEditableGrid(Grid<M> editableGrid)
GridEditing
setEditableGrid
in interface GridEditing<M>
editableGrid
- the editable gridpublic void setErrorSummary(boolean errorSummary)
errorSummary
- true to show an error summary.public void setMonitorPoll(int monitorPoll)
monitorPoll
- the polling interval in ms in that validation is donepublic void setMonitorValid(boolean monitorValid)
monitorValid
- true to monitor this row editorpublic abstract void startEditing(Grid.GridCell cell)
GridEditing
startEditing
in interface GridEditing<M>
cell
- the cellprotected void bindHandler()
protected HandlerManager ensureHandlers()
protected KeyNav ensureInternalKeyNav()
protected AbstractGridEditing.Handler ensureInternHandler()
protected Grid.GridCell findCell(Element target)
protected void focusCell(int row, int col)
protected void focusGrid()
protected abstract SafeHtml getErrorHtml()
protected void getErrorMessage(IsField<?> field, SafeHtmlBuilder sb, SafeHtml title)
protected void handleDoubleEdit(NativeEvent event)
protected <N,O> void handleHeaderMouseDown(HeaderMouseDownEvent event)
protected void handleSingleEdit(NativeEvent event)
protected void hideTooltip()
protected abstract boolean isValid()
protected void onAttachOrDetach(AttachEvent event)
protected void onClick(ClickEvent event)
protected void onDoubleClick(DoubleClickEvent event)
protected void onEnter(NativeEvent evt)
protected void onEsc(NativeEvent evt)
protected void onMouseDown(MouseDownEvent event)
protected void onMouseUp(MouseUpEvent event)
protected void onReconfigure(ReconfigureEvent event)
protected void onScroll(ScrollEvent event)
protected abstract void showTooltip(SafeHtml content)
protected void startEditing(Element target)
GridEditing
startEditing
in interface GridEditing<M>
target
- the cellprotected void startMonitoring()
protected void stopMonitoring()
Copyright © 2018. All rights reserved.