Set the appearance and preferences of the eclipse RCP Program

Source: Internet
Author: User

RCP ApplicationProgramThe default appearance is a blank window. Generally, we need to customize the interface through a workbenchadvisor class. Workbenchadvisor has many callback methods. You can set menus, toolbar, status bar, progress bar, and perspective switching tools in the prewindowopen () method. For details, see fillactionbars () add menu items and toolbar items in the method, and specify the preferred perspective in the getinitialwindowperspectiveid () method.

By default, the perspective switching tool is located in the upper-left corner of the window. In eclipse, you can change its position through window-> preferences-> workbench-> appearance. How can you use a program to control it? There are two methods. The first method is to use the followingCodeSet the variables in ipreferencestore:

Ipreferencestore apistore =Prefutil. getapipreferencestore (); apistore. setvalue (iworkbenchpreferenceconstants. dock_perspective_bar, iworkbenchpreferenceconstants. top_right );

Another method is to create a file named plugin_customization.ini in the directory where the plugin is located, and write the following content:

Your. plugin. ID/dock_perspective_bar = topright

Other preference values related to plugin can be set in the same way.

Update: in the latest version of eclipse 3.1m5a, the customization method for the RCP Application menu and toolbar has changed. You should use the newly added actionbaradvisor class to complete this work.

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.