Interface EditContext


  • public interface EditContext
    The edit context is used to define the edit behaviour of components. There is a context opened for every included component that can be edited (or designed). A component can be edited if it provides a EditConfig.
    • Method Detail

      • isRoot

        boolean isRoot()
        Checks if this is the root edit context.
        Returns:
        true if this is the root edit context
      • getParent

        EditContext getParent()
        Returns the parent edit context or null if this context is the root context.
        Returns:
        the parent context or null
      • getRoot

        EditContext getRoot()
        Returns the root edit context.
        Returns:
        the root edit context.
      • getComponentContext

        ComponentContext getComponentContext()
        Returns the primary component context that is bound to this edit context. Note that en edit context can span several component context if components are included that do not need editing.
        Returns:
        the component context.
      • getComponent

        Component getComponent()
        Returns the primary edit component for this context.
        Returns:
        the edit component.
      • getEditConfig

        EditConfig getEditConfig()
        Retrieves the edit config for the current component respecting the context hierarchy. This might not be the same as the one returned by getComponent().getEditConfig() since it can be merged with the child configs of its parents.
        Returns:
        the edit config
      • getAttribute

        java.lang.Object getAttribute​(java.lang.String name)
        Returns the context attribute for the given name
        Parameters:
        name - the name of the attribute
        Returns:
        the attribute or null if not defined.
      • setContentPath

        void setContentPath​(java.lang.String path)
        Sets the content path that is used when including the java script call for the edit bars. defaults to the path of the resource in edit mode or to the path of the style in design mode.
        Parameters:
        path - content path
      • setAttribute

        java.lang.Object setAttribute​(java.lang.String name,
                                      java.lang.Object value)
        Sets a context attribute with the given name. If the given attribute is null it is removed from the attribute map.
        Parameters:
        name - the name of the attribute
        value - the attribute value
        Returns:
        the old attribute or null