Runtime

## org.eclipse.gmf.runtime.diagram.ui.editparts
Class ConnectionEditPart

    java.lang.Object
      org.eclipse.gef.editparts.AbstractEditPart
          org.eclipse.gef.editparts.AbstractGraphicalEditPart
              org.eclipse.gef.editparts.AbstractConnectionEditPart
                  org.eclipse.gmf.runtime.diagram.ui.editparts.ConnectionEditPart

All Implemented Interfaces:
  ConnectionEditPart, EditPart, java.util.EventListener, GraphicalEditPart, IAdaptable, org.eclipse.gmf.runtime.diagram.ui.internal.editparts.IContainedEditPart, org.eclipse.gmf.runtime.diagram.ui.internal.editparts.IEditableEditPart, IGraphicalEditPart, IPrimaryEditPart, LayerConstants, NotificationListener, java.beans.PropertyChangeListener, RequestConstants

Direct Known Subclasses:
  ConnectionNodeEditPart

public abstract class ConnectionEditPart
extends AbstractConnectionEditPart
implements IGraphicalEditPart, java.beans.PropertyChangeListener, org.eclipse.gmf.runtime.diagram.ui.internal.editparts.IContainedEditPart, IPrimaryEditPart, NotificationListener

the base edit part that controls `Edge` views, it is the basic controller for the connection's view

Nested Class Summary

Nested classes inherited from class org.eclipse.gef.editparts.AbstractConnectionEditPart
`AbstractConnectionEditPart.DefaultAccessibleAnchorProvider`

Nested classes inherited from class org.eclipse.gef.editparts.AbstractGraphicalEditPart
`AbstractGraphicalEditPart.AccessibleGraphicalEditPart`

Nested classes inherited from class org.eclipse.gef.editparts.AbstractEditPart
`AbstractEditPart.EditPolicyIterator`

Field Summary
`protected AccessibleEditPart` `accessibleEP` Used for accessibility.
`protected static java.lang.String[]` `appearanceProperties` a static array of appearance property ids applicable to the connections

Fields inherited from class org.eclipse.gef.editparts.AbstractGraphicalEditPart
`figure, sourceConnections, targetConnections`

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.LayerConstants
`CONNECTION_LAYER, FEEDBACK_LAYER, GRID_LAYER, GUIDE_LAYER, HANDLE_LAYER, PRIMARY_LAYER, PRINTABLE_LAYERS, SCALABLE_LAYERS, SCALED_FEEDBACK_LAYER`

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
`ConnectionEditPart(View view)` construcotr

