Oxygen XML Editor 14.2 Author API

ro.sync.ecss.extensions.api.editor
Class InplaceEditorAdapter

java.lang.Object
  extended by ro.sync.ecss.extensions.api.editor.InplaceEditorAdapter
All Implemented Interfaces:
InplaceEditor, Extension

@API(type=EXTENDABLE,
     src=PUBLIC)
public abstract class InplaceEditorAdapter
extends java.lang.Object
implements InplaceEditor

Convenience implementation of the InplaceEditor. By extending this adapter you are protected if any new methods are added inside InplaceEditor.

Since:
14.1

*********************************
EXPERIMENTAL - Subject to change
********************************

Please note that this API is not marked as final and it can change in one of the next versions of the application. If you have suggestions, comments about it, please let us know.


Constructor Summary
InplaceEditorAdapter()
           
 
Method Summary
 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.
 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.
 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

InplaceEditorAdapter

public InplaceEditorAdapter()
Method Detail

getDescription

public java.lang.String getDescription()
Specified by:
getDescription in interface Extension
Returns:
The description of the extension.
See Also:
Extension.getDescription()

getEditorComponent

public java.lang.Object getEditorComponent(AuthorInplaceContext context,
                                           Rectangle allocation,
                                           Point mouseInvocationLocation)
Description copied from interface: InplaceEditor
Prepare and return the editor component.

Specified by:
getEditorComponent in interface InplaceEditor
Parameters:
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.

OBS: This is the very first call received by an editor. This ensures that the editor is properly initialized for the subsequent calls (like a InplaceEditor.requestFocus() call).
OBS: An editor implementation will have to add listeners onto itself like:
Returns:
The component that performs the editing. For the Standalone distribution this should be a java.awt.JComponent implementation. For the Eclipse plugin distribution, an org.eclipse.swt.widgets.Control is expected.
See Also:
InplaceEditor.getEditorComponent(ro.sync.ecss.extensions.api.editor.AuthorInplaceContext, ro.sync.exml.view.graphics.Rectangle, ro.sync.exml.view.graphics.Point)

getScrollRectangle

public Rectangle getScrollRectangle()
Description copied from interface: InplaceEditor
Returns a rectangle that should be made visible after the editor is shown. The coordinate should be relative to the editor itself. The default behavior is to make the entire editor visible but if the editor is bigger than the viewport the visible part might not be the right one. For example is the editor is a text field the caret might not be visible. This is when this method is useful. The caret rectangle should be returned so that the part of the editor with the caret is presented.

Specified by:
getScrollRectangle in interface InplaceEditor
Returns:
A rectangle to be made visible or null to make the entire editor visible.
See Also:
InplaceEditor.getScrollRectangle()

addEditingListener

public void addEditingListener(InplaceEditingListener editingListener)
Description copied from interface: InplaceEditor
Adds a listener to receive edit notifications: - 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.

Specified by:
addEditingListener in interface InplaceEditor
Parameters:
editingListener - Editing listener.
See Also:
InplaceEditor.addEditingListener(ro.sync.ecss.extensions.api.editor.InplaceEditingListener)

requestFocus

public void requestFocus()
Description copied from interface: InplaceEditor
Requests focus inside the editing component.

Specified by:
requestFocus in interface InplaceEditor
See Also:
InplaceEditor.requestFocus()

getValue

public java.lang.Object getValue()
Description copied from interface: InplaceEditor
Gets the value that the user entered.

Specified by:
getValue in interface InplaceEditor
Returns:
The value that the user entered.
See Also:
InplaceEditor.getValue()

stopEditing

public void stopEditing()
Description copied from interface: InplaceEditor
Stops the editing and commits the current value. The editor should release any held resources and notify InplaceEditingListener.editingStopped(EditingEvent). OBS: The current value will be committed only if at least one InplaceEditingListener.editingOccured() event was issued before this moment.

Specified by:
stopEditing in interface InplaceEditor
See Also:
InplaceEditor.stopEditing()

cancelEditing

public void cancelEditing()
Description copied from interface: InplaceEditor
Cancels the editing process. The editor should release any held resources and notify InplaceEditingListener.editingCanceled().

Specified by:
cancelEditing in interface InplaceEditor
See Also:
InplaceEditor.cancelEditing()

removeEditingListener

public void removeEditingListener(InplaceEditingListener editingListener)
Description copied from interface: InplaceEditor
Removes a listener that receives editing events.

Specified by:
removeEditingListener in interface InplaceEditor
Parameters:
editingListener - Editing listener.
See Also:
InplaceEditor.removeEditingListener(ro.sync.ecss.extensions.api.editor.InplaceEditingListener)

Oxygen XML Editor 14.2 Author API

© Copyright SyncRO Soft SRL 2002 - 2013. All rights reserved.