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 newModelElementListPropertyobject.ElementListProperty(java.lang.String id, java.lang.Object value)Creates and initializes a newModelElementListPropertyobject from specified parameters.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidaccept(PropertyVisitor v)Accepts the given visitor.ElementListPropertyclone()Clones the property.voidfirePropertyChange(java.lang.String propertyName, java.lang.Object oldValue, java.lang.Object newValue)DelegatesfirePropertyChangeto thePropertyChangeSupport, the member of this class, which reports a bound property update to any registered listeners.java.lang.StringgetClassType()Returns a class type of the property.java.util.CollectiongetDisplayableTypes()Returns displayable elements class types.Element[]getElements()java.lang.String[]getElementsIDs()ID's of stored Elements.java.lang.Object[]getOriginalValue()java.util.CollectiongetSelectableRestrictedElements()java.util.CollectiongetSelectableTypes()Returns selectable elements class types.StereotypegetStereotype()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.StringgetValueStringRepresentation()Returns value's string representation.booleanisContainment()Check Element list property is Containment.booleanisOrdered()Check Element list property is Ordered.voidsetContainment(boolean containment)voidsetDisplayableTypes(java.util.Collection displayableTypes)voidsetOrdered(boolean ordered)voidsetProject(Project project)voidsetPropertyData(java.util.Collection displayableTypes, java.util.Collection selectableTypes, boolean ordered, boolean containment)Sets data for property members.voidsetSelectableRestrictedElements(java.util.Collection stereotypes)Sets a stereotypes and metaclasses for filtering selectable elementsvoidsetSelectableTypes(java.util.Collection selectableTypes)voidsetValue(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 newModelElementListPropertyobject.
-
ElementListProperty
public ElementListProperty(java.lang.String id, @CheckForNull java.lang.Object value)Creates and initializes a newModelElementListPropertyobject 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:
getClassTypein interfacePropertyVisitorAcceptor- Overrides:
getClassTypein 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:
setPropertyDatain interfacecom.nomagic.magicdraw.properties.ElementFilterProperty
-
getSelectableTypes
@CheckForNull public java.util.Collection getSelectableTypes()
Returns selectable elements class types.- Specified by:
getSelectableTypesin interfacecom.nomagic.magicdraw.properties.ElementFilterProperty- Returns:
- selectable types.
-
getDisplayableTypes
@CheckForNull public java.util.Collection getDisplayableTypes()
Returns displayable elements class types.- Specified by:
getDisplayableTypesin interfacecom.nomagic.magicdraw.properties.ElementFilterProperty- Returns:
- displayable types.
-
isContainment
public boolean isContainment()
Check Element list property is Containment.- Specified by:
isContainmentin interfacecom.nomagic.magicdraw.properties.ElementFilterProperty- Returns:
- boolean.
-
isOrdered
public boolean isOrdered()
Check Element list property is Ordered.- Specified by:
isOrderedin interfacecom.nomagic.magicdraw.properties.ElementFilterProperty- Returns:
- boolean.
-
setValue
public void setValue(@CheckForNull java.lang.Object value)Description copied from class:ListPropertySets a value of the property.- Overrides:
setValuein 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:PropertyDelegatesfirePropertyChangeto 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:
firePropertyChangein 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:
getValuein classListProperty- Returns:
- an array of ModelElement.
-
clone
public ElementListProperty clone()
Clones the property.- Overrides:
clonein classListProperty- Returns:
- the clone of this property.
-
accept
public void accept(PropertyVisitor v) throws java.lang.Exception
Accepts the given visitor.- Specified by:
acceptin interfacePropertyVisitorAcceptor- Overrides:
acceptin classListProperty- Parameters:
v- the PropertyVisitor.- Throws:
java.lang.Exception
-
getValueStringRepresentation
public java.lang.String getValueStringRepresentation()
Description copied from class:PropertyReturns value's string representation.- Overrides:
getValueStringRepresentationin 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:
setProjectin interfacecom.nomagic.magicdraw.properties.ElementFilterProperty
-
getSelectableRestrictedElements
public java.util.Collection getSelectableRestrictedElements()
- Specified by:
getSelectableRestrictedElementsin 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:
setSelectableRestrictedElementsin 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:
setSelectableTypesin interfacecom.nomagic.magicdraw.properties.ElementFilterProperty
-
setDisplayableTypes
public void setDisplayableTypes(@CheckForNull java.util.Collection displayableTypes)- Specified by:
setDisplayableTypesin interfacecom.nomagic.magicdraw.properties.ElementFilterProperty
-
setContainment
public void setContainment(boolean containment)
- Specified by:
setContainmentin interfacecom.nomagic.magicdraw.properties.ElementFilterProperty
-
setOrdered
public void setOrdered(boolean ordered)
- Specified by:
setOrderedin interfacecom.nomagic.magicdraw.properties.ElementFilterProperty
-
-