Class AbstractEditPart
- java.lang.Object
-
- org.eclipse.gef.editparts.AbstractEditPart
-
- All Implemented Interfaces:
IAdaptable,EditPart,RequestConstants
- Direct Known Subclasses:
AbstractGraphicalEditPart,AbstractTreeEditPart,RootTreeEditPart
public abstract class AbstractEditPart extends java.lang.Object implements EditPart, RequestConstants, IAdaptable
The baseline implementation for theEditPartinterface.Since this is the default implementation of an interface, this document deals with proper sub-classing of this implementation. This class is not the API. For documentation on proper usage of the public API, see the documentation for the interface itself:
EditPart.This class assumes no visual representation. Subclasses
AbstractGraphicalEditPartandAbstractTreeEditPartadd support forFiguresandTreeItemsrespectively.AbstractEditPart provides support for children. All AbstractEditPart's can potentially be containers for other EditParts.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static classAbstractEditPart.EditPolicyIteratorIterates over aListof EditPolcies, skipping anynullvalues encountered.
-
Field Summary
Fields Modifier and Type Field Description protected java.util.ListchildrenThe List of children EditPartsprotected static intFLAG_ACTIVEThis flag is set duringactivate(), and reset ondeactivate()protected static intFLAG_FOCUSThis flag indicates that the EditPart has focus.protected static intMAX_FLAGThe left-most bit that is reserved by this class for setting flags.-
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
Constructors Constructor Description AbstractEditPart()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidactivate()Activates this EditPart, which in turn activates its children and EditPolicies.protected voidactivateEditPolicies()Activates all EditPolicies installed on this part.protected voidaddChild(EditPart child, int index)Adds a childEditPartto this EditPart.protected abstract voidaddChildVisual(EditPart child, int index)Performs the addition of the child's visual to this EditPart's Visual.voidaddEditPartListener(EditPartListener listener)Adds an EditPartListener.voidaddNotify()Called after the EditPart has been added to its parent.protected EditPartcreateChild(java.lang.Object model)Create the childEditPartfor the given model object.protected abstract voidcreateEditPolicies()Creates the initial EditPolicies and/or reserves slots for dynamic ones.voiddeactivate()Deactivates this EditPart, and in turn deactivates its children and EditPolicies.protected voiddeactivateEditPolicies()Deactivates all installed EditPolicies.protected voiddebug(java.lang.String message)Deprecated.in 3.1protected voiddebugFeedback(java.lang.String message)Deprecated.in 3.1voideraseSourceFeedback(Request request)Erases source feedback for the givenRequest.voideraseTargetFeedback(Request request)Erases target feedback for the givenRequest.protected voidfireActivated()NotifiesEditPartListenersthat this EditPart has been activated.protected voidfireChildAdded(EditPart child, int index)NotifiesEditPartListenersthat a child has been added.protected voidfireDeactivated()NotifiesEditPartListenersthat this EditPart has been deactivated.protected voidfireRemovingChild(EditPart child, int index)NotifiesEditPartListenersthat a child is being removed.protected voidfireSelectionChanged()NotifiesEditPartListenersthat the selection has changed.protected AccessibleEditPartgetAccessibleEditPart()Returns theAccessibleEditPartadapter for this EditPart.java.lang.ObjectgetAdapter(java.lang.Class key)Returns the specified adapter if recognized.java.util.ListgetChildren()Returns the List of childrenEditParts.CommandgetCommand(Request request)Subclasses should rarely extend this method.EditPolicygetEditPolicy(java.lang.Object key)protected AbstractEditPart.EditPolicyIteratorgetEditPolicyIterator()Used internally to iterate over the installed EditPolicies.protected java.util.IteratorgetEventListeners(java.lang.Class clazz)Returns an iterator for the specified type of listenerprotected booleangetFlag(int flag)Returns the boolean value of the given flag.java.lang.ObjectgetModel()Returns the primary model object that this EditPart represents.protected java.util.ListgetModelChildren()Returns aListcontaining the children model objects.EditPartgetParent()Returns the parentEditPart.RootEditPartgetRoot()Returns theRootEditPart.intgetSelected()Returns the selected state of this EditPart.EditPartgetTargetEditPart(Request request)Returns theEditPartwhich is the target of theRequest.EditPartViewergetViewer()Convenience method for returning theEditPartViewerfor this part.booleanhasFocus()Returns true if this EditPart has focus.voidinstallEditPolicy(java.lang.Object key, EditPolicy editPolicy)Installs an EditPolicy for a specified role.booleanisActive()returnstrueif the EditPart is active.booleanisSelectable()By default, an EditPart is regarded to be selectable.voidperformRequest(Request req)Subclasses should extend this method to handle Requests.voidrefresh()Refreshes all properties visually displayed by this EditPart.protected voidrefreshChildren()Updates the set of children EditParts so that it is in sync with the model children.protected voidrefreshVisuals()Refreshes this EditPart's visuals.protected voidregister()Registers itself in the viewer's various registries.protected voidregisterAccessibility()Registers theAccessibleEditPartadapter.protected voidregisterModel()Registers the model in theEditPartViewer.getEditPartRegistry().protected voidregisterVisuals()Registers the visuals in theEditPartViewer.getVisualPartMap().protected voidremoveChild(EditPart child)Removes a childEditPart.protected abstract voidremoveChildVisual(EditPart child)Removes the childs visual from this EditPart's visual.voidremoveEditPartListener(EditPartListener listener)No reason to overridevoidremoveEditPolicy(java.lang.Object key)No reason to overridevoidremoveNotify()Removes all references from theEditPartViewerto this EditPart.protected voidreorderChild(EditPart editpart, int index)Moves a childEditPartinto a lower index than it currently occupies.protected voidsetFlag(int flag, boolean value)Sets the value of the specified flag.voidsetFocus(boolean value)Called byEditPartViewerto indicate that theEditParthas gained or lost keyboard focus.voidsetModel(java.lang.Object model)Set the primary model object that this EditPart represents.voidsetParent(EditPart parent)Sets the parent EditPart.voidsetSelected(int value)Sets the selected state for this EditPart, which may be one of:EditPart.SELECTED_PRIMARYEditPart.SELECTEDEditPart.SELECTED_NONE.voidshowSourceFeedback(Request request)Shows or updates source feedback for the givenRequest.voidshowTargetFeedback(Request request)Shows or updates target feedback for the givenRequest.java.lang.StringtoString()Describes this EditPart for developmental debugging purposes.booleanunderstandsRequest(Request req)Returnstrueif thisEditPartunderstand the givenRequest.protected voidunregister()Undoes any registration performed byregister().protected voidunregisterAccessibility()Unregisters theAccessibleEditPartadapter.protected voidunregisterModel()Unregisters the model in theEditPartViewer.getEditPartRegistry().protected voidunregisterVisuals()Unregisters the visuals in theEditPartViewer.getVisualPartMap().-
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
getDragTracker
-
-
-
-
Field Detail
-
FLAG_ACTIVE
protected static final int FLAG_ACTIVE
This flag is set duringactivate(), and reset ondeactivate()- See Also:
- Constant Field Values
-
FLAG_FOCUS
protected static final int FLAG_FOCUS
This flag indicates that the EditPart has focus.- See Also:
- Constant Field Values
-
MAX_FLAG
protected static final int MAX_FLAG
The left-most bit that is reserved by this class for setting flags. Subclasses may define additional flags starting at(MAX_FLAG << 1).- See Also:
- Constant Field Values
-
children
protected java.util.List children
The List of children EditParts
-
-
Method Detail
-
activate
public void activate()
Activates this EditPart, which in turn activates its children and EditPolicies. Subclasses should extend this method to add listeners to the model. Activation indicates that the EditPart is realized in an EditPartViewer.deactivate()is the inverse, and is eventually called on all EditParts.- Specified by:
activatein interfaceEditPart- See Also:
EditPart.activate(),deactivate()
-
activateEditPolicies
protected void activateEditPolicies()
Activates all EditPolicies installed on this part. There is no reason to override this method.- See Also:
activate()
-
addChild
protected void addChild(EditPart child, int index)
Adds a childEditPartto this EditPart. This method is called fromrefreshChildren(). The following events occur in the order listed:- The child is added to the
childrenList, and its parent is set tothis addChildVisual(EditPart, int)is called to add the child's visualEditPart.addNotify()is called on the child.activate()is called if this part is activeEditPartListenersare notified that the child has been added.
Subclasses should implement
addChildVisual(EditPart, int).- Parameters:
child- TheEditPartto addindex- The index- See Also:
addChildVisual(EditPart, int),removeChild(EditPart),reorderChild(EditPart,int)
- The child is added to the
-
addChildVisual
protected abstract void addChildVisual(EditPart child, int index)
Performs the addition of the child's visual to this EditPart's Visual. The provided subclassesAbstractGraphicalEditPartandAbstractTreeEditPartalready implement this method correctly, so it is unlikely that this method should be overridden.- Parameters:
child- The EditPart being addedindex- The child's position- See Also:
addChild(EditPart, int),AbstractGraphicalEditPart.removeChildVisual(EditPart)
-
addEditPartListener
public void addEditPartListener(EditPartListener listener)
Adds an EditPartListener.- Specified by:
addEditPartListenerin interfaceEditPart- Parameters:
listener- the listener
-
addNotify
public void addNotify()
Description copied from interface:EditPartCalled after the EditPart has been added to its parent. This is used to indicate to the EditPart that it should refresh itself for the first time.- Specified by:
addNotifyin interfaceEditPart- See Also:
EditPart.addNotify()
-
createChild
protected EditPart createChild(java.lang.Object model)
Create the childEditPartfor the given model object. This method is called fromrefreshChildren().By default, the implementation will delegate to the
EditPartViewer'sEditPartFactory. Subclasses may override this method instead of using a Factory.- Parameters:
model- the Child model object- Returns:
- The child EditPart
-
createEditPolicies
protected abstract void createEditPolicies()
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.nullcan be used to reserve a "slot", should there be some desire to guarantee the ordering of EditPolcies.
-
deactivate
public void deactivate()
Deactivates this EditPart, and in turn deactivates its children and EditPolicies. Subclasses should extend this method to remove any listeners established inactivate()- Specified by:
deactivatein interfaceEditPart- See Also:
EditPart.deactivate(),activate()
-
deactivateEditPolicies
protected void deactivateEditPolicies()
Deactivates all installed EditPolicies.
-
debug
protected final void debug(java.lang.String message)
Deprecated.in 3.1This method will log a message to GEF's trace/debug system if the corresponding flag for EditParts is set to true.- Parameters:
message- a debug message
-
debugFeedback
protected final void debugFeedback(java.lang.String message)
Deprecated.in 3.1This method will log the message to GEF's trace/debug system if the corrseponding flag for FEEDBACK is set to true.- Parameters:
message- Message to be passed
-
eraseSourceFeedback
public void eraseSourceFeedback(Request request)
Erases source feedback for the givenRequest. By default, this responsibility is delegated to this part'sEditPolicies. Subclasses should rarely extend this method.
It is recommended that feedback be handled by EditPolicies, and not directly by the EditPart. - Specified by:
eraseSourceFeedbackin interfaceEditPart- Parameters:
request- identifies the type of feedback to erase.- See Also:
showSourceFeedback(Request)
-
eraseTargetFeedback
public void eraseTargetFeedback(Request request)
Erases target feedback for the givenRequest. By default, this responsibility is delegated to this part's EditPolicies. Subclasses should rarely extend this method.
It is recommended that feedback be handled by EditPolicies, and not directly by the EditPart. - Specified by:
eraseTargetFeedbackin interfaceEditPart- Parameters:
request- Command requesting the erase.- See Also:
showTargetFeedback(Request)
-
fireActivated
protected void fireActivated()
NotifiesEditPartListenersthat this EditPart has been activated.
-
fireChildAdded
protected void fireChildAdded(EditPart child, int index)
NotifiesEditPartListenersthat a child has been added.- Parameters:
child-EditPartbeing added as child.index- Position child is being added into.
-
fireDeactivated
protected void fireDeactivated()
NotifiesEditPartListenersthat this EditPart has been deactivated.
-
fireRemovingChild
protected void fireRemovingChild(EditPart child, int index)
NotifiesEditPartListenersthat a child is being removed.- Parameters:
child-EditPartbeing removed.index- Position of the child in children list.
-
fireSelectionChanged
protected void fireSelectionChanged()
NotifiesEditPartListenersthat the selection has changed.
-
getAccessibleEditPart
protected AccessibleEditPart getAccessibleEditPart()
Returns theAccessibleEditPartadapter for this EditPart. The same adapter instance must be used throughout the editpart's existance. Each adapter has a unique ID which is registered duringregister(). Accessibility clients can only refer to this editpart via that ID.- Returns:
nullor an AccessibleEditPart adapter
-
getAdapter
public java.lang.Object getAdapter(java.lang.Class key)
Returns the specified adapter if recognized. Delegates to the workbench adapter mechanism.Additional adapter types may be added in the future. Subclasses should extend this method as needed.
- Specified by:
getAdapterin interfaceIAdaptable- See Also:
IAdaptable.getAdapter(java.lang.Class)
-
getChildren
public java.util.List getChildren()
Description 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 interfaceEditPart- Returns:
- a
Listof children - See Also:
EditPart.getChildren()
-
getCommand
public Command getCommand(Request request)
Subclasses 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 interfaceEditPart- Parameters:
request- the Request- Returns:
- a Command
- See Also:
EditPart.getCommand(Request),EditPolicy.getCommand(Request)
-
getEventListeners
protected final java.util.Iterator getEventListeners(java.lang.Class clazz)
Returns an iterator for the specified type of listener- Parameters:
clazz- the Listener type over which to iterate- Returns:
- Iterator
-
getEditPolicy
public EditPolicy getEditPolicy(java.lang.Object key)
- Specified by:
getEditPolicyin interfaceEditPart- Parameters:
key- the key identifying the EditPolicy- Returns:
nullor the EditPolicy installed with the given key- See Also:
EditPart.getEditPolicy(Object)
-
getEditPolicyIterator
protected final AbstractEditPart.EditPolicyIterator getEditPolicyIterator()
Used internally to iterate over the installed EditPolicies. While EditPolicy slots may be reserved withnull, the iterator only returns the non-null ones.- Returns:
- an EditPolicyIterator
-
getFlag
protected final boolean getFlag(int flag)
Returns the boolean value of the given flag. Specifically, returnstrueif the bitwise AND of the specified flag and the internal flags field is non-zero.- Parameters:
flag- Bitmask indicating which flag to return- Returns:
- the requested flag's value
- See Also:
setFlag(int,boolean)
-
getModel
public java.lang.Object getModel()
Description copied from interface:EditPartReturns the primary model object that this EditPart represents. EditParts may correspond to more than one model object, or even no model object. In practice, the Object returned is used by other EditParts to identify this EditPart. In addition, EditPolicies probably rely on this method to build Commands that operate on the model.- Specified by:
getModelin interfaceEditPart- Returns:
nullor the primary model object- See Also:
EditPart.getModel()
-
getModelChildren
protected java.util.List getModelChildren()
Returns aListcontaining the children model objects. If this EditPart's model is a container, this method should be overridden to returns its children. This is what causes children EditParts to be created.Callers must not modify the returned List. Must not return
null.- Returns:
- the List of children
-
getParent
public EditPart getParent()
Description copied from interface:EditPartReturns the parentEditPart. This method should only be called internally or by helpers such as EditPolicies.- Specified by:
getParentin interfaceEditPart- Returns:
nullor the parentEditPart- See Also:
EditPart.getParent()
-
getRoot
public RootEditPart getRoot()
Description copied from interface:EditPartReturns theRootEditPart. This method should only be called internally or by helpers such as edit policies. The root can be used to get the viewer.- Specified by:
getRootin interfaceEditPart- Returns:
nullor theRootEditPart- See Also:
EditPart.getRoot()
-
getSelected
public int getSelected()
Description copied from interface:EditPartReturns the selected state of this EditPart. This method should only be called internally or by helpers such as EditPolicies.- Specified by:
getSelectedin interfaceEditPart- Returns:
- one of:
- See Also:
EditPart.getSelected()
-
getTargetEditPart
public EditPart getTargetEditPart(Request request)
Returns theEditPartwhich is the target of theRequest. The default implementation delegates this method to the installed EditPolicies. The first non-nullresult returned by an EditPolicy is returned. Subclasses should rarely extend this method.
It is recommended that targeting be handled by EditPolicies, and not directly by the EditPart. - Specified by:
getTargetEditPartin interfaceEditPart- Parameters:
request- Describes the type of target desired.- Returns:
nullor the targetEditPart- See Also:
EditPart.getTargetEditPart(Request),EditPolicy.getTargetEditPart(Request)
-
getViewer
public EditPartViewer getViewer()
Description copied from interface:EditPartConvenience method for returning theEditPartViewerfor this part.- Specified by:
getViewerin interfaceEditPart- Returns:
- the
EditPartViewerornull - See Also:
EditPart.getViewer()
-
hasFocus
public boolean hasFocus()
Description copied from interface:EditPartReturns true if this EditPart has focus. The focus EditPart is a property of the EditPartViewer. The Viewer keeps this property in sync with its focus.- Specified by:
hasFocusin interfaceEditPart- Returns:
- true if the EditPart has focus
- See Also:
EditPart.hasFocus()
-
installEditPolicy
public void installEditPolicy(java.lang.Object key, EditPolicy editPolicy)Description copied from interface:EditPartInstalls an EditPolicy for a specified role. A role is is simply an Object used to identify the EditPolicy. An example of a role is layout.EditPolicy.LAYOUT_ROLEis generally used as the key for this EditPolicy.nullis a valid value for reserving a location.- Specified by:
installEditPolicyin interfaceEditPart- Parameters:
key- an identifier used to key the EditPolicyeditPolicy- the EditPolicy- See Also:
EditPart.installEditPolicy(Object, EditPolicy)
-
isActive
public boolean isActive()
Description copied from interface:EditPartreturnstrueif the EditPart is active. Editparts are active afterEditPart.activate()is called, and untilEditPart.deactivate()is called.
-
isSelectable
public boolean isSelectable()
By default, an EditPart is regarded to be selectable.- Specified by:
isSelectablein interfaceEditPart- Returns:
trueif the receiver can be selected- See Also:
EditPart.isSelectable()
-
performRequest
public void performRequest(Request req)
Subclasses should extend this method to handle Requests. For now, the default implementation does not handle any requests.- Specified by:
performRequestin interfaceEditPart- Parameters:
req- the request to be performed- See Also:
EditPart.performRequest(Request)
-
refresh
public void refresh()
Refreshes all properties visually displayed by this EditPart. The default implementation will callrefreshChildren()to update its structural features. It also callsrefreshVisuals()to update its own displayed properties. Subclasses should extend this method to handle additional types of structural refreshing.
-
refreshChildren
protected void refreshChildren()
Updates the set of children EditParts so that it is in sync with the model children. This method is called fromrefresh(), and may also be called in response to notification from the model. This method requires linear time to complete. Clients should call this method as few times as possible. Consider also callingremoveChild(EditPart)andaddChild(EditPart, int)which run in constant time.The update is performed by comparing the existing EditParts with the set of model children returned from
getModelChildren(). EditParts whose models no longer exist areremoved. New models have their EditPartscreated.This method should not be overridden.
- See Also:
getModelChildren()
-
refreshVisuals
protected void refreshVisuals()
Refreshes this EditPart's visuals. This method is called byrefresh(), and may also be called in response to notifications from the model. This method does nothing by default. Subclasses may override.
-
register
protected void register()
Registers itself in the viewer's various registries. If your EditPart has a 1-to-1 relationship with a visual object and a 1-to-1 relationship with a model object, the default implementation should be sufficent.
-
registerAccessibility
protected final void registerAccessibility()
Registers theAccessibleEditPartadapter.- See Also:
getAccessibleEditPart()
-
registerModel
protected void registerModel()
Registers the model in theEditPartViewer.getEditPartRegistry(). Subclasses should only extend this method if they need to register this EditPart in additional ways.
-
registerVisuals
protected void registerVisuals()
Registers the visuals in theEditPartViewer.getVisualPartMap(). Subclasses should override this method for the visual part they support.AbstractGraphicalEditPartandAbstractTreeEditPartalready do this.
-
removeChild
protected void removeChild(EditPart child)
Removes a childEditPart. This method is called fromrefreshChildren(). The following events occur in the order listed:EditPartListenersare notified that the child is being removeddeactivate()is called if the child is activeEditPart.removeNotify()is called on the child.removeChildVisual(EditPart)is called to remove the child's visual object.- The child's parent is set to
null
Subclasses should implement
removeChildVisual(EditPart).- Parameters:
child- EditPart being removed- See Also:
addChild(EditPart,int)
-
removeChildVisual
protected abstract void removeChildVisual(EditPart child)
Removes the childs visual from this EditPart's visual. Subclasses should implement this method to support the visual type they introduce, such as Figures or TreeItems.- Parameters:
child- the child EditPart
-
removeEditPartListener
public void removeEditPartListener(EditPartListener listener)
No reason to override- Specified by:
removeEditPartListenerin interfaceEditPart- Parameters:
listener- the listener being removed- See Also:
EditPart.removeEditPartListener(EditPartListener)
-
removeEditPolicy
public void removeEditPolicy(java.lang.Object key)
No reason to override- Specified by:
removeEditPolicyin interfaceEditPart- Parameters:
key- the key identifying the EditPolicy to be removed- See Also:
EditPart.removeEditPolicy(Object)
-
removeNotify
public void removeNotify()
Removes all references from theEditPartViewerto this EditPart. This includes:- deselecting this EditPart if selected
- setting the Viewer's focus to
nullif this EditPart has focus unregister()this EditPart
In addition,
removeNotify()is called recursively on all children EditParts. Subclasses should extend this method to perform any additional cleanup.- Specified by:
removeNotifyin interfaceEditPart- See Also:
EditPart.removeNotify()
-
reorderChild
protected void reorderChild(EditPart editpart, int index)
Moves a childEditPartinto a lower index than it currently occupies. This method is called fromrefreshChildren().- Parameters:
editpart- the child being reorderedindex- new index for the child
-
setFlag
protected final void setFlag(int flag, boolean value)Sets the value of the specified flag. Flag values are decalared as static constants. Subclasses may define additional constants aboveMAX_FLAG.- Parameters:
flag- Flag being setvalue- Value of the flag to be set- See Also:
getFlag(int)
-
setFocus
public void setFocus(boolean value)
Called byEditPartViewerto indicate that theEditParthas gained or lost keyboard focus. Focus is considered to be part of the selected state. Therefore, only selectableEditParts are able to obtain focus, and the method may thus only be called with a value oftruein case the receiver is selectable, i.e.isSelectable()returnstrue. The method should rarely be overridden. Instead, EditPolicies that are selection-aware listen for notifications about the change of focus viaEditPartListener.selectedStateChanged(EditPart).- Specified by:
setFocusin interfaceEditPart- Parameters:
value- boolean indicating if this part has focus- See Also:
EditPart.setFocus(boolean),EditPartListener.selectedStateChanged(EditPart),SelectionEditPolicy
-
setModel
public void setModel(java.lang.Object model)
Set the primary model object that this EditPart represents. This method is used by anEditPartFactorywhen creating an EditPart.- Specified by:
setModelin interfaceEditPart- Parameters:
model- the Model- See Also:
EditPart.setModel(Object)
-
setParent
public void setParent(EditPart parent)
Sets the parent EditPart. There is no reason to override this method.- Specified by:
setParentin interfaceEditPart- Parameters:
parent- the parent EditPart- See Also:
EditPart.setParent(EditPart)
-
setSelected
public void setSelected(int value)
Sets the selected state for this EditPart, which may be one of: As only selectableEditParts may get selected, the method may only be called with a selected value ofEditPart.SELECTEDorEditPart.SELECTED_PRIMARYin case the receiver is selectable, i.e.isSelectable()returnstrue. The method should rarely be overridden. Instead, EditPolicies that are selection-aware listen for notifications about the change of selection state viaEditPartListener.selectedStateChanged(EditPart).- Specified by:
setSelectedin interfaceEditPart- Parameters:
value- the selected value- See Also:
EditPart.setSelected(int),EditPartListener.selectedStateChanged(EditPart),SelectionEditPolicy
-
showSourceFeedback
public void showSourceFeedback(Request request)
Shows or updates source feedback for the givenRequest. By default, this responsibility is delegated to this part's EditPolicies. Subclasses should rarely extend this method.
It is recommended that feedback be handled by EditPolicies, and not directly by the EditPart. - Specified by:
showSourceFeedbackin interfaceEditPart- Parameters:
request- the Request- See Also:
EditPolicy.showSourceFeedback(Request),EditPart.showSourceFeedback(Request)
-
showTargetFeedback
public void showTargetFeedback(Request request)
Shows or updates target feedback for the givenRequest. By default, this responsibility is delegated to this part's EditPolicies. Subclasses should rarely extend this method.
It is recommended that feedback be handled by EditPolicies, and not directly by the EditPart. - Specified by:
showTargetFeedbackin interfaceEditPart- Parameters:
request- the Request- See Also:
EditPolicy.showTargetFeedback(Request),EditPart.showTargetFeedback(Request)
-
toString
public java.lang.String toString()
Describes this EditPart for developmental debugging purposes.- Overrides:
toStringin classjava.lang.Object- Returns:
- a description
-
understandsRequest
public boolean understandsRequest(Request req)
Returnstrueif thisEditPartunderstand the givenRequest. By default, this responsibility is delegated to this part's installed EditPolicies.
It is recommended that EditPolicies implement understandsRequest()- Specified by:
understandsRequestin interfaceEditPart- Parameters:
req- aRequestdescribing an operation of some type- Returns:
trueif Request is understood- See Also:
EditPart.understandsRequest(Request)
-
unregister
protected void unregister()
Undoes any registration performed byregister(). The provided base classes will correctly unregister their visuals.
-
unregisterAccessibility
protected final void unregisterAccessibility()
Unregisters theAccessibleEditPartadapter.
-
unregisterModel
protected void unregisterModel()
Unregisters the model in theEditPartViewer.getEditPartRegistry(). Subclasses should only extend this method if they need to unregister this EditPart in additional ways.
-
unregisterVisuals
protected void unregisterVisuals()
Unregisters the visuals in theEditPartViewer.getVisualPartMap(). Subclasses should override this method for the visual part they support.AbstractGraphicalEditPartandAbstractTreeEditPartalready do this.
-
-