Skip to main content



      Home
Home » Language IDEs » Java Development Tools (JDT) » Get property in "plugin.properties" file.
Get property in "plugin.properties" file. [message #230116] Thu, 25 May 2006 02:05 Go to next message
Eclipse UserFriend
Dear all,

Hi all, did anyone know how to get the property from the
"plugin.properties" file in code? For example, I defined a property in
plugin.properties and I know to use this property in the plugin class.
Thanks

Best Regards,
Eddie
Re: Get property in "plugin.properties" file. [message #230138 is a reply to message #230116] Thu, 25 May 2006 08:56 Go to previous message
Eclipse UserFriend
This can load the file (from a method within your plugin):

ResourceBundle b = ResourceBundle.getBundle("plugin",
Locale.getDefault(), getClass().getClassLoader());


plugin.properties is ONLY for localization of your plugin.xml and
MANIFEST.MF. It is not for storing plugin-configuration type
properties. i.e. if the property is not used for localization, it
shouldn't be in there.

1) if you need a config type properties file, create another .properties
file and load it into a Properties object. You can find it using
getClass().getResourceAsStream(name).

2) for config-type files, remember that for all intents and purposes
your plugin is read-only.

3) if you need configuration, why not use your plugin's preferences?

Later,
PW
Previous Topic:Checking if an IMember is @Deprecated in Eclipse 3.1
Next Topic:Non-internal equivalent to JavaSourceViewer?
Goto Forum:
  


Current Time: Sun Nov 09 06:06:01 EST 2025

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

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

Back to the top