@API(type=EXTENDABLE, src=PUBLIC) public abstract class AbstractInplaceEditorWrapper extends java.lang.Object implements InplaceEditor
Constructor and Description |
---|
AbstractInplaceEditorWrapper() |
Modifier and Type | Method and Description |
---|---|
void |
addEditingListener(InplaceEditingListener editingListener)
Adds a listener to receive edit notifications:
-
InplaceEditingListener.editingCanceled() to remove the editor and
cancel the edit operation. |
void |
cancelEditing()
Cancels the editing process.
|
void |
commitValue()
Commit the given value inside the document without stopping the editing.
|
protected abstract InplaceEditor |
createEditor(AuthorInplaceContext context)
Depending of the received context, create an editor.
|
java.lang.String |
getDescription() |
java.lang.Object |
getEditorComponent(AuthorInplaceContext context,
Rectangle allocation,
Point mouseInvocationLocation)
Prepare and return the editor component.
|
Rectangle |
getScrollRectangle()
Returns a rectangle that should be made visible after the editor is shown.
|
java.lang.Object |
getValue()
Gets the value that the user entered.
|
boolean |
insertContent(java.lang.String xmlContent)
An insert text event was received by the author page and redirected to this currently active form control.
|
void |
refresh(AuthorInplaceContext context)
While this editor is inside an editing session a document change was detected
that didn't originated form this editor.
|
void |
removeEditingListener(InplaceEditingListener editingListener)
Removes a listener that receives editing events.
|
void |
requestFocus()
Requests focus inside the editing component.
|
void |
stopEditing()
Stops the editing and commits the current value.
|
public java.lang.String getDescription()
getDescription
in interface Extension
Extension.getDescription()
protected abstract InplaceEditor createEditor(AuthorInplaceContext context)
context
- Editing context.public final java.lang.Object getEditorComponent(AuthorInplaceContext context, Rectangle allocation, Point mouseInvocationLocation)
InplaceEditor
getEditorComponent
in interface InplaceEditor
context
- The context where the editor will be used.allocation
- The bounds where the editor will be shown. This is normally
the bounds of the box in which the value being edited is rendered. If the
editor requires to be presented in different bounds it should alter this parameter.
The X,Y coordinates are relative to the parent in which the editor will be added.mouseInvocationLocation
- if the editor was requested using the mouse this
parameter represents the X,Y location where the event took place. It is relative to the parent
in which the editor will be added. null
if the editor wasn't requested through
mouse interaction.
InplaceEditor.requestFocus()
call).
KeyListener
for handling key events like: ENTER to stop editing
(by calling InplaceEditingListener.editingStopped(EditingEvent)
)
and ESCAPE to cancel it (by calling InplaceEditingListener.editingCanceled()
).FocusListener
to stop editing when the focus is given to a component that is not
part of the editor (by calling InplaceEditingListener.editingStopped(EditingEvent)
).DocumentListener
to fire InplaceEditingListener.editingOccured()
events (If the editor has a document).InplaceEditor.getEditorComponent(ro.sync.ecss.extensions.api.editor.AuthorInplaceContext, ro.sync.exml.view.graphics.Rectangle, ro.sync.exml.view.graphics.Point)
public final Rectangle getScrollRectangle()
InplaceEditor
getScrollRectangle
in interface InplaceEditor
null
to make the entire editor
visible.InplaceEditor.getScrollRectangle()
public final void addEditingListener(InplaceEditingListener editingListener)
InplaceEditor
InplaceEditingListener.editingCanceled()
to remove the editor and
cancel the edit operation.
- InplaceEditingListener.editingOccured()
to signal modification in
the editor. This event marks the editor as dirty and it's value will be
committed when a InplaceEditingListener.editingStopped(EditingEvent)
is received.
- InplaceEditingListener.editingStopped(EditingEvent)
to end editing
and commit it's value if needed. The value is usually committed ONLY if
a InplaceEditingListener.editingOccured()
was fired. See
InplaceEditingListener.editingStopped(EditingEvent)
for more information.addEditingListener
in interface InplaceEditor
editingListener
- Editing listener.InplaceEditor.addEditingListener(ro.sync.ecss.extensions.api.editor.InplaceEditingListener)
public final void requestFocus()
InplaceEditor
requestFocus
in interface InplaceEditor
InplaceEditor.requestFocus()
public final java.lang.Object getValue()
InplaceEditor
getValue
in interface InplaceEditor
InplaceEditor.getValue()
public final void stopEditing()
InplaceEditor
InplaceEditingListener.editingStopped(EditingEvent)
.
OBS: The current value will be committed only if at least one
InplaceEditingListener.editingOccured()
event was issued before this moment.stopEditing
in interface InplaceEditor
InplaceEditor.stopEditing()
public void commitValue()
InplaceEditor
commitValue
in interface InplaceEditor
InplaceEditor.commitValue()
public final void cancelEditing()
InplaceEditor
InplaceEditingListener.editingCanceled()
.cancelEditing
in interface InplaceEditor
InplaceEditor.cancelEditing()
public final void removeEditingListener(InplaceEditingListener editingListener)
InplaceEditor
removeEditingListener
in interface InplaceEditor
editingListener
- Editing listener.InplaceEditor.removeEditingListener(ro.sync.ecss.extensions.api.editor.InplaceEditingListener)
public void refresh(AuthorInplaceContext context)
InplaceEditor
this editor edits an attribute and the same attribute was externally modified. In this situation is recommended for the editor to update the current value.
refresh
in interface InplaceEditor
context
- An updated editing context for this editor.InplaceEditor.refresh(ro.sync.ecss.extensions.api.editor.AuthorInplaceContext)
public boolean insertContent(java.lang.String xmlContent)
InplaceEditor
insertContent
in interface InplaceEditor
xmlContent
- Content to be inserted.true
if the event was handled or false
if the form control can do nothing with the string. For example a text field
can insert the text inside it but a check box form control can do nothing with it.
If false
is returned the form control editing session will be
stopped and the author page will handle the event instead.InplaceEditor.insertContent(java.lang.String)
© Copyright SyncRO Soft SRL 2002 - 2015. All rights reserved.