Oxygen XML Editor 14.2 Author API

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

java.lang.Object
  extended by ro.sync.ecss.extensions.api.editor.AuthorInplaceContext

@API(type=NOT_EXTENDABLE,
     src=PUBLIC)
public class AuthorInplaceContext
extends java.lang.Object

Context where an edit component will be used. Contains all the information required to build the editor.

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
AuthorInplaceContext(java.util.Map<java.lang.String,java.lang.Object> arguments, AuthorElement elem, Styles styles, AuthorSchemaManager schemaManager, AuthorAccess authorAccess, java.lang.Object parentHost)
          The editor context.
 
Method Summary
 java.util.Map<java.lang.String,java.lang.Object> getArguments()
           
 java.lang.String getAttributeToEdit()
           
static java.lang.String getAttributeToEdit(java.lang.String toEdit)
          Checks if the property InplaceEditorCSSConstants.PROPERTY_EDIT specifies an attribute to be edited.
 AuthorAccess getAuthorAccess()
           
 AuthorElement getElem()
          Get the element being edited.
 java.lang.String getErrorMessage()
           
 java.lang.Object getParentHost()
          The parent host in which the editor will be added or the renderer will be painted.
 Point getRelativeMouseLocation()
          If the mouse is currently hovering the area of this editor this represents the X,Y location relative to the editor bounds.
 AuthorSchemaManager getSchemaManager()
           
 Styles getStyles()
           
 void setErrorMessage(java.lang.String errorMessage)
          Sets an error message encountered while building the context.
 void setRelativeMousePosition(Point relativeMousePosition)
          If the mouse is currently hovering the area of this editor this represents the X,Y location relative to the editor bounds.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AuthorInplaceContext

public AuthorInplaceContext(java.util.Map<java.lang.String,java.lang.Object> arguments,
                            AuthorElement elem,
                            Styles styles,
                            AuthorSchemaManager schemaManager,
                            AuthorAccess authorAccess,
                            java.lang.Object parentHost)
The editor context.

Parameters:
arguments - The editor arguments
elem - The element being edited.
styles - The styles of the element where the editing takes place
schemaManager - Provides support for obtaining information about what elements, attributes can be inserted in a given context.
authorAccess - Provides access to different functions.
parentHost - The parent host in which the editor will be added or the renderer will be painted. If we are in the stand-alone Oxygen version this will be a JPanel. If we are in the Oxygen Eclipse plug-in this will be a Composite. For SWT, an editor will require the parent in order to create itself.
Method Detail

getArguments

public java.util.Map<java.lang.String,java.lang.Object> getArguments()
Returns:
The arguments from the oxy_editor function as well as some others. The keys are the constants from class InplaceEditorArgumentKeys.

getAttributeToEdit

public java.lang.String getAttributeToEdit()
Returns:
The attribute being edited as extracted from the oxy_editor arguments. null no attribute was specified in which case the text should be edited.

getAttributeToEdit

public static java.lang.String getAttributeToEdit(java.lang.String toEdit)
Checks if the property InplaceEditorCSSConstants.PROPERTY_EDIT specifies an attribute to be edited.

Parameters:
toEdit - The value of the property InplaceEditorCSSConstants.PROPERTY_EDIT
Returns:
The attribute being edited as extracted from the oxy_editor arguments. null if no attribute name was specified.

getElem

public AuthorElement getElem()
Get the element being edited.

Returns:
The element being edited. If a processing instruction is being edited, the returned object is an instance of ro.sync.ecss.extensions.api.node.ArtificialNode and you can obtain the wrapped PI from it.

getSchemaManager

public AuthorSchemaManager getSchemaManager()
Returns:
Returns the schemaManager.

getAuthorAccess

public AuthorAccess getAuthorAccess()
Returns:
Provides access to different author functions.

getParentHost

public java.lang.Object getParentHost()
The parent host in which the editor will be added or the renderer will be painted. If we are in the stand-alone Oxygen version this will be a JPanel. If we are in the Oxygen Eclipse plug-in this will be a Composite. For SWT, an editor will require the parent in order to create itself.

Returns:
The JPanel or Composite of the author.

setErrorMessage

public void setErrorMessage(java.lang.String errorMessage)
Sets an error message encountered while building the context.

Parameters:
errorMessage - An error message encountered while building the context.

getErrorMessage

public java.lang.String getErrorMessage()
Returns:
An error message encountered while building the context.

getStyles

public Styles getStyles()
Returns:
Returns the styles of the element where the editing takes place.

setRelativeMousePosition

public void setRelativeMousePosition(Point relativeMousePosition)
If the mouse is currently hovering the area of this editor this represents the X,Y location relative to the editor bounds. The editor might choose to render itself differently in this situation. For example a button editor might paint a special highlight as a feedback that an action can be performed. null if the mouse is not over the editor. This information is relevant only when the editor is painted. When editing is started the editor can just add mouse listeners onto itself.

Parameters:
relativeMousePosition - The mouse location if the mouse is over the editor.

getRelativeMouseLocation

public Point getRelativeMouseLocation()
If the mouse is currently hovering the area of this editor this represents the X,Y location relative to the editor bounds. The editor might choose to render itself differently in this situation. For example a button editor might paint a special highlight as a feedback that an action can be performed. null if the mouse is not over the editor. This information is relevant only when the editor is painted. When editing is started the editor can just add mouse listeners onto itself.

Returns:
The mouse location if the mouse is over the editor.

Oxygen XML Editor 14.2 Author API

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