Class 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
    • 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
      • 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