Skip to content
Radim Hopp edited this page Jun 3, 2015 · 14 revisions

API / Abstract

  • Menu / AbstractMenu

Implementation(s)

  • ContextMenu
  • ShellMenu
  • ToolItemMenu
  • ViewMenu

Usage

ContextMenu

Open context menu Open in New Window

Menu contextMenu = new ContextMenu("Open in New Window");
contextMenu.select();

ShellMenu

This snippet opens Preferences using workbench menu.

Open shell (or workbench) menu Window -> Preferences

Menu shellMenu = new ShellMenu("Window", "Preferences");
shellMenu.select();

ToolItemMenu

Each MenuItem can have its drop-down menu, which in RedDeer can be accessed through ToolItemMenu.

Trigger Toolbar Search -> File Search

//Obtain Search ToolItem.
ToolItem searchToolItem = new DefaultToolItem(new WorkbenchShell(), "Search");
//Obtain its menu.
Menu toolItemMenu = new ToolItemMenu("File Search");
toolItemMenu.select();

ViewMenu

Each View in Eclipse can have its own menu. This is accessible through triangle near minimize/maximize buttons as it is shown in this picture:

To access this menu in RedDeer, one has to use ViewMenu class.

Set Working sets as top element in Project Explorer

//Make sure project explorer is open and active.
JUnitView jUnitView = new JUnitView();
jUnitView.open();
//Obtain desired menu and select it.
Menu viewMenu = new ViewMenu("Show Execution Time");
viewMenu.select();
Clone this wiki locally