Wrap the SWT into a place that needs to be modified by plugin.

Source: Internet
Author: User

Put a SWTProgramIt is easy to package it into eclipse as a plug-in, but pay attention to the following points:

1. Eclipse's "pdtools-> convert projects to plug-in projects" can generate the files required by the plug-in project. Note that SWT is used in classpath. the jar reference should be changed to manifest. in the MF file. eclipse. ui dependency.

2. Use classloader in SWT for relative path files. if the file referenced by the getresourceasstream () method is not found in plugin, it should be changed to filelocator. tofileurl (platform. getbundle ("plugin. ID "). getentry ("/images ")). getFile (); or an equivalent method.

3. Reference to the DLL file of the static Link Library required by the local method. If the SWT program is specified in the startup parameter, it needs to be modified in the plugin, you can add it to path in the system environment variable.

4. The SWT program's entry class is generally replaced by plug-in elements such as editor or view. Note that the variables initialized in the entry class should also be changed to plug-in, especially static variables, correct initialization to prevent nullpointerexception.

5. If necessary, use the jface and other plugin features to rewrite the original SWT dialog box, tree, table, and other elements to make the UI more plug-in style.

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.