Runtime

## org.eclipse.gmf.runtime.diagram.ui.parts
Class DiagramEditorWithFlyOutPalette

    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.gmf.runtime.diagram.ui.parts.DiagramEditor
                          org.eclipse.gmf.runtime.diagram.ui.parts.DiagramEditorWithFlyOutPalette

All Implemented Interfaces:
  CommandStackListener, IAdaptable, IDiagramWorkbenchPart, IEditorPart, IExecutableExtension, ISaveablePart, ISelectionListener, IShowInSource, ITabbedPropertySheetPageContributor, IWorkbenchPart, IWorkbenchPart2, IWorkbenchPartOrientation

Direct Known Subclasses:
  DiagramDocumentEditor

public abstract class DiagramEditorWithFlyOutPalette
extends DiagramEditor

A generic diagram editor with a palette. This supports the palette moved from the diagram to a palette view. If the palette view is open than the palette in the diagram will be removed.

Nested Class Summary
`protected class` `DiagramEditorWithFlyOutPalette.CustomPalettePage` CustomPalettePage that helps with the switching of the palette from the diagram to the palette view.

Field Summary
`protected static int` `COLLAPSED` collapsed pinned palette state constant
`protected static int` `UNCOLLAPSED_PINNED` uncollapsed pinned palette state constant

Fields inherited from class org.eclipse.gmf.runtime.diagram.ui.parts.DiagramEditor
`ID_OUTLINE, ID_OVERVIEW, workspaceViewerPreferenceStore`

Fields inherited from interface org.eclipse.ui.IWorkbenchPart
`PROP_TITLE`

Fields inherited from interface org.eclipse.ui.IEditorPart
`PROP_DIRTY, PROP_INPUT`

Constructor Summary
`DiagramEditorWithFlyOutPalette()`
`DiagramEditorWithFlyOutPalette(boolean hasFlyout)`

Method Summary
`protected void` `configurePaletteViewer()` Called to configure the viewer before it receives its contents.
`protected PaletteRoot` `createPaletteRoot(PaletteRoot existingPaletteRoot)` Creates the palette root for the palette viewer or updates the existing palette root passed in if entries should be added/removed based on the current state.
`protected PaletteViewerProvider` `createPaletteViewerProvider()` Creates a PaletteViewerProvider.
`void` `createPartControl(Composite parent)` Creates a splitter composite that will contain 2 parts one is for the diagram and the other is for the palette.
`java.lang.Object` `getAdapter(java.lang.Class type)` Adapts to PalettePage.class PaletteViewer.class other wise delegates to super.getAdapter()
`protected abstract java.lang.Object` `getDefaultPaletteContent()` Gets the palette content to be sent to the palette service when creating the palette.
`protected int` `getInitialPaletteSize()` Returns the initial palette size in pixels.
`protected int` `getInitialPaletteState()` gets the initial palette state, it could be UNCOLLAPSED_PINNED or COLLAPSED
`protected PaletteViewerProvider` `getPaletteViewerProvider()` Returns the palette view provider that is reponsible for creating and palette view.
`protected void` `handlePaletteDefaultStateChanged(int newState)` Called whenever the user updates the default palette state.
`protected void` `handlePaletteResized(int newSize)` Called whenever the user resizes the palette.
`protected void` `initializeGraphicalViewer()`
`protected void` `setEditDomain(DefaultEditDomain ed)`
`void` `setFocus()`
`protected void` `startListening()` Installs all the listeners needed by the editor
`protected void` `stopListening()` Removes all the listeners used by the editor

Methods inherited from class org.eclipse.gmf.runtime.diagram.ui.parts.DiagramEditor

`addDefaultPreferences, addDefaultPreferences, clearGraphicalViewerContents, closeEditor, configureDiagramEditDomain, configureGraphicalViewer, createActionManager, createActions, createDiagramEditDomain, createGraphicalViewer, createHistoryListener, createOperationHistory, createScrollingGraphicalViewer, dispose, getActionManager, getContributorId, getDefaultOutlineViewMode, getDiagram, getDiagramEditDomain, getDiagramEditPart, getDiagramGraphicalViewer, getEditingDomain, getElements, getGraphicalControl, getKeyHandler, getOperationHistory, getOutlineViewEditPartFactory, getPreferencesHint, getRulerComposite, getShowInContext, getSite, getUndoContext, getWorkspaceViewerPreferenceStore, getZoomManager, init, initializeGraphicalViewerContents, isWritable, persistViewerSettings, setInput, setRulerComposite, setSite, setUndoContext, shouldAddUndoContext`

Methods inherited from class org.eclipse.gef.ui.parts.GraphicalEditor
`commandStackChanged, doSaveAs, firePropertyChange, getActionRegistry, getCommandStack, getEditDomain, getGraphicalViewer, getPropertyActions, getSelectionActions, getSelectionSynchronizer, getStackActions, hookGraphicalViewer, initializeActionRegistry, isDirty, isSaveAsAllowed, selectionChanged, setActionRegistry, setGraphicalViewer, updateActions`

