Skip to main content

Identifiers and locationURI Syntax for Main Menus

Syntax for main menu contribution identifies the specific menu and the insertion point for the menu entry. The below topics explain the syntax.

Identifiers for Main Menu Location Syntax

The following table lists the values for configuring main menu contributions.

MENU_ID and ITEM_ID Values for Main Menu Location Syntax

MENU_ID Values
Defines the main menu category

ITEM_ID Values
Defines the placement or insertion point on the sub-menu as either <before> or <after> a sub-menu entry

menu:file

file.top – Separator

com.sabre.edge.command.file.printpreview – Print Preview

com.sabre.edge.command.file.print – Print

file.bottom – Separator

org.eclipse.ui.file.exit – Exit

menu:edit

edit.top – Separator

com.sabre.edge.command.edit.cut – Cut

com.sabre.edge.command.edit.copy – Copy

com.sabre.edge.command.edit.paste – Paste

edit.selectall – Separator

com.sabre.edge.command.edit.selectall – Select All

edit.appsarea – Separator

edit.bottom – Separator

menu:view

view.top – Separator
view.bottom – Separator

menu:tools

tools.top – Separator

tools.topmiddle – Separator

tools.middle – Separator

tools.bottom – Separator

menu:windows

window.top – Separator

window.bottom – Separator

menu:help

help.top – Separator

help.bottom – Separator

help.about.bottom – Separator

com.sabre.edge.command.help.about – About

 

locationURI Syntax for Main Menus

Red Apps apply specific syntax for main menu contributions. You are required to add the syntax to the org.eclipse.ui.menus extension point in the locationURI property for menuContribution.

The syntax identifies the menu that will receive your menu contribution. By default, a new menu contribution is inserted at the last position of the sub-menu. You can, however, specify the placement in relation to other menu entries with the optional PLACEMENT variable. The below paragraphs explain the syntax.

Syntax for Default Location of the Insertion Point

locationURI=MENU_ID

        Where:

        MENU_ID is any of the values in the MENU_ID column in the preceding table.

Example

The below example places the insertion point for the menu contribution in the last position on the Tools menu.

locationURI=menu:tools

Syntax for Customizing the Placement of the Insertion Point

locationURI=menu:MENU_ID?PLACEMENT=ITEM_ID

        Where:

        MENU_ID is any of the values in the MENU_ID column in the preceding table.

        The ? character follows MENU_ID.

        PLACEMENT is either BEFORE or AFTER. PLACEMENT is required for customization.

        ITEM_ID is any of the values that correspond to the MENU_ID in the ITEM_ID column in the preceding table. ITEM_ID is used in combination with PLACEMENT.

Examples

The below example places the insertion point for the menu contribution after the Print Preview entry on the File menu.

locationURI=menu:file?after=com.sabre.edge.command.file.printpreview

The following example places the insertion point for the menu contribution before the top separator on the Edit menu.