Interface InplaceEditingListener
-
- All Superinterfaces:
InplaceEditingTraversalListener
@API(type=EXTENDABLE, src=PUBLIC) public interface InplaceEditingListener extends InplaceEditingTraversalListener
Gets notified about edit events:editingStopped(EditingEvent)
- a request to stop the editing and commit the value from the editor. Unless aeditingOccured()
is received the value will not be committed.editingOccured()
- signals an edit event inside the editor. This will mark the value from the editor as being dirty and requiring committing.editingCanceled()
- a request to hide the editor without any commit.
- a
KeyListener
for handling key events like: ENTER to stop editing and ESCAPE to cancel it. - a
FocusListener
to stop editing when the focus is given to a component that is not part of the editor. - a
DocumentListener
to fireeditingOccured()
events (If the editor has a document).
- Since:
- 14.1
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
commitValue(EditingEvent event)
Commit the given value inside the document without stopping the editing.void
editingCanceled()
An editing canceled request.void
editingOccured()
An edit happened in the inplace editor which could result in a document modification if the new value will be committed.void
editingStopped(EditingEvent event)
An editing stopped request.-
Methods inherited from interface ro.sync.ecss.extensions.api.editor.InplaceEditingTraversalListener
nextEditLocationRequested, previousEditLocationRequested
-
-
-
-
Method Detail
-
editingStopped
void editingStopped(EditingEvent event)
An editing stopped request. This will commit the value into the document ONLY if the following conditions apply:- an
editingOccured()
event was received prior to this event. - the value that must be committed is different from the old value. The old
value taken into account is either
InplaceEditorArgumentKeys.INITIAL_VALUE
or, if missing,InplaceEditorArgumentKeys.DEFAULT_VALUE
.
OBS: Before or after firing this event, the editor should release any held resources. For example a SWT editor will have to dispose() any created images, fonts or controls.- Parameters:
event
- Provides information about the editing. Ifnull
we should handle this as a cancel event.
- an
-
editingCanceled
void editingCanceled()
An editing canceled request.
OBS: Before or after firing this event, the editor should release any held resources. For example a SWT editor will have to dispose() any created images, fonts or controls.
-
editingOccured
void editingOccured()
An edit happened in the inplace editor which could result in a document modification if the new value will be committed. OBS: THIS EVENT IS VERY IMPORTANT. If noeditingOccured()
event is received, the value from the editor will not be committed when the editing is stopped. SeeeditingStopped(EditingEvent)
for more information.
-
commitValue
void commitValue(EditingEvent event)
Commit the given value inside the document without stopping the editing. Will only commit if a new string value is provided and only if the value that must be committed is different from the current value. Normally, this kind of event should be preceded by aneditingOccured()
event.- Parameters:
event
- Editing event. Currently only the string value from within is of interest. Also in case of custom form controls any givenEditingEvent.customEdit
will also be executed.
-
-