CoreMedia CKEditor 5 Plugins
    Preparing search index...

    An abstract command for opening contents in a tab.

    By default, has no value and is always enabled. Provides method refreshValueAndEnabledState to update value and enabled state based on the given value.

    Hierarchy (View Summary)

    Index

    Constructors

    • Creates an OpenInTabCommand.

      The OpenInTabCommand triggers the ContentFormService.openEntityInTab of the current selected model element, if it is the element this command is registered for.

      This command only executes if the selected model element has the given elementName and an attribute with the given attributeName.

      The "isEnabled" property can be used to update the state of any bound ui element and restrict its execution.

      If no elementName is given, it defaults to undefined. This is a special case for textNodes as textNodes are not represented as elements.

      Parameters

      • editor: Editor

        the ckeditor instance

      Returns OpenInTabCommand

    Methods

    • Executes command, either based on URI path set as value or as URI path given as parameter. Any uriPath set explicitly, overrides uriPath derived from model state.

      Parameters

      • OptionaluriPath: string

        optional URI paths; defaults to the URI path from model state

      Returns Promise<OpenEntityInTabResult>

      Promise, that denotes result of requested URIs to open

    • Refreshes the command value according to the provided value. Value will be set to undefined if the given value from the model does not represent a valid URI Path.

      Parameters

      • valueFromModel: unknown

        value found in model

      Returns string | undefined

      value set

    • Updates the value and enabled state.

      Only if valueFromModel resolves to a content URI, the value of this command is set accordingly, otherwise set to undefined.

      Enabled state in addition to that respects if a referenced content can be opened. Due to asynchronous behavior to validate content, meanwhile, a default enabled state is assumed.

      Parameters

      • valueFromModel: unknown

        value as retrieved from the model

      • defaultEnabled: boolean = true

        default enabled state to take, until ability to open a given content has been checked.

      Returns void