Class GadgetIdentifier

java.lang.Object
de.espirit.firstspirit.ui.gadgets.GadgetIdentifier

public final class GadgetIdentifier extends Object
Identifier for gadgets providing information to find named form elements in a gadget model. The original gadget's identifier will be identified having the FORM_TAG as key.A gadget may decide to identify inner components by handing over an identifier with a custom key. Hierarchical gadgets should envelop inner forms to enable hierarchic identification.
Since:
4.2.405
  • Field Details

    • FORM_TAG

      public static final String FORM_TAG
      The generic default form-based identifier's key.
      Since:
      4.2.405
      See Also:
  • Method Details

    • from

      public static GadgetIdentifier from(@NotNull GomFormElement form)
      Get a default identifier for a given form element.
      Parameters:
      form - The form element to base the identifier upon.
      Returns:
      The form-related identifier.
      Since:
      4.2.405
    • on

      public static GadgetIdentifier on(@NotNull String name, @NotNull Serializable key)
      Get an identifier based on the given name and key.
      Parameters:
      name - The name of the gadget.
      key - The key of a specific component.
      Returns:
      The gadget identifier.
      Since:
      4.2.405
    • envelop

      public GadgetIdentifier envelop(@NotNull String name, @NotNull Serializable key)
      Envelop this identifier as inner node of a new identifier.
      Parameters:
      name - The name of the outer gadget node.
      key - A tag for gadget specific identification means.
      Returns:
      A new identifier containing the original one as inner node.
      Since:
      4.2.405
    • forLanguage

      public GadgetIdentifier forLanguage(@NotNull Language language)
      Get an identifier from this instance for a specific language.
      Parameters:
      language - The language to get the identifier for.
      Returns:
      A gadget identifier.
      Since:
      4.2.405
    • getName

      @NotNull public String getName()
      Get the name of the gadget.
      Returns:
      The gadget's name.
      Since:
      4.2.405
    • getKey

      @NotNull public Serializable getKey()
      Get the key of the specific gadget component.
      Returns:
      The specific component's key.
      Since:
      4.2.405
    • getLanguage

      @Nullable public Language getLanguage()
      Get the language this identifier was created for.
      Returns:
      The language or null
      Since:
      4.2.405
    • getInnerNode

      @Nullable public GadgetIdentifier getInnerNode()
      Get the inner node of a hierarchical identifier.
      Returns:
      The inner node or null.
      Since:
      4.2.405