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.