Method Summary
`void` `activate()`
`protected void` `addChild(EditPart child, int index)`
`protected void` `addListenerFilter(java.lang.String filterId, NotificationListener listener, EObject element)` Adds a listener filter by adding the given listener to a passed notifier
`protected void` `addListenerFilter(java.lang.String filterId, NotificationListener listener, EObject element, EStructuralFeature feature)` Adds a listener filter by adding the given listener to a passed notifier
`protected void` `addNotationalListeners()` This method adds all listeners to the notational world (views, figures, editpart...etc) Override this method to add more notational listeners down the hierarchy
`void` `addNotify()`
`protected void` `addSemanticListeners()` This method adds all listeners to the semantic element behind this EditPart Override this method to add more semantic listeners down the hierarchy This method is called only if the semantic element is resolvable
`protected EditPart` `createChild(java.lang.Object model)`
`protected ConnectionEditPart` `createConnection(java.lang.Object connectionView)`
`protected abstract Connection` `createConnectionFigure()` Method createConnectionFigure.
`protected void` `createDefaultEditPolicies()` Should be overridden to install editpolicies programmatically.
`protected void` `createEditPolicies()` Overridden to support editpolicies installed programmatically and via the `EditPolicyService`.
`protected IFigure` `createFigure()`
`void` `deactivate()`
`void` `disableEditMode()` Disables edit mode of the EditPart.
`void` `enableEditMode()` Enables edit mode of the EditPart.
`void` `eraseSourceFeedback(Request request)`
`void` `eraseTargetFeedback(Request request)`
`protected void` `executeCommand(Command command)` executes the passed command
`EditPart` `findEditPart(EditPart epBegin, EObject theElement)` Finds an editpart given a starting editpart and an EObject
`protected AccessibleEditPart` `getAccessibleEditPart()`
`java.lang.Object` `getAdapter(java.lang.Class key)` Adds the ability to adapt to this editpart's view class.
`protected java.lang.String[]` `getAppearancePropertyIDs()` Returns an array of the appearance property ids applicable to the receiver.
`IGraphicalEditPart` `getChildBySemanticHint(java.lang.String semanticHint)` Method getChildBySemanticHint.
`Command` `getCommand(Request _request)`
`IDiagramEditDomain` `getDiagramEditDomain()` Gets the associated DiagramEditDomain to the edit part
`PreferencesHint` `getDiagramPreferencesHint()` Gets the preferences hint that is to be used to find the appropriate preference store from which to retrieve diagram preference values.
`protected Diagram` `getDiagramView()` Convenience method returning the editpart's Diagram, the Diagam that owns the edit part
`DragTracker` `getDragTracker(Request req)`
`protected Edge` `getEdge()` utility method to get the `Edge` view
`protected EditDomain` `getEditDomain()` Convenience method returning the editpart's edit domain.
`org.eclipse.emf.transaction.TransactionalEditingDomain` `getEditingDomain()` Derives my editing domain from my diagram element.
`protected org.eclipse.gmf.runtime.draw2d.ui.mapmode.IMapMode` `getMapMode()`
`protected java.util.List` `getModelChildren()` Return this editpart's view (model) children.
`protected java.lang.Object` `getModelSource()` give access to the source of the edit part's Edge
`protected java.lang.Object` `getModelTarget()` give access to the target of the edit part's Edge
`View` `getNotationView()` Return the editpart's associated Notation View.
`java.lang.Object` `getPreferredValue(EStructuralFeature feature)` Retrieves the preferred value for the supplied feature.
`EditPart` `getPrimaryChildEditPart()` this method will return the primary child EditPart inside this edit part
`View` `getPrimaryView()` Convenience method returns the editpart's primary view.
`protected Command` `getPropertyChangeCommand(java.lang.Object property, java.lang.Object oldValue, java.lang.Object newValue)` gets a property change command for the passed property, using both of the old and new values
`protected ResourceManager` `getResourceManager()` Gets the resource manager to remember the resources allocated for this graphical viewer.
`java.lang.Object` `getStructuralFeatureValue(EStructuralFeature feature)` Convenience method to retreive the value for the supplied value from the editpart's associated view element.
`TopGraphicEditPart` `getTopGraphicEditPart()` Walks up the editpart hierarchy to find and return the `TopGraphicEditPart` instance.
`protected void` `handleMajorSemanticChange()` Handles the case where the semantic reference has changed.
`protected void` `handleNotificationEvent(Notification event)` Handles the property changed event
`protected void` `handlePropertyChangeEvent(java.beans.PropertyChangeEvent event)` Handles the property changed event.
`protected void` `installRouter()` installes a router on the edit part, depending on the `RoutingStyle`
`boolean` `isCanonical()` check if there is a canonical edit policy installed on the edit part or not
`boolean` `isEditModeEnabled()` Returns `true` if the EditPart is editable.
`boolean` `isSelectable()` checks if the edit part's figure is visible or not
`boolean` `isSemanticConnection()` Answers whether or not this connection represents a part of the semantic model.
`void` `notifyChanged(Notification notification)` Will be called when a Notification event gets sent from the DiagramEventBroker after the transaction has been closed.
`protected void` `performDirectEditRequest(Request request)` Performs a direct edit request (usually by showing some type of editor)
`void` `performRequest(Request request)` Perform a request by executing a command from the target editpart of the request For the Direct_Edit request, we need to show up an editor first
`void` `propertyChange(java.beans.PropertyChangeEvent event)` Handles the passed property changed event only if the editpart's view is not deleted
`void` `reactivateSemanticModel()` Method reactivateSemanticModel.
`void` `refresh()`
`protected void` `refreshBendpoints()` refresh the pendpoints owned by the EditPart's `Edge`
`protected void` `refreshFont()` Refresh the editpart's figure font.
`protected void` `refreshForegroundColor()` Refresh the editpart's figure foreground colour.
`protected void` `refreshJumplinks()` Method refreshJumplinks.
`protected void` `refreshRouterChange()` Method refreshRouterChange.
`protected void` `refreshRoutingStyles()` Method refreshRoutingStyles.
`protected void` `refreshSmoothness()` Method refreshSmoothness.
`protected void` `refreshVisibility()` Refresh the editpart's figure visibility.
`protected void` `refreshVisuals()`
`protected void` `registerModel()` Adds a [ref, editpart] mapping to the EditPartForElement map.
`protected void` `removeListenerFilter(java.lang.String filterId)` Removes a listener previously added with the given id
`protected void` `removeNotationalListeners()` This method removes all listeners to the notational world (views, figures, editpart...etc) Override this method to remove notational listeners down the hierarchy
`void` `removeNotify()`
`protected void` `removeSemanticListeners()` This method removes all listeners to the semantic element behind this EditPart Override this method to remove semantic listeners down the hierarchy
`EObject` `resolveSemanticElement()` try to resolve the semantic element and Return the resolven element; if the element is unresolvable or null it will return null
`protected void` `setFont(FontData fontData)` Sets the font to the label.
`protected void` `setForegroundColor(Color color)` sets the forefround color of the editpart's figure
`void` `setModel(java.lang.Object model)` Clear the semantic connection value when the model changes.
`void` `setStructuralFeatureValue(EStructuralFeature feature, java.lang.Object value)` Sets the passed feature if possible on this editpart's view to the passed value.
`protected void` `setVisibility(boolean vis)` sets the edit part's visibility
`void` `showSourceFeedback(Request request)`
`void` `showTargetFeedback(Request request)`
`boolean` `understandsRequest(Request req)`
`protected void` `unregisterModel()` Remove this editpart from the EditPartForElement map.

