Org. Eclipse. UI. actionsets extension point (zz from javaeye Hoodman's blog)

Source: Internet
Author: User

Used to add menus, menu items, and toolbar buttons. Contains menu and action elements.

If the label of the menu element is Chinese, add the shortcut to "file (& F)" as the inner character shortcut; path is the position added to the menu (insert the menu position from the root directory, if omitted, the menu is added to the additions naming group by default;
The action element is equivalent to a menu item, and the label is the name of the menu item "(New (& n)". menupath specifies the position of the operation in the menu bar and uses '/' to define the path, for example, help/helpend. Add action at the end of the Help menu. If this option is omitted, this operation will not appear in the menu bar. Toolbarpath specifies the location of this operation in the toolbar, and uses '/' to define the path. The first mark indicates the toolbar identifier (normal indicates the default toolbar ), the second is the name Group marked in the toolbar. If there is no reorganization, it will be created. If this option is omitted, the action will not appear in the toolbar. Style control menu styles include Radio (with vertices), toggle (with hooks), and push (normal) pulldown. The initial state is specified by the State option.

1. Create a menu item for an independent menu:
<Menu
Path = "additions">
Id = "menu1"
<Separator
Name = "separator1">
</Separator>
<Separator
Name = "separator2">
</Separator>
</Menu>

<Action
Label = "New (& amp; n )"
Menubarpath = "menu1/seperator1"
Toolbarpath = "Save. Group"
</Action>

2. Create a secondary menu for an independent menu

<Menu
Path = "additions">
Id = "menu1"
<Separator
Name = "separator1">
</Separator>
<Separator
Name = "separator2">
</Separator>
</Menu>
<Menu
Path = "menu1/additions">
Id = "menu2"
<Separator
Name = "separator1">
</Separator>
<Separator
Name = "separator2">
</Separator>
</Menu>
<Action
Label = "New (& amp; n )"
Menubarpath = "menu1/menu2/seperator1"
Toolbarpath = "Save. Group"
</Action>
3. Create a menu item and a level-2 menu item for the existing workbench menu, just set the path to the existing menu. The menu insertion points provided by the standard workbench include file, edit, navigate, project, window, and help. Each menu item in each menu is an insert point. Taking the File menu as an example, the insert points include: filestart, new, close, closeall, save, and so on.

4 The position on the toolbar is determined by the toolbar identifier (Org. eclipse. UI. workbench. file, org. eclipse. UI. workbench. navigate, org. eclipse. UI. workbench. launchactionset/normal) and toolbar Group Identifier (New. group, save. group, pin. group, such as Org. eclipse. UI. workbench. file/New. group adds a tool before the new button. The most common setting is normal/additions.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.