Bug 32147 - using -data is not intuitive enough
Summary: using -data is not intuitive enough
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 2.1   Edit
Hardware: All All
: P2 major with 11 votes (vote)
Target Milestone: 3.0 M8   Edit
Assignee: Andrew Eidsness CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 46379 (view as bug list)
Depends on: 50006 54179
Blocks: 37681 48686
  Show dependency tree
 
Reported: 2003-02-18 13:10 EST by Adam Kiezun CLA
Modified: 2004-04-26 10:11 EDT (History)
16 users (show)

See Also:


Attachments
Dialog to allow workspace selection on startup (29.28 KB, application/zip)
2004-03-04 10:07 EST, Andrew Eidsness CLA
no flags Details
adds version checking in the ide (52.68 KB, patch)
2004-03-05 15:14 EST, Andrew Eidsness CLA
no flags Details | Diff
handle case where selected workspace does not exist (70.21 KB, patch)
2004-03-08 18:09 EST, Andrew Eidsness CLA
no flags Details | Diff
contains workaround for bug#54081 (70.40 KB, patch)
2004-03-09 10:07 EST, Andrew Eidsness CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Adam Kiezun CLA 2003-02-18 13:10:54 EST
we have this question asked on the newsgroup every week
and i see it asked on other forums too:
'how to updgrade from eclipse build X to build Y?'

seems like using -data is just something nobody ever comes up with
we should provide some help for people here
vame had something, other ides have something too: you can point the ide to a 
workspace

we could ask on startup - that would be good
current solution is not intuitive to anyone

marking as major, since when we ship 2.1 there'll be thousands of frustrated 
people copying their workspaces thinking that this is the way to upgrade
Comment 1 Jon Skeet CLA 2003-02-20 09:16:28 EST
A few ideas:

1) Within Eclipse, an option to "Move Workspace" would help before the upgrade
2) Within Eclipse, an option to "Change Workspace" would make life easier
   for some people, of possible. (May well not be possible, given that some
   configuration changes require a restart of Eclipse...)
3) Possibly have another launcher which allows:
   o Twiddling of VM, options etc
   o Selection of workspaces from "recently used" list

Feature 3 would involve keeping a file with last-used options and existing
workspaces in "some well known place" - not sure where that would be.
Comment 2 Jonathan Gossage CLA 2003-02-20 11:02:54 EST
If you go the route of asking at startup what workspace to use I think that 
this should only happen if the -data command line argument has not been 
specified. In addition, The dialog should indicate that the permanent solution 
is to add a -data argument to the command line.

Regards

Jonathan Gossage
Comment 3 Jon Skeet CLA 2003-02-20 11:36:55 EST
My suggestion was for a separate actual executable which would be launched, and
which would in turn launch Eclipse itself.

However, I think if we went down this route, we should have some kind of option
on eclipse.exe itself to use the "current set of defaults".
Comment 4 Oleg Shteynbuk CLA 2003-02-20 22:58:34 EST
separate executable, sort of an installation program,  could be an easiest and 
non-intrusive solution.

My guess is that some users are not aware of -data option, I was not aware of 
this option until I start writing ant script for eclipse upgrade. 

For users that not aware of - data the script will copy workspace, for others 
it is an optional property in the script; it could be similar to Jon's first 
point from comment #1.

The script has no dialog for now, everything thru Ant properties, but they 
could be set thru dialog, the script has "some well known place" for previous 
installation, and eclipse.bat is generated with different options including -
data, vm options; could be simular to feature 3 from Jon's comment #1,

Main benefits of the script come from external plugin directory that is a 
different issue but often related in a sense that user installed plugins can 
add to users frustration when upgrading eclipse, at least from my experience.

You can look at the script at 
http://home.nyc.rr.com/olegs/eclipse/antscript/readme.htm
Comment 5 Ron Baldwin CLA 2003-02-21 02:26:28 EST
You should be able to set and change the workspace directory from within the
Eclipse UI.  Users do not expect, and should not have to resort to, using the
command line to set a non-standard workspace dir, or change workspaces.

In addition, Eclipse should definitely ask the user where to put the workspace
the first time it is run (related bug 26756).
Comment 6 Oleg Shteynbuk CLA 2003-02-21 13:15:34 EST
No disagreement that having GUI is better than command line, in todo section of 
the readme file I mention it under todo section. 

When I switched to Eclipse I had very vague idea what Eclipse workspace meant 
and having default workspace was very helpful and seems to be consistent with 
having default project folders and default plugin directory. You can use 
external project folders, external plugin directory too. I would argue that one 
does not need to be an Eclipse expert in order to use Eclipse. Users who 
understand what workspace is can use  - data option without any problem.