Methods inherited from class org.eclipse.gef.editparts.AbstractConnectionEditPart
`activateFigure, deactivateFigure, getConnectionFigure, getSource, getSourceConnectionAnchor, getTarget, getTargetConnectionAnchor, refreshSourceAnchor, refreshTargetAnchor, setParent, setSource, setTarget`

Methods inherited from class org.eclipse.gef.editparts.AbstractGraphicalEditPart

`addChildVisual, addNodeListener, addSourceConnection, addTargetConnection, createOrFindConnection, fireRemovingSourceConnection, fireRemovingTargetConnection, fireSourceConnectionAdded, fireTargetConnectionAdded, getContentPane, getFigure, getLayer, getModelSourceConnections, getModelTargetConnections, getSourceConnections, getTargetConnections, primAddSourceConnection, primAddTargetConnection, primRemoveSourceConnection, primRemoveTargetConnection, refreshSourceConnections, refreshTargetConnections, registerVisuals, removeChildVisual, removeNodeListener, removeSourceConnection, removeTargetConnection, reorderChild, reorderSourceConnection, reorderTargetConnection, setFigure, setLayoutConstraint, unregisterVisuals`

Methods inherited from class org.eclipse.gef.editparts.AbstractEditPart

`activateEditPolicies, addEditPartListener, deactivateEditPolicies, debug, debugFeedback, fireActivated, fireChildAdded, fireDeactivated, fireRemovingChild, fireSelectionChanged, getChildren, getEditPolicy, getEditPolicyIterator, getEventListeners, getFlag, getModel, getParent, getRoot, getSelected, getTargetEditPart, getViewer, hasFocus, installEditPolicy, isActive, refreshChildren, register, registerAccessibility, removeChild, removeEditPartListener, removeEditPolicy, setFlag, setFocus, setSelected, toString, unregister, unregisterAccessibility`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Methods inherited from interface org.eclipse.gef.GraphicalEditPart
`addNodeListener, getContentPane, getFigure, getSourceConnections, getTargetConnections, removeNodeListener, setLayoutConstraint`

Methods inherited from interface org.eclipse.gef.EditPart
`addEditPartListener, getChildren, getEditPolicy, getModel, getParent, getRoot, getSelected, getTargetEditPart, getViewer, hasFocus, installEditPolicy, isActive, removeEditPartListener, removeEditPolicy, setFocus, setParent, setSelected`

Field Detail

### accessibleEP

    protected AccessibleEditPart accessibleEP

  Used for accessibility.

### appearanceProperties

    protected static final java.lang.String[] appearanceProperties

  a static array of appearance property ids applicable to the connections

Constructor Detail

### ConnectionEditPart

    public ConnectionEditPart(View view)

  construcotr

Parameters:
  `view` - , the view the edit part will own

Method Detail

