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
KeyListenerfor handling key events like: ENTER to stop editing and ESCAPE to cancel it. - a
FocusListenerto stop editing when the focus is given to a component that is not part of the editor. - a
DocumentListenerto fireeditingOccured()events (If the editor has a document).
- Since:
- 14.1
-
Method Summary
Modifier and TypeMethodDescriptionvoidcommitValue(EditingEvent event) Commit the given value inside the document without stopping the editing.voidAn editing canceled request.voidAn edit happened in the inplace editor which could result in a document modification if the new value will be committed.voideditingStopped(EditingEvent event) An editing stopped request.Methods inherited from interface ro.sync.ecss.extensions.api.editor.InplaceEditingTraversalListener
nextEditLocationRequested, previousEditLocationRequested
-
Method Details
-
editingStopped
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_VALUEor, 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. Ifnullwe 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
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.customEditwill also be executed.
-