Package org.eclipse.gef
Class EditDomain
java.lang.Object
org.eclipse.gef.EditDomain
- Direct Known Subclasses:
- DefaultEditDomain
The collective state of a GEF "application", loosely defined by a
 CommandStack, one or more EditPartViewers, and the active Tool. An EditDomain
 is usually tied with an Eclipse 
IEditorPart). However, the distinction between EditorPart and EditDomain was
 made to allow for much flexible use of the Graphical Editing Framework.- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionvoidaddViewer(EditPartViewer viewer) Adds an EditPartViewer into the EditDomain.voidfocusGained(FocusEvent event, EditPartViewer viewer) Called when one of the EditDomain's Viewers receives keyboard focus.voidfocusLost(FocusEvent event, EditPartViewer viewer) Called when one of the EditDomain's Viewers is losing keyboard focus.Returns the active ToolReturns the CommandStack.Returns the default tool for this edit domain.Returns the palette viewer currently associated with this domain.voidkeyDown(KeyEvent keyEvent, EditPartViewer viewer) Called when a key is pressed on a Viewer.voidkeyTraversed(TraverseEvent traverseEvent, EditPartViewer viewer) Called when a traversal occurs on a viewer.voidkeyUp(KeyEvent keyEvent, EditPartViewer viewer) Called when a key is released on a Viewer.voidLoads the default Tool.voidmouseDoubleClick(MouseEvent mouseEvent, EditPartViewer viewer) Called when the mouse button has been double-clicked on a Viewer.voidmouseDown(MouseEvent mouseEvent, EditPartViewer viewer) Called when the mouse button has been pressed on a Viewer.voidmouseDrag(MouseEvent mouseEvent, EditPartViewer viewer) Called when the mouse has been dragged within a Viewer.voidmouseHover(MouseEvent mouseEvent, EditPartViewer viewer) Called when the mouse has hovered on a Viewer.voidmouseMove(MouseEvent mouseEvent, EditPartViewer viewer) Called when the mouse has been moved on a Viewer.voidmouseUp(MouseEvent mouseEvent, EditPartViewer viewer) Called when the mouse button has been released on a Viewer.voidmouseWheelScrolled(Event event, EditPartViewer viewer) Called by the DomainEventDispatcher when the mouse wheel has been scrolled.voidnativeDragFinished(DragSourceEvent event, EditPartViewer viewer) Called when a native drag has finished on a Viewer.voidnativeDragStarted(DragSourceEvent event, EditPartViewer viewer) Called when a native drag has started on a Viewer.voidremoveViewer(EditPartViewer viewer) Removes a previously added viewer from the EditDomain.voidsetActiveTool(Tool tool) Sets the active Tool for this EditDomain.voidsetCommandStack(CommandStack stack) Sets theCommandStack.voidsetDefaultTool(Tool tool) Sets the default Tool, which is used if the Palette does not provide a defaultvoidsetPaletteRoot(PaletteRoot root) Sets the PalatteRoot for this EditDomain.voidsetPaletteViewer(PaletteViewer palette) Sets thePaletteViewerfor this EditDomainvoidviewerEntered(MouseEvent mouseEvent, EditPartViewer viewer) Called when the mouse enters a Viewer.voidviewerExited(MouseEvent mouseEvent, EditPartViewer viewer) Called when the mouse exits a Viewer.
- 
Constructor Details- 
EditDomainpublic EditDomain()Constructs an EditDomain and loads the default tool.
 
- 
- 
Method Details- 
addViewerAdds an EditPartViewer into the EditDomain. A viewer is most likely placed in aWorkbenchPartof some form, such as the IEditorPart or an IViewPart.- Parameters:
- viewer- The EditPartViewer
 
- 
focusGainedCalled when one of the EditDomain's Viewers receives keyboard focus.- Parameters:
- event- The SWT focus event
- viewer- the Viewer that received the event.
 
- 
focusLostCalled when one of the EditDomain's Viewers is losing keyboard focus.- Parameters:
- event- The SWT focus event
- viewer- the Viewer that received the event.
 
- 
getActiveToolReturns the active Tool- Returns:
- the active Tool
 
- 
getCommandStackReturns the CommandStack. Command stacks could potentially be shared across domains depending on the application.- Returns:
- The command stack
 