### getPropertyChangeCommand

    protected Command getPropertyChangeCommand(java.lang.Object property,
                                               java.lang.Object oldValue,
                                               java.lang.Object newValue)

  gets a property change command for the passed property, using both of the old and new values

  Parameters:
    `property` - the property associated with the command
    `oldValue` - the old value associated with the command
    `newValue` - the new value associated with the command
  Returns:
    a command

### addChild

    protected void addChild(EditPart child,
                            int index)

### activate

    public void activate()

  Specified by:
    `activate` in interface `EditPart`

### addListenerFilter

    protected void addListenerFilter(java.lang.String filterId,
                                     NotificationListener listener,
                                     EObject element)

  Adds a listener filter by adding the given listener to a passed notifier

  Parameters:
    `filterId` - A unique filter id (within the same editpart instance)
    `listener` - A listener instance

### addListenerFilter

    protected void addListenerFilter(java.lang.String filterId,
                                     NotificationListener listener,
                                     EObject element,
                                     EStructuralFeature feature)

  Adds a listener filter by adding the given listener to a passed notifier

  Parameters:
    `filterId` - A unique filter id (within the same editpart instance)
    `listener` - A listener instance

### createChild

    protected final EditPart createChild(java.lang.Object model)

### createConnection

    protected final ConnectionEditPart createConnection(java.lang.Object connectionView)

### createEditPolicies

    protected final void createEditPolicies()

  Overridden to support editpolicies installed programmatically and via the `EditPolicyService`. Subclasses should override `createDefaultEditPolicies()`.

  See Also:
    `AbstractEditPart.createEditPolicies()`

### createDefaultEditPolicies

    protected void createDefaultEditPolicies()

  Should be overridden to install editpolicies programmatically.

  See Also:
    `AbstractEditPart.createEditPolicies()`

### deactivate

    public void deactivate()

  Specified by:
    `deactivate` in interface `EditPart`

### removeNotify

    public void removeNotify()

  Specified by:
    `removeNotify` in interface `EditPart`

### executeCommand

    protected void executeCommand(Command command)

  executes the passed command

  Parameters:
    `command` - the command to execute

### getAccessibleEditPart

    protected AccessibleEditPart getAccessibleEditPart()

### getAdapter

    public java.lang.Object getAdapter(java.lang.Class key)

  Adds the ability to adapt to this editpart's view class.

  Specified by:
    `getAdapter` in interface `IAdaptable`

### getChildBySemanticHint

    public IGraphicalEditPart getChildBySemanticHint(java.lang.String semanticHint)

  Method getChildBySemanticHint.

  Specified by:
    `getChildBySemanticHint` in interface `IGraphicalEditPart`
  Parameters:
    `semanticHint` -
  Returns:
    IGraphicalEditPart

### getCommand

    public Command getCommand(Request _request)

  Specified by:
    `getCommand` in interface `EditPart`

### getDiagramView

    protected Diagram getDiagramView()

  Convenience method returning the editpart's Diagram, the Diagam that owns the edit part

  Returns:
    the diagram

### getPrimaryView

    public View getPrimaryView()

  Description copied from interface: `IGraphicalEditPart`
  Convenience method returns the editpart's primary view.

  Specified by:
    `getPrimaryView` in interface `IGraphicalEditPart`
  Returns:
    the primary view

### getEditDomain

    protected EditDomain getEditDomain()

  Convenience method returning the editpart's edit domain. Same as calling `getRoot().getViewer().getEditDomain()`

  Returns:
    the edit domain

### getDiagramEditDomain

    public IDiagramEditDomain getDiagramEditDomain()

  Description copied from interface: `IGraphicalEditPart`
  Gets the associated DiagramEditDomain to the edit part

  Specified by:
    `getDiagramEditDomain` in interface `IGraphicalEditPart`
  Returns:
    IDiagramEditDomain

### getModelChildren

    protected java.util.List getModelChildren()

  Return this editpart's view (model) children.

  Returns:
    list of views.

### getStructuralFeatureValue

    public java.lang.Object getStructuralFeatureValue(EStructuralFeature feature)

  Convenience method to retreive the value for the supplied value from the editpart's associated view element. Same as calling `ViewUtil.getStructuralFeatureValue(getNotationView(),feature)`.

  Specified by:
    `getStructuralFeatureValue` in interface `IGraphicalEditPart`
  Returns:
    Object the value

