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
,java.lang.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, UNDEFINED, VALUE
-
-
Constructor Summary
Constructors Constructor Description ElementListProperty()
Creates and initializes a newModelElementListProperty
object.ElementListProperty(java.lang.String id, java.lang.Object value)
Creates and initializes a newModelElementListProperty
object from specified parameters.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
accept(PropertyVisitor v)
Accepts the given visitor.ElementListProperty
clone()
Clones the property.void
firePropertyChange(java.lang.String propertyName, java.lang.Object oldValue, java.lang.Object newValue)
DelegatesfirePropertyChange
to thePropertyChangeSupport
, the member of this class, which reports a bound property update to any registered listeners.java.lang.String
getClassType()
Returns a class type of the property.java.util.Collection
getDisplayableTypes()
Returns displayable elements class types.Element[]
getElements()
java.lang.String[]
getElementsIDs()
ID's of stored Elements.java.lang.Object[]
getOriginalValue()
java.util.Collection
getSelectableRestrictedElements()
java.util.Collection
getSelectableTypes()
Returns selectable elements class types.Stereotype
getStereotype()
Deprecated.This is a deprecated methods and you must use collection of restricted elements, not single stereotypeElement[]
getValue()
Returns an array of model elements.java.lang.String
getValueStringRepresentation()
Returns value's string representation.boolean
isContainment()
Check Element list property is Containment.boolean
isOrdered()
Check Element list property is Ordered.void
setContainment(boolean containment)
void
setDisplayableTypes(java.util.Collection displayableTypes)
void
setOrdered(boolean ordered)
void
setProject(Project project)
void
setPropertyData(java.util.Collection displayableTypes, java.util.Collection selectableTypes, boolean ordered, boolean containment)
Sets data for property members.void
setSelectableRestrictedElements(java.util.Collection stereotypes)
Sets a stereotypes and metaclasses for filtering selectable elementsvoid
setSelectableTypes(java.util.Collection selectableTypes)
void
setValue(java.lang.Object value)
Sets a value of the property.-
Methods inherited from class com.nomagic.magicdraw.properties.Property
_getValue, _isFrozen, _setFrozen, _setValue, addPropertyChangeListener, addSource, addSources, areValuesEqual, checkFrozen, checkFrozen, createCellEditor, createTableCellRenderer, equals, generateDefaultDescriptionID, getAdditionalProperties, getAdditionalProperty, getDescription, getDescriptionID, getFirstElementFromSources, getGroup, getID, getIntroductoryVersion, getName, getNonEditableReason, getProjectFromSourcesOrActive, getPureDescription, getResourceProvider, getResourceProviderID, getSourceAsElement, getSources, getSourcesAsStream, getUndefinedString, getUndefinedString, hashCode, isEditable, isUndefinedState, isValueCompatible, removePropertyChangeListener, setAdditionalProperties, setAdditionalProperty, setDescription, setDescriptionID, setEditable, setGroup, setID, setIntroductoryVersion, setNonEditableReason, setResourceProvider, setResourceProviderID, setSources, setUndefinedState, toString
-
-
-
-
Constructor Detail
-
ElementListProperty
public ElementListProperty()
Creates and initializes a newModelElementListProperty
object.
-
ElementListProperty
public ElementListProperty(java.lang.String id, @CheckForNull java.lang.Object value)
Creates and initializes a newModelElementListProperty
object from specified parameters.- Parameters:
id
- - id of the property.value
- - a value of the property.
-
-
Method Detail
-
getClassType
public java.lang.String getClassType()
Returns a class type of the property.- Specified by:
getClassType
in interfacePropertyVisitorAcceptor
- Overrides:
getClassType
in classListProperty
- Returns:
- PropertyID.ELEMENT_LIST_PROPERTY
- See Also:
PropertyID.ELEMENT_LIST_PROPERTY
-
setPropertyData
public void setPropertyData(@CheckForNull java.util.Collection displayableTypes, @CheckForNull java.util.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
@CheckForNull public java.util.Collection getSelectableTypes()
Returns selectable elements class types.- Specified by:
getSelectableTypes
in interfacecom.nomagic.magicdraw.properties.ElementFilterProperty
- Returns:
- selectable types.
-
getDisplayableTypes
@CheckForNull public java.util.Collection 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
public void setValue(@CheckForNull java.lang.Object value)
Description copied from class:ListProperty
Sets a value of the property.- Overrides:
setValue
in classListProperty
- Parameters:
value
- a value.
-
getElements
public Element[] getElements()
-
getOriginalValue
public java.lang.Object[] getOriginalValue()
-
firePropertyChange
public void firePropertyChange(java.lang.String propertyName, java.lang.Object oldValue, java.lang.Object newValue)
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:
PropertyChangeSupport
-
getElementsIDs
@CheckForNull public java.lang.String[] getElementsIDs()
ID's of stored Elements. Real value of project.- Returns:
- id's of elements
-
getValue
public Element[] getValue()
Returns an array of model elements.- Overrides:
getValue
in classListProperty
- Returns:
- an array of ModelElement.
-
clone
public ElementListProperty clone()
Clones the property.- Overrides:
clone
in classListProperty
- Returns:
- the clone of this property.
-
accept
public void accept(PropertyVisitor v) throws java.lang.Exception
Accepts the given visitor.- Specified by:
accept
in interfacePropertyVisitorAcceptor
- Overrides:
accept
in classListProperty
- Parameters:
v
- the PropertyVisitor.- Throws:
java.lang.Exception
-
getValueStringRepresentation
public java.lang.String 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.
-
setProject
public void setProject(@CheckForNull Project project)
- Specified by:
setProject
in interfacecom.nomagic.magicdraw.properties.ElementFilterProperty
-
getSelectableRestrictedElements
public java.util.Collection getSelectableRestrictedElements()
- Specified by:
getSelectableRestrictedElements
in interfacecom.nomagic.magicdraw.properties.ElementFilterProperty
- Returns:
- stereotypes and metaclasses for filtering selectable elements
-
setSelectableRestrictedElements
public void setSelectableRestrictedElements(java.util.Collection stereotypes)
Sets a stereotypes and metaclasses for filtering selectable elements- Specified by:
setSelectableRestrictedElements
in interfacecom.nomagic.magicdraw.properties.ElementFilterProperty
- Parameters:
stereotypes
- stereotypes
-
getStereotype
@CheckForNull @Deprecated public Stereotype 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:
getSelectableRestrictedElements()
-
setSelectableTypes
public void setSelectableTypes(@CheckForNull java.util.Collection selectableTypes)
- Specified by:
setSelectableTypes
in interfacecom.nomagic.magicdraw.properties.ElementFilterProperty
-
setDisplayableTypes
public void setDisplayableTypes(@CheckForNull java.util.Collection displayableTypes)
- 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
-
-