- 
getDefaultToolReturns the default tool for this edit domain. This will be aSelectionToolunless specifically replaced usingsetDefaultTool(Tool).- Returns:
- The default Tool for this domain
 
- 
getPaletteViewerReturns the palette viewer currently associated with this domain.- Returns:
- The current palette viewer
- Since:
- 1.0
 
- 
keyDownCalled when a key is pressed on a Viewer.- Parameters:
- keyEvent- The SWT key event
- viewer- The source of the event.
 
- 
keyTraversedCalled when a traversal occurs on a viewer.- Parameters:
- traverseEvent- the SWT traverse event
- viewer- the source of the event
- Since:
- 3.1
 
- 
keyUpCalled when a key is released on a Viewer.- Parameters:
- keyEvent- The SWT key event
- viewer- the source of the event.
 
- 
loadDefaultToolpublic void loadDefaultTool()Loads the default Tool. If a palette has been provided and that palette has a default, then that tool is loaded. If not, the EditDomain's default tool is loaded. By default, this is theSelectionTool.
- 
mouseDoubleClickCalled when the mouse button has been double-clicked on a Viewer.- Parameters:
- mouseEvent- The SWT mouse event
- viewer- The source of the event.
 
- 
mouseDownCalled when the mouse button has been pressed on a Viewer.- Parameters:
- mouseEvent- The SWT mouse event
- viewer- The source of the event.
 
- 
mouseDragCalled when the mouse has been dragged within a Viewer.- Parameters:
- mouseEvent- The SWT mouse event
- viewer- The source of the event.
 
- 
mouseHoverCalled when the mouse has hovered on a Viewer.- Parameters:
- mouseEvent- The SWT mouse event
- viewer- The source of the event.
 
- 
mouseMoveCalled when the mouse has been moved on a Viewer.- Parameters:
- mouseEvent- The SWT mouse event
- viewer- The viewer that the mouse event is over.
 
- 
mouseUpCalled when the mouse button has been released on a Viewer.- Parameters:
- mouseEvent- The SWT mouse event
- viewer- The source of the event.
 
- 
mouseWheelScrolledCalled by the DomainEventDispatcher when the mouse wheel has been scrolled.- Parameters:
- event- The SWT event
- viewer- The source of the event
 
- 
nativeDragFinishedCalled when a native drag has finished on a Viewer.- Parameters:
- event- The DragSourceEvent
- viewer- The viewer where the drag finished
 
- 
nativeDragStartedCalled when a native drag has started on a Viewer.- Parameters:
- event- The DragSourceEvent
- viewer- The viewer where the drag started
 
- 
removeViewerRemoves a previously added viewer from the EditDomain. A Viewer that is removed from the EditDomain will no longer forward input to the domain and its active Tool.- Parameters:
- viewer- the Viewer being removed
 
- 
setCommandStackSets theCommandStack.- Parameters:
- stack- the CommandStack
 
- 
setDefaultToolSets the default Tool, which is used if the Palette does not provide a default- Parameters:
- tool-- nullor a Tool
 
- 
setPaletteRootSets the PalatteRoot for this EditDomain. If the EditDomain already knows about a PaletteViewer, this root will be set into the palette viewer also. Loads the default Tool after the root has been set.It is recommended that the palette root not be set multiple times. Some components (such as the PaletteCustomizerDialog for the PaletteViewer) might still hold on to the old root. If the input has changed or needs to be refreshed, just remove all the children from the root and add the new ones. - Parameters:
- root- the palette's root
 
- 
setPaletteViewerSets thePaletteViewerfor this EditDomain- Parameters:
- palette- the PaletteViewer
 
- 
setActiveToolSets the active Tool for this EditDomain. If a current Tool is active, it is deactivated. The new Tool is told its EditDomain, and is activated.- Parameters:
- tool- the Tool
 
- 
viewerEnteredCalled when the mouse enters a Viewer.- Parameters:
- mouseEvent- the SWT mouse event
- viewer- the Viewer being entered
 
- 
viewerExitedCalled when the mouse exits a Viewer.- Parameters:
- mouseEvent- the SWT mouse event
- viewer- the Viewer being exited
 
 
-