Package org.eclipse.gef.ui.parts
Class GraphicalEditorWithPalette
java.lang.Object
org.eclipse.core.commands.common.EventManager
org.eclipse.ui.part.WorkbenchPart
org.eclipse.ui.part.EditorPart
org.eclipse.gef.ui.parts.GraphicalEditor
org.eclipse.gef.ui.parts.GraphicalEditorWithPalette
- All Implemented Interfaces:
EventListener
,IAdaptable
,IExecutableExtension
,CommandStackListener
,IEditorPart
,ISaveablePart
,ISelectionListener
,IWorkbenchPart
,IWorkbenchPart2
,IWorkbenchPart3
,IWorkbenchPartOrientation
This class serves as a quick starting point for clients who are new to GEF.
It will create an Editor containing a Split composite, with one side
contianing a PaletteViewer, and the other a GraphicalViewer.
-
Field Summary
Fields inherited from interface org.eclipse.ui.IEditorPart
PROP_DIRTY, PROP_INPUT
Fields inherited from interface org.eclipse.ui.IWorkbenchPart
PROP_TITLE
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected void
Called to configure the viewer before it receives its contents.protected void
createPaletteViewer
(Composite parent) Creates the palette on the given composite.void
createPartControl
(Composite parent) Realizes the Editor by creating it's Control.protected int
Returns the initial palette size in pixels.protected abstract PaletteRoot
Returns the PaletteRoot for the palette viewer.protected PaletteViewer
Returns the PaletteViewer.protected void
handlePaletteResized
(int newSize) Called whenever the user resizes the palette.protected void
Called when the palette viewer is set.protected void
Called to populate the palette viewer.protected void
Sets thepalette root
of the edit domainprotected void
setPaletteViewer
(PaletteViewer paletteViewer) Sets the palette viewerMethods inherited from class org.eclipse.gef.ui.parts.GraphicalEditor
commandStackChanged, configureGraphicalViewer, createActions, createGraphicalViewer, dispose, doSaveAs, firePropertyChange, getActionRegistry, getAdapter, getCommandStack, getEditDomain, getGraphicalViewer, getPropertyActions, getSelectionActions, getSelectionSynchronizer, getStackActions, hookGraphicalViewer, init, initializeActionRegistry, initializeGraphicalViewer, isDirty, isSaveAsAllowed, selectionChanged, setActionRegistry, setFocus, setGraphicalViewer, updateActions
Methods inherited from class org.eclipse.ui.part.EditorPart
checkSite, doSave, getEditorInput, getEditorSite, getTitleToolTip, isSaveOnCloseNeeded, setContentDescription, setInitializationData, setInput, setInputWithNotify, setPartName
Methods inherited from class org.eclipse.ui.part.WorkbenchPart
addPartPropertyListener, addPropertyListener, firePartPropertyChanged, getConfigurationElement, getContentDescription, getDefaultImage, getOrientation, getPartName, getPartProperties, getPartProperty, getSite, getTitle, getTitleImage, removePartPropertyListener, removePropertyListener, setPartProperty, setSite, setTitle, setTitleImage, setTitleToolTip, showBusy
Methods inherited from class org.eclipse.core.commands.common.EventManager
addListenerObject, clearListeners, getListeners, isListenerAttached, removeListenerObject
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.eclipse.ui.IWorkbenchPart
addPropertyListener, getSite, getTitle, getTitleImage, removePropertyListener
-
Constructor Details
-
GraphicalEditorWithPalette
public GraphicalEditorWithPalette()
-
-
Method Details
-
configurePaletteViewer
protected void configurePaletteViewer()Called to configure the viewer before it receives its contents. -
createPaletteViewer
Creates the palette on the given composite.- Parameters:
parent
- the composite
-
createPartControl
Description copied from class:GraphicalEditor
Realizes the Editor by creating it's Control.WARNING: This method may or may not be called by the workbench prior to
GraphicalEditor.dispose()
.- Specified by:
createPartControl
in interfaceIWorkbenchPart
- Overrides:
createPartControl
in classGraphicalEditor
- Parameters:
parent
- the parent composite- See Also:
-
getPaletteRoot
Returns the PaletteRoot for the palette viewer.- Returns:
- the palette root
-
getInitialPaletteSize
protected int getInitialPaletteSize()Returns the initial palette size in pixels. Subclasses may override this method to return a persisted value.- Returns:
- the initial size of the palette in pixels.
- See Also:
-
getPaletteViewer
Returns the PaletteViewer.- Returns:
- the palette viewer
-
handlePaletteResized
protected void handlePaletteResized(int newSize) Called whenever the user resizes the palette.- Parameters:
newSize
- the new size in pixels
-
hookPaletteViewer
protected void hookPaletteViewer()Called when the palette viewer is set. By default, the EditDomain is given the palette viewer. -
initializePaletteViewer
protected void initializePaletteViewer()Called to populate the palette viewer. -
setPaletteViewer
Sets the palette viewer- Parameters:
paletteViewer
- the palette viewer
-
setEditDomain
Sets thepalette root
of the edit domain- Overrides:
setEditDomain
in classGraphicalEditor
- Parameters:
ed
- the domain- See Also:
-