Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Oomph » Preference not taking effect?(Default perspective not changing)
Preference not taking effect? [message #1822840] Sun, 15 March 2020 13:38 Go to next message
Sina MadaniFriend
Messages: 156
Registered: November 2015
Location: York, UK
Senior Member
Hi,

I am trying to change the default perspective on an automated Eclipse install using Oomph, but no matter what I try it doesn't seem to work. I have tried placing the preference both inside and/or outside the "Product Version" element(s), tried with various keys and still it doesn't work. Am I doing something wrong or misunderstanding how Preferences work in Oomph? (see also attached image)

Thanks.
Re: Preference not taking effect? [message #1822846 is a reply to message #1822840] Sun, 15 March 2020 15:10 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 32111
Registered: July 2009
Senior Member
I think that's a tricky one. After all, by the time the preference task runs in the IDE, the default perspective will already have been created. So it's kind of an odd preference to store in instance scope; after all when is it used?

The value is stored in <workspace>/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.ui.prefs. So if you had a Resource Creation task you could create this resource and that could work if you're defining a project setup that configures a workspace. But it sounds like you want a Product setup and there the workspace location of course is not known (and there can be multiple). Even if you had a resource creation task in the product setup, it too would run after the IDE is already open on a workspace at which point the default perspective too would already be created.

It seems a bit tricky looking at this:

https://stackoverflow.com/questions/37819588/setting-default-perspective-in-config-ini-eclipse-ide

But you don't want to change the actual plugin_customization.ini of the product bundle because that's shared across installations...

There is this alternative approach:

https://stackoverflow.com/questions/24002530/how-can-i-specify-eclipse-preferences-using-plugin-customization-ini

Such an argument could be added with an Eclipse Ini task and the resource could be created with a Resource Creation task perhaps similar to this one that creates the resource in the installation's configuration folder:
<?xml version="1.0" encoding="UTF-8"?>
<setup:ResourceCreationTask
    xmi:version="2.0"
    xmlns:xmi="http://www.omg.org/XMI"
    xmlns:setup="http://www.eclipse.org/oomph/setup/1.0"
    content="MAX_RECENT_WORKSPACES=5&#xD;&#xA;RECENT_WORKSPACES=${workspace.location|property}&#xD;&#xA;RECENT_WORKSPACES_PROTOCOL=3&#xD;&#xA;SHOW_WORKSPACE_SELECTION_DIALOG=true&#xD;&#xA;eclipse.preferences.version=1"
    targetURL="configuration:/.settings/org.eclipse.ui.ide.prefs"/>

Probably best that you figure out what you'd need to change manually in a given installation's folder such that when it opens a new workspace it opens the perspective you want, and then use setup tasks to automate that.


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Preference not taking effect? [message #1822920 is a reply to message #1822846] Mon, 16 March 2020 19:57 Go to previous message
Sina MadaniFriend
Messages: 156
Registered: November 2015
Location: York, UK
Senior Member
Thank you for your suggestion. I also found this article to be useful. I added a .properties file with the correct key-value preference, and I refer to this file in the eclipse.ini (with -Declipse.pluginCustomization=epsilon.properties) and it worked! I also added defaultPerspectiveId=org.eclipse.epsilon.perspective.EpsilonPerspectiveFactory to <eclipse>/configuration/.settings/org.eclipse.ui.ide.prefs, although this file has to be created as part of the install (it isn't there until Eclipse is launched for the first time).
Previous Topic:Complete reference for all concepts in Oomph?
Next Topic:Filter on Java version >= 11
Goto Forum:
  


Current Time: Mon Dec 06 20:15:11 GMT 2021

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

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

Back to the top