org.eclipse.gef.ui.parts

## Class DomainEventDispatcher

- java.lang.Object
- - org.eclipse.draw2d.EventDispatcher
  - - org.eclipse.draw2d.SWTEventDispatcher
    - - org.eclipse.gef.ui.parts.DomainEventDispatcher

    public class DomainEventDispatcher
    extends SWTEventDispatcher

A special event dispatcher that will route events to the `EditDomain` when appropriate.

IMPORTANT: This class is not intended to be used or subclassed by clients.

### Nested Class Summary

Nested Classes
`protected class` `DomainEventDispatcher.EditPartAccessibilityDispatcher` Extended accessibility support for editpart.

### Nested classes/interfaces inherited from class org.eclipse.draw2d.SWTEventDispatcher

`SWTEventDispatcher.FigureAccessibilityDispatcher`

### Nested classes/interfaces inherited from class org.eclipse.draw2d.EventDispatcher

`EventDispatcher.AccessibilityDispatcher`

### Field Summary

Fields
`protected EditDomain` `domain` The edit domain
`protected EditPartViewer` `viewer` The viewer on which this dispatcher is created.

### Fields inherited from class org.eclipse.draw2d.SWTEventDispatcher

`ANY_BUTTON, control`

### Constructor Summary

Constructors
Constructor and Description
`DomainEventDispatcher(EditDomain d, EditPartViewer v)` Constructs the dispatcher for the given domain and viewer.

### Method Summary

Methods
`void` `dispatchFocusGained(FocusEvent event)`
`void` `dispatchFocusLost(FocusEvent event)`
`void` `dispatchKeyPressed(KeyEvent e)`
`void` `dispatchKeyReleased(KeyEvent e)`
`void` `dispatchKeyTraversed(TraverseEvent e)`
`void` `dispatchMouseDoubleClicked(MouseEvent me)`
`void` `dispatchMouseEntered(MouseEvent me)`
`void` `dispatchMouseExited(MouseEvent me)`
`void` `dispatchMouseHover(MouseEvent me)`
`void` `dispatchMouseMoved(MouseEvent me)`
`void` `dispatchMousePressed(MouseEvent me)`
`void` `dispatchMouseReleased(MouseEvent me)`
`void` `dispatchMouseWheelScrolled(Event evt)` Forwards the event to the EditDomain.
`void` `dispatchNativeDragFinished(DragSourceEvent event, AbstractEditPartViewer viewer)` Dispatches a drag finished event.
`void` `dispatchNativeDragStarted(DragSourceEvent event, AbstractEditPartViewer viewer)` Dispatches a drag started event.
`protected EventDispatcher.AccessibilityDispatcher` `getAccessibilityDispatcher()` Lazily creates and returns the accessibility dispatcher.
`protected EditPartViewer` `getViewer()` Returns the viewer on which this dispatcher was created
`protected void` `setCapture(IFigure figure)`
`protected void` `setCursor(Cursor newCursor)`
`void` `setOverrideCursor(Cursor newCursor)` Sets the override cursor.
`void` `setRouteEventsToEditor(boolean value)` Sets whether events should go directly to the edit domain.

### Methods inherited from class org.eclipse.draw2d.SWTEventDispatcher

`getCurrentEvent, getCursorTarget, getFocusOwner, getFocusTraverseManager, getMouseTarget, getRoot, getToolTipHelper, isCaptured, releaseCapture, requestFocus, requestRemoveFocus, setControl, setEnableKeyTraversal, setFigureUnderCursor, setFocus, setHoverSource, setMouseTarget, setRoot, updateCursor, updateFigureUnderCursor, updateHoverSource`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Field Detail

#### domain

    protected EditDomain domain

The edit domain

#### viewer

    protected EditPartViewer viewer

The viewer on which this dispatcher is created.

### Constructor Detail

#### DomainEventDispatcher

    public DomainEventDispatcher(EditDomain d,
                         EditPartViewer v)

Constructs the dispatcher for the given domain and viewer.

Parameters:
  `d` - the domain
  `v` - the viewer

### Method Detail

#### dispatchFocusGained

    public void dispatchFocusGained(FocusEvent event)

Overrides:
  `dispatchFocusGained` in class `SWTEventDispatcher`
See Also:
  `EventDispatcher.dispatchFocusGained(org.eclipse.swt.events.FocusEvent)`

#### dispatchFocusLost

    public void dispatchFocusLost(FocusEvent event)

Overrides:
  `dispatchFocusLost` in class `SWTEventDispatcher`
See Also:
  `EventDispatcher.dispatchFocusLost(org.eclipse.swt.events.FocusEvent)`

#### dispatchKeyPressed

    public void dispatchKeyPressed(KeyEvent e)

Overrides:
  `dispatchKeyPressed` in class `SWTEventDispatcher`
See Also:
  `EventDispatcher.dispatchKeyPressed(org.eclipse.swt.events.KeyEvent)`

