Bundle provides information for obtaining plug-ins. You can use the following method to obtain the plug-in information.
Platform. getbundle (symbolicname );
For example
Bundle bundle = platform. getbundle ("org. Eclipse. UI. Views ");
1. Bundle. getentry ("/"); ---- obtain the URL of the plug-in installation directory
2. Bundle. getsymbolicname () ---- return a unique plug-in identifier (string type), consistent with the bundle-symbolicname statement in the manifest. MF File
3. Bundle. getheaders () ---- return the dictionary of the header and value defined by the menifest. MF file of the plug-in (key-Value Pair)
This key-value pair can be enumerated and printed.
For example:
Bundle-Name: bundle. getheaders (). Get ("bundle-name"); // return the plug-in name.
Version: bundle. getheaders (). Get ("bundle-version") // return the plug-in version.
4. Bundle. getstate () ---- return the current status of the plug-in. constants corresponding to the status value can be found in the bundle class, such as bundle. Active and bundle. starting.
5. Bundle. getbundleid () ---- unique identifier of the returned plug-in (long type), which is allocated by ECLIPSE during the installation package.
6. Platform. getresourcebundle (bundle): return the plug-in resource package object (Java. util. resourcebundle) corresponding to the current region ).
The information in this package object will be stored as the plugin. properties file in the plug-in installation directory after the plug-in is released.
// Pending