Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » ConfigurationScope is not working
ConfigurationScope is not working [message #645600] Sat, 18 December 2010 15:30 Go to next message
bachra04  is currently offline bachra04
Messages: 148
Registered: April 2010
Senior Member
Hi Experts,

I tried the following code and it works as expected:

IScopeContext configContext = new InstanceScope();
EclipsePreferences configurationNode = (EclipsePreferences) configContext.getNode(Activator.PLUGIN_ID);
configurationNode.put(key, value);
saveNode(configurationNode);

So that the preferences are stored correctly and have a workspace scope.

My problem comes with the ConfigurationScope:

IScopeContext configContext = new ConfigurationScope();
EclipsePreferences configurationNode = (EclipsePreferences) configContext.getNode(Activator.PLUGIN_ID);
configurationNode.put(key, value);
saveNode(configurationNode);

The code is executed successfully and I can see the contents of the configurationNode. But once I restart Eclipse, everything is gone.

Do you have any idea what can be missing ?

Thanks
Re: ConfigurationScope is not working [message #647162 is a reply to message #645600] Tue, 04 January 2011 19:52 Go to previous messageGo to next message
Paul Webster is currently offline Paul Webster
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

Are you in a multi-user install, or any install where the configuration
area is read-only?

new ConfigurationScope().getNode(PLUGIN_ID) and using get and put seem
to be enough for other examples.

PW


--
Paul Webster
http://wiki.eclipse.org/Platform_Command_Framework
http://wiki.eclipse.org/Command_Core_Expressions
http://wiki.eclipse.org/Platform_Expression_Framework
http://wiki.eclipse.org/Menu_Contributions
http://wiki.eclipse.org/Menus_Extension_Mapping
http://help.eclipse.org/galileo/index.jsp?topic=/org.eclipse .platform.doc.isv/guide/workbench.htm


Re: ConfigurationScope is not working [message #647168 is a reply to message #647162] Tue, 04 January 2011 20:18 Go to previous message
bachra04  is currently offline bachra04
Messages: 148
Registered: April 2010
Senior Member
Hi Paul,

Thank you for your reply.

I actually have found that the problem occurs only when I run a new instance of eclipse from inside my Dev eclipse (in order to debug my code)

When I run it as a standalone eclipse it works fine.
Previous Topic:Programmatically add Buttons to Toolbar during runtime
Next Topic:closing a web browser editor
Goto Forum:
  


Current Time: Wed Oct 01 18:32:09 GMT 2014

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

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