Package org.eclipse.gef.editparts
Class RootTreeEditPart
java.lang.Object
org.eclipse.gef.editparts.AbstractEditPart
org.eclipse.gef.editparts.RootTreeEditPart
- All Implemented Interfaces:
- IAdaptable,- EditPart,- RequestConstants,- RootEditPart,- TreeEditPart
The root editpart for a 
TreeViewer. There is limited control of
 a Tree, so this root implementation should work for all purposes. This
 implementation does little more than hold onto the viewer, and pass the
 Tree to the contents as its widget.- 
Nested Class SummaryNested classes/interfaces inherited from class org.eclipse.gef.editparts.AbstractEditPartAbstractEditPart.EditPolicyIterator
- 
Field SummaryFields inherited from class org.eclipse.gef.editparts.AbstractEditPartchildren, FLAG_ACTIVE, FLAG_FOCUS, MAX_FLAGFields inherited from interface org.eclipse.gef.EditPartSELECTED, SELECTED_NONE, SELECTED_PRIMARYFields inherited from interface org.eclipse.gef.RequestConstantsREQ_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 SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionprotected voidaddChildVisual(EditPart childEditPart, int index) This is where the child gets added.protected voidCreates the initial EditPolicies and/or reserves slots for dynamic ones.getCommand(Request request) Subclasses should rarely extend this method.Returns the contents EditPart.getDragTracker(Request request) This method will never be called on a tree root.getRoot()Returnsthis.Convenience method for returning theEditPartViewerfor this part.The editpart holds onto the SWT Tree, which is also the contents' widget.protected voidOverridden to do nothing since the child is explicitly set.protected voidremoveChildVisual(EditPart childEditPart) This is where the child gets removed.voidsetContents(EditPart editpart) Sets the contents EditPart.voidsetViewer(EditPartViewer epviewer) Sets the root's EditPartViewer.voidCalled byTreeViewerto set theTreeinto the root.Methods inherited from class org.eclipse.gef.editparts.AbstractEditPartactivate, activateEditPolicies, addChild, addEditPartListener, addNotify, createChild, deactivate, deactivateEditPolicies, debug, debugFeedback, eraseSourceFeedback, eraseTargetFeedback, fireActivated, fireChildAdded, fireDeactivated, fireRemovingChild, fireSelectionChanged, getAccessibleEditPart, getAdapter, getChildren, getEditPolicy, getEditPolicyIterable, getEditPolicyIterator, getEventListeners, getEventListenersIterable, getFlag, getModel, getModelChildren, getParent, getSelected, getTargetEditPart, hasFocus, installEditPolicy, isActive, isSelectable, performRequest, refresh, refreshVisuals, register, registerAccessibility, registerModel, registerVisuals, removeChild, removeEditPartListener, removeEditPolicy, removeNotify, reorderChild, setFlag, setFocus, setModel, setParent, setSelected, showSourceFeedback, showTargetFeedback, toString, understandsRequest, unregister, unregisterAccessibility, unregisterModel, unregisterVisualsMethods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.eclipse.gef.EditPartactivate, 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, understandsRequestMethods inherited from interface org.eclipse.core.runtime.IAdaptablegetAdapter
- 
Constructor Details- 
RootTreeEditPartpublic RootTreeEditPart()
 
- 
- 
Method Details- 
addChildVisualThis is where the child gets added. No TreeItem is needed here because the contents is actually represented by the Tree iteself.- Specified by:
- addChildVisualin class- AbstractEditPart
- Parameters:
- childEditPart- EditPart of child to be added.
- index- Position where it is to be added.
- See Also:
 
- 
createEditPoliciesprotected void createEditPolicies()Description copied from class:AbstractEditPartCreates the initial EditPolicies and/or reserves slots for dynamic ones. Should be implemented to install the initial EditPolicies based on the model's initial state.nullcan be used to reserve a "slot", should there be some desire to guarantee the ordering of EditPolcies.- Specified by:
- createEditPoliciesin class- AbstractEditPart
- See Also:
 
- 
getCommandDescription copied from class:AbstractEditPartSubclasses should rarely extend this method. The default implementation combines the contributions from each installedEditPolicy. This method is implemented indirectly using EditPolicies.  It is recommended that Command creation be handled by EditPolicies, and not directly by the EditPart. - Specified by:
- getCommandin interface- EditPart
- Overrides:
- getCommandin class- AbstractEditPart
- Parameters:
- request- the Request
- Returns:
- a Command
- See Also:
 
- 
getContentsDescription copied from interface:RootEditPartReturns the contents EditPart. A RootEditPart only has a single child, called its contents.- Specified by:
- getContentsin interface- RootEditPart
- Returns:
- the contents.
- See Also:
 
- 
getDragTrackerThis method will never be called on a tree root.- Specified by:
- getDragTrackerin interface- EditPart
- Parameters:
- request- a- Requestindicating the context of the drag
- Returns:
- nullor a DragTracker
- See Also:
 
- 
getRootReturnsthis.- Specified by:
- getRootin interface- EditPart
- Overrides:
- getRootin class- AbstractEditPart
- Returns:
- nullor the- RootEditPart
- See Also:
 
- 
getViewerDescription copied from interface:EditPartConvenience method for returning theEditPartViewerfor this part.- Specified by:
- getViewerin interface- EditPart
- Specified by:
- getViewerin interface- RootEditPart
- Overrides:
- getViewerin class- AbstractEditPart
- Returns:
- the EditPartViewerornull
- See Also:
 
- 
getWidgetThe editpart holds onto the SWT Tree, which is also the contents' widget.- Specified by:
- getWidgetin interface- TreeEditPart
- Returns:
- the Widget
- See Also:
 
- 
refreshChildrenprotected void refreshChildren()Overridden to do nothing since the child is explicitly set.- Overrides:
- refreshChildrenin class- AbstractEditPart
- See Also:
 
- 
removeChildVisualThis 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:
- removeChildVisualin class- AbstractEditPart
- Parameters:
- childEditPart- EditPart of child to be removed.
 
- 
setContentsDescription copied from interface:RootEditPartSets the contents EditPart. A RootEditPart only has a single child, called its contents.- Specified by:
- setContentsin interface- RootEditPart
- Parameters:
- editpart- the contents
- See Also:
 
- 
setViewerDescription copied from interface:RootEditPartSets the root's EditPartViewer.- Specified by:
- setViewerin interface- RootEditPart
- Parameters:
- epviewer- the EditPartViewer
- See Also:
 
- 
setWidgetCalled byTreeViewerto set theTreeinto the root. The root simply holds onto this widget and passes it to the contents when the contents is added.- Specified by:
- setWidgetin interface- TreeEditPart
- Parameters:
- w- the Widget
- See Also:
 
 
-