GEF v2.0

org.eclipse.gef.editparts
Class AbstractTreeEditPart

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

public abstract class AbstractTreeEditPart
extends AbstractEditPart
implements TreeEditPart

Provides support for EditParts which belong to the Tree.


Inner classes inherited from class org.eclipse.gef.editparts.AbstractEditPart
AbstractEditPart.EditPolicyIterator
 
Field Summary
protected  Widget widget
           
 
Fields inherited from class org.eclipse.gef.editparts.AbstractEditPart
children, eventListeners, FLAG_ACTIVE, FLAG_FOCUS, FLAG_INITIALIZED, 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_CHILD, REQ_ALIGN_CHILDREN, REQ_ANCESTOR_DELETED, REQ_CONNECTION_END, REQ_CONNECTION_START, REQ_CREATE, REQ_CREATE_BENDPOINT, REQ_DELETE, REQ_DELETE_BENDPOINT, REQ_DELETE_DEPENDANT, REQ_DIRECT_EDIT, REQ_MOVE, REQ_MOVE_BENDPOINT, REQ_MOVE_CHILD, REQ_MOVE_CHILDREN, REQ_ORPHAN, REQ_ORPHAN_CHILDREN, REQ_RECONNECT_END, REQ_RECONNECT_SOURCE, REQ_RECONNECT_START, REQ_RECONNECT_TARGET, REQ_RESIZE, REQ_RESIZE_CHILD, REQ_RESIZE_CHILDREN, REQ_SELECTION, REQ_SELECTION_HOVER, REQ_SOURCE_DELETED, REQ_TARGET_DELETED
 
Constructor Summary
AbstractTreeEditPart()
           
AbstractTreeEditPart(Object model)
          Constructor, which sets the model of this.
 
Method Summary
 void activate()
          Indicates that editing has begun and the model may start changing.
protected  void addChildVisual(EditPart childEditPart, int index)
          This is where the child gets added, and its widget created and set.
protected  boolean checkTreeItem()
           
protected  void createEditPolicies()
          Creates the initial EditPolicies and reserves slots for dynamic ones.
 DragTracker getDragTracker(Request req)
          Returns a drag tracker suitable for dragging the receiver.
protected  Image getImage()
           
protected  String getText()
           
 Widget getWidget()
          Returns the Widget which represents this.
protected  void refreshVisuals()
           Refreshes this part's visuals.
protected  void removeChildVisual(EditPart childEditPart)
          The child is finally removed through this method.
 void setWidget(Widget widget)
          Sets the Widget of this, after which the entire EditPart is updated.
protected  void setWidgetImage(Image image)
          Sets the image of a TreeItem (Widget) of this with the one given as input.
protected  void setWidgetText(String text)
          Sets the test of a TreeItem (Widget) of this with the text given as input.
protected  boolean shouldInitialize()
          Determines if the Editpart has the necessary information to initialize
 
Methods inherited from class org.eclipse.gef.editparts.AbstractEditPart
activateEditPolicies, addChild, addEditPartListener, createChild, createConnection, createOrFindConnection, deactivate, deactivateEditPolicies, debug, debugFeedback, dispose, doInitialize, eraseSourceFeedback, eraseTargetFeedback, fireActivated, fireChildAdded, fireDeactivated, fireRemovingChild, fireSelectionChanged, getAccessibleEditPart, getAdapter, getChildren, getCommand, getEditPolicy, getEditPolicyIterator, getEventListeners, getFlag, getKeyHandler, getModel, getModelChildren, getParent, getRoot, getSelected, getTargetEditPart, getViewer, hasFocus, initialize, installEditPolicy, isActive, isSelectable, performRequest, refresh, refreshChildren, register, registerAccessibility, registerModel, registerVisuals, removeChild, removeEditPartListener, removeEditPolicy, reorderChild, setFlag, setFocus, setModel, setParent, setSelected, showSourceFeedback, showTargetFeedback, toString, understandsRequest, unregister, unregisterAccessibility, unregisterModel
 
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, deactivate, dispose, eraseSourceFeedback, eraseTargetFeedback, getChildren, getCommand, getEditPolicy, getKeyHandler, getModel, getParent, getRoot, getSelected, getTargetEditPart, hasFocus, installEditPolicy, performRequest, refresh, removeEditPartListener, removeEditPolicy, setFocus, setModel, setParent, setSelected, showSourceFeedback, showTargetFeedback, understandsRequest
 
