Eclipse RCP startup Modification

Source: Internet
Author: User
As required by the project, the Login Dialog Box is displayed before eclipse RCP starts. After logon, the function module is assigned according to the permissions of the user. You can
Platformui. createandrunworkbench (display, new ideworkbenchadvisor ());
I have done this before, but it is a problem to load various views. Therefore, the solution is as follows.
To enable rcp to start and load the plug-in based on the module in the database, you must determine the plug-in and remove the plug-ins that do not belong to the current user from the plug-in registry. Extensionregistry provides the removeextension method, but you need to pass a token, which is created at system startup and is private in this class, so you have to first get the token: Object token through reflection;
Extensionregistry exregulatory = (extensionregistry) Platform
. Getextensionregistry ();
Try {
Field field = exregulatory. getclass (). getdeclaredfield ("mastertoken ");
Field. setaccessible (true );
Token = field. Get (exregulatory );
} Catch (exception e ){
Return;
}

Then you can
(Extensionregistry) exregulatory). removeextension (exts, token );
The specified plug-in has been deleted.

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.