Reputation: 1042
I am currently developing a Java RCP with Eclipse RCP which has a plugin.xml where one can find information like ID, version, Name, plattform, and so on....
Now, my question is, whether it is possible to somehow access the plugin.xml from my java code. Is it for example possible to load the ID into a therefor created variable?
edit I want to access the ID you can find when you open the plugin.xml file with the plug-in manifest editor. I tried the approach with Platform.getBundle("plugin.xml"), but I only received an object refering to null.
edit2 I also tried Platform.getProduct().getId(); but it seems getProduct() also returns null. Does anyone have a clue why those two approaches mentioned above do not work? Or does anyone have a proper solution for accessing the ID?
Thanks in advance.
Regards, kain
Upvotes: 2
Views: 1257
Reputation: 373
You can use Platform.getBundle("symbolic.name") to get the reference to your plugin. You can get version number and id from the Bundle object. http://www.osgi.org/javadoc/r4v43/org/osgi/framework/Bundle.html
Upvotes: 1