### resolveSemanticElement

    public EObject resolveSemanticElement()

  try to resolve the semantic element and Return the resolven element; if the element is unresolvable or null it will return null

  Specified by:
    `resolveSemanticElement` in interface `IGraphicalEditPart`
  Returns:
    non proxy EObject or NULL

### getTopGraphicEditPart

    public TopGraphicEditPart getTopGraphicEditPart()

  Walks up the editpart hierarchy to find and return the `TopGraphicEditPart` instance.

  Specified by:
    `getTopGraphicEditPart` in interface `IGraphicalEditPart`
  Returns:
    TopGraphicEditPart

### getNotationView

    public View getNotationView()

  Return the editpart's associated Notation View.

  Specified by:
    `getNotationView` in interface `IGraphicalEditPart`
  Returns:
    `View`, the associated view or null if there is no associated Notation View

### propertyChange

    public final void propertyChange(java.beans.PropertyChangeEvent event)

  Handles the passed property changed event only if the editpart's view is not deleted

  Specified by:
    `propertyChange` in interface `java.beans.PropertyChangeListener`

### handlePropertyChangeEvent

    protected void handlePropertyChangeEvent(java.beans.PropertyChangeEvent event)

  Handles the property changed event. Clients should override to respond to the specific notification events they are interested. Note: This method may get called on a non-UI thread. Clients should either ensure that their code is thread safe and/or doesn't make unsupported calls (i.e. Display.getCurrent() ) assuming they are on the main thread. Alternatively if this is not possible, then the client can wrap their handler within the Display.synchExec runnable to ensure synchronization and subsequent execution on the main thread.

  Parameters:
    `event` - the `Notification` object that is the property changed event

### reactivateSemanticModel

    public void reactivateSemanticModel()

  Method reactivateSemanticModel. This method reactivates the edit part's emantic model by: 1- removing semantic listeners 2- adding semantic listeners if the semantic reference is resolvable 3- Refreshing it This method is called in response to IView's Properties.ID_SEMANTICREF property change event However, it will only work under the following assumptions: 1- The old and new semantic models are compatible in their kind 2- The deltas between old and new semantic models do not affect notation 3- Connections are not refereshed since they are maintained by the diagram

### findEditPart

    public EditPart findEditPart(EditPart epBegin,
                                 EObject theElement)

  Finds an editpart given a starting editpart and an EObject

  Specified by:
    `findEditPart` in interface `IGraphicalEditPart`
  Parameters:
    `epBegin` - starting edit part
    `theElement` - eObject to use
  Returns:
    the found edit part if there is any

### refreshForegroundColor

    protected void refreshForegroundColor()

  Refresh the editpart's figure foreground colour.

### refreshVisibility

    protected void refreshVisibility()

  Refresh the editpart's figure visibility.

### removeListenerFilter

    protected void removeListenerFilter(java.lang.String filterId)

  Removes a listener previously added with the given id

  Parameters:
    `filterId` - the filiter ID

### setForegroundColor

    protected void setForegroundColor(Color color)

  sets the forefround color of the editpart's figure

  Parameters:
    `color` - the color

### setStructuralFeatureValue

    public void setStructuralFeatureValue(EStructuralFeature feature,
                                          java.lang.Object value)

  Sets the passed feature if possible on this editpart's view to the passed value.

  Specified by:
    `setStructuralFeatureValue` in interface `IGraphicalEditPart`
  Parameters:
    `feature` - the feature to use
    `value` - the value of the property being set

### setVisibility

    protected void setVisibility(boolean vis)

  sets the edit part's visibility

  Parameters:
    `vis` - the new visibilty value

### addNotationalListeners

    protected void addNotationalListeners()

  This method adds all listeners to the notational world (views, figures, editpart...etc) Override this method to add more notational listeners down the hierarchy

### addSemanticListeners

    protected void addSemanticListeners()

  This method adds all listeners to the semantic element behind this EditPart Override this method to add more semantic listeners down the hierarchy This method is called only if the semantic element is resolvable

### removeNotationalListeners

    protected void removeNotationalListeners()

  This method removes all listeners to the notational world (views, figures, editpart...etc) Override this method to remove notational listeners down the hierarchy

### removeSemanticListeners

    protected void removeSemanticListeners()

  This method removes all listeners to the semantic element behind this EditPart Override this method to remove semantic listeners down the hierarchy

### addNotify

    public void addNotify()

  Specified by:
    `addNotify` in interface `EditPart`
  See Also:
    `EditPart.addNotify()`

