Eclipse GEF 3.2

## org.eclipse.gef.ui.palette
Class FlyoutPaletteComposite

    java.lang.Object
      org.eclipse.swt.widgets.Widget
          org.eclipse.swt.widgets.Control
              org.eclipse.swt.widgets.Scrollable
                  org.eclipse.swt.widgets.Composite
                      org.eclipse.gef.ui.palette.FlyoutPaletteComposite

All Implemented Interfaces:
  Drawable

public class FlyoutPaletteComposite
extends Composite

The FlyoutPaletteComposite is used to show a flyout palette alongside another control. The flyout palette auto-hides (thus maximizing space) when not in use, but can also be pinned open if so desired. It will only be visible when the PaletteView is not.

Since:
  3.0

Nested Class Summary
`static interface` `FlyoutPaletteComposite.FlyoutPreferences` FlyoutPreferences is used to save/load the preferences for the flyout palette.

Field Summary
`static int` `STATE_COLLAPSED` One of the two possible initial states of the flyout palette.
`static int` `STATE_PINNED_OPEN` One of the two possible initial states of the flyout palette.

Fields inherited from class org.eclipse.swt.widgets.Control
`handle`

Constructor Summary
`FlyoutPaletteComposite(Composite parent, int style, IWorkbenchPage page, PaletteViewerProvider pvProvider, FlyoutPaletteComposite.FlyoutPreferences preferences)` Constructor

Method Summary
`static FlyoutPaletteComposite.FlyoutPreferences` `createFlyoutPreferences(Preferences prefs)` This is a convenient method to get a default FlyoutPreferences object.
`void` `hookDropTargetListener(GraphicalViewer viewer)` This method hooks a DropTargetListener that collapses the flyout patette when the user drags something from the palette and moves the cursor to the primary viewer's control.
`void` `layout(boolean changed)`
`void` `setExternalViewer(PaletteViewer viewer)` If an external palette viewer is provided, palette state (that is captured in `PaletteViewer.saveState(IMemento)` -- active tool, drawer expansion state, drawer pin state, etc.) will be maintained when switching between the two viewers.
`void` `setGraphicalControl(Control graphicalViewer)` Sets the control along the side of which the palette is to be displayed.

Methods inherited from class org.eclipse.swt.widgets.Composite
`changed, checkSubclass, computeSize, getBackgroundMode, getChildren, getLayout, getLayoutDeferred, getTabList, isLayoutDeferred, layout, layout, layout, setBackgroundMode, setFocus, setLayout, setLayoutDeferred, setTabList`

Methods inherited from class org.eclipse.swt.widgets.Scrollable
`computeTrim, getClientArea, getHorizontalBar, getVerticalBar`

Methods inherited from class org.eclipse.swt.widgets.Control

`addControlListener, addFocusListener, addHelpListener, addKeyListener, addMouseListener, addMouseMoveListener, addMouseTrackListener, addPaintListener, addTraverseListener, computeSize, forceFocus, getAccessible, getBackground, getBackgroundImage, getBorderWidth, getBounds, getEnabled, getFont, getForeground, getLayoutData, getLocation, getMenu, getMonitor, getParent, getShell, getSize, getToolTipText, getVisible, internal_dispose_GC, internal_new_GC, isEnabled, isFocusControl, isReparentable, isVisible, moveAbove, moveBelow, pack, pack, redraw, redraw, removeControlListener, removeFocusListener, removeHelpListener, removeKeyListener, removeMouseListener, removeMouseMoveListener, removeMouseTrackListener, removePaintListener, removeTraverseListener, setBackground, setBackgroundImage, setBounds, setBounds, setCapture, setCursor, setEnabled, setFont, setForeground, setLayoutData, setLocation, setLocation, setMenu, setParent, setRedraw, setSize, setSize, setToolTipText, setVisible, toControl, toControl, toDisplay, toDisplay, traverse, update`

Methods inherited from class org.eclipse.swt.widgets.Widget
`addDisposeListener, addListener, checkWidget, dispose, getData, getData, getDisplay, getStyle, isDisposed, isListening, notifyListeners, removeDisposeListener, removeListener, removeListener, setData, setData, toString`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Field Detail

### STATE_COLLAPSED

    public static final int STATE_COLLAPSED

  One of the two possible initial states of the flyout palette. This is the default one. When in this state, only the flyout palette's sash is visible.

  See Also:
    Constant Field Values

### STATE_PINNED_OPEN

    public static final int STATE_PINNED_OPEN

  One of the two possible initial states of the flyout palette. When in this state, the flyout palette is completely visible and pinned open so that it doesn't disappear when the user wanders away from the flyout.

  See Also:
    Constant Field Values

Constructor Detail

### FlyoutPaletteComposite

    public FlyoutPaletteComposite(Composite parent,
                                  int style,
                                  IWorkbenchPage page,
                                  PaletteViewerProvider pvProvider,
                                  FlyoutPaletteComposite.FlyoutPreferences preferences)

  Constructor

Parameters:
  `parent` - The parent Composite
  `style` - The style of the widget to construct; only SWT.BORDER is allowed
  `page` - The current workbench page
  `pvProvider` - The provider that is to be used to create the flyout palette
  `preferences` - To save/retrieve the preferences for the flyout

Method Detail

### createFlyoutPreferences

    public static FlyoutPaletteComposite.FlyoutPreferences createFlyoutPreferences(Preferences prefs)

  This is a convenient method to get a default FlyoutPreferences object. The returned FlyoutPreferences does not save any changes made to the given `Preferences`. It's upto the owner plugin to `save` the changes before it `stops`.

  Parameters:
    `prefs` - `a plugin's Preferences`
  Returns:
    a default implementation of FlyoutPreferences that stores the settings in the given Preferences
  Since:
    3.2

### layout

    public void layout(boolean changed)

  See Also:
    `Composite.layout(boolean)`

### setExternalViewer

    public void setExternalViewer(PaletteViewer viewer)

  If an external palette viewer is provided, palette state (that is captured in `PaletteViewer.saveState(IMemento)` -- active tool, drawer expansion state, drawer pin state, etc.) will be maintained when switching between the two viewers. Providing an external viewer, although recommended, is optional.

  Parameters:
    `viewer` - The palette viewer used in the PaletteView

### setGraphicalControl

    public void setGraphicalControl(Control graphicalViewer)

  Sets the control along the side of which the palette is to be displayed. The given Control should be a child of this Composite. This method should only be invoked once.

  Parameters:
    `graphicalViewer` - the control of the graphical viewer; cannot be `null`

### hookDropTargetListener

    public void hookDropTargetListener(GraphicalViewer viewer)

  This method hooks a DropTargetListener that collapses the flyout patette when the user drags something from the palette and moves the cursor to the primary viewer's control. If the auto-hide feature of the palette is to work properly when dragging, this method should be called before any other drop target listeners are added to the primary viewer.

  Parameters:
    `viewer` - the primary viewer

Eclipse GEF 3.2

Copyright (c) IBM Corp. and others 2000, 2006. All Rights Reserved.