Class 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
  • Constructor Details

    • ElementListProperty

      public ElementListProperty()
      Creates and initializes a new ModelElementListProperty object.
    • ElementListProperty

      public ElementListProperty(String id, @CheckForNull Object value)
      Creates and initializes a new ModelElementListProperty object from specified parameters.
      Parameters:
      id - - id of the property.
      value - - a value of the property.
  • Method Details

    • getClassType

      public String getClassType()
      Returns a class type of the property.
      Specified by:
      getClassType in interface PropertyVisitorAcceptor
      Overrides:
      getClassType in class ListProperty
      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 interface com.nomagic.magicdraw.properties.ElementFilterProperty
    • getSelectableTypes

      @CheckForNull public Collection getSelectableTypes()
      Returns selectable elements class types.
      Specified by:
      getSelectableTypes in interface com.nomagic.magicdraw.properties.ElementFilterProperty
      Returns:
      selectable types.
    • getDisplayableTypes

      @CheckForNull public Collection getDisplayableTypes()
      Returns displayable elements class types.
      Specified by:
      getDisplayableTypes in interface com.nomagic.magicdraw.properties.ElementFilterProperty
      Returns:
      displayable types.
    • isContainment

      public boolean isContainment()
      Check Element list property is Containment.
      Specified by:
      isContainment in interface com.nomagic.magicdraw.properties.ElementFilterProperty
      Returns:
      boolean.
    • isOrdered

      public boolean isOrdered()
      Check Element list property is Ordered.
      Specified by:
      isOrdered in interface com.nomagic.magicdraw.properties.ElementFilterProperty
      Returns:
      boolean.
    • setValue

      public void setValue(@CheckForNull Object value)
      Description copied from class: ListProperty
      Sets a value of the property.
      Overrides:
      setValue in class ListProperty
      Parameters:
      value - a value.
    • getElements

      public Element[] getElements()
    • getOriginalValue

      public Object[] getOriginalValue()
    • firePropertyChange

      public void firePropertyChange(String propertyName, Object oldValue, Object newValue)
      Description copied from class: Property
      Delegates firePropertyChange to the PropertyChangeSupport, 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 class Property
      Parameters:
      propertyName - the programmatic name of the property that was changed.
      oldValue - the old value of the property
      newValue - the new value of the property
      See Also:
    • getElementsIDs

      @CheckForNull public 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 class ListProperty
      Returns:
      an array of ModelElement.
    • clone

      public ElementListProperty clone()
      Clones the property.
      Overrides:
      clone in class ListProperty
      Returns:
      the clone of this property.
    • accept

      public void accept(PropertyVisitor v) throws Exception
      Accepts the given visitor.
      Specified by:
      accept in interface PropertyVisitorAcceptor
      Overrides:
      accept in class ListProperty
      Parameters:
      v - the PropertyVisitor.
      Throws:
      Exception
    • getValueStringRepresentation

      public String getValueStringRepresentation()
      Description copied from class: Property
      Returns value's string representation.
      Overrides:
      getValueStringRepresentation in class ListProperty
      Returns:
      string "null" if property does not have value; value. toString() if property has value.
    • getSortableValueStringRepresentation

      public String getSortableValueStringRepresentation()
      Overrides:
      getSortableValueStringRepresentation in class Property
    • setProject

      public void setProject(@CheckForNull Project project)
      Description copied from interface: com.nomagic.magicdraw.properties.ElementFilterProperty
      Set project (scope for property)
      Specified by:
      setProject in interface com.nomagic.magicdraw.properties.ElementFilterProperty
      Parameters:
      project - project.
    • getSelectableRestrictedElements

      public Collection getSelectableRestrictedElements()
      Description copied from interface: com.nomagic.magicdraw.properties.ElementFilterProperty
      Returns a stereotypes and metaclasses for filtering selectable elements
      Specified by:
      getSelectableRestrictedElements in interface com.nomagic.magicdraw.properties.ElementFilterProperty
      Returns:
      stereotypes and metaclasses for filtering selectable elements
    • setSelectableRestrictedElements

      public void setSelectableRestrictedElements(Collection stereotypes)
      Sets a stereotypes and metaclasses for filtering selectable elements
      Specified by:
      setSelectableRestrictedElements in interface com.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 stereotype
      Returns a first stereotype from selectable restricted elements.
      Returns:
      first stereotype
      See Also:
    • setSelectableTypes

      public void setSelectableTypes(@CheckForNull Collection selectableTypes)
      Specified by:
      setSelectableTypes in interface com.nomagic.magicdraw.properties.ElementFilterProperty
    • setDisplayableTypes

      public void setDisplayableTypes(@CheckForNull Collection displayableTypes)
      Specified by:
      setDisplayableTypes in interface com.nomagic.magicdraw.properties.ElementFilterProperty
    • setContainment

      public void setContainment(boolean containment)
      Specified by:
      setContainment in interface com.nomagic.magicdraw.properties.ElementFilterProperty
    • setOrdered

      public void setOrdered(boolean ordered)
      Specified by:
      setOrdered in interface com.nomagic.magicdraw.properties.ElementFilterProperty
    • setLoadedUserData

      public void setLoadedUserData(boolean loadedUserData)
    • isLoadedUserData

      public boolean isLoadedUserData()