Skip to content
This repository has been archived by the owner on Dec 5, 2024. It is now read-only.
Radim Hopp edited this page Apr 29, 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

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.
ProjectExplorer pExplorer = new ProjectExplorer();
pExplorer.open();
//Obtain desired menu and select it.
Menu viewMenu = new ViewMenu("Top Level Elements", "Working Sets");
viewMenu.select();
Clone this wiki locally