Interface InlineEditContext

All Superinterfaces:
BaseContext, SpecialistsBroker

public interface InlineEditContext extends BaseContext
Object providing information and accessors about the context in which inline editing items have been requested.

Those items will be requested in various contexts, like a basic IDProvider or one of its nested editors. You may use the provided contextual information to include or exclude certain contexts in your implementation.

Since:
5.0.103
  • Nested Class Summary

    Nested classes/interfaces inherited from interface de.espirit.firstspirit.access.BaseContext

    BaseContext.Env
  • Method Summary

    Modifier and Type
    Method
    Description
    @Nullable EditorNode
    Provides the editor node identifying the nested content in which the inline editing items have been requested, or null if this context only references a top level element.
    @Nullable IDProvider
    Get the contextual element for which the item has been requested.
    @NotNull Language
    Returns the language in which the inline editing items have been requested.
    @Nullable String
    Returns the tag name of the targeted editor, or null if no tag is available.
    boolean
    Returns true if edit mode is active, otherwise history mode is active.
    boolean
    Indicates this context to operate on meta data.

    Methods inherited from interface de.espirit.firstspirit.access.BaseContext

    is, logDebug, logError, logError, logInfo, logWarning

    Methods inherited from interface de.espirit.firstspirit.agency.SpecialistsBroker

    requestSpecialist, requireSpecialist
  • Method Details

    • getElement

      @Nullable @Nullable IDProvider getElement()
      Get the contextual element for which the item has been requested.

      Keep in mind that an element might have nested content like a specific editor, which will result in a separate item request. You may use getEditorNode() to filter certain nested content, or exclude it completely. There might additionally be a request for the metadata content of the element, which you can filter using isMeta().

      Returns:
      The menu related element.
      Since:
      5.0.204
    • getEditorNode

      @Nullable @Nullable EditorNode getEditorNode()
      Provides the editor node identifying the nested content in which the inline editing items have been requested, or null if this context only references a top level element.

      The editor node can be used to determine the nested content in which the inline editing items have been requested. You may use context.getEditorNode() == null to ensure your action will not be shown on any nested editor. There might additionally be a request for the metadata content of the element, which you can exclude using !context.isMeta().

      Returns:
      The editor node or null.
      Since:
      5.0.103
    • isEditMode

      boolean isEditMode()
      Returns true if edit mode is active, otherwise history mode is active.

      The history mode indicates a historical view on the contextual element, in which the user should usually not be able to modify that element, except for operations like "restore element" or "compare versions".

      Returns:
      true if edit mode is active, otherwise history mode is active.
      Since:
      5.0.103
    • getLanguage

      @NotNull @NotNull Language getLanguage()
      Returns the language in which the inline editing items have been requested.

      The language may be used to retain the language context in which the user is operating, so any following action does not switch the language in an unintuitive way.

      Returns:
      current language.
      Since:
      5.0.103
    • isMeta

      boolean isMeta()
      Indicates this context to operate on meta data.
      Returns:
      true, if operating on meta data.
      Since:
      5.0.103
    • getTag

      @Nullable @Nullable String getTag()
      Returns the tag name of the targeted editor, or null if no tag is available.

      If you want nested content in general to be included or excluded you should use context.getEditorNode() == null instead of explicitly checking for null or "CMS_MODULE".

      Returns:
      The editor's tag.
      Since:
      5.0.103
      See Also: