Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Newcomers » Newcomers » Replacement for IPluginDescriptor(Replacement for IPluginDescriptor in new eclipse version 2019-12)
Replacement for IPluginDescriptor [message #1822236] Mon, 02 March 2020 09:23 Go to next message
Priya Kumari is currently offline Priya KumariFriend
Messages: 7
Registered: March 2020
Junior Member
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 #1822257 is a reply to message #1822236] Mon, 02 March 2020 16:09 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33108
Registered: July 2009
Senior Member
You'll have to make due with methods like this one to which you can pass the names you see in the configuration elements.

org.eclipse.core.runtime.Platform.getBundle(String)


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Replacement for IPluginDescriptor [message #1822292 is a reply to message #1822257] Tue, 03 March 2020 10:23 Go to previous messageGo to next message
Priya Kumari is currently offline Priya KumariFriend
Messages: 7
Registered: March 2020
Junior Member
Can you suggest way to get Plugin based on extension.
Re: Replacement for IPluginDescriptor [message #1822316 is a reply to message #1822292] Tue, 03 March 2020 20:10 Go to previous messageGo to next message
Nitin Dahyabhai is currently offline Nitin DahyabhaiFriend
Messages: 4425
Registered: July 2009
Senior Member

To do what? Odds are there's a cleaner way to solve whatever problem led you to the Plugin instance or the plug-in descriptor.

_
Nitin Dahyabhai
Eclipse Web Tools Platform
Re: Replacement for IPluginDescriptor [message #1822433 is a reply to message #1822316] Fri, 06 March 2020 05:12 Go to previous messageGo to next message
Priya Kumari is currently offline Priya KumariFriend
Messages: 7
Registered: March 2020
Junior Member
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 #1822686 is a reply to message #1822433] Wed, 11 March 2020 11:53 Go to previous messageGo to next message
Priya Kumari is currently offline Priya KumariFriend
Messages: 7
Registered: March 2020
Junior Member
Any suggestion for above query?
Re: Replacement for IPluginDescriptor [message #1822689 is a reply to message #1822686] Wed, 11 March 2020 13:21 Go to previous messageGo to next message
Nitin Dahyabhai is currently offline Nitin DahyabhaiFriend
Messages: 4425
Registered: July 2009
Senior Member

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.


_
Nitin Dahyabhai
Eclipse Web Tools Platform
Re: Replacement for IPluginDescriptor [message #1823014 is a reply to message #1822689] Wed, 18 March 2020 07:35 Go to previous messageGo to next message
Priya Kumari is currently offline Priya KumariFriend
Messages: 7
Registered: March 2020
Junior Member
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]

Report message to a moderator

Re: Replacement for IPluginDescriptor [message #1823022 is a reply to message #1823014] Wed, 18 March 2020 09:51 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33108
Registered: July 2009
Senior Member
Probably Platform.getBundle(...).getEntry(...).

Ed Merks
Professional Support: https://www.macromodeling.com/
Previous Topic:Another Eclipse update problem...
Next Topic:How did Eclipse update from 2019-12 to 2020-03 without running the installer?
Goto Forum:
  


Current Time: Tue Mar 19 10:11:50 GMT 2024

Powered by FUDForum. Page generated in 0.04079 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top