### createConnectionFigure

    protected abstract Connection createConnectionFigure()

  Method createConnectionFigure.

  Returns:
    a `Connection` figure

### createFigure

    protected final IFigure createFigure()

### refresh

    public void refresh()

  Specified by:
    `refresh` in interface `EditPart`

### getEdge

    protected Edge getEdge()

  utility method to get the `Edge` view

  Returns:
    the `Edge`

### getDragTracker

    public DragTracker getDragTracker(Request req)

  Specified by:
    `getDragTracker` in interface `EditPart`

### getModelSource

    protected java.lang.Object getModelSource()

  give access to the source of the edit part's Edge

  Returns:
    the source

### getModelTarget

    protected java.lang.Object getModelTarget()

  give access to the target of the edit part's Edge

  Returns:
    the target

### installRouter

    protected void installRouter()

  installes a router on the edit part, depending on the `RoutingStyle`

### refreshBendpoints

    protected void refreshBendpoints()

  refresh the pendpoints owned by the EditPart's `Edge`

### refreshRouterChange

    protected void refreshRouterChange()

  Method refreshRouterChange.

### refreshSmoothness

    protected void refreshSmoothness()

  Method refreshSmoothness.

### refreshJumplinks

    protected void refreshJumplinks()

  Method refreshJumplinks.

### refreshRoutingStyles

    protected void refreshRoutingStyles()

  Method refreshRoutingStyles.

### refreshVisuals

    protected void refreshVisuals()

### refreshFont

    protected void refreshFont()

  Refresh the editpart's figure font.

### setFont

    protected void setFont(FontData fontData)

  Sets the font to the label. This method could be overriden to change the font data of the font overrides typically look like this: super.setFont( new FontData( fontData.getName(), fontData.getHeight(), fontData.getStyle() <| &> SWT.????));

  Parameters:
    `fontData` - the font data

### getAppearancePropertyIDs

    protected java.lang.String[] getAppearancePropertyIDs()

  Returns an array of the appearance property ids applicable to the receiver. Fro this type it is Properties.ID_FONT, Properties.ID_FONTCOLOR, Properties.ID_LINECOLOR

  Returns:
    - an array of the appearane property ids applicable to the receiver

### performRequest

    public void performRequest(Request request)

  Perform a request by executing a command from the target editpart of the request For the Direct_Edit request, we need to show up an editor first

  Specified by:
    `performRequest` in interface `EditPart`
  See Also:
    `EditPart.performRequest(org.eclipse.gef.Request)`

### performDirectEditRequest

    protected void performDirectEditRequest(Request request)

  Performs a direct edit request (usually by showing some type of editor)

  Parameters:
    `request` - the direct edit request

### understandsRequest

    public boolean understandsRequest(Request req)

  Specified by:
    `understandsRequest` in interface `EditPart`
  See Also:
    `EditPart.understandsRequest(org.eclipse.gef.Request)`

### registerModel

    protected void registerModel()

  Adds a [ref, editpart] mapping to the EditPartForElement map.

### unregisterModel

    protected void unregisterModel()

  Remove this editpart from the EditPartForElement map.

### handleMajorSemanticChange

    protected final void handleMajorSemanticChange()

  Handles the case where the semantic reference has changed.

### isCanonical

    public final boolean isCanonical()

  check if there is a canonical edit policy installed on the edit part or not

  Returns:
    `true` if a canonical editpolicy has been installed on this editpart; otherwise `false`

### isSelectable

    public boolean isSelectable()

  checks if the edit part's figure is visible or not

  Specified by:
    `isSelectable` in interface `EditPart`
  Returns:
    `true` if the editpart's figure is visible; `false` otherwise.

### disableEditMode

    public void disableEditMode()

  Description copied from interface: `org.eclipse.gmf.runtime.diagram.ui.internal.editparts.IEditableEditPart`
  Disables edit mode of the EditPart. EditParts that are not editable do not provide commands to any requests.

  Specified by:
    `disableEditMode` in interface `org.eclipse.gmf.runtime.diagram.ui.internal.editparts.IEditableEditPart`

### enableEditMode

    public void enableEditMode()

  Description copied from interface: `org.eclipse.gmf.runtime.diagram.ui.internal.editparts.IEditableEditPart`
  Enables edit mode of the EditPart. EditParts that are editable provide commands to requests.

  Specified by:
    `enableEditMode` in interface `org.eclipse.gmf.runtime.diagram.ui.internal.editparts.IEditableEditPart`

