Package 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 org.eclipse.draw2d.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
Modifier and Type
Class
Description
`protected class`
`DomainEventDispatcher.EditPartAccessibilityDispatcher`
Extended accessibility support for editpart.

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

`org.eclipse.draw2d.SWTEventDispatcher.FigureAccessibilityDispatcher`

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

`org.eclipse.draw2d.EventDispatcher.AccessibilityDispatcher`

## Field Summary

Fields
Modifier and Type
Field
Description
`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
Description
`DomainEventDispatcher(EditDomain d, EditPartViewer v)`
Constructs the dispatcher for the given domain and viewer.

## Method Summary

Modifier and Type
Method
Description
`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 org.eclipse.draw2d.EventDispatcher.AccessibilityDispatcher`
`getAccessibilityDispatcher()`
Lazily creates and returns the accessibility dispatcher.
`protected final EditPartViewer`
`getViewer()`
Returns the viewer on which this dispatcher was created
`protected void`
`setCapture(org.eclipse.draw2d.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 Details

### domain

protected EditDomain domain
The edit domain

### viewer

protected EditPartViewer viewer
The viewer on which this dispatcher is created.

## Constructor Details

### DomainEventDispatcher

public DomainEventDispatcher(EditDomain d, EditPartViewer v)
Constructs the dispatcher for the given domain and viewer.

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

## Method Details

### dispatchFocusGained

public void dispatchFocusGained(FocusEvent event)

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

### dispatchFocusLost

public void dispatchFocusLost(FocusEvent event)

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

### dispatchKeyPressed

public void dispatchKeyPressed(KeyEvent e)

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

### dispatchKeyTraversed

public void dispatchKeyTraversed(TraverseEvent e)

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

### dispatchKeyReleased

public void dispatchKeyReleased(KeyEvent e)

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

### dispatchMouseDoubleClicked

public void dispatchMouseDoubleClicked(MouseEvent me)

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

### dispatchMouseEntered

public void dispatchMouseEntered(MouseEvent me)

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

### dispatchMouseExited

public void dispatchMouseExited(MouseEvent me)

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

### dispatchMouseHover

public void dispatchMouseHover(MouseEvent me)

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

### dispatchMousePressed

public void dispatchMousePressed(MouseEvent me)

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

### dispatchMouseMoved

public void dispatchMouseMoved(MouseEvent me)

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

### dispatchMouseReleased

public void dispatchMouseReleased(MouseEvent me)

Overrides:
  `dispatchMouseReleased` in class `org.eclipse.draw2d.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 `org.eclipse.draw2d.EventDispatcher`
See Also:
  - `EventDispatcher.dispatchMouseWheelScrolled(org.eclipse.swt.widgets.Event)`

### getAccessibilityDispatcher

protected org.eclipse.draw2d.EventDispatcher.AccessibilityDispatcher getAccessibilityDispatcher()
Lazily creates and returns the accessibility dispatcher.

Overrides:
  `getAccessibilityDispatcher` in class `org.eclipse.draw2d.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(org.eclipse.draw2d.IFigure figure)

Overrides:
  `setCapture` in class `org.eclipse.draw2d.SWTEventDispatcher`
See Also:
  - `EventDispatcher.setCapture(IFigure)`

### setCursor

protected void setCursor(Cursor newCursor)

Overrides:
  `setCursor` in class `org.eclipse.draw2d.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