Menubarpath and toolbarpath commonly used in Eclipse plug-in development

Source: Internet
Author: User

About menu bar path

 

The menu bar path (menubar path) specifies the position where the menu item is added. We use the list of layered identifiers to access this location. The following lists frequently used menu entries and their paths and public group labels:

· File: File

O "start" Area: filestart

O "add" group icon inside the "new" menu: New/Additions

O "new", under the "new" menu: New. ext

O "close" Area: Close. ext

O "save": Save. ext

O "print" Area: print. ext

O "open": open. ext

O "import" Area: import. ext

O "additional" Area: Additions

O "recent document" Area: MRU

O "end" Area: fileend

· EDIT: Edit

O "start" Area: editstart

O "undo": Undo. ext

O "cut" Area: Cut. ext

O "Search" Area: Find. ext

O "add" Area: Add. ext

O "end" area (sometimes not end): fileend

O "additional" Area: Additions

· Source: org. Eclipse. jdt. UI. Source. Menu

· Reconstruction: org. Eclipse. jdt. UI. refactoring. Menu

· Navigation: navigate

O "start" Area: navstart

O "go to"> "add" group flag: goto/Additions

O "open": open. Ext, open. ext2, open. ext3, and open. ext4

O "display": Show. Ext, show. ext2, show. ext3, and show. ext4

O "additional" Area: Additions

O "end" Area: navend

· Search: org. Eclipse. Search. Menu

· Project: Project

O "start" Area: projstart

O "open": open. ext

O "build": Build. ext

O "additional" Area: Additions

O "end" Area: projend

· Loading: Launch

· Run: org. Eclipse. UI. Run

· "Additional" group flag: Additions

· Window: Window

O "additional" Area: Additions

O "end" Area: additionsend

· Help: Help

O "start" Area: helpstart

O "Main Group": group. Main. ext

O "tutorial group" Area: group. tutorials

O "tool group" Area: group. Tools

O "Update group" Area: group. Updates

O "end" area (sometimes not end): helpend

O "additional" Area: Additions

O "about group": group. About. ext

If the menu bar ID you provide does not contain a flag ID, your menu item will appear behind this menu bar. If you create a new menu bar ID, your menu bar is added to the "project" and "run" menus.

Eclipse developers prompt: ensure that the toolbar is consistent with the menu bar ID and flag position.

Note the "new" group icon in the "file" menu. This is where we add our own menu. Because its flag ID is new. Ext, the complete path is file/New. Ext.

 

 

Tool bar path

 

The toolbar path specifies the position of the add toolbar button. Since anyone can create a toolbar and sometimes a button can contain sub-options, we use a list of hierarchical identifiers to access this location. The following lists frequently used tool bar lists and their paths:

· File: org. Eclipse. UI. workbench. file has some common grouping signs (you can add more buttons ):

O "new" Area: New. ext

O "save": Save. ext

O "print" Area: print. ext

O "build": Build. ext

· Navigation: org. Eclipse. UI. workbench. navigate

· Loading: org. Eclipse. Debug. UI. launchactionset

· Editor: org. Eclipse. UI. Edit. Text. actionset. Presentation

· Search: org. Eclipse. Search. searchactionset

· Java element creation: org. Eclipse. jdt. UI. javaelementcreationactionset

· Group: Team

· CVS: CVs

 

 

 Example: Add menu

You may have guessed that the process of adding menu items is almost the same as that of adding toolbar buttons. You must also declare an extension (of the same type), use a specific tag (the same tag) to expand it, and write an operation class (the same class ). The main difference is the declaration of expansion. Below is the extended XML code of the menu item (there is no corresponding toolbar button ):

<Extension id = "newinvokatronaction" name = "New invokatron document action" point = "org. eclipse. UI. actionsets "> </P> <p> <actionset id =" invokatron. actionset "label =" invokatron actions "visible =" true "> <br/> <action id =" invokatron. wizard. runwizardaction "label =" New invokatron "<br/> menubarpath =" file/New. ext "<br/> icon =" icons/invokatronicon16.gif "<br/> tooltip =" starts the new invokatron document wizard. "<br/> class =" invokatron. wizard. runwizardaction "> <br/> </Action> <br/> </actionset> </P> <p> </extension>

 

 

 Example: running result

There are other features available in the action set, including shortcut keys, status buttons, floating icons, help content, and form toolbar. An operation set is only one type of extension that records dozens of extension points. Therefore, we only see the tip of the iceberg. But at least it makes us understand how the extension points work. The processes we see are all very good.

Let's take a look at the new toolbar buttons and menu items:

 

 

 

Note:

1, this article reproduced from: http://tech.163.com/05/0520/11/1K6N4H9I00091589_3.html

Http://tech.163.com/05/0520/11/1K6N4H9I00091589_2.html

 

 

 

 

 

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.