### isEditModeEnabled

    public boolean isEditModeEnabled()

  Description copied from interface: `org.eclipse.gmf.runtime.diagram.ui.internal.editparts.IEditableEditPart`
  Returns `true` if the EditPart is editable. Editparts are editable after `IEditableEditPart.enableEditMode()`is called, and until `IEditableEditPart.disableEditMode()`is called.

  Specified by:
    `isEditModeEnabled` in interface `org.eclipse.gmf.runtime.diagram.ui.internal.editparts.IEditableEditPart`
  Returns:
    `true` when editable

### showSourceFeedback

    public void showSourceFeedback(Request request)

  Specified by:
    `showSourceFeedback` in interface `EditPart`

### showTargetFeedback

    public void showTargetFeedback(Request request)

  Specified by:
    `showTargetFeedback` in interface `EditPart`

### eraseSourceFeedback

    public void eraseSourceFeedback(Request request)

  Specified by:
    `eraseSourceFeedback` in interface `EditPart`

### eraseTargetFeedback

    public void eraseTargetFeedback(Request request)

  Specified by:
    `eraseTargetFeedback` in interface `EditPart`

### getPrimaryChildEditPart

    public EditPart getPrimaryChildEditPart()

  this method will return the primary child EditPart inside this edit part

  Specified by:
    `getPrimaryChildEditPart` in interface `IGraphicalEditPart`
  Returns:
    the primary child view inside this edit part

### getDiagramPreferencesHint

    public PreferencesHint getDiagramPreferencesHint()

  Description copied from interface: `IGraphicalEditPart`
  Gets the preferences hint that is to be used to find the appropriate preference store from which to retrieve diagram preference values. The preference hint is mapped to a preference store in the preference registry <@link DiagramPreferencesRegistry>.

  Specified by:
    `getDiagramPreferencesHint` in interface `IGraphicalEditPart`
  Returns:
    the preferences hint

### notifyChanged

    public void notifyChanged(Notification notification)

  Description copied from interface: `NotificationListener`
  Will be called when a Notification event gets sent from the DiagramEventBroker after the transaction has been closed.

  Specified by:
    `notifyChanged` in interface `NotificationListener`
  Parameters:
    `notification` - the notification object

### handleNotificationEvent

    protected void handleNotificationEvent(Notification event)

  Handles the property changed event

  Parameters:
    `event` - the property changed event

### getMapMode

    protected org.eclipse.gmf.runtime.draw2d.ui.mapmode.IMapMode getMapMode()

  Returns:
    `IMapMode` that allows for the coordinate mapping from device to logical units.

### getEditingDomain

    public org.eclipse.emf.transaction.TransactionalEditingDomain getEditingDomain()

  Derives my editing domain from my diagram element. Subclasses may override.

  Specified by:
    `getEditingDomain` in interface `IGraphicalEditPart`
  Returns:
    my transactional EMF editing domain

### getPreferredValue

    public java.lang.Object getPreferredValue(EStructuralFeature feature)

  Description copied from interface: `IGraphicalEditPart`
  Retrieves the preferred value for the supplied feature. This value could be the current value set in the preference store. Clients may override this to supply their own preferred values. The type of the return value will vary depending on the feature.

  Specified by:
    `getPreferredValue` in interface `IGraphicalEditPart`
  Parameters:
    `feature` - the feature to use
  Returns:
    Object The preferred value for the supplied feature. The object is of the same type as if the value of the feature were retrieved directly from the view.

### getResourceManager

    protected ResourceManager getResourceManager()

  Gets the resource manager to remember the resources allocated for this graphical viewer. All resources will be disposed when the graphical viewer is closed if they have not already been disposed.

  Returns:
    the resource manager

### isSemanticConnection

    public boolean isSemanticConnection()

  Answers whether or not this connection represents a part of the semantic model.

  Returns:
    `true` if this connection has semantic meaning, `false` otherwise.

### setModel

    public void setModel(java.lang.Object model)

  Clear the semantic connection value when the model changes.

  Specified by:
    `setModel` in interface `EditPart`

Runtime

Guidelines for using Eclipse APIs.

Copyright (c) IBM Corp., Borland Software Corp., and others 2005,2006. All rights reserved.