Class AbstractPropertyOptionsGroup
- java.lang.Object
-
- com.nomagic.magicdraw.core.options.OptionsGroup
-
- com.nomagic.magicdraw.core.options.AbstractPropertyOptionsGroup
-
- All Implemented Interfaces:
java.lang.Cloneable
- Direct Known Subclasses:
AbstractDiagramLayouterOptionsGroup
,com.nomagic.magicdraw.core.options.VersionedOptionsGroup
@OpenApi public abstract class AbstractPropertyOptionsGroup extends OptionsGroup
Manages editing of properties as options in an application.- See Also:
EnvironmentOptions
,OptionsGroup
-
-
Field Summary
Fields Modifier and Type Field Description private PropertyManager
additionalDefaultOptions
private PropertyManager
backupOptions
private java.util.Collection<java.lang.String>
invisibleProperties
Properties which are invisible to the user.private PropertyManager
propertyManager
Properties managed by this group.-
Fields inherited from class com.nomagic.magicdraw.core.options.OptionsGroup
ICON_ENVIRONMENT_OPTIONS
-
-
Constructor Summary
Constructors Constructor Description AbstractPropertyOptionsGroup(PropertyManager propertyManager)
Constructs property options group.AbstractPropertyOptionsGroup(java.lang.String id)
Constructs property options group.AbstractPropertyOptionsGroup(java.lang.String id, PropertyManager propertyManager, boolean visible)
Constructs property options group.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addInvisibleProperty(Property property)
Adds a property which is invisible to the user.void
addProperty(Property property)
Adds property to this group.void
addProperty(Property property, boolean generateDescription)
Adds property to this group.void
addProperty(Property property, java.lang.String descriptionID)
Adds property with given descriptionID.protected void
afterLoad(com.nomagic.magicdraw.lic.MDVersion version, boolean pluginsLoaded)
void
beforeLoad(boolean pluginsLoaded)
protected java.lang.Object
clone()
PropertyManager
createDefault()
Creates default values for properties.PropertyManager
createOptions()
Creates a property manager for the group.com.nomagic.magicdraw.ui.dialogs.options.BaseOptionsPanel
createOptionsPanel()
Creates options panel for editing the properties.protected void
fixProperty(java.lang.String propertyID, ProjectOptions.PropertySetter propertySetter)
AbstractPropertyOptionsGroup
getCopy()
PropertyManager
getOptions()
Gets properties managed by options.Style
getOptionsToSave()
Property
getProperty(java.lang.String name)
Gets property by name.PropertyManager
getVisibleOptions()
Gets properties which are visible to the user.protected boolean
hasVisibleOptions()
void
loadOptions(Style style, boolean pluginsLoaded)
private void
rememberAdditionalDefaultProperties(boolean pluginsLoaded)
void
removeProperty(java.lang.String name)
Removes a property by name.void
setDefaultValues()
Sets default values for the properties contained in this group.protected void
setOptions(PropertyManager propertyManager)
Sets properties for options.void
setPropertiesInvisible(java.lang.String[] ids, boolean invisible)
Sets visibility flag for an array of properties.void
setPropertyInvisible(java.lang.String id, boolean invisible)
Changes visibility flag to the property.-
Methods inherited from class com.nomagic.magicdraw.core.options.OptionsGroup
add, afterSave, firstInit, getBanner, getChildren, getGroupIcon, getIcon, getId, getName, getParent, isEnabled, isVisible, remove, resetCachedValues, setEnabled, setVisible, sortChildren
-
-
-
-
Field Detail
-
propertyManager
private PropertyManager propertyManager
Properties managed by this group.
-
invisibleProperties
private final java.util.Collection<java.lang.String> invisibleProperties
Properties which are invisible to the user.
-
additionalDefaultOptions
private PropertyManager additionalDefaultOptions
-
backupOptions
@CheckForNull private PropertyManager backupOptions
-
-
Constructor Detail
-
AbstractPropertyOptionsGroup
@OpenApi public AbstractPropertyOptionsGroup(java.lang.String id, @CheckForNull PropertyManager propertyManager, boolean visible)
Constructs property options group.- Parameters:
id
- id of the group.propertyManager
- property options managed by this group.visible
- indicates if group is visible to the user.
-
AbstractPropertyOptionsGroup
@OpenApi public AbstractPropertyOptionsGroup(PropertyManager propertyManager)
Constructs property options group.- Parameters:
propertyManager
- property options managed by this group.
-
AbstractPropertyOptionsGroup
@OpenApi public AbstractPropertyOptionsGroup(java.lang.String id)
Constructs property options group.- Parameters:
id
- id of the group.
-
-
Method Detail
-
createDefault
public final PropertyManager createDefault()
Creates default values for properties.- Returns:
- property manager with properties having default values.
-
createOptions
public PropertyManager createOptions()
Creates a property manager for the group.- Returns:
- created property manager.
-
setDefaultValues
@OpenApi public void setDefaultValues()
Sets default values for the properties contained in this group. Overriding classes should set default values to the properties.
-
createOptionsPanel
public com.nomagic.magicdraw.ui.dialogs.options.BaseOptionsPanel createOptionsPanel()
Description copied from class:OptionsGroup
Creates options panel for editing the properties.- Returns:
- created options panel.
-
getOptions
@OpenApi public PropertyManager getOptions()
Gets properties managed by options.- Returns:
- properties managed by options.
-
getVisibleOptions
@OpenApi public PropertyManager getVisibleOptions()
Gets properties which are visible to the user.- Returns:
- properties which are visible to the user.
-
hasVisibleOptions
protected boolean hasVisibleOptions()
-
getOptionsToSave
public Style getOptionsToSave()
-
loadOptions
public void loadOptions(Style style, boolean pluginsLoaded)
-
afterLoad
protected void afterLoad(com.nomagic.magicdraw.lic.MDVersion version, boolean pluginsLoaded)
-
rememberAdditionalDefaultProperties
private void rememberAdditionalDefaultProperties(boolean pluginsLoaded)
-
beforeLoad
public void beforeLoad(boolean pluginsLoaded)
-
setOptions
@OpenApi protected void setOptions(PropertyManager propertyManager)
Sets properties for options.- Parameters:
propertyManager
- property manager to set.
-
getProperty
@CheckForNull @OpenApi public Property getProperty(java.lang.String name)
Gets property by name.- Parameters:
name
- name of the property.- Returns:
- property found by name.
-
addProperty
@OpenApi public void addProperty(Property property)
Adds property to this group. DescriptionID will be reset. To add property with description useaddProperty(Property, String)
method.- Parameters:
property
- property to be added.
-
addProperty
@OpenApi public void addProperty(Property property, boolean generateDescription)
Adds property to this group. Property description ID will be generated or reset depending on generateDescription parameter value. If generateDescription = true, standard description resource ID will be generated by MagicDraw. If generateDescription = false, description ID will be set to null. To add property with its own description ID useaddProperty(Property, String)
method- Parameters:
property
- property to add.generateDescription
- true if description for property must be generated. Otherwise description ID will be reset.
-
addProperty
@OpenApi public void addProperty(Property property, java.lang.String descriptionID)
Adds property with given descriptionID.- Parameters:
property
- property to be added.descriptionID
- descriptionID for property.
-
addInvisibleProperty
@OpenApi public void addInvisibleProperty(Property property)
Adds a property which is invisible to the user.- Parameters:
property
- property to add.
-
removeProperty
@OpenApi public void removeProperty(java.lang.String name)
Removes a property by name.- Parameters:
name
- name by which to remove the property.
-
setPropertyInvisible
@OpenApi public void setPropertyInvisible(java.lang.String id, boolean invisible)
Changes visibility flag to the property.- Parameters:
id
- id of the property for which to change visibility.invisible
- visibility flag value.
-
setPropertiesInvisible
@OpenApi public void setPropertiesInvisible(java.lang.String[] ids, boolean invisible)
Sets visibility flag for an array of properties.- Parameters:
ids
- ids of properties for which to change visibility flag.invisible
- visibility flag value.
-
clone
protected java.lang.Object clone() throws java.lang.CloneNotSupportedException
- Overrides:
clone
in classjava.lang.Object
- Throws:
java.lang.CloneNotSupportedException
-
getCopy
@CheckForNull public AbstractPropertyOptionsGroup getCopy()
-
fixProperty
protected void fixProperty(java.lang.String propertyID, ProjectOptions.PropertySetter propertySetter)
-
-