roneditor.edit.parts
Class RONTreeEditPart

java.lang.Object
  extended by org.eclipse.gef.editparts.AbstractEditPart
      extended by org.eclipse.gef.editparts.AbstractTreeEditPart
          extended by roneditor.edit.parts.RONTreeEditPart
All Implemented Interfaces:
org.eclipse.core.runtime.IAdaptable, org.eclipse.emf.common.notify.Adapter, org.eclipse.gef.EditPart, org.eclipse.gef.RequestConstants, org.eclipse.gef.TreeEditPart

public class RONTreeEditPart
extends org.eclipse.gef.editparts.AbstractTreeEditPart
implements org.eclipse.emf.common.notify.Adapter

TreeEditPart for the top-level container item in the tree editor. This provides an visual item in the tree editor and allows the execution of actions to create HLPlaces and HLTransitions via context menu on this item.

Author:
Tony Modica

Nested Class Summary
 
Nested classes/interfaces inherited from class org.eclipse.gef.editparts.AbstractEditPart
org.eclipse.gef.editparts.AbstractEditPart.EditPolicyIterator
 
Nested classes/interfaces inherited from interface org.eclipse.emf.common.notify.Adapter
org.eclipse.emf.common.notify.Adapter.Internal
 
Field Summary
private  org.eclipse.ui.views.properties.IPropertySource propertySource
           
private  org.eclipse.emf.common.notify.Notifier target
          Target field for Adapter implementation.
 
Fields inherited from class org.eclipse.gef.editparts.AbstractTreeEditPart
widget
 
Fields inherited from class org.eclipse.gef.editparts.AbstractEditPart
children, FLAG_ACTIVE, FLAG_FOCUS, MAX_FLAG
 
Fields inherited from interface org.eclipse.gef.EditPart
SELECTED, SELECTED_NONE, SELECTED_PRIMARY
 
Fields inherited from interface org.eclipse.gef.RequestConstants
REQ_ADD, REQ_ALIGN, REQ_ALIGN_CHILDREN, REQ_CLONE, REQ_CONNECTION_END, REQ_CONNECTION_START, REQ_CREATE, REQ_CREATE_BENDPOINT, REQ_DELETE, REQ_DELETE_DEPENDANT, REQ_DIRECT_EDIT, REQ_MOVE, REQ_MOVE_BENDPOINT, REQ_MOVE_CHILDREN, REQ_OPEN, REQ_ORPHAN, REQ_ORPHAN_CHILDREN, REQ_RECONNECT_SOURCE, REQ_RECONNECT_TARGET, REQ_RESIZE, REQ_RESIZE_CHILDREN, REQ_SELECTION, REQ_SELECTION_HOVER
 
Constructor Summary
RONTreeEditPart(java.lang.Object model)
           
 
Method Summary
 void activate()
          Hooks in this EditPart as a listener for changes of its model.
 void deactivate()
          Hooks off this EditPart as a listener for changes of its model.
 java.lang.Object getAdapter(java.lang.Class key)
           
 ronmodel.RON getCastedModel()
          Convenience method that casts the model to the appropriate type.
 org.eclipse.gef.commands.Command getCommand(org.eclipse.gef.Request request)
          Returns a Command if the appropriate request is passed.
 org.eclipse.gef.DragTracker getDragTracker(org.eclipse.gef.Request req)
          Returns a DragTracker to handle direct editing and/or opening.
protected  org.eclipse.swt.graphics.Image getImage()
           
protected  java.util.List<java.lang.Object> getModelChildren()
          Returns a List of all HLNodes in the RON which is the model of this EditPart.
private  org.eclipse.ui.views.properties.IPropertySource getPropertySource()
           
 org.eclipse.emf.common.notify.Notifier getTarget()
           
 boolean isAdapterForType(java.lang.Object type)
           
 void notifyChanged(org.eclipse.emf.common.notify.Notification notification)
          If the model fires a property change notification to its listeners, the visual elements which are managed by this EditPart will be refrehed depending on the featureID the notifiation contains.
 void setTarget(org.eclipse.emf.common.notify.Notifier newTarget)
           
 boolean understandsRequest(org.eclipse.gef.Request req)
          Besides the requests handled by the installed EditPolicies (none for this EditPart) this EditPart understands following request.
 
Methods inherited from class org.eclipse.gef.editparts.AbstractTreeEditPart
addChildVisual, checkTreeItem, createEditPolicies, getText, getWidget, refreshVisuals, removeChildVisual, reorderChild, setWidget, setWidgetImage, setWidgetText
 
