Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » Changing Eclipse preferences programmatically
Changing Eclipse preferences programmatically [message #332168] Wed, 08 October 2008 10:28 Go to next message
Eclipse UserFriend
Originally posted by: j4r0d.hotmail.com

Hello,

I have tried the following code for changing the eclipse preferences; more
precisely the JDK compliance level and the contextual launch option.
I have placed the following code in the start method of my plugin Activator
class.


Preferences nodeCore = new DefaultScope().getNode("org.eclipse.jdt.core");
if (nodeCore != null) {
nodeCore.put("org.eclipse.jdt.core.compiler.source", "1.3");
nodeCore.put("org.eclipse.jdt.core.compiler.compliance", "1.3");
nodeCore.put("org.eclipse.jdt.core.compiler.problem.assertIdentifier ",
"ignore");
nodeCore.put("org.eclipse.jdt.core.compiler.problem.enumIdentifier ",
"ignore");
}

Preferences nodeUI = new DefaultScope().getNode("org.eclipse.debug.ui");
if (nodeUI != null)
nodeUI.putBoolean("org.eclipse.debug.ui.UseContextualLaunch ", false);


Then when I run Eclipse and I go to the preferences menu, unfortunately, I
can see that the compiler compliance level is still 6.0 and the contextual
launch option is still turned on.

Why is my code not working? What is the problem?

Thanks in advance for your help.

--
J.
Re: Changing Eclipse preferences programmatically [message #332174 is a reply to message #332168] Wed, 08 October 2008 12:25 Go to previous messageGo to next message
Paul Webster is currently offline Paul WebsterFriend
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

What if you use InstanceScope?

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/ganymede/index.jsp?topic=/org.eclips e.platform.doc.isv/guide/workbench.htm


Re: Changing Eclipse preferences programmatically [message #332176 is a reply to message #332174] Wed, 08 October 2008 12:57 Go to previous message
Eclipse UserFriend
Originally posted by: j4r0d.hotmail.com

Oh lord,

you saved my life ;-)

Thx!



"Paul Webster" <pwebster@ca.ibm.com> wrote in message
news:gci985$pcv$4@build.eclipse.org...
> What if you use InstanceScope?
>
> 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/ganymede/index.jsp?topic=/org.eclips e.platform.doc.isv/guide/workbench.htm
Previous Topic:Adding plugins through natures?
Next Topic:Contributing command to popup submenu
Goto Forum:
  


Current Time: Tue Jul 16 16:40:16 GMT 2024

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

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

Back to the top