Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 209721 - [Wizards] Creating working sets from Import Project Set Dialogue
Summary: [Wizards] Creating working sets from Import Project Set Dialogue
Status: VERIFIED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Team (show other bugs)
Version: 3.4   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.4 M6   Edit
Assignee: Tomasz Zarna CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 219580
  Show dependency tree
 
Reported: 2007-11-13 17:15 EST by Lee Surprenant CLA
Modified: 2008-05-05 07:58 EDT (History)
5 users (show)

See Also:


Attachments
Patch (10.25 KB, patch)
2008-02-20 06:49 EST, Tomasz Zarna CLA
no flags Details | Diff
mylyn/context/zip (6.34 KB, application/octet-stream)
2008-02-20 06:49 EST, Tomasz Zarna CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Lee Surprenant CLA 2007-11-13 17:15:26 EST
Build ID: I20070625-1500

Steps To Reproduce:
1.File -> Import... -> Team -> Team Project Set and select the .psf
2.Check "Add the imported team project set to a working set"
3.Click Browse and type in the name of a working set that does not exist
4.Click OK and Finish
5.Select Configure Working Sets from the Project Explorer
6.Note that the working set is not in the list
7.Click New... and type in the name of the fake working set
8.Note the error:   A working set with that name already exists.


More information:
I think that the ability to import a project set as a working set makes a lot of sense.  The wizard should either not allow the user to create a working set or create the new working set properly.  Obviously, the latter would be preffered.
Comment 1 Martin Aeschlimann CLA 2007-11-14 06:17:57 EST
The project explorer seems to be broken when grouping by workings sets. I also didn't understand how this works.
Comment 2 Tomasz Zarna CLA 2007-11-21 08:10:02 EST
I've followed the steps from comment 0, but everything looks fine to me. After selecting "Select Working Set..." ( I belive this is what you meant by "Configure Working Sets") I am able to see the newly added working set in the list. It works fine in both Project and Package Explorers. The only problem I've observed is that in the Project Explorer the "Edit Active Working Set" doesn't go on for the newly created set.

Lee, have you observed any errors while importing the project set?
Comment 3 Lee Surprenant CLA 2007-11-21 08:32:28 EST
Interesting...the "Select Working Sets..." option shows the new working set just as you mentioned.  The problem I reported still exists, I just made a mistake in the steps to reproduce.  
You will find the "Configure Working Sets..." option in the Package Explorer menu, not the Project Explorer menu.  This is the view in which the new working set is not visible.
As Martin points out, this problem also is seen when you select Top Level Elements -> Working Sets from the Package Explorer.
Comment 4 Martin Aeschlimann CLA 2007-11-21 08:44:59 EST
The Java package explorer only accepts resource and Java working sets as top level nodes. I have no idea what kind of working set team creates here.

Comment 5 Tomasz Zarna CLA 2007-11-21 09:01:04 EST
Oh, now I can see it too. I need to set "Working Set" as "Top level elements" in the Package Explorer. This is when the "Configure Working Set" entry shows up.

Martin: It's a resource working set which is being created. At least, this is how the icon looks like.
Comment 6 Martin Aeschlimann CLA 2007-11-21 09:17:17 EST
I can manually create a Resource working set and it shows up in the package explorer. So it seems that the one created by team is somehow different.
Comment 7 Martin Aeschlimann CLA 2007-11-21 09:27:21 EST
workingSet.getID returns null. The resource working sets I created through the wizard contain 'org.eclipse.ui.resourceWorkingSetPage'

The id is required for the test 'WorkingSet.isSelfUpdating()'.
Comment 8 Tomasz Zarna CLA 2007-11-21 09:56:37 EST
Team uses the IWorkingSetManager[1] to create a working set when asked during a Project Set Import. It seems that the working set returned from the createWorkingSet method[2] is not what the "Configure Working Set" is expecting. It doesn't look like a team bug anymore to me.

[1] org.eclipse.ui.IWorkingSetManager#createWorkingSet(String, IAdaptable[]) and org.eclipse.ui.internal.AbstractWorkingSetManager
[2] org.eclipse.team.internal.ui.wizards.ImportProjectSetOperation line 72
Comment 9 Michael Valenta CLA 2007-11-21 10:17:45 EST
I seem to recall that Markus gave us a patch at some point that allowed the user to create any type of working set they desired when importing. Perhaps that was for the CVS Import Wizard? I also seem to recall that there was some support added to the Platform to improvie this type of working set creation. We should investigate this as well (I seem to recall that Kim logged a bug against Team or CVS to adopt the new support).
Comment 10 Tomasz Zarna CLA 2007-11-21 10:23:51 EST
The bug logged by Kim - bug 201597.
	

Comment 11 Tomasz Zarna CLA 2007-11-21 10:27:08 EST
The bug with the patch by Markus - bug 167595.
Comment 12 Tomasz Zarna CLA 2008-02-20 06:49:24 EST
Created attachment 90166 [details]
Patch

Patch that adds the new controls outline for working sets (see bug 199904). This simplifies the code of the ImportProjectSetMainPage class including it's updateEnablement method. However, there is still one minor issue related to the enablement but I will report a separate bug for it.

This is also a partial fix for bug 201597.
Comment 13 Tomasz Zarna CLA 2008-02-20 06:49:28 EST
Created attachment 90167 [details]
mylyn/context/zip
Comment 14 Tomasz Zarna CLA 2008-02-27 07:13:18 EST
Released to HEAD.
Comment 15 Tomasz Zarna CLA 2008-03-26 08:23:25 EDT
Verified in I20080304-1113.