Replacement for IPluginDescriptor [message #1822236] |
Mon, 02 March 2020 09:23  |
Eclipse User |
|
|
|
We have eclipse plugin application build on eclipse version 4.3 which used IPluginDescriptor. Now, we want to build the same application on latest eclipse version i.e. eclipse 2019-12. While doing so we are facing issues with deprecated interface for example IPluginDescriptor.
As found from eclipse forums IPluginDescriptor was only supported by by plug-ins which explicitly require the org.eclipse.core.runtime.compatibility plug-in. But this is not used anymore as eclipse 4.6 removed it.
What is replacement for "org.eclipse.core.runtime.compatibility" or "IPluginDescriptor" in latest eclipse version 2019-12.
Below is the code that we need to modify which requires replacement of IPluginDescriptor :
IPluginDescriptor pluginDescriptor =
getRootElement().getDeclaringExtension().getDeclaringPluginDescriptor();
return pluginDescriptor.getPlugin();
Looking for your response.
Regards
Priya
|
|
|
|
|
|
Re: Replacement for IPluginDescriptor [message #1822433 is a reply to message #1822316] |
Fri, 06 March 2020 05:12   |
Eclipse User |
|
|
|
Below is the piece of code :
/**
* Discovers the ProviderLocation extensions and loads the pluginList
*
* @param registry The plugin registry to search for the extension
*/
private void discoverProviders(IExtensionRegistry registry)
{
IExtensionPoint myPoint =
registry.getExtensionPoint(PLUGIN_ID, PROVIDER_EXTENSION);
if (myPoint == null)
{
/* No extensions found for the ProviderLocation, no sweet. We just
* move on.
*/
return;
}
IExtension[] extensions = myPoint.getExtensions();
for (int i = 0; i < extensions.length; i++)
{
String pluginName = "";
try
{
Plugin plugin =
extensions[i].getDeclaringPluginDescriptor().getPlugin();
if (pluginList_.containsKey(plugin))
{
continue;
}
IConfigurationElement[] elements =
extensions[i].getConfigurationElements();
pluginName = elements[0].getAttribute(EXTENSION_NAME);
The line highlighted in bold is giving error as getDeclaringPluginDescriptor() has been deprecated.
Could you please suggest what can be used here??
|
|
|
|
Re: Replacement for IPluginDescriptor [message #1822689 is a reply to message #1822686] |
Wed, 11 March 2020 13:21   |
Eclipse User |
|
|
|
It would be better to understand what you needed the object for, otherwise it's not clear what the answer should be.
For example, to get the plug-in ID, you can call IExtension#getContributor() and then just ask the IContributor its name. I don't know if that's what you actually needed from the Plugin or descriptor object, though.
|
|
|
Re: Replacement for IPluginDescriptor [message #1823014 is a reply to message #1822689] |
Wed, 18 March 2020 07:35   |
Eclipse User |
|
|
|
Thanks for the suggestion. Currently it has resolved my one of compilation issue.
Another suggestion which I could need is replacement for getPluginRegistry() in below line of code or way to get appropriate value :
System.setProperty("javax.net.ssl.trustStore", Platform.getPluginRegistry().getPluginDescriptor("com.abc.xyz").find(new Path("wb-server.jks")).getPath());
I tried to use getExtensionRegistry() in place of getPluginRegistry() but could not find appropriate method which will return a String which is required for System.setProperty.
Can you provide a way to handle this?
[Updated on: Wed, 18 March 2020 13:44] by Moderator Report message to a moderator
|
|
|
|
Powered by
FUDForum. Page generated in 0.08555 seconds