Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 150009

Summary: [build path] allow selecting a working set for new Java project
Product: [Eclipse Project] JDT Reporter: Victor Toni <victor.toni>
Component: UIAssignee: Benno Baumgartner <benno.baumgartner>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: bpasero, gabriele.garuglieri, j.verschoor, markus.kell.r, martinae
Version: 3.3   
Target Milestone: 3.3 M7   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
fix
none
fix 10
none
fix 12
none
fix 15-17 none

Description Victor Toni CLA 2006-07-07 11:59:01 EDT
Choosing a "Working Set" and executing "Go into" shows only the belonging projects. This is expected.
When creating a new project in this mode the new project won't be added to the current working set but will "disappear" because it will be placed into "other projects".
The expected behaviour would be to create the new project into the current working set.

(Also a nice option would be to have a "New..." entry when clicking on the working set which would use the clicked working set as context.)
Comment 1 Martin Aeschlimann CLA 2006-07-12 03:24:56 EDT
I see, but creating a project is not really related to what the package explorer is drilled in (go into). 

But we could add configuration to the new Java project wizard to choose a working set (first page, checkbox: add new project to working set, combo: all working sets)
Comment 2 Victor Toni CLA 2006-07-12 11:35:58 EDT
But it should.

A working set should be treated as a resource as it used as context in other use cases (e.g. it can be the "parent" of the multiple projects in regard to the problem view).
Comment 3 Victor Toni CLA 2006-07-12 11:56:42 EDT
If one uses working sets the new project will be definitely be part of a working set being it only the "Other projects" fallback.

Preselecting the current working set (in the checkbox) would be a nice solution.
Comment 4 Benno Baumgartner CLA 2006-08-22 03:42:35 EDT
*** Bug 154590 has been marked as a duplicate of this bug. ***
Comment 5 Juergen Weber CLA 2007-01-02 10:27:07 EST
(In reply to comment #3)
> If one uses working sets the new project will be definitely be part of a
> working set being it only the "Other projects" fallback.
> 
> Preselecting the current working set (in the checkbox) would be a nice
> solution.
> 

Yes, that would be great, if new projects came by default into the current working set. It is kind of awkward if you are in a working set, create a new project and don't see the project afterwards.
Comment 6 Victor Toni CLA 2007-01-02 21:00:14 EST
Changed target to 3.3.
Comment 7 Benno Baumgartner CLA 2007-04-03 07:28:15 EDT
M7 new project wizard polish
Comment 8 Benno Baumgartner CLA 2007-04-16 09:18:50 EDT
Created attachment 63899 [details]
fix
Comment 9 Benno Baumgartner CLA 2007-04-16 09:24:54 EDT
fixed > I20070410-1043

Uhfff, this may need a iteration or two... Please give it a try and give feedback, thanks.
Comment 10 Martin Aeschlimann CLA 2007-04-16 13:05:43 EDT
My comments:
- The UI needs a checkbox: 'Add new project to the following working sets:'
- It would be nice if the input field would be a combo that shows the previously used sets of working sets
- The selection dialog description should: 'The new project will be added to the following working sets:'
Comment 11 Markus Keller CLA 2007-04-17 07:41:44 EDT
Reopening, since the support was taken out for the I-build. See also bug 15941 and its dups for the general request in Platform/UI.

A problem in HEAD is also that IWorkingSet.adaptElements(IAdaptable[]) is not called before adding stuff to existing working sets in JavaProjectWizard.performFinish().
Comment 12 Markus Keller CLA 2007-04-17 07:42:53 EDT
The wizard should also get its default working set(s) from the Package Explorer if the selection is empty and the Package Explorer was the active view. There are two cases:

a) Package Explorer with 'Top Level Elements > Projects' and a working set enabled as filter
=> Should default to the filter working set.

b) Package Explorer with 'Top Level Elements > Working Sets' and 'context menu > Go Into' a working set was applied
=> Should default to the context working set.

The Window Working Set is a difficult problem, since you cannot add anything to it. An approach could be to add the new project to all working sets in the window working set. Another possibility could be to ask the user if filters should be removed to reveal the project (but only if the Package Explorer was active!).
Comment 13 Benno Baumgartner CLA 2007-04-17 09:40:11 EDT
Created attachment 64028 [details]
fix 10

Implements everything requested by comment #10
Comment 14 Benno Baumgartner CLA 2007-04-18 05:38:45 EDT
Created attachment 64151 [details]
fix 12

Implements everything requested by comment #12.

Unfortunately the reveal dialog is shown on top of the new project wizard which does look a bit odd. But I don't know any way around it...
Comment 15 Markus Keller CLA 2007-04-18 07:51:16 EDT
JavaProjectWizard#performFinish() should still call selectAndReveal(..), even if the PE was not the active view, otherwise the element will not be selected in other views.

I guess you should try to call tryToReveal(..) in an asyncExec, so that it is only executed after the dialog has been closed.
Comment 16 Markus Keller CLA 2007-04-18 07:59:44 EDT
I couldn't get comment 12 to work in HEAD with an *empty* selection.
Comment 17 Markus Keller CLA 2007-04-18 08:07:01 EDT
The working set selection dialog should be resizable, and it should not have a help icon.
Comment 18 Benno Baumgartner CLA 2007-04-18 08:51:40 EDT
Created attachment 64177 [details]
fix 15-17

Forgot the empty selection. async exec works good. Thanks Markus!
Comment 19 Benno Baumgartner CLA 2007-04-18 08:56:47 EDT
fixed? > I20070417-0800

Hint that the org.eclipse.jdt.internal.ui.workingsets.WorkingSetConfigurationBlock is java agnostic and could be used in other new wizards.
Comment 20 Dani Megert CLA 2007-05-02 12:49:15 EDT
Verified in I20070502-0010.
Comment 21 Markus Keller CLA 2008-11-07 10:46:57 EST
*** Bug 85369 has been marked as a duplicate of this bug. ***