org.eclipse.gef.ui.parts
Class GraphicalEditorWithFlyoutPalette

java.lang.Object
  extended byorg.eclipse.ui.part.WorkbenchPart
      extended byorg.eclipse.ui.part.EditorPart
          extended byorg.eclipse.gef.ui.parts.GraphicalEditor
              extended byorg.eclipse.gef.ui.parts.GraphicalEditorWithFlyoutPalette
All Implemented Interfaces:
CommandStackListener, org.eclipse.core.runtime.IAdaptable, org.eclipse.ui.IEditorPart, org.eclipse.core.runtime.IExecutableExtension, org.eclipse.ui.ISaveablePart, org.eclipse.ui.ISelectionListener, org.eclipse.ui.IWorkbenchPart, org.eclipse.ui.IWorkbenchPart2

public abstract class GraphicalEditorWithFlyoutPalette
extends GraphicalEditor

This class serves as a quick starting point for clients who are new to GEF. It will create an Editor with a flyout palette. The flyout palette will only be visible when the palette view is not open.

IMPORTANTThis class should only be used as a reference for creating your own EditorPart implementation. This class will not suit everyone's needs, and may change in the future. Clients may copy the implementation.

Since:
3.0

Nested Class Summary
protected  class GraphicalEditorWithFlyoutPalette.CustomPalettePage
          A custom PalettePage that helps GraphicalEditorWithFlyoutPalette keep the two PaletteViewers (one displayed in the editor and the other displayed in the PaletteView) in sync when switching from one to the other (i.e., it helps maintain state across the two viewers).
 
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
GraphicalEditorWithFlyoutPalette()
           
 
Method Summary
protected  GraphicalEditorWithFlyoutPalette.CustomPalettePage createPalettePage()
           
protected  PaletteViewerProvider createPaletteViewerProvider()
          Creates a PaletteViewerProvider that will be used to create palettes for the view and the flyout.
 void createPartControl(org.eclipse.swt.widgets.Composite parent)
          Realizes the Editor by creating it's Control.
 java.lang.Object getAdapter(java.lang.Class type)
          Returns the adapter for the specified key.
protected  org.eclipse.swt.widgets.Control getGraphicalControl()
           
protected abstract  FlyoutPaletteComposite.FlyoutPreferences getPalettePreferences()
           
protected abstract  PaletteRoot getPaletteRoot()
          Returns the PaletteRoot for the palette viewer.
protected  PaletteViewerProvider getPaletteViewerProvider()
          Returns the palette viewer provider that is used to create palettes for the view and the flyout.
protected  void initializeGraphicalViewer()
          Override to set the contents of the GraphicalViewer after it has been created.
protected  void setEditDomain(DefaultEditDomain ed)
          Sets the edit domain for this editor.
 
Methods inherited from class org.eclipse.gef.ui.parts.GraphicalEditor
commandStackChanged, configureGraphicalViewer, createActions, createGraphicalViewer, dispose, firePropertyChange, getActionRegistry, getCommandStack, getEditDomain, getGraphicalViewer, getPropertyActions, getSelectionActions, getSelectionSynchronizer, getStackActions, hookGraphicalViewer, init, initializeActionRegistry, selectionChanged, setActionRegistry, setFocus, setGraphicalViewer, updateActions
 
Methods inherited from class org.eclipse.ui.part.EditorPart
doSave, doSaveAs, getEditorInput, getEditorSite, getTitleToolTip, isDirty, isSaveAsAllowed, isSaveOnCloseNeeded, setContentDescription, setInitializationData, setInput, setPartName
 
Methods inherited from class org.eclipse.ui.part.WorkbenchPart
addPropertyListener, getConfigurationElement, getContentDescription, getDefaultImage, getPartName, getSite, getTitle, getTitleImage, removePropertyListener, setSite, setTitle, setTitleImage, setTitleToolTip, showBusy
 
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 Detail

GraphicalEditorWithFlyoutPalette

public GraphicalEditorWithFlyoutPalette()
Method Detail

initializeGraphicalViewer

protected void initializeGraphicalViewer()
Description copied from class: GraphicalEditor
Override to set the contents of the GraphicalViewer after it has been created.

Specified by:
initializeGraphicalViewer in class GraphicalEditor
See Also:
GraphicalEditor.initializeGraphicalViewer()

createPaletteViewerProvider

protected PaletteViewerProvider createPaletteViewerProvider()
Creates a PaletteViewerProvider that will be used to create palettes for the view and the flyout.

Returns:
the palette provider

createPalettePage

protected GraphicalEditorWithFlyoutPalette.CustomPalettePage createPalettePage()
Returns:
a newly-created GraphicalEditorWithFlyoutPalette.CustomPalettePage

createPartControl

public void createPartControl(org.eclipse.swt.widgets.Composite parent)
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 interface org.eclipse.ui.IWorkbenchPart
Overrides:
createPartControl in class GraphicalEditor
Parameters:
parent - the parent composite
See Also:
GraphicalEditor.createPartControl(Composite)

getAdapter

public java.lang.Object getAdapter(java.lang.Class type)
Description copied from class: GraphicalEditor
Returns the adapter for the specified key.

IMPORTANT certain requests, such as the property sheet, may be made before or after GraphicalEditor.createPartControl(Composite) is called. The order is unspecified by the Workbench.

Specified by:
getAdapter in interface org.eclipse.core.runtime.IAdaptable
Overrides:
getAdapter in class GraphicalEditor
See Also:
IAdaptable.getAdapter(java.lang.Class)

getGraphicalControl

protected org.eclipse.swt.widgets.Control getGraphicalControl()
Returns:
the graphical viewer's control

getPalettePreferences

protected abstract FlyoutPaletteComposite.FlyoutPreferences getPalettePreferences()
Returns:
the FlyoutPreferences object used to save the flyout palette's preferences

getPaletteRoot

protected abstract PaletteRoot getPaletteRoot()
Returns the PaletteRoot for the palette viewer.

Returns:
the palette root

getPaletteViewerProvider

protected final PaletteViewerProvider getPaletteViewerProvider()
Returns the palette viewer provider that is used to create palettes for the view and the flyout. Creates one if it doesn't already exist.

Returns:
the PaletteViewerProvider that can be used to create PaletteViewers for this editor
See Also:
createPaletteViewerProvider()

setEditDomain

protected void setEditDomain(DefaultEditDomain ed)
Sets the edit domain for this editor.

Overrides:
setEditDomain in class GraphicalEditor
Parameters:
ed - The new EditDomain