Package com.nomagic.magicdraw.properties
Class AbstractChoiceProperty
- java.lang.Object
-
- com.nomagic.magicdraw.properties.Property
-
- com.nomagic.magicdraw.properties.AbstractChoiceProperty
-
- All Implemented Interfaces:
PropertyVisitorAcceptor
,java.lang.Cloneable
- Direct Known Subclasses:
ChoiceProperty
@OpenApiAll public class AbstractChoiceProperty extends Property
Extracted more common class for Choice editing
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.List
choice
The list of possible values.private boolean
editableValue
If property is editable, then value can be selected not just from the list, but entered the new one.private boolean
undefinedStateAvailable
Undefined state is available if lower value of multiplicity is zeroprivate boolean
valuesTranslatable
True, if values of this property must be translated with resource provider.-
Fields inherited from class com.nomagic.magicdraw.properties.Property
DEFAULT_PROPERTY_RESOURCE_PROVIDER, EDITABLE, NULL, NULL_ID_PROPERTY_RESOURCE_PROVIDER, UNDEFINED, VALUE
-
-
Constructor Summary
Constructors Constructor Description AbstractChoiceProperty()
AbstractChoiceProperty(java.lang.String id, java.lang.Object value)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AbstractChoiceProperty
clone()
Clones the property.java.util.List
getChoice()
Returns list of possible values.boolean
isEditableValue()
Returns editable flag.boolean
isUndefinedStateAvailable()
boolean
isValuesTranslatable()
void
setChoice(java.util.List val)
Sets the list of possible values for selecting.void
setEditableValue(boolean editable)
Sets the editable flag..void
setUndefinedStateAvailable(boolean undefinedStateAvailable)
void
setValuesTranslatable(boolean valuesTranslatable)
Set true, if values of this property must be translated with property's resource provider.-
Methods inherited from class com.nomagic.magicdraw.properties.Property
_getValue, _isFrozen, _setFrozen, _setValue, accept, addPropertyChangeListener, addSource, addSources, areValuesEqual, checkFrozen, checkFrozen, createCellEditor, createTableCellRenderer, equals, firePropertyChange, generateDefaultDescriptionID, getAdditionalProperties, getAdditionalProperty, getClassType, getDescription, getDescriptionID, getFirstElementFromSources, getGroup, getID, getIntroductoryVersion, getName, getNonEditableReason, getProjectFromSourcesOrActive, getPureDescription, getResourceProvider, getResourceProviderID, getSourceAsElement, getSources, getSourcesAsStream, getUndefinedString, getUndefinedString, getValue, getValueStringRepresentation, hashCode, isEditable, isUndefinedState, isValueCompatible, removePropertyChangeListener, setAdditionalProperties, setAdditionalProperty, setDescription, setDescriptionID, setEditable, setGroup, setID, setIntroductoryVersion, setNonEditableReason, setResourceProvider, setResourceProviderID, setSources, setUndefinedState, setValue, toString
-
-
-
-
Field Detail
-
choice
private java.util.List choice
The list of possible values.
-
valuesTranslatable
private boolean valuesTranslatable
True, if values of this property must be translated with resource provider.
-
editableValue
private boolean editableValue
If property is editable, then value can be selected not just from the list, but entered the new one.
-
undefinedStateAvailable
private boolean undefinedStateAvailable
Undefined state is available if lower value of multiplicity is zero
-
-
Method Detail
-
setEditableValue
public void setEditableValue(boolean editable)
Sets the editable flag.. If property is editable, then value can be selected not just from the list, but entered the new one.- Parameters:
editable
- the editable state of the property.
-
isEditableValue
public boolean isEditableValue()
Returns editable flag.- Returns:
- the editable flag.
-
getChoice
public java.util.List getChoice()
Returns list of possible values.- Returns:
- list of possible values.
-
setChoice
public void setChoice(java.util.List val)
Sets the list of possible values for selecting. Sets only mMaximum number of values from the List's beginning.- Parameters:
val
- a new possible values list.
-
isValuesTranslatable
public boolean isValuesTranslatable()
- Returns:
- true, if values of this property must be translated with property's resource provider
-
setValuesTranslatable
public void setValuesTranslatable(boolean valuesTranslatable)
Set true, if values of this property must be translated with property's resource provider.- Parameters:
valuesTranslatable
- the new value of this flag.
-
clone
public AbstractChoiceProperty clone()
Description copied from class:Property
Clones the property. Clone is not deep, the clone will have the same instance of value. The clone will not have registered PropertyChangeListeners.
-
isUndefinedStateAvailable
public boolean isUndefinedStateAvailable()
-
setUndefinedStateAvailable
public void setUndefinedStateAvailable(boolean undefinedStateAvailable)
-
-