Skip to main content



      Home
Home » Eclipse Projects » Eclipse Platform » Replacement for getDescriptor().getPluginClassLoader()
Replacement for getDescriptor().getPluginClassLoader() [message #324983] Tue, 05 February 2008 05:28 Go to next message
Eclipse UserFriend
Can I replace the following lines of code :

ResourcesPlugin.getDefault().getDescriptor().getPluginClassL oader()

With:

ResourcesPlugin.getDefault().getClass().getClassLoader()

Where ResourcePlugin is my plugin, and getDefault() method returns the
plugin instance.
Re: Replacement for getDescriptor().getPluginClassLoader() [message #324994 is a reply to message #324983] Tue, 05 February 2008 09:31 Go to previous messageGo to next message
Eclipse UserFriend
If it works, then ... maybe :-)

You can get your Bundle to load classes for you (correctly) by getting
your Bundle (you can use Platform.getBundle()) and then calling
Bundle#loadClass(*)

if you are trying to get the classloader to create ResourceBundles, have
a look at the archives for this group or eclipse.platform.rcp ... there
was a thread on this in the last 2 months which (IIRC) has a solution.

PW


--
Paul Webster
http://wiki.eclipse.org/Platform_Command_Framework
http://wiki.eclipse.org/Command_Core_Expressions
http://wiki.eclipse.org/Menu_Contributions
http://wiki.eclipse.org/Menus_Extension_Mapping
http://help.eclipse.org/help33/index.jsp?topic=/org.eclipse. platform.doc.isv/guide/workbench.htm
Re: Replacement for getDescriptor().getPluginClassLoader() [message #325031 is a reply to message #324994] Wed, 06 February 2008 08:07 Go to previous message
Eclipse UserFriend
I had a look into the post that Paul mentioned, i.e. by using the
FileLocator.find() to locate and load the ResourceBundles under the
plugin. But there is a difference in the way how the .properties files are
made available inside the plugin in both the cases. In short, while using
ResouceBundle.getBundle() the translated files are under "src" folder of
plugin with the locale attributes appended to the file name (e.g.
MyResources_fr_FR.properties), where are in case of FileLocator().find()
the files are expected in a different way. There should a folder called
"nl" in the plugin and the each of the translated files has same name but
located in different folder (nl/fr/FR/MyResources.properties). Can some
body suggest me which is the better approach with pros/cons of each one.

Warm Regards,
Rajesh
Previous Topic:Proxy Settings and plugincustomization, core.net.prefs
Next Topic:Default vs Launcher VM Args
Goto Forum:
  


Current Time: Wed Sep 17 14:24:13 EDT 2025

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

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

Back to the top