Class EditorPropCnr

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

public class EditorPropCnr extends PropCnr
Editor Property Container, i.e. data only for the Editor. This container is not created in Server or Client from XML (file): it is Editor only by class (isPropForEditorAtCreation()), so a factory of a program type other than EDITOR drops it at load whether or not the file carries editorProp, and the flag cannot be cleared.

A change inside it never marks the file changed on its own account: it is save-relevant only through a child EditorDataPropCnr, see isPropSaveRelevant().

Author:
Christopher Mindus
  • Constructor Details

    • EditorPropCnr

      public EditorPropCnr()
      Creates an Editor Property Container without name with a null value.
    • EditorPropCnr

      public EditorPropCnr(Atom propertyAtom)
      Creates an Editor Property Container with the specified name with a null value.
      Parameters:
      propertyAtom - the property atom.
    • EditorPropCnr

      public EditorPropCnr(Atom propertyAtom, GProp<?>[] properties) throws PropException
      Creates an Editor Property Container with the specified name and properties.
      Parameters:
      propertyAtom - the property atom.
      properties - the property array value.
      Throws:
      PropException - as structural changes in containers on client is prohibited.
  • Method Details

    • isPropForEditorAtCreation

      protected boolean isPropForEditorAtCreation()
      Editor only by class: the flag is set at creation, the editorProp attribute is not read for it and setPropForEditor(false) is refused, so a SERVER or CLIENT factory drops the container at load with or without the attribute - as the JavaScript design view creates every component-level $designer without setting the editor bit.
      Overrides:
      isPropForEditorAtCreation in class GProp<GProp<?>[]>
      Returns:
      true, always.
    • shouldCreateProps

      protected boolean shouldCreateProps(Element element)
      Only the Editor will load children elements.
      Overrides:
      shouldCreateProps in class PropCnr
      Parameters:
      element - The element in question.
      Returns:
      true to create properties out of it, false to ignore the element.
    • isPropSaveRelevant

      protected boolean isPropSaveRelevant()
      An editor container is save-relevant only through what it holds: it is when one of its children is an editor container that is, never on its own account. A panel's $designer is therefore invisible to the save comparison while it holds view state only, and visible as soon as it holds Designer data such as guides.
      Overrides:
      isPropSaveRelevant in class GProp<GProp<?>[]>
      Returns:
      true if a child editor container is save-relevant.
    • equalsTree

      protected Object equalsTree(PropCnr pc2, int how)
      Checks for equality in the whole container structure.

      Under the save comparison (IGProp.EQC_SAVE_FILE) only the save-relevant editor containers among the children of both sides are compared: their presence, by atom, and their content, through equalsObj. Everything else an editor container holds is view state or derived data and never a reason to save. Every other comparison is the ordinary one.

      NOTE: This method should not be overridden except in extreme situations, e.g. for MememtoPropCnr.

      Overrides:
      equalsTree in class PropCnr
      Parameters:
      pc2 - The property value to compare with.
      how - Flags EQC_* values for equal checking.
      Returns:
      Both atom and value are equal on all levels.