Class ArrayProp<ITEM extends GProp<?>>

All Implemented Interfaces:
EventListener, IGProp<GProp<?>[]>, IPropCnr, Cloneable
Direct Known Subclasses:
VSRows

public class ArrayProp<ITEM extends GProp<?>> extends PropCnr
The Array property class holds the property name, value and optionally has a parent and/or property listener(s).
Author:
Christopher Mindus
  • Constructor Details

    • ArrayProp

      public ArrayProp()
      Creates an Array property with the specified name with a null value.
    • ArrayProp

      public ArrayProp(Atom propertyAtom)
      Creates an Array property with the specified name with a null value.
      Parameters:
      propertyAtom - The property atom.
    • ArrayProp

      public ArrayProp(Atom propertyAtom, Class<ITEM> itemClass)
      Creates an Array property with the specified name with a null value.
      Parameters:
      propertyAtom - The property atom.
      itemClass - The item class.
  • Method Details

    • usesPropIndex

      public final boolean usesPropIndex()
      Use of index for the property container is enabled.
      Specified by:
      usesPropIndex in interface IPropCnr
      Overrides:
      usesPropIndex in class PropCnr
      Returns:
      true for this container.
    • setItemClass

      public void setItemClass(Class<ITEM> itemClass)
      Assigns the item property class for verification. This method is required to be called due to the Generics nature of Java code and that the items cannot otherwise be verified at runtime.
      Parameters:
      itemClass - The item class.
      Throws:
      IllegalArgumentException - If called with different class.
    • getPossibleChildren

      public Class<?>[] getPossibleChildren()
      Gets the acceptable children property classes that can be used in conjunction with e.g. a Paste operation.
      Specified by:
      getPossibleChildren in interface IPropCnr
      Overrides:
      getPossibleChildren in class PropCnr
      Returns:
      An array containing the classes of possible children, or null for no support.
    • clone

      public ArrayProp<?> clone()
      Clones the property.
      Overrides:
      clone in class PropCnr
      Returns:
      A new cloned property.
    • initializeElement

      protected void initializeElement(Element element)
      Called when the XML file for the property tree is serialized from properties. The property should fill attributes and nodes with appropriate information.
      Overrides:
      initializeElement in class PropCnr
      Parameters:
      element - The Element to initialize.
    • initializeProp

      public void initializeProp(Element element) throws PropException
      Called to initialize the property from an Element. The property should initialize itself from attributes and nodes with appropriate information.
      Overrides:
      initializeProp in class PropCnr
      Parameters:
      element - The Element.
      Throws:
      PropException - when the initialization fails.