Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Oomph » Preselect default workspace location in Eclipse Launcher
Preselect default workspace location in Eclipse Launcher [message #1746284] Wed, 26 October 2016 12:50 Go to next message
Konrad Windszus is currently offline Konrad WindszusFriend
Messages: 37
Registered: July 2009
Member
I know that I can use the -data argument in the Eclipse.ini to force Eclipse to always use the given directory. This is not flexible enough for me. Is it also possible to prepropagate the "Workspace" drop down in the Eclipse Launcher with the default workspace location? How do I achieve that?
Thanks,
Konrad
Re: Preselect default workspace location in Eclipse Launcher [message #1746332 is a reply to message #1746284] Thu, 27 October 2016 07:00 Go to previous messageGo to next message
Konrad Windszus is currently offline Konrad WindszusFriend
Messages: 37
Registered: July 2009
Member
The configuration setting for this is stored (on a Mac) below
Eclipse.app/Eclipse/configuration/.settings/org.eclipse.ui.ide.prefs
and read out in the code via
new ScopedPreferenceStore(ConfigurationScope.INSTANCE,
IDEWorkbenchPlugin.IDE_WORKBENCH);
.
Can I use the setup:PreferenceTask to write values to this PreferenceStore. If yes, what of key do I have to provide for scope ConfigurationScope.INSTANCE?
Re: Preselect default workspace location in Eclipse Launcher [message #1746335 is a reply to message #1746332] Thu, 27 October 2016 07:33 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 31035
Registered: July 2009
Senior Member
Well you could use a preference task, but the preference task must run in the IDE where the preference is to be set, so of course by then it's to late to change the workspace. You can manipulate the file where it's stored directly. That's what this task that's in each project catalog does:

<?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"/>


So if you're provisioning a project setup, this should already be happening automatically...
Re: Preselect default workspace location in Eclipse Launcher [message #1746338 is a reply to message #1746332] Thu, 27 October 2016 08:09 Go to previous message
Konrad Windszus is currently offline Konrad WindszusFriend
Messages: 37
Registered: July 2009
Member
Found out that /conference/ is the right prefix (https://www.eclipse.org/forums/index.php/t/1069172/). For further information look at http://help.eclipse.org/neon/index.jsp?topic=%2Forg.eclipse.platform.doc.isv%2Freference%2Fapi%2Forg%2Feclipse%2Fcore%2Fruntime%2Fpreferences%2FConfigurationScope.html.. So just using the key
/configuration/org.eclipse.ui.ide/RECENT_WORKSPACES
with key
${workspace.location}
works.
In addition the key
 /configuration/org.eclipse.ui.ide/RECENT_WORKSPACES_PROTOCOL
has to be set to 3.

[Updated on: Thu, 27 October 2016 09:31]

Report message to a moderator

Previous Topic:Including JRE 7 with Neon
Next Topic:ResourceCopyTask appears to fail when authentication requried
Goto Forum:
  


Current Time: Mon Apr 06 19:24:45 GMT 2020

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

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

Back to the top