Comment 7 Peter Manahan CLA 2003-02-22 14:41:15 EST
A separate execuatble is how WSAD launches a different workspace. We default to
the Windows default user dir and on Linux to the home dir. Once selected we save
it off to a prefence (registry on windows) ~/.wstools/workspace on linux. There
is also a checkbox to turn it off and a -setworkspace flag to turn it on. We
found it to be useful. Its fairly simple.  I'll see about getting it contributed.
Comment 8 Andre Weinand CLA 2003-02-24 04:33:12 EST
[Here is the MacOS X point of view (as reported some tiem ago in bug 23863). I've 
changed platform and OS to All, since the problem is not Win2k specific]

Mac UI applications are not started via the command line but by double-clicking. As a 
consequence Eclipse's execution options are not easily accessible. The not-Mac-like 
work around is to specify the execution arguments by editing a (normally invisible) file 
within the application bundle. Since this is rather static, the user has to duplicate the 
60MB Eclipse application if she wants to work with multiple workspaces.

It would be more Mac-like to have an initial dialog to choose from recent workspaces, or 
to have a file which is associated with Eclipse so that  a double click would lauch Eclipse 
with the correct workspace. 
In addition it would make sense to have some of the execution options on a preference 
page and would apply after a restart.
Comment 9 Andre Weinand CLA 2003-02-24 04:38:01 EST
BTW, bug 5509 is closely related to (if not even a duplicate of) this one too.
Comment 10 Martin Möbius CLA 2003-02-24 12:18:25 EST
I filed a similar br too
http://bugs.eclipse.org/bugs/show_bug.cgi?id=24896
Comment 11 Nick Edgar CLA 2003-03-13 16:51:45 EST
The eclipse.exe shipped with Eclipse is a bare-bones launcher.
Eclipse-based products like WSAD typically improve on it, e.g. by adding a 
prompt for workspace location.
We would like to improve the launcher, but this will not happen for 2.1.

We will document in the README how to migrate from one release to another.
Comment 12 Ringo De Smet CLA 2003-04-18 16:19:00 EDT
While the additional functionality to select the proper workspace is not yet in
place, I would like to have /Users/<uid>/Projects as the default workspace
folder on MacOS X. Is this possible, now that a real Eclipse launcher is in
place for this platform? Andre, comments?

Ringo
Comment 13 Andre Weinand CLA 2003-04-22 04:27:23 EDT
Yes, that should work since last night.
Just edit your Info.plist file and change "workspace" to "~/Projects/workspace" 
Comment 14 Randy Hudson CLA 2003-06-02 15:40:23 EDT
What ever happened to the prompt in VA Micro Edition?  That's what is needed 
here.
Comment 15 Eric Estievenart CLA 2003-11-05 04:35:23 EST
I think that the easier solution would be,
when eclipse is launched the first time
(there is no workspace forder in ECLIPSE_HOME/ )
to show a dialog prompting for either :
 - new workspace creation (can be in ECLIPSE_HOME or somewhere else)
 - use of an old workspace stored somewhere
Then if the workspace is not in ECLIPSE_HOME/workspace,
create a dummy workspace there with a file pointing to the
real workspace, so that next runs will not prompt for the workspace.
Comment 16 John Arthorne CLA 2003-11-10 17:47:22 EST
*** Bug 46379 has been marked as a duplicate of this bug. ***
Comment 17 Nick Edgar CLA 2004-01-27 13:32:21 EST
Investigate prompt for workspace on startup for M8.
Comment 18 Nick Edgar CLA 2004-02-09 14:35:20 EST
With the RCP changes and changes to Runtime, it is now possible for the primary 
application to bring up a prompter to choose the Workspace location before the 
Workbench is brought up.

For example, if you add the following to run() after Display creation but 
before Workbench creation, it will prompt you for the directory to use.
Note that in order for (!Platform.hasInstanceData()) to pass, you'll need to 
add -noDefaultData to the command line for now (whether or not you're 
specifying -data).

		if (!Platform.hasInstanceData()) {
		    IPath instanceLoc = promptForInstanceLoc(display);
			if (instanceLoc == null) {
			    return IPlatformRunnable.EXIT_OK;
			}
			Platform.setInstanceLocation(instanceLoc);
			Platform.lockInstanceData();
		}
		

    /**
     * Prompts for an instance location (workspace folder).
     * 
     * @return the instance location, or <code>null</code> if the user cancels.
     */
    private IPath promptForInstanceLoc(Display display) {
        Shell shell = new Shell(display);
        DirectoryDialog dialog = new DirectoryDialog(shell);
        dialog.setText("Select Workspace Directory");
        dialog.setMessage("Select the workspace directory to use.");
        String dir = dialog.open();
        shell.dispose();
        return dir == null ? null : new Path(dir);
    }


The code above is just a proof of concept though.  For M8, we should have a 
dialog like:

title: "Choose Workspace directory"
message: Choose the directory to use as the workspace location.

