Package com.nomagic.magicdraw.properties
Class ElementListProperty
java.lang.Object
com.nomagic.magicdraw.properties.Property
com.nomagic.magicdraw.properties.ListProperty
com.nomagic.magicdraw.properties.ElementListProperty
- All Implemented Interfaces:
com.nomagic.magicdraw.properties.ElementFilterProperty
,PropertyVisitorAcceptor
,Cloneable
@OpenApiAll
public class ElementListProperty
extends ListProperty
implements com.nomagic.magicdraw.properties.ElementFilterProperty
Property for selecting a list of Elements of given type. Editor of this property allows to choose some
specific Elements 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
ConstructorDescriptionCreates and initializes a newModelElementListProperty
object.ElementListProperty
(String id, Object value) Creates and initializes a newModelElementListProperty
object from specified parameters. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Accepts the given visitor.clone()
Clones the property.void
firePropertyChange
(String propertyName, Object oldValue, Object newValue) DelegatesfirePropertyChange
to thePropertyChangeSupport
, the member of this class, which reports a bound property update to any registered listeners.Returns a class type of the property.Returns displayable elements class types.Element[]
String[]
ID's of stored Elements.Object[]
Returns a stereotypes and metaclasses for filtering selectable elementsReturns selectable elements class types.Deprecated.This is a deprecated methods and you must use collection of restricted elements, not single stereotypeElement[]
getValue()
Returns an array of model elements.Returns value's string representation.boolean
Check Element list property is Containment.boolean
boolean
Check Element list property is Ordered.void
setContainment
(boolean containment) void
setDisplayableTypes
(Collection displayableTypes) void
setLoadedUserData
(boolean loadedUserData) void
setOrdered
(boolean ordered) void
setProject
(Project project) Set project (scope for property)void
setPropertyData
(Collection displayableTypes, Collection selectableTypes, boolean ordered, boolean containment) Sets data for property members.void
setSelectableRestrictedElements
(Collection stereotypes) Sets a stereotypes and metaclasses for filtering selectable elementsvoid
setSelectableTypes
(Collection selectableTypes) void
Sets a value of the property.Methods inherited from class com.nomagic.magicdraw.properties.Property
_getValue, _isFrozen, _setFrozen, _setValue, addAnnotation, addPropertyChangeListener, addSource, addSources, areEqualByValue, areValuesEqual, checkFrozen, checkFrozen, createCellEditor, createTableCellRenderer, equals, generateDefaultDescriptionID, getAdditionalProperties, getAdditionalProperty, getAnnotation, getAnnotations, getDescription, getDescriptionID, getFirstElementFromSources, getGroup, getID, getIntroductoryVersion, getName, getNonEditableReason, getProjectFromSourcesOrActive, getPureDescription, getResourceProvider, getResourceProviderID, 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
-
ElementListProperty
public ElementListProperty()Creates and initializes a newModelElementListProperty
object. -
ElementListProperty
Creates and initializes a newModelElementListProperty
object from specified parameters.- Parameters:
id
- - id of the property.value
- - a value of the property.
-
-
Method Details
-
getClassType
Returns a class type of the property.- Specified by:
getClassType
in interfacePropertyVisitorAcceptor
- Overrides:
getClassType
in classListProperty
- Returns:
- PropertyID.ELEMENT_LIST_PROPERTY
- See Also:
-
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:
setPropertyData
in interfacecom.nomagic.magicdraw.properties.ElementFilterProperty
-
getSelectableTypes
Returns selectable elements class types.- Specified by:
getSelectableTypes
in interfacecom.nomagic.magicdraw.properties.ElementFilterProperty
- Returns:
- selectable types.
-
getDisplayableTypes
Returns displayable elements class types.- Specified by:
getDisplayableTypes
in interfacecom.nomagic.magicdraw.properties.ElementFilterProperty
- Returns:
- displayable types.
-
isContainment
public boolean isContainment()Check Element list property is Containment.- Specified by:
isContainment
in interfacecom.nomagic.magicdraw.properties.ElementFilterProperty
- Returns:
- boolean.
-
isOrdered
public boolean isOrdered()Check Element list property is Ordered.- Specified by:
isOrdered
in interfacecom.nomagic.magicdraw.properties.ElementFilterProperty
- Returns:
- boolean.
-
setValue
Description copied from class:ListProperty
Sets a value of the property.- Overrides:
setValue
in classListProperty
- Parameters:
value
- a value.
-
getElements
-
getOriginalValue
-
firePropertyChange
Description copied from class:Property
DelegatesfirePropertyChange
to thePropertyChangeSupport
, the member of this class, which reports a bound property update to any registered listeners. No event is fired if old and new are equal and non-null.- Overrides:
firePropertyChange
in classProperty
- Parameters:
propertyName
- the programmatic name of the property that was changed.oldValue
- the old value of the propertynewValue
- the new value of the property- See Also:
-
getElementsIDs
ID's of stored Elements. Real value of project.- Returns:
- id's of elements
-
getValue
Returns an array of model elements.- Overrides:
getValue
in classListProperty
- Returns:
- an array of ModelElement.
-
clone
Clones the property.- Overrides:
clone
in classListProperty
- Returns:
- the clone of this property.
-
accept
Accepts the given visitor.- Specified by:
accept
in interfacePropertyVisitorAcceptor
- Overrides:
accept
in classListProperty
- Parameters:
v
- the PropertyVisitor.- Throws:
Exception
-
getValueStringRepresentation
Description copied from class:Property
Returns value's string representation.- Overrides:
getValueStringRepresentation
in classListProperty
- Returns:
- string "null" if property does not have value;
value. toString()
if property has value.
-
getSortableValueStringRepresentation
- Overrides:
getSortableValueStringRepresentation
in classProperty
-
setProject
Description copied from interface:com.nomagic.magicdraw.properties.ElementFilterProperty
Set project (scope for property)- Specified by:
setProject
in interfacecom.nomagic.magicdraw.properties.ElementFilterProperty
- Parameters:
project
- project.
-
getSelectableRestrictedElements
Description copied from interface:com.nomagic.magicdraw.properties.ElementFilterProperty
Returns a stereotypes and metaclasses for filtering selectable elements- Specified by:
getSelectableRestrictedElements
in interfacecom.nomagic.magicdraw.properties.ElementFilterProperty
- Returns:
- stereotypes and metaclasses for filtering selectable elements
-
setSelectableRestrictedElements
Sets a stereotypes and metaclasses for filtering selectable elements- Specified by:
setSelectableRestrictedElements
in interfacecom.nomagic.magicdraw.properties.ElementFilterProperty
- Parameters:
stereotypes
- stereotypes
-
getStereotype
Deprecated.This is a deprecated methods and you must use collection of restricted elements, not single stereotypeReturns a first stereotype from selectable restricted elements.- Returns:
- first stereotype
- See Also:
-
setSelectableTypes
- Specified by:
setSelectableTypes
in interfacecom.nomagic.magicdraw.properties.ElementFilterProperty
-
setDisplayableTypes
- Specified by:
setDisplayableTypes
in interfacecom.nomagic.magicdraw.properties.ElementFilterProperty
-
setContainment
public void setContainment(boolean containment) - Specified by:
setContainment
in interfacecom.nomagic.magicdraw.properties.ElementFilterProperty
-
setOrdered
public void setOrdered(boolean ordered) - Specified by:
setOrdered
in interfacecom.nomagic.magicdraw.properties.ElementFilterProperty
-
setLoadedUserData
public void setLoadedUserData(boolean loadedUserData) -
isLoadedUserData
public boolean isLoadedUserData()
-