Methods inherited from interface org.eclipse.core.runtime.IAdaptable
getAdapter
 

Field Detail

widget

protected Widget widget
Constructor Detail

AbstractTreeEditPart

public AbstractTreeEditPart(Object model)
Constructor, which sets the model of this.
Parameters:
model - Model which this Tree EditPart should represent.

AbstractTreeEditPart

public AbstractTreeEditPart()
Method Detail

activate

public void activate()
Description copied from interface: EditPart
Indicates that editing has begun and the model may start changing. Called by the managing EditPart. The managing edit part may call EditPart.activate() and then EditPart.deactivate() multiple times on the receiver.

Activiation should initiate several things. First, the EditPart should begin to observe its model if appropriate, and should continue the observation until EditPart.deactivate() is called. The EditPart should create and activate all of its EditPolicies. EditPolicies may also observe the model, and should also stop observing when deactivated. Any EditParts managed by this EditPart should also be activated.

Specified by:
activate in interface EditPart
Overrides:
activate in class AbstractEditPart
Following copied from class: org.eclipse.gef.editparts.AbstractEditPart
See Also:
AbstractEditPart.deactivate()

addChildVisual

protected void addChildVisual(EditPart childEditPart,
                              int index)
This is where the child gets added, and its widget created and set.
Overrides:
addChildVisual in class AbstractEditPart
Parameters:
childEditPart - EditPart of child to be added.
index - Position where it is to be added.

checkTreeItem

protected boolean checkTreeItem()

createEditPolicies

protected void createEditPolicies()
Description copied from class: AbstractEditPart
Creates the initial EditPolicies and reserves slots for dynamic ones. Should be overridden to install the inital edit policies 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.
Overrides:
createEditPolicies in class AbstractEditPart
Following copied from class: org.eclipse.gef.editparts.AbstractEditPart
See Also:
AbstractEditPart.doInitialize(), AbstractEditPart.installEditPolicy(Object, EditPolicy)

getDragTracker

public DragTracker getDragTracker(Request req)
Returns a drag tracker suitable for dragging the receiver.
Specified by:
getDragTracker in interface EditPart
Returns:
Returns a DragTracker

getImage

protected Image getImage()

getText

protected String getText()

getWidget

public Widget getWidget()
Returns the Widget which represents this.
Specified by:
getWidget in interface TreeEditPart
Returns:
Widget

refreshVisuals

protected void refreshVisuals()
Description copied from class: AbstractEditPart
Refreshes this part's visuals. After creating the visuals, they should be initialized and the updated in response to model changes by implementing this method.
Overrides:
refreshVisuals in class AbstractEditPart

removeChildVisual

protected void removeChildVisual(EditPart childEditPart)
The child is finally removed through this method. Its Widget is first removed and disposed, after which it removes the EditPart.
Overrides:
removeChildVisual in class AbstractEditPart
Parameters:
childEditPart - EditPart of the child to be removed.

setWidget

public void setWidget(Widget widget)
Sets the Widget of this, after which the entire EditPart is updated.
Specified by:
setWidget in interface TreeEditPart
Parameters:
newWidget - The new Widget of this.

setWidgetImage

protected void setWidgetImage(Image image)
Sets the image of a TreeItem (Widget) of this with the one given as input.
Parameters:
image - Image to be used.

setWidgetText

protected void setWidgetText(String text)
Sets the test of a TreeItem (Widget) of this with the text given as input.
Parameters:
text - Text to be set.

shouldInitialize

protected boolean shouldInitialize()
Determines if the Editpart has the necessary information to initialize
Overrides:
shouldInitialize in class AbstractEditPart

GEF v2.0