Package com.nomagic.magicdraw.properties
Class ElementProperty
java.lang.Object
com.nomagic.magicdraw.properties.Property
com.nomagic.magicdraw.properties.ElementProperty
- All Implemented Interfaces:
com.nomagic.magicdraw.properties.ElementFilterProperty,PropertyVisitorAcceptor,Cloneable
@OpenApiAll
public class ElementProperty
extends Property
implements com.nomagic.magicdraw.properties.ElementFilterProperty
Property for selecting Element of given type. Editor of this property allows to choose some
specific Element from all existing elements in the current project.
-
Field Summary
Fields inherited from class com.nomagic.magicdraw.properties.Property
DEFAULT_PROPERTY_RESOURCE_PROVIDER, EDITABLE, NULL, NULL_ID_PROPERTY_RESOURCE_PROVIDER, TO, UNDEFINED, VALUE, VALUE_ANNOTATIONS -
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor.ElementProperty(String id, Object element) The property constructor. -
Method Summary
Modifier and TypeMethodDescriptionvoidAccepts the given visitor.clone()Clones the property.Returns property class type.Returns displayable elements class types.Returns model elementReturns stored element ID (real value of Property).Does not convert persistent value to element, but returns at it is (id of element)Returns a stereotypes and metaclasses for filtering selectable elementsReturns selectable elements class types.static StringgetStringRepresentation(Object element) getValue()Returns properties value.Returns value's string representation.booleanTests Is containment.booleanCheck Element list property is Ordered.booleanChecks if selected element intends to be the parent for other elementbooleanTest is Type Element.booleanReturns 'use unspecified' flag for this property.voidsetContainment(boolean containment) Set containment.voidsetDisplayableTypes(Collection displayableTypes) Set Displayable types.voidsetOrdered(boolean ordered) voidsetParentApplicant(boolean parentApplicant) Set parent applicant.voidsetProject(Project project) Set project.voidsetPropertyData(Collection displayableTypes, Collection selectableTypes, boolean ordered, boolean containment) Sets data for property members.voidsetSelectableRestrictedElements(Collection elements) Sets a stereotypes and metaclasses for filtering selectable elementsvoidsetSelectableTypes(Collection selectableTypes) Set Select table types.voidsetTypeElement(boolean typeElement) Set type Element.voidsetUseUnspecified(boolean useUnspecified) Set Use Unspecified.voidSets new property value.Methods inherited from class com.nomagic.magicdraw.properties.Property
_getValue, _isFrozen, _setFrozen, _setValue, addAnnotation, addPropertyChangeListener, addSource, addSources, areEqualByValue, areValuesEqual, checkFrozen, checkFrozen, equals, firePropertyChange, generateDefaultDescriptionID, getAdditionalProperties, getAdditionalProperty, getAnnotation, getAnnotations, getDescription, getDescriptionID, getFirstElementFromSources, getGroup, getID, getIntroductoryVersion, getName, getNonEditableReason, getProjectFromSourcesOrActive, getPureDescription, getResourceProvider, getResourceProviderID, getSortableValueStringRepresentation, getSourceAsElement, getSources, getSourcesAsStream, getUndefinedString, getUndefinedString, hashCode, isEditable, isUndefinedState, isValueCompatible, removeAnnotation, removePropertyChangeListener, setAdditionalProperties, setAdditionalProperty, setAnnotations, setDescription, setDescriptionID, setEditable, setGroup, setID, setIntroductoryVersion, setNonEditableReason, setResourceProvider, setResourceProviderID, setSources, setUndefinedState, toString
-
Constructor Details
-
ElementProperty
public ElementProperty()Default constructor. Value of the property will be null. ID will be empty string. Property is editable. -
ElementProperty
The property constructor.- Parameters:
id- the ID of property.element- some type - model Element or String.
-
-
Method Details
-
clone
Clones the property. -
getClassType
Returns property class type.- Specified by:
getClassTypein interfacePropertyVisitorAcceptor- Overrides:
getClassTypein classProperty- Returns:
- PropertyID.ELEMENT_PROPERTY
- See Also:
-
setSelectableTypes
Set Select table types.- Specified by:
setSelectableTypesin interfacecom.nomagic.magicdraw.properties.ElementFilterProperty- Parameters:
selectableTypes- List of select table types.
-
setDisplayableTypes
Set Displayable types.- Specified by:
setDisplayableTypesin interfacecom.nomagic.magicdraw.properties.ElementFilterProperty- Parameters:
displayableTypes- List of Displayable type.
-
setUseUnspecified
public void setUseUnspecified(boolean useUnspecified) Set Use Unspecified.- Parameters:
useUnspecified- Use Unspecified flag.
-
setParentApplicant
public void setParentApplicant(boolean parentApplicant) Set parent applicant.- Parameters:
parentApplicant- Parent applicant.
-
setContainment
public void setContainment(boolean containment) Set containment.- Specified by:
setContainmentin interfacecom.nomagic.magicdraw.properties.ElementFilterProperty- Parameters:
containment- Containment value.
-
setTypeElement
public void setTypeElement(boolean typeElement) Set type Element.- Parameters:
typeElement- The given type element.
-
getSelectableTypes
Returns selectable elements class types.- Specified by:
getSelectableTypesin interfacecom.nomagic.magicdraw.properties.ElementFilterProperty- Returns:
- selectable types.
-
getDisplayableTypes
Returns displayable elements class types.- Specified by:
getDisplayableTypesin interfacecom.nomagic.magicdraw.properties.ElementFilterProperty- Returns:
- displayable types.
-
isUseUnspecified
public boolean isUseUnspecified()Returns 'use unspecified' flag for this property.- Returns:
- 'use unspecified' flag for this property.
-
isParentApplicant
public boolean isParentApplicant()Checks if selected element intends to be the parent for other element- Returns:
- true - if selected element intends to be the parent of the other element; otherwise - false.
-
setValue
Sets new property value. Will fire aPropertyChangeEventwith propertyName - property ID, newValue and oldValue. -
getOriginalValue
Does not convert persistent value to element, but returns at it is (id of element) -
getElementID
Returns stored element ID (real value of Property).- Returns:
- value of the property.
-
getValue
Returns properties value. -
getElement
Returns model element- Returns:
- Model Element.
-
accept
Accepts the given visitor.- Specified by:
acceptin interfacePropertyVisitorAcceptor- Overrides:
acceptin classProperty- Parameters:
v- the PropertyVisitor.- Throws:
Exception
-
getValueStringRepresentation
Description copied from class:PropertyReturns value's string representation.- Overrides:
getValueStringRepresentationin classProperty- Returns:
- string "null" if property does not have value;
value. toString()if property has value.
-
getStringRepresentation
-
setProject
Set project.- Specified by:
setProjectin interfacecom.nomagic.magicdraw.properties.ElementFilterProperty- Parameters:
project- Given project.
-
isContainment
public boolean isContainment()Tests Is containment.- Specified by:
isContainmentin interfacecom.nomagic.magicdraw.properties.ElementFilterProperty- Returns:
- boolean
-
isTypeElement
public boolean isTypeElement()Test is Type Element. -
getSelectableRestrictedElements
Returns a stereotypes and metaclasses for filtering selectable elements- Specified by:
getSelectableRestrictedElementsin interfacecom.nomagic.magicdraw.properties.ElementFilterProperty
-
setSelectableRestrictedElements
Sets a stereotypes and metaclasses for filtering selectable elements- Specified by:
setSelectableRestrictedElementsin interfacecom.nomagic.magicdraw.properties.ElementFilterProperty- Parameters:
elements- elements
-
setPropertyData
public void setPropertyData(@CheckForNull Collection displayableTypes, @CheckForNull Collection selectableTypes, boolean ordered, boolean containment) Sets data for property members. This method takes collections of class types. You must add into these collections class types from constants class ClassTypes.- Specified by:
setPropertyDatain interfacecom.nomagic.magicdraw.properties.ElementFilterProperty
-
isOrdered
public boolean isOrdered()Description copied from interface:com.nomagic.magicdraw.properties.ElementFilterPropertyCheck Element list property is Ordered.- Specified by:
isOrderedin interfacecom.nomagic.magicdraw.properties.ElementFilterProperty- Returns:
- boolean.
- See Also:
-
ElementFilterProperty.isOrdered()
-
setOrdered
public void setOrdered(boolean ordered) - Specified by:
setOrderedin interfacecom.nomagic.magicdraw.properties.ElementFilterProperty- See Also:
-
ElementFilterProperty.setOrdered(boolean)
-