Class SectionToolbar


  • public class SectionToolbar
    extends Object
    This class provides a convenient shorthand for creating and initializing ToolBar. This offers several benefits over creating ToolBar normal way:
    • Minimize the codes of the creating of the ToolBar
    • The setters on SectionToolbar all return "this", allowing them to be chained
    • Constructor Summary

      Constructors 
      Constructor Description
      SectionToolbar​(org.eclipse.swt.widgets.Composite section)
      Create SectionToolbar with default style (SWT.FLAT | SWT.HORIZONTAL)
      SectionToolbar​(org.eclipse.swt.widgets.Composite section, int style)
      Create SectionToolbar using specified style (See styles of the ToolBarManager).
    • Constructor Detail

      • SectionToolbar

        public SectionToolbar​(org.eclipse.swt.widgets.Composite section)
        Create SectionToolbar with default style (SWT.FLAT | SWT.HORIZONTAL)
        Parameters:
        section - - a parent composite
      • SectionToolbar

        public SectionToolbar​(org.eclipse.swt.widgets.Composite section,
                              int style)
        Create SectionToolbar using specified style (See styles of the ToolBarManager).
        Parameters:
        section - - a parent composite
        style - - a style for the create of the ToolBarManager
    • Method Detail

      • add

        public SectionToolbar add​(org.eclipse.jface.action.IAction action)
        Adds an action as a contribution item, and returns this for convenience
        Parameters:
        action - - the action, this cannot be null
        Returns:
        this for convenience
      • add

        public SectionToolbar add​(org.eclipse.jface.action.IContributionItem iContributionItem)
        Adds a contribution item to this manager, and returns this for convenience
        Parameters:
        iContributionItem - - the contribution item, this cannot be null
        Returns:
        this for convenience
      • done

        public SectionToolbar done()
        Updates the wrapped ToolBarManager.
        Equivalent to this.toolBarManager#update(true);
        Returns:
        this for convenience
        See Also:
        ToolBarManager.update(boolean)
      • getControl

        public org.eclipse.swt.widgets.ToolBar getControl()
        Gets the created ToolBar.
        Returns:
        created ToolBar
      • getManager

        public org.eclipse.jface.action.ToolBarManager getManager()
        Gets the created ToolBar manager.
        Returns:
        created ToolBar