It will have a combo box remembering the recently used workspace locations (5 
max, in MRU order), and a Browse button that will bring up a directory chooser 
in case it's not in the MRU list.

It will have an OK and Cancel button.  OK will only be enabled when the user 
has chosen a valid workspace location (i.e. a valid folder).
Cancel will exit immediately without bringing up the Workbench.

Comment 19 Nick Edgar CLA 2004-02-09 14:36:17 EST
The run() method referred to above is in IDEApplication.
Comment 20 paul moore CLA 2004-02-23 16:22:47 EST
I like the vs.net solution idea. 
A workspace should be an associated set of projects. And I can then chosose to 
open whichever one I like. 
The only problem with mapping this to a workspace is that the workspace 
persists all my settings including ones that I want regardless of which 
workspace I have open (like code format options ,....)

I have tried using Working Sets but that feels kind of a glued on after thought.
Comment 21 Andrew Eidsness CLA 2004-03-04 10:07:09 EST
Created attachment 8328 [details]
Dialog to allow workspace selection on startup

The attached patch opens a workspace selection dialog during ide startup.  This
works on top of the recent runtime changes to the -data command line option as
follows:

-data xxx: same as current behaviour, dialog is not displayed, command line
parameter is used as the workspace
-data not given: dialog is opened, user selects workspace
-data @none: ide's always require a workspace, application exits
-data @noDefault: dialog is opened, on first use a safe default is generated
and displayed

Outstanding issues:

1. If the user selects a workspace that is already in use, they should be given
the opportunity to select a new one.  Waiting for a runtime change to allow
this functionality, the current patch displays an error dialog and the
application exits.

2. The version check (Bug#48686) should be moved to this startup procedure, so
the user has a chance to change their selection if they have chosen a workspace
from an older version of the application.  Waiting for the same change
described in #1.

So, this current patch implements most of the bells but a few whistles are
missing.
Comment 22 Jeff McAffer CLA 2004-03-04 16:57:05 EST
We have released new API setURL(URL, boolean) where the boolean says whether or 
not to lock.
Comment 23 Andrew Eidsness CLA 2004-03-05 15:14:25 EST
Created attachment 8366 [details]
adds version checking in the ide

This patch adds version checking to the ide.  It will need to be committed in
concert with jeff's change to take version checking out of the runtime.
Comment 24 Andrew Eidsness CLA 2004-03-08 18:09:51 EST
Created attachment 8423 [details]
handle case where selected workspace does not exist

The previous version would fail if the selected workspace did not exist.  The
runtime part of the solution is described by bug#54085; this is the ui half of
the fix.

This patch also prunes some unused values from messages.properties.
Comment 25 Nick Edgar CLA 2004-03-08 22:15:20 EST
Patch plus workaround for bug 54081 released to HEAD for the nightly build, but 
not submitted to the integration build.  Need to test on GTK and Mac.
Comment 26 Andrew Eidsness CLA 2004-03-09 10:07:39 EST
Created attachment 8434 [details]
contains workaround for bug#54081

This patch changes IDEApplication to use an URL constructor rather than
File.toURL to get around bug#54081 where the runtime seems to have troubles
with a path containing a leading slash.
Comment 27 Nick Edgar CLA 2004-03-15 00:09:43 EST
Andrew, can you please verify this on the Mac and GTK?
Comment 28 Andrew Eidsness CLA 2004-03-15 11:07:55 EST
I wasn't able to get eclipse to run at all on the mac (not even the mar 10 
integration build).

On gtk I got the same behaviour as xp.

1) Running with -data someDir, does not open the prompt -- intended behaviour
2) Running with -data @noDefault, opens the prompt -- intended behaviour
3) Running without -data does not open the prompt -- unintended behaviour, but 
this case is explained by a known problem where the resources plugin is 
accessing the instance area too early.
Comment 29 Nick Edgar CLA 2004-03-15 11:46:00 EST
Patch released and tested as best we can for now.  Closing.
Comment 30 Andre Weinand CLA 2004-03-17 10:52:38 EST
All 3 cases work just fine on Panther (Mac OS X 10.3.3) and Java 1.4.2_03
Cool.

Will verify later today for Jaguar.
Comment 31 Nick Edgar CLA 2004-03-17 11:03:07 EST
Thanks Andre.
Comment 32 Andre Weinand CLA 2004-03-25 05:35:42 EST
Verified 3 cases for jaguar too.
Comment 33 Ines Khelifi CLA 2004-03-25 13:09:15 EST
Verified on Windows XP with Build id: 200403250800.
Comment 34 Gunnar Wagenknecht CLA 2004-04-26 10:07:59 EDT
The workspace prompt dialog is gone in builds >= I20040420. Please see bug 
59897.
Comment 35 Andrew Eidsness CLA 2004-04-26 10:11:53 EDT
The workspace dialog going away is described by bug 59274.  The fix has been 
submitted and will be in the next integration build.