Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 190438 - [working sets] Assign Working Sets dialog forgets settings after adding and moving new working set
Summary: [working sets] Assign Working Sets dialog forgets settings after adding and m...
Status: RESOLVED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.3   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 3.5 M6   Edit
Assignee: Raksha Vasisht CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-06-01 06:22 EDT by Markus Keller CLA
Modified: 2009-02-17 05:21 EST (History)
2 users (show)

See Also:


Attachments
Fixed. The settings are remembered now between dialogs. (6.11 KB, patch)
2009-01-30 09:07 EST, Raksha Vasisht CLA
daniel_megert: review-
Details | Diff
Fixed the datastructure and all minor issues. (6.61 KB, patch)
2009-02-03 03:06 EST, Raksha Vasisht CLA
daniel_megert: review-
Details | Diff
Yep , replaced the newly created set by taking contents from getChecked() and adding newly added ws from WSCD to it. (5.37 KB, patch)
2009-02-04 13:42 EST, Raksha Vasisht CLA
daniel_megert: iplog+
daniel_megert: review+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Markus Keller CLA 2007-06-01 06:22:01 EDT
I20070601-0010

I had the platform and jdt doc plugins in two different working sets:
  - WS JDT: jdt.doc
  - WS Platform: platform.doc

- selected all doc plug-ins
- Assign Working Sets...
- New..., create WS "Doc" with selection
- uncheck both grey-checked WS (JDT & Platform)
- click link "Package Explorer working sets"
- move WS Doc up or down
- OK
=> WS JDT and WS Platform are grey-checked again
=> Expected: check state should not be changed when working sets are moved around
Comment 1 Markus Keller CLA 2008-06-10 06:07:31 EDT
Not really minor. I run into this every time I create a new working set (when I try to configure the Package Explorer from the dialog).
Comment 2 Markus Keller CLA 2009-01-27 08:40:22 EST
At least in I20090127-0100, it's even worse:
- Assign Working Sets...
- check or uncheck a working set
- click 'Configure Package Explorer Working Sets'
- click Cancel
=> Working Set Assignments dialog still shows my previous checked state
- click OK
=> working sets are not changed
=> expected: elements should end up in the checked working sets
Comment 3 Raksha Vasisht CLA 2009-01-30 09:07:59 EST
Created attachment 124273 [details]
Fixed. The settings are remembered now between dialogs.
Comment 4 Dani Megert CLA 2009-02-02 05:19:32 EST
Hi Raksha. I looked at the patch but it does not work: to test follow the steps from comment 2.

Some minor details:
- why is fCheckedWorkingSets public? Fields should almost never be public.
- copyright in WorkingSetConfigurationDialog is not correct
- wrong formatting (missing indent):
			if (addedWorkingSets != null)
			fCheckedWorkingSets.addAll(addedWorkingSets);
Comment 5 Raksha Vasisht CLA 2009-02-03 03:06:51 EST
Created attachment 124517 [details]
Fixed the datastructure and all minor issues.
Comment 6 Dani Megert CLA 2009-02-03 08:27:43 EST
Raksha, the patch still does not work as it missed to update the data structure when clicking (De-)Select All. After thinking of it again: why do you duplicate the checked state with a separate set. The same information is already available in ConfigureWorkingSetAssignementAction.GrayedCheckedModel.getChecked(). You simply need to use that information and combine it with what you get back from the configure dialog.

- the if-check here is not needed:						
if  (fCheckedWorkingSets.contains(workingSet))
	fCheckedWorkingSets.remove(workingSet);

- WorkingSetConfigurationDialog.getNewlyAddedWorkingSets()
	Use "working set" instead of "Working Set" in the comment
Comment 7 Raksha Vasisht CLA 2009-02-04 13:42:14 EST
Created attachment 124711 [details]
Yep , replaced the newly created set by taking contents from getChecked() and adding newly added ws from WSCD to it.
Comment 8 Dani Megert CLA 2009-02-05 03:54:49 EST
Patch is good and works. Committed it with two minor improvements:
- Set fCheckedWorkingSets= new HashSet();
  ==> 'f' prefix is only for fields
- addedWorkingSets is not needed: simply pass dialog.getNewlyAddedWorkingSets()
Comment 9 Dani Megert CLA 2009-02-17 05:21:59 EST
.