Skip to content
This repository has been archived by the owner on Dec 5, 2024. It is now read-only.

ToolBar

Pavol Srna edited this page Mar 25, 2015 · 6 revisions

This component represents one ToolBar. Due to some restrictions, implementation is separated to two classes: DefaultToolBar and ViewToolBar.

Note, that there is basically nothing to do with ToolBars except using it as ReferencedComposite for searching for ToolItems inside desired ToolBar.

API / Abstract

  • ToolBar / AbstractToolBar

Implementations

DefaultToolBar

This class should be used for all toolbars except View toolbars. It contains set of all constructors including public DefaultToolBar(ReferencedComposite rc, int index) for searching inside of some composite (for example Editor or whole WorkbenchShell).

ViewToolBar

This class should be used if you want to access ViewToolBar (eclipse documentation).

Usage

DefaultToolBar

Look up first toolbar in Preferences shell"

Shell preferencesShell = new DefaultShell("Preferences");
ToolBar preferencesToolBar = new DefaultToolBar();

ViewToolBar

Look up a toolbar in Outline view

View outlineView = new OutlineView();
outlineView.open();
ToolBar viewToolbar = new ViewToolBar();
Clone this wiki locally