About the right-click menu in JFace Action class, Actgiongroup class, Menumanager class

Source: Internet
Author: User

Action class, Actiongroup class, Menumanager class introduction

The menu in SWT is the mean class, and the use of the menu class has been described in the previous section.

Menu items are implemented using the Meauitem class. But in actual development, the same function will have a multi-medium representation,

For example: "New" feature in Eclipse, he will appear in main menu, main toolbar, right-click menu,

If you are using Meanuitem to achieve, you need to write three code, and then maintain three code. Of course you can handle the time

It is inconvenient to write external classes to share code, but names, images, and some other information are written as external classes to share.

The JFace package already provides a solution to the above problems, JFace provides an action class that will name,

Images, action handlers, and so on, so you can share these actions to form menu items, toolbar buttons, and so on.

Of course at the bottom of the end for the menu or MenuItem object, the action is converted to MenuItem is by the

Menumanager (menu manager) to complete. Menumanager simplifies the creation of menus, once a

The Menumanager object can be generalized to the menu bar, pop-up menu, and toolbar drop-down menu.

Other than that. An action written in one class can be messy. JFace also provides a Actiongroup class for unified management of action.

Then let the outside program access the action via Actiongroup. Of course, Actiongroup is not the class that is required to use action. Just use it to be better.

About the right-click menu in JFace Action class, Actgiongroup class, Menumanager class

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.