Class Option

All Implemented Interfaces:
Manageable, PersistenceCapable, Shareable, SharedObjectProvider, RegistryContext, UserFields, XObject, Described, KeyDescription, Map, Serializable
Direct Known Subclasses:
ShortCut

public class Option extends Value implements KeyDescription
See Also:
  • Field Details

  • Constructor Details

    • Option

      public Option()
  • Method Details

    • getNTypeImpl

      protected Node.NType getNTypeImpl()
      Description copied from class: Node
      This method returns the Node.NType which describes the managed fields of the class of this node. This method has to be implemented in every concrete subclass.
      Overrides:
      getNTypeImpl in class Value
      Returns:
      type describing the managed fields of the class of this node
    • newInstance

      protected Node newInstance()
      Description copied from class: Node
      This method returns a new instance of the class of this node. This method has to be implemented in every concrete subclass.
      Overrides:
      newInstance in class Value
      Returns:
      new instance of class of this node
    • getTypeFromObject

      protected boolean getTypeFromObject()
      Overrides:
      getTypeFromObject in class LazyObjectItem
    • createNoneditableOption

      public static Option createNoneditableOption(String name, Object value)
    • isEditable

      public boolean isEditable()
    • isTransient

      public boolean isTransient()
    • setPreference

      public static void setPreference(Item item, String value)
    • getPreference

      public static String getPreference(Item item)
    • belongsToGroup

      public boolean belongsToGroup(Item item)
    • getKey

      public String getKey()
      Description copied from interface: KeyDescription
      Returns the key which is described by this instance.
      Specified by:
      getKey in interface KeyDescription
      Returns:
      the key
    • getType

      public Type getType()
      Description copied from interface: KeyDescription
      Returns the type of values which are associated with the key.
      Specified by:
      getType in interface KeyDescription
      Returns:
      the type of values
    • getQuantity

      public Quantity getQuantity()
      Description copied from interface: KeyDescription
      Returns the quantity of values which are associated with the key.
      Specified by:
      getQuantity in interface KeyDescription
      Returns:
      the quantity of values
    • setOptionValue

      public void setOptionValue(Object value)
      The value is set to either: - the OptionBase object (in the workbench.options file of the workbench) if the option is set locally - to the Option (this) object value$FIELD and to the java pref if it is set globally
      Parameters:
      value -
    • activateImpl

      protected void activateImpl()
      Overrides:
      activateImpl in class Item
    • getObject

      public Object getObject()
      Load the value of an option either: - based on the workbench.options file within a workbench (see OptionBase) if the workbench contains that file - based on the global preferences - registry option
      Overrides:
      getObject in class LazyObjectItem
    • getObject

      public Object getObject(Registry r)
      Load the value of an option either: - based on the workbench.options file within a workbench (see OptionBase) if the workbench contains that file - based on the global preferences - registry option
    • readAttribute

      protected boolean readAttribute(String uri, String name, String value) throws SAXException
      Overrides:
      readAttribute in class Value
      Throws:
      SAXException
    • get

      public static Option get(Item item, String option)
    • hasEditableOptions

      public static boolean hasEditableOptions(Item item)
    • getEditableOptions

      public static Option[] getEditableOptions(Item i, boolean includeTransient)
      Returns all options in the subtree starting with i which are editable or transient (the latter only if includeTransient is true). Links having the name "option" are resolved.
      Parameters:
      i - the item to start with
      includeTransient - include transient options?
      Returns:
      an array of all editable options in the subtree starting with i