org.jupe.editors.classdiagram.model
Class ModelElement

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

public abstract class ModelElement
extends org.eclipse.emf.common.notify.impl.AdapterImpl
implements org.eclipse.ui.views.properties.IPropertySource

Base class for the model. Each element that appears in the class diagram model should be a subclass of this one.

Author:
carlos, 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 GENERAL_CHANGE_PROP
          PropertyId that indicates a general change to the observers.
 
Constructor Summary
ModelElement()
          Default constructor for a ModelElement.
 
Method Summary
 void addPropertyChangeListener(java.beans.PropertyChangeListener propertyChangeListener)
          Attach a non-null PropertyChangeListener to this object.
abstract  ClassDiagram getClassDiagram()
           
 java.lang.Object getEditableValue()
          (non-Javadoc)
 org.eclipse.ui.views.properties.IPropertyDescriptor[] getPropertyDescriptors()
          Normally subclasses shouldn't override this, but implement initializeDescriptors() to define which property ids it supports.
abstract  java.lang.Object getPropertyValue(java.lang.Object propertyId)
          Children should override this.
abstract  org.eclipse.uml2.uml.Element getUML2Element()
          Sets the corresponding uml2element of this model element.
abstract  boolean isPropertySet(java.lang.Object propertyId)
          Children should override this.
 void notifyChanged(org.eclipse.emf.common.notify.Notification notification)
          The ModelElement does only handle SET notifications.
 void removePropertyChangeListener(java.beans.PropertyChangeListener propertyChangeListener)
          Remove a PropertyChangeListener from this component.
abstract  void resetPropertyValue(java.lang.Object propertyId)
          Children should override this.
abstract  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.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

GENERAL_CHANGE_PROP

public static final java.lang.String GENERAL_CHANGE_PROP
PropertyId that indicates a general change to the observers.

See Also:
Constant Field Values
Constructor Detail

ModelElement

public ModelElement()
Default constructor for a ModelElement.

Method Detail

addPropertyChangeListener

public void addPropertyChangeListener(java.beans.PropertyChangeListener propertyChangeListener)
Attach a non-null PropertyChangeListener to this object.

Parameters:
propertyChangeListener - a non-null PropertyChangeListener instance
Throws:
java.lang.IllegalArgumentException - if the parameter is null

getEditableValue

public java.lang.Object getEditableValue()
(non-Javadoc)

Specified by:
getEditableValue in interface org.eclipse.ui.views.properties.IPropertySource
See Also:
IPropertySource.getEditableValue()

getPropertyDescriptors

public org.eclipse.ui.views.properties.IPropertyDescriptor[] getPropertyDescriptors()
Normally subclasses shouldn't override this, but implement initializeDescriptors() to define which property ids it supports.

Specified by:
getPropertyDescriptors in interface org.eclipse.ui.views.properties.IPropertySource
See Also:
eclipse.ui.views.properties.IPropertySource#getPropertyDescriptors()

getPropertyValue

public abstract java.lang.Object getPropertyValue(java.lang.Object propertyId)
Children should override this.

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

isPropertySet

public abstract boolean isPropertySet(java.lang.Object propertyId)
Children should override this.

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

removePropertyChangeListener

public void removePropertyChangeListener(java.beans.PropertyChangeListener propertyChangeListener)
Remove a PropertyChangeListener from this component.

Parameters:
propertyChangeListener - a PropertyChangeListener instance

resetPropertyValue

public abstract void resetPropertyValue(java.lang.Object propertyId)
Children should override this.

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

setPropertyValue

public abstract void setPropertyValue(java.lang.Object propertyId,
                                      java.lang.Object value)
Children should override this.

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

getUML2Element

public abstract org.eclipse.uml2.uml.Element getUML2Element()
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.


setUML2Element

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

Parameters:
uml2Element - the new uml2 reference for the model element

notifyChanged

public void notifyChanged(org.eclipse.emf.common.notify.Notification notification)
The ModelElement does only handle SET notifications. ADD and REMOVE need special treatment for each Element (see AddAdapter for details) and should be handled in subclasses. All implementations in the subclasses should call this super method. It is also necessary to verify that the handleNotifications variable is set to true to avoid notifications for each call of setPropertyValue().

Specified by:
notifyChanged in interface org.eclipse.emf.common.notify.Adapter
Overrides:
notifyChanged in class org.eclipse.emf.common.notify.impl.AdapterImpl
See Also:
Adapter.notifyChanged(org.eclipse.emf.common.notify.Notification)

getClassDiagram

public abstract ClassDiagram getClassDiagram()