Record Class ActionFacet

java.lang.Object
java.lang.Record
limn.accessibility.ActionFacet
Record Components:
actions - the verbs, in no particular order; never empty and never modifiable
keyBinding - the accelerator that performs this node's primary action, or null
accessKey - the access letter's chord as a user would read it, or null

public record ActionFacet(Set<Accessible.Action> actions, @Nullable String keyBinding, @Nullable String accessKey) extends Record
The parameterless verbs a node offers, and the keystroke that performs the first of them.

Only parameterless verbs are published here. A parameterised setter is dispatched through the same one call and is not in this list, because one of the three platforms cannot express a parameterised action in its action list at all; what advertises such a setter is the presence of the facet it sets.

The key binding is here because one platform's action list has a column for it and nothing else in the model does. It is the accelerator as a user would read it, already localized.

The access key is apart from it: the letter a user presses with Alt to reach the node ("Alt+N"), which a menu, a button or a field's label marks, where the key binding runs a command ("Ctrl+N"). Windows has a property for each; Linux serves both in one string.

  • Constructor Details

    • ActionFacet

      public ActionFacet(Set<Accessible.Action> actions, @Nullable String keyBinding)
      A facet with no access key.
    • ActionFacet

      public ActionFacet(Set<Accessible.Action> actions, @Nullable String keyBinding, @Nullable String accessKey)
      Creates an instance of a ActionFacet record class.
      Parameters:
      actions - the value for the actions record component
      keyBinding - the value for the keyBinding record component
      accessKey - the value for the accessKey record component
  • Method Details

    • has

      public boolean has(Accessible.Action action)
      Parameters:
      action - the verb to look for
      Returns:
      whether this node offers it
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • actions

      public Set<Accessible.Action> actions()
      Returns the value of the actions record component.
      Returns:
      the value of the actions record component
    • keyBinding

      public @Nullable String keyBinding()
      Returns the value of the keyBinding record component.
      Returns:
      the value of the keyBinding record component
    • accessKey

      public @Nullable String accessKey()
      Returns the value of the accessKey record component.
      Returns:
      the value of the accessKey record component