Package org.eclipse.gef.editparts
Class AbstractTreeEditPart
java.lang.Object
org.eclipse.gef.editparts.AbstractEditPart
org.eclipse.gef.editparts.AbstractTreeEditPart
- All Implemented Interfaces:
- IAdaptable,- EditPart,- RequestConstants,- TreeEditPart
Default implementation for 
TreeEditParts used in GEF
 TreeViewers.
 This is an implementation class, and the documentation here is targeted at subclassing this class. Callers of public API should refer to the interface's documentation.
- 
Nested Class SummaryNested classes/interfaces inherited from class org.eclipse.gef.editparts.AbstractEditPartAbstractEditPart.EditPolicyIterator
- 
Field SummaryFieldsFields 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 SummaryConstructorsConstructorDescriptionDefault constructorAbstractTreeEditPart(Object model) Constructs a new EditPart with the specified model.
- 
Method SummaryModifier and TypeMethodDescriptionprotected voidaddChildVisual(EditPart childEditPart, int index) Implemented to assign the child itswidget.protected final booleanConvenience method that returnstrueif the widget is a TreeItem and is safe to use.protected voidOverride this method to install the EditPolicies for your EditPart.List<? extends TreeEditPart> Returns the List of childrenEditParts.getDragTracker(Request req) Returns aDragTrackerfor dragging this EditPart.protected ImagegetImage()Override this method to return theImagefor this EditPart'swidget.protected StringgetText()Override this method to return the String to be used in this EditPart'swidget.protected voidBy default, this method will apply anImageandStringto the widget if it is aTreeItem.protected voidremoveChildVisual(EditPart childEditPart) Disposes the child'swidgetand sets it tonull.protected voidreorderChild(EditPart editpart, int index) Moves a childEditPartinto a lower index than it currently occupies.voidSets thewidget.protected final voidsetWidgetImage(Image image) Sets a specifiedImageinto the widget iff it is aTreeItem.protected final voidsetWidgetText(String text) Sets a specifiedStringinto the widget iff it is aTreeItem.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, getCommand, getEditPolicy, getEditPolicyIterable, getEditPolicyIterator, getEventListeners, getEventListenersIterable, getFlag, getModel, getModelChildren, 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, 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, getCommand, getEditPolicy, getModel, getParent, getRoot, getSelected, getTargetEditPart, getViewer, hasFocus, installEditPolicy, isActive, isSelectable, performRequest, refresh, removeEditPartListener, removeEditPolicy, removeNotify, setFocus, setModel, setParent, setSelected, showSourceFeedback, showTargetFeedback, understandsRequestMethods inherited from interface org.eclipse.core.runtime.IAdaptablegetAdapter
- 
Field Details- 
widgetEither a Tree or TreeItem
 
- 
- 
Constructor Details- 
AbstractTreeEditPartConstructs a new EditPart with the specified model.- Parameters:
- model- the model
 
- 
AbstractTreeEditPartpublic AbstractTreeEditPart()Default constructor
 
- 
- 
Method Details- 
addChildVisualImplemented to assign the child itswidget. Subclasses should not call or override this method.- Specified by:
- addChildVisualin class- AbstractEditPart
- Parameters:
- childEditPart- The EditPart being added
- index- The child's position
- See Also:
 
- 
checkTreeItemprotected final boolean checkTreeItem()Convenience method that returnstrueif the widget is a TreeItem and is safe to use.- Returns:
- trueif the widget is a- TreeItemand is not disposed
 
- 
createEditPoliciesprotected void createEditPolicies()Override this method to install the EditPolicies for your EditPart.- Specified by:
- createEditPoliciesin class- AbstractEditPart
- See Also:
 
- 
getChildrenDescription copied from interface:EditPartReturns the List of childrenEditParts. This method should rarely be called, and is only made public so that helper objects of this EditPart, such as EditPolicies, can obtain the children. The returned List may be by reference, and should never be modified.- Specified by:
- getChildrenin interface- EditPart
- Overrides:
- getChildrenin class- AbstractEditPart
- Returns:
- a Listof children
- See Also:
 
- 
getDragTrackerDescription copied from interface:EditPartReturns aDragTrackerfor dragging this EditPart. TheSelectionToolis the only Tool by default that calls this method. The SelectionTool will use aSelectionRequestto provide information such as which mouse button is down, and what modifier keys are pressed.- Specified by:
- getDragTrackerin interface- EditPart
- Parameters:
- req- a- Requestindicating the context of the drag
- Returns:
- nullor a DragTracker
- See Also:
 
- 
getImageOverride this method to return theImagefor this EditPart'swidget. This method is called fromrefreshVisuals().- Returns:
- the Image to be displayed in the TreeItem
 
- 
getTextOverride this method to return the String to be used in this EditPart'swidget. This method is called fromrefreshVisuals().- Returns:
- the String to be displayed by the TreeItem
 
- 
getWidgetDescription copied from interface:TreeEditPart- Specified by:
- getWidgetin interface- TreeEditPart
- Returns:
- the Widget
- See Also:
 
- 
refreshVisualsprotected void refreshVisuals()By default, this method will apply anImageandStringto the widget if it is aTreeItem. Subclasses should overridegetImage()andgetText()to provide theImageandStringused.Subclasses might extend this method if they also want to change the TreeItem's foreground or background color. - Overrides:
- refreshVisualsin class- AbstractEditPart
- See Also:
 
- 
removeChildVisualDisposes the child'swidgetand sets it tonull.- Specified by:
- removeChildVisualin class- AbstractEditPart
- Parameters:
- childEditPart- the child EditPart
- See Also:
 
- 
reorderChildDescription copied from class:AbstractEditPartMoves a childEditPartinto a lower index than it currently occupies. This method is called fromAbstractEditPart.refreshChildren().- Overrides:
- reorderChildin class- AbstractEditPart
- Parameters:
- editpart- the child being reordered
- index- new index for the child
- See Also:
 
- 
setWidgetSets thewidget.- Specified by:
- setWidgetin interface- TreeEditPart
- Parameters:
- widget- the Widget
- See Also:
 
- 
setWidgetImageSets a specifiedImageinto the widget iff it is aTreeItem.- Parameters:
- image- the Image
 
- 
setWidgetTextSets a specifiedStringinto the widget iff it is aTreeItem.- Parameters:
- text- the String
 
 
-