Eclipse GEF
2.1

org.eclipse.gef.editparts
Class RootTreeEditPart

java.lang.Object
  |
  +--org.eclipse.gef.editparts.AbstractEditPart
        |
        +--org.eclipse.gef.editparts.RootTreeEditPart
All Implemented Interfaces:
EditPart, IAdaptable, RequestConstants, RootEditPart, TreeEditPart

public class RootTreeEditPart
extends AbstractEditPart
implements RootEditPart, TreeEditPart


Nested Class Summary
 
Nested classes inherited from class org.eclipse.gef.editparts.AbstractEditPart
AbstractEditPart.EditPolicyIterator
 
Field Summary
 
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_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
RootTreeEditPart()
           
 
Method Summary
protected  void addChildVisual(EditPart childEditPart, int index)
          This is where the child gets added.
protected  void createEditPolicies()
          Creates the initial EditPolicies and/or reserves slots for dynamic ones.
 Command getCommand(Request request)
          Returns the Command to perform the specified Request or null.
 EditPart getContents()
          Returns the contents EditPart.
 DragTracker getDragTracker(Request request)
          Returns a DragTracker for dragging this EditPart.
 RootEditPart getRoot()
          Returns itself
 EditPartViewer getViewer()
          Return the viewer that this root view object lives in.
 Widget getWidget()
          Returns either a Tree or TreeItem.
protected  void removeChildVisual(EditPart childEditPart)
          This is where the child gets removed.
 void setContents(EditPart editpart)
          Sets the contents EditPart.
 void setViewer(EditPartViewer epviewer)
          Set the viewer that this root view object lives in.
 void setWidget(Widget w)
          Set's the EditPart's widget.
 
Methods inherited from class org.eclipse.gef.editparts.AbstractEditPart
activate, activateEditPolicies, addChild, addEditPartListener, addNotify, createChild, deactivate, deactivateEditPolicies, debug, debugFeedback, eraseSourceFeedback, eraseTargetFeedback, fireActivated, fireChildAdded, fireDeactivated, fireRemovingChild, fireSelectionChanged, getAccessibleEditPart, getAdapter, getChildren, getEditPolicy, getEditPolicyIterator, getEventListeners, getFlag, getModel, getModelChildren, getParent, getSelected, getTargetEditPart, hasFocus, installEditPolicy, isActive, isSelectable, performRequest, refresh, refreshChildren, refreshVisuals, register, registerAccessibility, registerModel, registerVisuals, removeChild, removeEditPartListener, removeEditPolicy, removeNotify, reorderChild, setFlag, setFocus, setModel, setParent, setSelected, showSourceFeedback, showTargetFeedback, toString, understandsRequest, 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
activate, addEditPartListener, addNotify, deactivate, eraseSourceFeedback, eraseTargetFeedback, getChildren, getEditPolicy, getModel, getParent, getSelected, getTargetEditPart, hasFocus, installEditPolicy, isActive, isSelectable, performRequest, refresh, removeEditPartListener, removeEditPolicy, removeNotify, setFocus, setModel, setParent, setSelected, showSourceFeedback, showTargetFeedback, understandsRequest
 
Methods inherited from interface org.eclipse.core.runtime.IAdaptable
getAdapter
 

Constructor Detail

RootTreeEditPart

public RootTreeEditPart()
Method Detail

addChildVisual

protected void addChildVisual(EditPart childEditPart,
                              int index)
This is where the child gets added. No TreeItem is needed here because the contents is actually represented by the Tree iteself.

Specified by:
addChildVisual in class AbstractEditPart
Parameters:
childEditPart - EditPart of child to be added.
index - Position where it is to be added.
See Also:
AbstractEditPart.addChild(EditPart, int), AbstractGraphicalEditPart.removeChildVisual(EditPart)

createEditPolicies

protected void createEditPolicies()
Description copied from class: AbstractEditPart
Creates the initial EditPolicies and/or reserves slots for dynamic ones. Should be implemented to install the inital EditPolicies based on the model's initial state. null can be used to reserve a "slot", should there be some desire to guarantee the ordering of EditPolcies.

Specified by:
createEditPolicies in class AbstractEditPart
See Also:
#doInitialize(), EditPart.installEditPolicy(Object, EditPolicy)

getCommand

public Command getCommand(Request request)
Description copied from interface: EditPart
Returns the Command to perform the specified Request or null.

Specified by:
getCommand in interface EditPart
Overrides:
getCommand in class AbstractEditPart
Parameters:
request - describes the Command being requested
Returns:
null or a Command

getContents

public EditPart getContents()
Description copied from interface: RootEditPart
Returns the contents EditPart. A RootEditPart only has a single child, called its contents.

Specified by:
getContents in interface RootEditPart
Returns:
the contents.

getDragTracker

public DragTracker getDragTracker(Request request)
Description copied from interface: EditPart
Returns a DragTracker for dragging this EditPart. The SelectionTool is the only Tool by default that calls this method. The SelectionTool will use a SelectionRequest to provide information such as which mouse button is down, and what modifier keys are pressed.

Specified by:
getDragTracker in interface EditPart
Parameters:
request - a Request indicating the context of the drag
Returns:
null or a DragTracker

getRoot

public RootEditPart getRoot()
Returns itself

Specified by:
getRoot in interface EditPart
Overrides:
getRoot in class AbstractEditPart
Returns:
the RootEditPart

getViewer

public EditPartViewer getViewer()
Return the viewer that this root view object lives in.

Specified by:
getViewer in interface RootEditPart
Overrides:
getViewer in class AbstractEditPart
Returns:
The EditPartViewer

getWidget

public Widget getWidget()
Description copied from interface: TreeEditPart
Returns either a Tree or TreeItem.

Specified by:
getWidget in interface TreeEditPart
Returns:
the Widget

removeChildVisual

protected void removeChildVisual(EditPart childEditPart)
This is where the child gets removed. This method is overridden here so that the AbstractTreeEditPart does not dispose the widget, which is the Tree in this case. The tree is owned by the viewer, not the child.

Specified by:
removeChildVisual in class AbstractEditPart
Parameters:
childEditPart - EditPart of child to be removed.

setContents

public void setContents(EditPart editpart)
Description copied from interface: RootEditPart
Sets the contents EditPart. A RootEditPart only has a single child, called its contents.

Specified by:
setContents in interface RootEditPart
Parameters:
editpart - the contents

setViewer

public void setViewer(EditPartViewer epviewer)
Set the viewer that this root view object lives in.

Specified by:
setViewer in interface RootEditPart
Parameters:
epviewer - the EditPartViewer

setWidget

public void setWidget(Widget w)
Description copied from interface: TreeEditPart
Set's the EditPart's widget. Because SWT TreeItem and Tree cannot be created without a parent, a TreeEditPart must rely on its parent providing its Widget.

Specified by:
setWidget in interface TreeEditPart
Parameters:
w - the Widget

Eclipse GEF
2.1

Copyright (c) IBM Corp. and others 2000, 2003. All Rights Reserved.