Methods inherited from class org.eclipse.gef.editparts.AbstractEditPart
activateEditPolicies, addChild, addEditPartListener, addNotify, createChild, deactivateEditPolicies, debug, debugFeedback, eraseSourceFeedback, eraseTargetFeedback, fireActivated, fireChildAdded, fireDeactivated, fireRemovingChild, fireSelectionChanged, getAccessibleEditPart, getChildren, getEditPolicy, getEditPolicyIterator, getEventListeners, getFlag, getModel, getParent, getRoot, getSelected, getTargetEditPart, getViewer, hasFocus, installEditPolicy, isActive, isSelectable, performRequest, refresh, refreshChildren, register, registerAccessibility, registerModel, registerVisuals, removeChild, removeEditPartListener, removeEditPolicy, removeNotify, setFlag, setFocus, setModel, setParent, setSelected, showSourceFeedback, showTargetFeedback, toString, unregister, unregisterAccessibility, unregisterModel, unregisterVisuals
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.eclipse.gef.EditPart
addEditPartListener, addNotify, eraseSourceFeedback, eraseTargetFeedback, getChildren, getEditPolicy, getModel, getParent, getRoot, getSelected, getTargetEditPart, getViewer, hasFocus, installEditPolicy, isActive, isSelectable, performRequest, refresh, removeEditPartListener, removeEditPolicy, removeNotify, setFocus, setModel, setParent, setSelected, showSourceFeedback, showTargetFeedback
 

Field Detail

target

private org.eclipse.emf.common.notify.Notifier target
Target field for Adapter implementation.


propertySource

private org.eclipse.ui.views.properties.IPropertySource propertySource
Constructor Detail

RONTreeEditPart

public RONTreeEditPart(java.lang.Object model)
Method Detail

getModelChildren

protected java.util.List<java.lang.Object> getModelChildren()
Returns a List of all HLNodes in the RON which is the model of this EditPart.

Overrides:
getModelChildren in class org.eclipse.gef.editparts.AbstractEditPart

getCastedModel

public ronmodel.RON getCastedModel()
Convenience method that casts the model to the appropriate type.

Returns:
The model of this EditPart appropriately casted.

getImage

protected org.eclipse.swt.graphics.Image getImage()
Overrides:
getImage in class org.eclipse.gef.editparts.AbstractTreeEditPart

understandsRequest

public boolean understandsRequest(org.eclipse.gef.Request req)
Besides the requests handled by the installed EditPolicies (none for this EditPart) this EditPart understands following request.

Specified by:
understandsRequest in interface org.eclipse.gef.EditPart
Overrides:
understandsRequest in class org.eclipse.gef.editparts.AbstractEditPart

getCommand

public org.eclipse.gef.commands.Command getCommand(org.eclipse.gef.Request request)
Returns a Command if the appropriate request is passed. Checks the Commands handled by installed EditPolicies (none for this EditPart) as well.

Specified by:
getCommand in interface org.eclipse.gef.EditPart
Overrides:
getCommand in class org.eclipse.gef.editparts.AbstractEditPart

activate

public void activate()
Hooks in this EditPart as a listener for changes of its model.

Specified by:
activate in interface org.eclipse.gef.EditPart
Overrides:
activate in class org.eclipse.gef.editparts.AbstractEditPart

deactivate

public void deactivate()
Hooks off this EditPart as a listener for changes of its model.

Specified by:
deactivate in interface org.eclipse.gef.EditPart
Overrides:
deactivate in class org.eclipse.gef.editparts.AbstractEditPart

getDragTracker

public org.eclipse.gef.DragTracker getDragTracker(org.eclipse.gef.Request req)
Returns a DragTracker to handle direct editing and/or opening. As this EditPart is not represented as an TreeItem a SelectEditPartTracker instead of a DragTreeItemsTracker is returned, so that this EditPart can be selected with a click on the background.

Specified by:
getDragTracker in interface org.eclipse.gef.EditPart
Overrides:
getDragTracker in class org.eclipse.gef.editparts.AbstractTreeEditPart

getAdapter

public java.lang.Object getAdapter(java.lang.Class key)
Specified by:
getAdapter in interface org.eclipse.core.runtime.IAdaptable
Overrides:
getAdapter in class org.eclipse.gef.editparts.AbstractEditPart

getPropertySource

private org.eclipse.ui.views.properties.IPropertySource getPropertySource()
Returns:
A RONPropertySource for the Properties View.

isAdapterForType

public boolean isAdapterForType(java.lang.Object type)
Specified by:
isAdapterForType in interface org.eclipse.emf.common.notify.Adapter

notifyChanged

public void notifyChanged(org.eclipse.emf.common.notify.Notification notification)
If the model fires a property change notification to its listeners, the visual elements which are managed by this EditPart will be refrehed depending on the featureID the notifiation contains.

Specified by:
notifyChanged in interface org.eclipse.emf.common.notify.Adapter

setTarget

public void setTarget(org.eclipse.emf.common.notify.Notifier newTarget)
Specified by:
setTarget in interface org.eclipse.emf.common.notify.Adapter

getTarget

public org.eclipse.emf.common.notify.Notifier getTarget()
Specified by:
getTarget in interface org.eclipse.emf.common.notify.Adapter