Class 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
    • 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,
                                    DynamicPropertyEvaluator propsEvaluator)
        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.
        propsEvaluator - Some form control properties can't be evaluated at the time the CSS is compiled. This interface can be used by form controls to expand such properties.
      • AuthorInplaceContext

        public AuthorInplaceContext​(AuthorInplaceContext copy)
        Copy constructor.
        Parameters:
        copy - Another context object to copy from.
    • Method Detail

      • getPropertyEvaluator

        public DynamicPropertyEvaluator getPropertyEvaluator()
        Some form control properties can't be evaluated at the time the CSS is compiled. This interface can be used by form controls to expand such properties.
        Returns:
        A property evaluator.
        Since:
        16.1
      • 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

        @Deprecated
        public java.lang.String getAttributeToEdit()
        Deprecated.
        Use getAttributeToEditQName() instead. This method returns the attribute name as it was specified in the CSS. If a QName was specified then this QName might not be valid in the context of the current element. Property InplaceEditorArgumentKeys.PROPERTY_EDIT_QUALIFIED should be used in these situations.
        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.
      • getAttributeToEditQName

        public javax.xml.namespace.QName getAttributeToEditQName()
        The QName of the edited attribute.
        Returns:
        The QName of the edited attribute or null if not editing an attribute.
      • 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, for InplaceEditor this will be a Composite and for InplaceRenderer it will be a JPanel. 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.
      • setReadOnlyContext

        public void setReadOnlyContext​(boolean readOnlyContext)
        Sets if the form control is added in a context where editing is not permitted.
        Parameters:
        readOnlyContext - true if this form control is added in a context where changes are not permitted.
      • isReadOnlyContext

        public boolean isReadOnlyContext()
        Checks if the form control is added in a context where changes are not permitted. In this situation the form control will automatically be rendered as disabled. A form control implementation might look to this flag to dynamically change things. For example a pop-up form control usually presents a message that says: "Click to edit....". In a read-only context this tooltip will not be presented anymore.
        Returns:
        true if this form control is added in a context where changes are not permitted.
      • setParentHost

        public void setParentHost​(java.lang.Object 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.
        Parameters:
        parentHost - The host to set.