Methods inherited from class org.eclipse.ui.part.EditorPart
`checkSite, doSave, getEditorInput, getEditorSite, getTitleToolTip, isSaveOnCloseNeeded, setContentDescription, setInitializationData, setInputWithNotify, setPartName`

Methods inherited from class org.eclipse.ui.part.WorkbenchPart
`addPropertyListener, getConfigurationElement, getContentDescription, getDefaultImage, getOrientation, getPartName, getTitle, getTitleImage, removePropertyListener, 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, getTitle, getTitleImage, getTitleToolTip, removePropertyListener`

Field Detail

### UNCOLLAPSED_PINNED

    protected static final int UNCOLLAPSED_PINNED

  uncollapsed pinned palette state constant

  See Also:
    Constant Field Values

### COLLAPSED

    protected static final int COLLAPSED

  collapsed pinned palette state constant

  See Also:
    Constant Field Values

Constructor Detail

### DiagramEditorWithFlyOutPalette

    public DiagramEditorWithFlyOutPalette()

### DiagramEditorWithFlyOutPalette

    public DiagramEditorWithFlyOutPalette(boolean hasFlyout)

Method Detail

### initializeGraphicalViewer

    protected void initializeGraphicalViewer()

  Overrides:
    `initializeGraphicalViewer` in class `DiagramEditor`
  See Also:
    `GraphicalEditor.initializeGraphicalViewer()`

### createPaletteViewerProvider

    protected PaletteViewerProvider createPaletteViewerProvider()

  Creates a PaletteViewerProvider.

  Returns:
    PaletteViewerProvider that provides for the palette viewer for the diagram

### setFocus

    public void setFocus()

  See Also:
    `IWorkbenchPart.setFocus()`

### createPartControl

    public void createPartControl(Composite parent)

  Creates a splitter composite that will contain 2 parts one is for the diagram and the other is for the palette.

  See Also:
    `IWorkbenchPart.createPartControl(Composite)`

### getAdapter

    public java.lang.Object getAdapter(java.lang.Class type)

  Adapts to
  - PalettePage.class
  - PaletteViewer.class other wise delegates to super.getAdapter()

  Specified by:
    `getAdapter` in interface `IAdaptable`
  Overrides:
    `getAdapter` in class `DiagramEditor`
  See Also:
    `IAdaptable.getAdapter(Class)`

### createPaletteRoot

    protected PaletteRoot createPaletteRoot(PaletteRoot existingPaletteRoot)

  Creates the palette root for the palette viewer or updates the existing palette root passed in if entries should be added/removed based on the current state.

  Parameters:
    `existingPaletteRoot` - the existing palette root if the palette has already been created, or null if the palette root has not yet been created
  Returns:
    the new palette root or the updated palette root

### getDefaultPaletteContent

    protected abstract java.lang.Object getDefaultPaletteContent()

  Gets the palette content to be sent to the palette service when creating the palette.

  Returns:
    the palette content

### getPaletteViewerProvider

    protected final PaletteViewerProvider getPaletteViewerProvider()

  Returns the palette view provider that is reponsible for creating and palette view.

  Returns:
    PaletteViewerProvider

### 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:
    `DiagramEditorWithFlyOutPalette.handlePaletteResized(int)`

### getInitialPaletteState

    protected int getInitialPaletteState()

  gets the initial palette state, it could be UNCOLLAPSED_PINNED or COLLAPSED

  Returns:
    int

### setEditDomain

    protected void setEditDomain(DefaultEditDomain ed)

### configurePaletteViewer

    protected void configurePaletteViewer()

  Called to configure the viewer before it receives its contents.

### handlePaletteResized

    protected void handlePaletteResized(int newSize)

  Called whenever the user resizes the palette. Sub-classes can store the new palette size. May want to use this to store preferences as a perferences.

  Parameters:
    `newSize` - the new size in pixels

### handlePaletteDefaultStateChanged

    protected void handlePaletteDefaultStateChanged(int newState)

  Called whenever the user updates the default palette state. Sub-classes can store the new palette state. May want to use this to store preferences as a perferences.

  Parameters:
    `newState` - the new state

### startListening

    protected void startListening()

  Description copied from class: `DiagramEditor`
  Installs all the listeners needed by the editor

  Overrides:
    `startListening` in class `DiagramEditor`

### stopListening

    protected void stopListening()

  Description copied from class: `DiagramEditor`
  Removes all the listeners used by the editor

  Overrides:
    `stopListening` in class `DiagramEditor`

Runtime

Guidelines for using Eclipse APIs.

Copyright (c) IBM Corp., Borland Software Corp., and others 2005,2006. All rights reserved.