public interface InlineEditContext extends BaseContext
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.
BaseContext.Env
Modifier and Type | Method and Description |
---|---|
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. |
IDProvider |
getElement()
Get the contextual element for which the item has been requested.
|
Language |
getLanguage()
Returns the language in which the inline editing items have been requested.
|
String |
getTag()
Returns the tag name of the targeted editor, or
null if no tag is available. |
boolean |
isEditMode()
Returns
true if edit mode is active, otherwise history mode is active. |
boolean |
isMeta()
Indicates this context to operate on meta data.
|
is, logDebug, logError, logError, logInfo, logWarning
requestSpecialist, requireSpecialist
@Nullable IDProvider getElement()
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()
.
@Nullable EditorNode getEditorNode()
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()
null
.boolean isEditMode()
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".
true
if edit mode is active, otherwise history mode is active.@NotNull Language getLanguage()
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.
boolean isMeta()
true
, if operating on meta data.@Nullable String getTag()
null
if no tag is available.
If you want nested content in general to be included or excluded you should use
context.
instead of explicitly checking for
getEditorNode()
== nullnull
or "CMS_MODULE"
.
getEditorNode()
,
GomElement.getGomElementTag()
Copyright © 2021 e-Spirit AG. All Rights Reserved. Build 5.2.210210