Skip to content

ToolItem

Radim Hopp edited this page Mar 25, 2015 · 3 revisions

API / Abstract

  • ToolItem / AbstractToolItem

Implementations

DefaultToolItem

This class could be used for any ToolItem. It contains whole set of constructors to provide enough power to find any ToolItem you need. For more info see Usage. Constructors without ReferencedComposite parameter are looking for ToolItem inside currently active View, Editor or Shell (when there is other Shell than WorkbenchShell active).

Note, that for accessing ToolItems located in main toolbar, one must use constructor with ReferencedComposite parameter and use WorkbenchShell for it as it's shown in Usage

ViewToolItem

This class is deprecated in RedDeer version 0.7. Now, for accessing view's items, it's enough to use DefaultToolItem and it looks in currently active View.

Usage

DefaultToolItem

Look up ToolItem with tooltip "Open Console" in Console View

new ConsoleView().open();
ToolItem toolItem = new DefaultToolItem("Open Console");

Look up second ToolItem inside Workbench matching regular expression "Run.*"

ToolItem toolItem = new DefaultToolItem(new WorkbenchShell(), 1,
				new WithTooltipTextMatcher(new RegexMatcher("Run.*")));
Clone this wiki locally