Package com.iizigo.prop
Class PropertyEditorInfo
- java.lang.Object
- com.iizigo.prop.PropertyEditorInfo
- All Implemented Interfaces:
java.lang.Cloneable
public class PropertyEditorInfo extends java.lang.Object implements java.lang.CloneableClass used to map property name to texts.- Author:
- Christopher Mindus
Nested Class Summary
Nested Classes Modifier and Type Class Description static classPropertyEditorInfo.CreateItemClass used to hold information about an edited item during creation.
Field Summary
Fields Modifier and Type Field Description AtomatomThe property Atom, null for special ones.java.lang.StringdefaultPropertyValueThe default property value.java.lang.StringdefinitionNameThe definition name in the properties file.java.lang.String[]editOptionsOptions for the composite editor, null for none.IEditedPropertyEntry<?,?>editPropertyClass providing the property editor.java.lang.StringgroupThe group.IGroupTextFormattergroupFormatterThe group formatter, null for none.java.lang.StringgroupTextPromptThe group text prompt.java.lang.StringgroupToolTipTextThe group tool tip text.booleanisPrivatePrivate property flag.PropertyEditorInfoOptionsoptionsThe required flag.java.lang.Class<GProp<?>>propertyClassThe GProp class.java.lang.StringpropertyNameThe name of the property.PropertyEditorSetupsetupThe property editor object.java.lang.StringtextPromptThe text prompt.java.lang.StringtoolTipTextThe tooltip text.IEntryValidatorvalidatorThe validator/property converter, null if none.
Constructor Summary
Constructors Constructor Description PropertyEditorInfo(IzAnnotation jap)Dynamic creation of a editable property item for the Java Action Actor.PropertyEditorInfo(PropertyEditorSetup pes, java.lang.String propertyName, java.lang.String definitionName, PropertyEditorInfoOptions options)Constructor.
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description PropertyEditorInfocopyForParent(java.lang.String altParentPropertyName)Creates a copy of the instance with an alternate parent.MultiPropEditorcreateControls(PropertyEditor editor, org.eclipse.swt.widgets.Composite entryPart, com.iizigo.prop.PropertyEditorLayout pl, MultiPropLabel mlabel, DefinedButton definedButton, PropertyEditor.Node node, PropCnr[] containers)Creates the controls required.static java.util.ArrayList<PropertyEditorInfo.CreateItem>getCombinedPropertyEditorInfos(PropCnr[] pcs, java.util.ArrayList<PropertyEditorInfo>[] infosArray)Creates the combined EditProperties for an array of properties.static java.util.ArrayList<PropertyEditorInfo.CreateItem>getCombinedPropertyEditorInfos(PropCnr pc, java.util.ArrayList<PropertyEditorInfo> infosArray)Creates the combined EditProperties for a single property that are edited.PropertyEditorGroupInfogetGroupInfo()Gets the group info.java.lang.StringgetParentPropertyName()Gets the parent property name that must be present, null for none.static booleanhasAtLeastOnePropertyInGroup(java.util.Collection<PropertyEditorInfo> infos, java.lang.String[] propertyNames)Helper to check for at least one property in group.booleanisName()Checks if this is the property name editor.booleanisSpecial()Checks if this is a special property for extends, or the property name itself etc.static java.lang.StringverifyPropertiesPresentInGroup(java.util.Collection<PropertyEditorInfo> infos, java.lang.String[] propertyNames)Helper to verify properties are present for a group.
Field Detail
propertyName
public final java.lang.String propertyName
The name of the property.
definitionName
public final java.lang.String definitionName
The definition name in the properties file.
atom
public final Atom atom
The property Atom, null for special ones.
options
public final PropertyEditorInfoOptions options
The required flag.
textPrompt
public final java.lang.String textPrompt
The text prompt.
toolTipText
public final java.lang.String toolTipText
The tooltip text.
group
public final java.lang.String group
The group.
groupTextPrompt
public final java.lang.String groupTextPrompt
The group text prompt.
groupToolTipText
public final java.lang.String groupToolTipText
The group tool tip text.
propertyClass
public final java.lang.Class<GProp<?>> propertyClass
The GProp class.
defaultPropertyValue
public final java.lang.String defaultPropertyValue
The default property value.
editProperty
public final IEditedPropertyEntry<?,?> editProperty
Class providing the property editor.
editOptions
public final java.lang.String[] editOptions
Options for the composite editor, null for none.
validator
public final IEntryValidator validator
The validator/property converter, null if none.
groupFormatter
public final IGroupTextFormatter groupFormatter
The group formatter, null for none.
setup
public final PropertyEditorSetup setup
The property editor object.
isPrivate
public final boolean isPrivate
Private property flag.
Constructor Detail
PropertyEditorInfo
public PropertyEditorInfo(PropertyEditorSetup pes, java.lang.String propertyName, java.lang.String definitionName, PropertyEditorInfoOptions options)
Constructor.
PropertyEditorInfo
public PropertyEditorInfo(IzAnnotation jap) throws java.lang.IllegalArgumentException, java.text.ParseException
Dynamic creation of a editable property item for the Java Action Actor.- Parameters:
jap- The annotation.- Throws:
java.lang.IllegalArgumentException- For errors.java.text.ParseException- For value parsing errors.
Method Detail
getGroupInfo
public PropertyEditorGroupInfo getGroupInfo()
Gets the group info.- Returns:
- The group info, null for none.
getParentPropertyName
public java.lang.String getParentPropertyName()
Gets the parent property name that must be present, null for none.
copyForParent
public PropertyEditorInfo copyForParent(java.lang.String altParentPropertyName)
Creates a copy of the instance with an alternate parent.
createControls
public MultiPropEditor createControls(PropertyEditor editor, org.eclipse.swt.widgets.Composite entryPart, com.iizigo.prop.PropertyEditorLayout pl, MultiPropLabel mlabel, DefinedButton definedButton, PropertyEditor.Node node, PropCnr[] containers)
Creates the controls required.
verifyPropertiesPresentInGroup
public static java.lang.String verifyPropertiesPresentInGroup(java.util.Collection<PropertyEditorInfo> infos, java.lang.String[] propertyNames)
Helper to verify properties are present for a group.- Parameters:
infos- The array of edit's for the property.propertyNames- The property names to verify.- Returns:
- null for no error, otherwise the missing name(s) (comma separated preceded with "missing property name:").
hasAtLeastOnePropertyInGroup
public static boolean hasAtLeastOnePropertyInGroup(java.util.Collection<PropertyEditorInfo> infos, java.lang.String[] propertyNames)
Helper to check for at least one property in group.- Parameters:
infos- The array of edit's for the property.propertyNames- The names to verify.- Returns:
- null for no error, otherwise the missing name(s) (comma separated preceded with "missing property name:").
isName
public boolean isName()
Checks if this is the property name editor.
isSpecial
public boolean isSpecial()
Checks if this is a special property for extends, or the property name itself etc. Special properties cannot be edited together in multi-edit's.
getCombinedPropertyEditorInfos
public static java.util.ArrayList<PropertyEditorInfo.CreateItem> getCombinedPropertyEditorInfos(PropCnr pc, java.util.ArrayList<PropertyEditorInfo> infosArray)
Creates the combined EditProperties for a single property that are edited.
getCombinedPropertyEditorInfos
public static java.util.ArrayList<PropertyEditorInfo.CreateItem> getCombinedPropertyEditorInfos(PropCnr[] pcs, java.util.ArrayList<PropertyEditorInfo>[] infosArray)
Creates the combined EditProperties for an array of properties.