#### dispatchKeyTraversed

    public void dispatchKeyTraversed(TraverseEvent e)

Overrides:
  `dispatchKeyTraversed` in class `SWTEventDispatcher`
See Also:
  `SWTEventDispatcher.dispatchKeyTraversed(org.eclipse.swt.events.TraverseEvent)`

#### dispatchKeyReleased

    public void dispatchKeyReleased(KeyEvent e)

Overrides:
  `dispatchKeyReleased` in class `SWTEventDispatcher`
See Also:
  `EventDispatcher.dispatchKeyReleased(org.eclipse.swt.events.KeyEvent)`

#### dispatchMouseDoubleClicked

    public void dispatchMouseDoubleClicked(MouseEvent me)

Overrides:
  `dispatchMouseDoubleClicked` in class `SWTEventDispatcher`
See Also:
  `EventDispatcher.dispatchMouseDoubleClicked(org.eclipse.swt.events.MouseEvent)`

#### dispatchMouseEntered

    public void dispatchMouseEntered(MouseEvent me)

Overrides:
  `dispatchMouseEntered` in class `SWTEventDispatcher`
See Also:
  `EventDispatcher.dispatchMouseEntered(org.eclipse.swt.events.MouseEvent)`

#### dispatchMouseExited

    public void dispatchMouseExited(MouseEvent me)

Overrides:
  `dispatchMouseExited` in class `SWTEventDispatcher`
See Also:
  `EventDispatcher.dispatchMouseExited(org.eclipse.swt.events.MouseEvent)`

#### dispatchMouseHover

    public void dispatchMouseHover(MouseEvent me)

Overrides:
  `dispatchMouseHover` in class `SWTEventDispatcher`
See Also:
  `EventDispatcher.dispatchMouseHover(org.eclipse.swt.events.MouseEvent)`

#### dispatchMousePressed

    public void dispatchMousePressed(MouseEvent me)

Overrides:
  `dispatchMousePressed` in class `SWTEventDispatcher`
See Also:
  `EventDispatcher.dispatchMousePressed(org.eclipse.swt.events.MouseEvent)`

#### dispatchMouseMoved

    public void dispatchMouseMoved(MouseEvent me)

Overrides:
  `dispatchMouseMoved` in class `SWTEventDispatcher`
See Also:
  `EventDispatcher.dispatchMouseMoved(org.eclipse.swt.events.MouseEvent)`

#### dispatchMouseReleased

    public void dispatchMouseReleased(MouseEvent me)

Overrides:
  `dispatchMouseReleased` in class `SWTEventDispatcher`
See Also:
  `EventDispatcher.dispatchMouseReleased(org.eclipse.swt.events.MouseEvent)`

#### dispatchNativeDragFinished

    public void dispatchNativeDragFinished(DragSourceEvent event,
                                  AbstractEditPartViewer viewer)

Dispatches a drag finished event.

Parameters:
  `event` - the event
  `viewer` - the viewer on which the event occured.

#### dispatchNativeDragStarted

    public void dispatchNativeDragStarted(DragSourceEvent event,
                                 AbstractEditPartViewer viewer)

Dispatches a drag started event.

Parameters:
  `event` - the event
  `viewer` - the viewer

#### dispatchMouseWheelScrolled

    public void dispatchMouseWheelScrolled(Event evt)

Forwards the event to the EditDomain.

Overrides:
  `dispatchMouseWheelScrolled` in class `EventDispatcher`
See Also:
  `EventDispatcher.dispatchMouseWheelScrolled(org.eclipse.swt.widgets.Event)`

#### getAccessibilityDispatcher

    protected EventDispatcher.AccessibilityDispatcher getAccessibilityDispatcher()

Lazily creates and returns the accessibility dispatcher.

Overrides:
  `getAccessibilityDispatcher` in class `SWTEventDispatcher`
See Also:
  `EventDispatcher.getAccessibilityDispatcher()`

#### getViewer

    protected final EditPartViewer getViewer()

Returns the viewer on which this dispatcher was created

Returns:
  the viewer for this dispatcher

#### setCapture

    protected void setCapture(IFigure figure)

Overrides:
  `setCapture` in class `SWTEventDispatcher`
See Also:
  `EventDispatcher.setCapture(IFigure)`

#### setCursor

    protected void setCursor(Cursor newCursor)

Overrides:
  `setCursor` in class `SWTEventDispatcher`
See Also:
  `SWTEventDispatcher.setCursor(Cursor)`

#### setRouteEventsToEditor

    public void setRouteEventsToEditor(boolean value)

Sets whether events should go directly to the edit domain.

Parameters:
  `value` - `true` if all events should go directly to the edit domain

#### setOverrideCursor

    public void setOverrideCursor(Cursor newCursor)

Sets the override cursor.

Parameters:
  `newCursor` - the cursor