Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Oomph » Preferences not updated on restart(When changing a preference in product.setup it doesn't get updated)
Preferences not updated on restart [message #1777322] Tue, 28 November 2017 13:28 Go to next message
Anders  Jönsson is currently offline Anders JönssonFriend
Messages: 48
Registered: January 2012
Member
Hi,
I change a preference in the product setup file and the preference is not updated upon a restart of the Eclipse IDE.

If however, I make a clean install of the IDE or even if I just create a new workspace the changed preference is loaded correctly.

Can I make Oomph detect the changed property and run the setup task when Eclipse is restarted?

The preference is a template file and the setup task looks like this:
<setupTask
xsi:type="setup:PreferenceTask"
key="/instance/org.eclipse.cdt.ui/org.eclipse.cdt.ui.text.custom_code_templates"
value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?>&lt;templates>&lt;template autoinsert=&quot;false&quot; context=&quot;org.eclipse.cdt.ui.text.codetemplates.filecomment_context&quot; deleted=&quot;false&quot; description=&quot;Comment for created C/C++ files&quot; enabled=&quot;true&quot; id=&quot;org.eclipse.cdt.ui.text.codetemplates.filecomment&quot; name=&quot;filecomment&quot;>/* &amp;gt; Copyright XXX AB&#xA; ***********************************************************************************&#xA; * *&#xA; * The copyright to the computer programs herein is the property of... etc, etc... &#xA; * *&#xA; ***********************************************************************************&#xA; */&#xA; "/>

///Anders
Re: Preferences not updated on restart [message #1777326 is a reply to message #1777322] Tue, 28 November 2017 13:49 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 29552
Registered: July 2009
Senior Member
I see it's an XML preference and without specialized merging support, we will not replace an XML value with a different value; that's why it works when you create a new workspace, but not in an existing workspace. So we have
      registry.put(URI.createURI("//instance/org.eclipse.jdt.ui/org.eclipse.jdt.ui.text.custom_code_templates"), new Factory()
      {
        public PreferenceHandler create(URI key)
        {
          return new XMLPreferenceHandler(key, "template", new String[] { "context", "description", "name" }, null);
        }
      });
The last time this issue came up on the forum we talked about some attribute or annotation you could put on the preference task to force it to overwrite the existing preference value (which could replace/overwrite some user's own custom templates)...
Re: Preferences not updated on restart [message #1777328 is a reply to message #1777326] Tue, 28 November 2017 14:08 Go to previous messageGo to next message
Anders  Jönsson is currently offline Anders JönssonFriend
Messages: 48
Registered: January 2012
Member
Thanks,

An option to force a preference to be updated sounds like a good idea.
There could be a difference between overwriting only the "default" preference and to overwrite "everything" including user prefs. I,e, a parameter with two different options.

I believe overwriting everything is the functionality I need.

///Anders
Re: Preferences not updated on restart [message #1777334 is a reply to message #1777328] Tue, 28 November 2017 15:11 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 29552
Registered: July 2009
Senior Member
Many of these preferences that are XML-based are effectively lists of things (e.g., named formatter profiles), so ideally the task would only merge/modify the one profile not replace the entire list... But in many cases, replacing everything in the case of a dedicated workspace/product, is perfectly acceptable.... I'm not sure a bugzilla enhancement request is open yet, so please open one.
Re: Preferences not updated on restart [message #1777473 is a reply to message #1777334] Wed, 29 November 2017 14:45 Go to previous messageGo to next message
Anders  Jönsson is currently offline Anders JönssonFriend
Messages: 48
Registered: January 2012
Member
Bugzilla opened:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=527920
///Anders
Re: Preferences not updated on restart [message #1777474 is a reply to message #1777473] Wed, 29 November 2017 14:47 Go to previous message
Anders  Jönsson is currently offline Anders JönssonFriend
Messages: 48
Registered: January 2012
Member
The bugzilla name is:
"Attribute to force overwrite of preference in setup task"
Previous Topic:Working set Location predicate on different platforms
Next Topic:Problem with certain setup elements not having an effect
Goto Forum:
  


Current Time: Tue Sep 25 17:53:37 GMT 2018

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

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

Back to the top