org.jupe.editors.classdiagram.model.nodes
Class AbstractClassInterfaceElement

java.lang.Object
  extended by org.eclipse.emf.common.notify.impl.AdapterImpl
      extended by org.jupe.editors.classdiagram.model.ModelElement
          extended by org.jupe.editors.classdiagram.model.nodes.NodeModelElement
              extended by org.jupe.editors.classdiagram.model.nodes.AbstractClassInterfaceElement
All Implemented Interfaces:
org.eclipse.emf.common.notify.Adapter, org.eclipse.emf.common.notify.Adapter.Internal, org.eclipse.ui.views.properties.IPropertySource, IContainerElement
Direct Known Subclasses:
ClassElement, InterfaceElement

public abstract class AbstractClassInterfaceElement
extends NodeModelElement
implements IContainerElement

Helper class that contains equal code for ClassElement and InterfaceElement.

Author:
Michael Pradel, Steffen Klüpfel, Emanuel Thomas

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.eclipse.emf.common.notify.Adapter
org.eclipse.emf.common.notify.Adapter.Internal
 
Field Summary
static java.lang.String ATTRIBUTES_PROP
          PropertyID for attributes of a class interface.
static java.lang.String METHODS_PROP
          PropertyID for methods of a class or interface.
 
Fields inherited from class org.jupe.editors.classdiagram.model.nodes.NodeModelElement
CHILD_ADDED_PROP, CHILD_REMOVED_PROP, CONNECTIONS_PROP, LOCATION_PROP, SIZE_PROP, SOURCE_CONNECTIONS_PROP, TARGET_CONNECTIONS_PROP
 
Fields inherited from class org.jupe.editors.classdiagram.model.ModelElement
GENERAL_CHANGE_PROP
 
Constructor Summary
AbstractClassInterfaceElement()
          Default constructor of a new ClassInterfaceElement.
 
Method Summary
 boolean assimilate(NodeModelElement modelElement)
          Creates a UML2 element to a given NodeModelElement.
 AttributeElement findAttribute(java.lang.String name)
          Searches for an antribute with the given name.
 MethodElement findMethod(java.lang.String name)
          Searches for a method with the given name.
 java.util.Set<AttributeElement> getAttributes()
          Get all attributes of a class or interface.
 java.util.Set<MethodElement> getMethods()
          Get all methods of a class or interface.
 java.lang.Object getPropertyValue(java.lang.Object propertyId)
          Children should override this.
 boolean isPropertySet(java.lang.Object propertyId)
          Children should override this.
 void resetPropertyValue(java.lang.Object propertyId)
          Children should override this.
 void setPropertyValue(java.lang.Object propertyId, java.lang.Object value)
          Children should override this.
 
Methods inherited from class org.jupe.editors.classdiagram.model.nodes.NodeModelElement
addChild, addConnection, addToHash, getAllChildren, getChildren, getClassDiagram, getLocation, getParent, getSize, getSourceConnections, getTargetConnections, notifyChanged, removeChild, removeConnection, removeFromHash, removeFromModel, setLocation, setSize, setSourceConnections, setTargetConnections
 
Methods inherited from class org.jupe.editors.classdiagram.model.ModelElement
addPropertyChangeListener, getEditableValue, getPropertyDescriptors, getUML2Element, removePropertyChangeListener, setUML2Element
 
Methods inherited from class org.eclipse.emf.common.notify.impl.AdapterImpl
getTarget, isAdapterForType, setTarget, unsetTarget
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

METHODS_PROP

public static final java.lang.String METHODS_PROP
PropertyID for methods of a class or interface. Should not be displayed.

Value: MethodElement

See Also:
Constant Field Values

ATTRIBUTES_PROP

public static final java.lang.String ATTRIBUTES_PROP
PropertyID for attributes of a class interface. Should not be displayed.

Value: AttributeElement

See Also:
Constant Field Values
Constructor Detail

AbstractClassInterfaceElement

public AbstractClassInterfaceElement()
Default constructor of a new ClassInterfaceElement.

Method Detail

getAttributes

public java.util.Set<AttributeElement> getAttributes()
Get all attributes of a class or interface.

Returns:
attributes of the class or interface

getMethods

public java.util.Set<MethodElement> getMethods()
Get all methods of a class or interface.

Returns:
methods of the class or interface

getPropertyValue

public java.lang.Object getPropertyValue(java.lang.Object propertyId)
Description copied from class: ModelElement
Children should override this.

Specified by:
getPropertyValue in interface org.eclipse.ui.views.properties.IPropertySource
Overrides:
getPropertyValue in class NodeModelElement
See Also:
eclipse.ui.views.properties.IPropertySource#getPropertyValue(java.lang.Object)

isPropertySet

public boolean isPropertySet(java.lang.Object propertyId)
Description copied from class: ModelElement
Children should override this.

Specified by:
isPropertySet in interface org.eclipse.ui.views.properties.IPropertySource
Overrides:
isPropertySet in class NodeModelElement
See Also:
eclipse.ui.views.properties.IPropertySource#isPropertySet(java.lang.Object)

resetPropertyValue

public void resetPropertyValue(java.lang.Object propertyId)
Description copied from class: ModelElement
Children should override this.

Specified by:
resetPropertyValue in interface org.eclipse.ui.views.properties.IPropertySource
Overrides:
resetPropertyValue in class NodeModelElement
See Also:
IPropertySource.resetPropertyValue(java.lang.Object)

setPropertyValue

public void setPropertyValue(java.lang.Object propertyId,
                             java.lang.Object value)
Description copied from class: ModelElement
Children should override this.

Specified by:
setPropertyValue in interface org.eclipse.ui.views.properties.IPropertySource
Overrides:
setPropertyValue in class NodeModelElement
See Also:
eclipse.ui.views.properties.IPropertySource#setPropertyValue(java.lang.Object, java.lang.Object)

assimilate

public boolean assimilate(NodeModelElement modelElement)
Creates a UML2 element to a given NodeModelElement.

Specified by:
assimilate in interface IContainerElement
Parameters:
modelElement - The model element to assimilate to this container.
Returns:
True, if successful, false otherwise.
See Also:
IContainerElement.assimilate(NodeModelElement)

findAttribute

public AttributeElement findAttribute(java.lang.String name)
Searches for an antribute with the given name.

Parameters:
name - the attribute's name
Returns:
a refernce to the AttributeElement or null if the attribute has not been found

findMethod

public MethodElement findMethod(java.lang.String name)
Searches for a method with the given name.

Parameters:
name - the method's name
Returns:
a refernce to the MethodElement or null if the method has not been found