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

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.MethodElement
All Implemented Interfaces:
org.eclipse.emf.common.notify.Adapter, org.eclipse.emf.common.notify.Adapter.Internal, org.eclipse.ui.views.properties.IPropertySource

public class MethodElement
extends NodeModelElement

Model element that represents a method of a class or interface.

Author:
Michael Pradel, 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 ABS_RETURNTYPE_NAME_PROP
          PropertyId for the return type of a method.
static java.lang.String ABSTRACT_PROP
          PropertyId for the abstract flag of a method.
static java.lang.String NAME_PROP
           
static java.lang.String PARAMETERS_PROP
          PropertyId for the parameters of a method. * Parameters have to be passed as comma-separated list of "name : type".
static java.lang.String QUERY_PROP
          PropertyId for the query flag of a method.
static java.lang.String STATIC_PROP
          PropertyId for the static flag of a method.
static java.lang.String VISIBILITY_PROP
          PropertyId for visibility of a method : public, protected, private.
 
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
MethodElement()
          Default constructor.
MethodElement(org.eclipse.uml2.uml.Operation uml2element)
          Constructor which creates the MethodElement with the corresponding UML2 element.
 
Method Summary
 java.lang.Object getPropertyValue(java.lang.Object propertyId)
          Children should override this.
 org.eclipse.uml2.uml.Element getUML2Element()
          Sets the corresponding uml2element of this model element.
 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.
 void setUML2Element(org.eclipse.uml2.uml.Element uml2Element)
          Children should override this method, call super.setUML2Element(uml2Element) and then update their UML2Element accordingly.
 
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, removePropertyChangeListener
 
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

NAME_PROP

public static final java.lang.String NAME_PROP
See Also:
Constant Field Values

PARAMETERS_PROP

public static final java.lang.String PARAMETERS_PROP
PropertyId for the parameters of a method. * Parameters have to be passed as comma-separated list of "name : type". E.g. "n : int, name : String". Should be displayed.

Value: String validated by editors.classdiagram.model.validators.ParameterListValidator

See Also:
Constant Field Values

VISIBILITY_PROP

public static final java.lang.String VISIBILITY_PROP
PropertyId for visibility of a method : public, protected, private. Should be displayed.

Value: VisibilityKind

See Also:
Constant Field Values

ABS_RETURNTYPE_NAME_PROP

public static final java.lang.String ABS_RETURNTYPE_NAME_PROP
PropertyId for the return type of a method. Should be displayed. If possible, it's the absolute name of the type (e.g. "java.lang.String").

Value: String

See Also:
Constant Field Values

STATIC_PROP

public static final java.lang.String STATIC_PROP
PropertyId for the static flag of a method. Should be displayed.

Value: Boolean

See Also:
Constant Field Values

ABSTRACT_PROP

public static final java.lang.String ABSTRACT_PROP
PropertyId for the abstract flag of a method. Should be displayed.

Value: Boolean

See Also:
Constant Field Values

QUERY_PROP

public static final java.lang.String QUERY_PROP
PropertyId for the query flag of a method. Should be displayed.

Value: Boolean

See Also:
Constant Field Values
Constructor Detail

MethodElement

public MethodElement()
Default constructor.


MethodElement

public MethodElement(org.eclipse.uml2.uml.Operation uml2element)
Constructor which creates the MethodElement with the corresponding UML2 element.

Parameters:
uml2element - the corresponding UML2 element.
Method Detail

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)

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)

setUML2Element

public void setUML2Element(org.eclipse.uml2.uml.Element uml2Element)
Description copied from class: ModelElement
Children should override this method, call super.setUML2Element(uml2Element) and then update their UML2Element accordingly.

Overrides:
setUML2Element in class ModelElement
Parameters:
uml2Element - the new uml2 reference for the model element

getUML2Element

public org.eclipse.uml2.uml.Element getUML2Element()
Description copied from class: ModelElement
Sets the corresponding uml2element of this model element. This method should only be called by IContainerElements in their create.. methods. This method has to be implemented by each subclass which have themselves to set as an adapter of the element.

Specified by:
getUML2Element in class ModelElement