Class PropCnrEditorProperties
java.lang.Object
com.iizigo.prop.PropCnrEditorProperties
The definition of the properties to edit for a property component.
An instance may be read from more than one thread: its items are filled when it is created and never changed afterwards, and the list it hands out cannot be changed. Its only state that can change later is the flag for group buttons.
Building a definition never changes a property tree. A definition that holds the rows of a child container the edited property container does not have (the Styles of a component without its $styles container) says so: getAbsentParentPropertyName().
- Author:
- Christopher Mindus
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final PropCnrEditorPropertiesInstance for empty settings.protected final List<PropertyEditorInfo> The info items in the order of the setup: an unmodifiable view, an attempt to change it throwsUnsupportedOperationException.Constructor Summary
ConstructorsConstructorDescriptionPropCnrEditorProperties(PropCnrEditorProperties existing, boolean useGroupButtons) Creates the instance of the EditProperties for a property component from an existing definition that can receive additional setup.PropCnrEditorProperties(PropCnrEditorProperties existing, PropCnr parent, PropCnrEditorProperties pes) Create a new instance and adds the definitions from another edited property container.PropCnrEditorProperties(PropCnrEditorProperties existing, PropCnr parent, PropCnr owner, PropCnrEditorProperties pes) Create a new instance and adds the definitions from another edited property container, which may be one that is in no property tree: a container made for the call, because the property container being edited has none of that name.PropCnrEditorProperties(PropCnrEditorProperties existing, Object[] setup) Creates the instance of the EditProperties for a property component from an existing definition that can receive additional setup.PropCnrEditorProperties(PropertyEditorSetup pes, Object[] setup) Creates the instance of the EditProperties for a property component.PropCnrEditorProperties(PropertyEditorSetup pes, Object[] setup, String itemAppender) Creates the instance of the EditProperties for a property component.Method Summary
Modifier and TypeMethodDescriptionfinal StringGets the name of the parent property whose container the edited property container did not have when this definition was built, e.g.final List<PropertyEditorInfo> Gets all the PropertyEditorInfo items of this definition, in the order of the setup: every row, the property name ("$") and the rows with a parent property included, whatever property container is edited.getEmptySettingsImage(PropCnr property) When the group is not editable, this image is shown.getEmptySettingsMessage(PropCnr property) When the group is not editable, this message is shown.final Object[]Returns the original setup data.final PropertyEditorInfogetPropertyEditorInfo(Atom atom) Gets a PropertyEditorInfo from a property Atom.Gets the PropertyEditorInfo array for the property editor for a single property.getPropertyEditorInfos(PropCnr pc, PropCnr owner) Gets the PropertyEditorInfo array for a property container that is in no property tree, with the property container named that would be its parent.final voidsetUseGroupButtons(boolean on) Sets the flag for group buttons.final booleanGets the flag for group buttons.
Field Details
EMPTY
Instance for empty settings.list
The info items in the order of the setup: an unmodifiable view, an attempt to change it throwsUnsupportedOperationException.
Constructor Details
PropCnrEditorProperties
Creates the instance of the EditProperties for a property component.- Parameters:
pes- The setup data for the Designer or the Plug-in.setup- This array contains the name of the property followed by a "required flag".
PropCnrEditorProperties
Creates the instance of the EditProperties for a property component.- Parameters:
pes- The setup data for the Designer or the Plug-in.setup- This array contains the name of the property followed by a "required flag".
PropCnrEditorProperties
Creates the instance of the EditProperties for a property component from an existing definition that can receive additional setup.- Parameters:
existing- An existing instance to add new data to.
PropCnrEditorProperties
Creates the instance of the EditProperties for a property component from an existing definition that can receive additional setup.- Parameters:
existing- An existing instance to add new data to.useGroupButtons- Flag to use group buttons or not.
PropCnrEditorProperties
public PropCnrEditorProperties(PropCnrEditorProperties existing, PropCnr parent, PropCnrEditorProperties pes) Create a new instance and adds the definitions from another edited property container.PropCnrEditorProperties
public PropCnrEditorProperties(PropCnrEditorProperties existing, PropCnr parent, PropCnr owner, PropCnrEditorProperties pes) Create a new instance and adds the definitions from another edited property container, which may be one that is in no property tree: a container made for the call, because the property container being edited has none of that name. Nothing is added to a property tree here. The rows of such a container are part of the definition all the same, and the definition says so:getAbsentParentPropertyName().- Parameters:
existing- An existing instance to add new data to.parent- The container whose definitions are added: its name is the parent property of the added rows.owner- The property container being edited whenparentis in no property tree: it is asked in the place ofparent's parent (seegetPropertyEditorInfos(PropCnr,PropCnr)). Null whenparentis a child of the property container being edited.pes- The definitions ofparent.
Method Details
getOriginalSetup
Returns the original setup data.- Returns:
- The original setup data, null if not present.
useGroupButtons
public final boolean useGroupButtons()Gets the flag for group buttons.setUseGroupButtons
public final void setUseGroupButtons(boolean on) Sets the flag for group buttons. The definition a setup class keeps is shared by every caller: a change of its flag is seen by all of them.getPropertyEditorInfos
Gets the PropertyEditorInfo array for the property editor for a single property.- Parameters:
pc- The property container being edited.- Returns:
- A new list at every call, never null: the caller may change it, this definition is not affected.
getPropertyEditorInfos
Gets the PropertyEditorInfo array for a property container that is in no property tree, with the property container named that would be its parent. A definition whose rows depend on the parent of the edited container (the Styles: the component is asked for its supported styles) overrides this method and asksownerinstead. This implementation asks no parent: it answersgetPropertyEditorInfos(PropCnr).- Parameters:
pc- The property container being edited, in no property tree.owner- The property container that would be its parent.- Returns:
- A new list at every call, never null: the caller may change it, this definition is not affected.
getAbsentParentPropertyName
Gets the name of the parent property whose container the edited property container did not have when this definition was built, e.g."$styles"for a component without its Styles container. The rows of that container are in this definition, built from a container that is in no property tree, andgetPropertyEditorInfos(PropCnr)keeps them while the edited property container has no such container. They can only be edited once the container is there: the property view creates it before it shows the rows.- Returns:
- The name of the parent property, null when no container was absent.
getAllPropertyEditorInfos
Gets all the PropertyEditorInfo items of this definition, in the order of the setup: every row, the property name ("$") and the rows with a parent property included, whatever property container is edited.getPropertyEditorInfos(PropCnr)is the list for one container.- Returns:
- An unmodifiable view of the items, never null; empty for
EMPTY.
getPropertyEditorInfo
Gets a PropertyEditorInfo from a property Atom.- Parameters:
atom- The atom.- Returns:
- An instance of PropertyEditorInfo if the atom is found, null otherwise.
getEmptySettingsMessage
getEmptySettingsImage