Package com.nomagic.magicdraw.properties
Class LocaleProperty
- java.lang.Object
-
- com.nomagic.magicdraw.properties.Property
-
- com.nomagic.magicdraw.properties.AbstractChoiceProperty
-
- com.nomagic.magicdraw.properties.ChoiceProperty
-
- com.nomagic.magicdraw.properties.LocaleProperty
-
- All Implemented Interfaces:
PropertyVisitorAcceptor
,java.lang.Cloneable
@OpenApiAll public class LocaleProperty extends ChoiceProperty
The property for storing and editing somejava.util.Locale
value.- See Also:
Locale
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.Locale
mLocale
The sett locale.-
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 LocaleProperty()
Default constructor.LocaleProperty(java.lang.String id, int index, java.util.List choice)
The constructor.LocaleProperty(java.lang.String id, java.lang.Object value, java.util.List choice)
The constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
accept(PropertyVisitor v)
Accepts the given visitor.LocaleProperty
clone()
Clones the property.java.lang.String
getClassType()
Returns property class type.java.util.Locale
getLocale()
Return the locale.void
setLocale(java.util.Locale locale)
Sets a new locale for property.void
updateLocaleByString(java.lang.String locale)
Update Locale By Stringvoid
updateLocaleByValue()
Updates locale by current value.-
Methods inherited from class com.nomagic.magicdraw.properties.ChoiceProperty
getIndex, isAppendValue, setAppendValue, setChoice, setIndex, setValue, toString
-
Methods inherited from class com.nomagic.magicdraw.properties.AbstractChoiceProperty
getChoice, isEditableValue, isUndefinedStateAvailable, isValuesTranslatable, setEditableValue, setUndefinedStateAvailable, setValuesTranslatable
-
Methods inherited from class com.nomagic.magicdraw.properties.Property
_getValue, _isFrozen, _setFrozen, _setValue, addPropertyChangeListener, addSource, addSources, areValuesEqual, checkFrozen, checkFrozen, createCellEditor, createTableCellRenderer, equals, firePropertyChange, generateDefaultDescriptionID, getAdditionalProperties, getAdditionalProperty, 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
-
-
-
-
Constructor Detail
-
LocaleProperty
public LocaleProperty()
Default constructor. Value of the property will be null. ID will be empty string.
-
LocaleProperty
public LocaleProperty(java.lang.String id, java.lang.Object value, java.util.List choice)
The constructor.- Parameters:
id
- the ID of property.value
- the value of the property.choice
- the list of possible values.
-
LocaleProperty
public LocaleProperty(java.lang.String id, int index, java.util.List choice)
The constructor.- Parameters:
id
- the ID of property.index
- the index in choice of selected value.choice
- the list of possible values.
-
-
Method Detail
-
getLocale
public java.util.Locale getLocale()
Return the locale.- Returns:
- a locale from property.
-
setLocale
public void setLocale(java.util.Locale locale)
Sets a new locale for property.- Parameters:
locale
- a new locale.
-
updateLocaleByValue
public void updateLocaleByValue()
Updates locale by current value. Also updates available language list for this property from ResourceManager languages.
-
updateLocaleByString
public void updateLocaleByString(java.lang.String locale)
Update Locale By String- Parameters:
locale
- Locale String.
-
getClassType
public java.lang.String getClassType()
Returns property class type.- Specified by:
getClassType
in interfacePropertyVisitorAcceptor
- Overrides:
getClassType
in classChoiceProperty
- Returns:
- PropertyID.LOCALE_PROPERTY
- See Also:
PropertyID.LOCALE_PROPERTY
-
accept
public void accept(PropertyVisitor v) throws java.lang.Exception
Accepts the given visitor.- Specified by:
accept
in interfacePropertyVisitorAcceptor
- Overrides:
accept
in classChoiceProperty
- Parameters:
v
- the PropertyVisitor.- Throws:
java.lang.Exception
-
clone
public LocaleProperty 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.- Overrides:
clone
in classChoiceProperty
- Returns:
- the cloned property.
-
-