Class ActionBar

  • All Implemented Interfaces:
    org.eclipse.swt.graphics.Drawable

    public class ActionBar
    extends org.eclipse.swt.widgets.Composite
    Action bar contains the set of action buttons, having their unique listeners and decorating images.
    • Field Summary

      • Fields inherited from class org.eclipse.swt.widgets.Control

        handle
    • Constructor Summary

      Constructors 
      Constructor Description
      ActionBar​(org.eclipse.swt.widgets.Composite parent, org.eclipse.ui.forms.widgets.FormToolkit toolkit, int actionBarHeight, int style)
      Creates an instance of the action bar.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addActionBarListener​(IActionBarListener listener)
      Adds action bar listener to the bar.
      IActionBarItem addButton​(String id, org.eclipse.swt.graphics.Image image, String toolTip, int style)
      Add a new button to the action bar.
      IActionBarItem addSpinner​(String id, int style)  
      IActionBarItem[] getItems()  
      void removeActionBarListener​(IActionBarListener listener)
      Removes action bar listener from the bar.
      void setHeight​(int height)
      Sets the height of the action bar.
      • Methods inherited from class org.eclipse.swt.widgets.Composite

        changed, checkSubclass, drawBackground, getBackgroundMode, getChildren, getLayout, getLayoutDeferred, getTabList, isLayoutDeferred, layout, layout, layout, layout, layout, setBackgroundMode, setFocus, setLayout, setLayoutDeferred, setTabList, toString
      • Methods inherited from class org.eclipse.swt.widgets.Scrollable

        computeTrim, getClientArea, getHorizontalBar, getScrollbarsMode, getVerticalBar
      • Methods inherited from class org.eclipse.swt.widgets.Control

        addControlListener, addDragDetectListener, addFocusListener, addGestureListener, addHelpListener, addKeyListener, addMenuDetectListener, addMouseListener, addMouseMoveListener, addMouseTrackListener, addMouseWheelListener, addPaintListener, addTouchListener, addTraverseListener, computeSize, computeSize, dragDetect, dragDetect, forceFocus, getAccessible, getBackground, getBackgroundImage, getBorderWidth, getBounds, getCursor, getDragDetect, getEnabled, getFont, getForeground, getLayoutData, getLocation, getMenu, getMonitor, getOrientation, getParent, getRegion, getShell, getSize, getTextDirection, getToolTipText, getTouchEnabled, getVisible, internal_dispose_GC, internal_new_GC, isEnabled, isFocusControl, isReparentable, isVisible, moveAbove, moveBelow, pack, pack, print, redraw, redraw, removeControlListener, removeDragDetectListener, removeFocusListener, removeGestureListener, removeHelpListener, removeKeyListener, removeMenuDetectListener, removeMouseListener, removeMouseMoveListener, removeMouseTrackListener, removeMouseWheelListener, removePaintListener, removeTouchListener, removeTraverseListener, requestLayout, setBackground, setBackgroundImage, setBounds, setBounds, setCapture, setCursor, setDragDetect, setEnabled, setFont, setForeground, setLayoutData, setLocation, setLocation, setMenu, setOrientation, setParent, setRedraw, setRegion, setSize, setSize, setTextDirection, setToolTipText, setTouchEnabled, setVisible, toControl, toControl, toDisplay, toDisplay, traverse, traverse, traverse, update
      • Methods inherited from class org.eclipse.swt.widgets.Widget

        addDisposeListener, addListener, checkWidget, dispose, getData, getData, getDisplay, getListeners, getStyle, isAutoDirection, isDisposed, isListening, notifyListeners, removeDisposeListener, removeListener, removeListener, reskin, setData, setData
      • Methods inherited from interface org.eclipse.swt.graphics.Drawable

        isAutoScalable
    • Constructor Detail

      • ActionBar

        public ActionBar​(org.eclipse.swt.widgets.Composite parent,
                         org.eclipse.ui.forms.widgets.FormToolkit toolkit,
                         int actionBarHeight,
                         int style)
        Creates an instance of the action bar. The creator is able to specify desired height of the action bar
        By default 24px height and width are used.
        Parameters:
        parent - Parent composite holding this action bar.
        toolkit - Reference to the form toolkit.
        actionBarHeight - Actionbar height.
        style - Desired style.
    • Method Detail

      • getItems

        public IActionBarItem[] getItems()
        Returns:
        array of action items of this action bar. Never null.
      • addActionBarListener

        public void addActionBarListener​(IActionBarListener listener)
        Adds action bar listener to the bar.
        Parameters:
        listener - Listener to add.
      • removeActionBarListener

        public void removeActionBarListener​(IActionBarListener listener)
        Removes action bar listener from the bar.
        Parameters:
        listener - Listener to remove.
      • addButton

        public IActionBarItem addButton​(String id,
                                        org.eclipse.swt.graphics.Image image,
                                        String toolTip,
                                        int style)
        Add a new button to the action bar. The button is being placed as the rightmost button in the bar. previously existing buttons.
        Parameters:
        id - Identifier of the button, can be used for distinguishing buttons in IActionBarListener calls.
        image - Image being displayed on the button. Ideally it shouln't exceed dimensions of the button.
        toolTip - Tooltip that is displayed when mouse moves over the button.
        style - Style modifier for the button being added.
        Returns:
        ActionBar button for further pre-launch modification.
      • setHeight

        public void setHeight​(int height)
        Sets the height of the action bar. Rescales child elements (buttons) accordingly.
        Parameters:
        height - The height to set.