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 inherited from class com.nomagic.magicdraw.properties.Property
DEFAULT_PROPERTY_RESOURCE_PROVIDER, EDITABLE, NULL, NULL_ID_PROPERTY_RESOURCE_PROVIDER, UNDEFINED, VALUE, VALUE_ANNOTATIONS
-
-
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 booleanareEqualByValue(Property other)AbstractChoicePropertyclone()Clones the property.java.util.ListgetChoice()Returns list of possible values.booleanisEditableValue()Returns editable flag.booleanisUndefinedStateAvailable()booleanisValuesTranslatable()voidsetChoice(java.util.List val)Sets the list of possible values for selecting.voidsetEditableValue(boolean editable)Sets the editable flag..voidsetUndefinedStateAvailable(boolean undefinedStateAvailable)voidsetValuesTranslatable(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, addAnnotation, addPropertyChangeListener, addSource, addSources, areValuesEqual, checkFrozen, checkFrozen, createCellEditor, createTableCellRenderer, equals, firePropertyChange, generateDefaultDescriptionID, getAdditionalProperties, getAdditionalProperty, getAnnotation, getAnnotations, getClassType, getDescription, getDescriptionID, getFirstElementFromSources, getGroup, getID, getIntroductoryVersion, getName, getNonEditableReason, getProjectFromSourcesOrActive, getPureDescription, getResourceProvider, getResourceProviderID, getSortableValueStringRepresentation, getSourceAsElement, getSources, getSourcesAsStream, getUndefinedString, getUndefinedString, getValue, getValueStringRepresentation, hashCode, isEditable, isUndefinedState, isValueCompatible, removeAnnotation, removePropertyChangeListener, setAdditionalProperties, setAdditionalProperty, setAnnotations, setDescription, setDescriptionID, setEditable, setGroup, setID, setIntroductoryVersion, setNonEditableReason, setResourceProvider, setResourceProviderID, setSources, setUndefinedState, setValue, toString
-
-
-
-
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.
-
areEqualByValue
public boolean areEqualByValue(Property other)
- Overrides:
areEqualByValuein classProperty
-
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:PropertyClones 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)
-
-