Bug 246163 - New Class and New Package buttons are enabled when there is no project selected
Summary: New Class and New Package buttons are enabled when there is no project selected
Status: RESOLVED WONTFIX
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: IDE4EDU (show other bugs)
Version: unspecified   Edit
Hardware: PC Mac OS X - Carbon (unsup.)
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: bugday, helpwanted
Depends on:
Blocks:
 
Reported: 2008-09-03 19:12 EDT by Neil Bartlett CLA
Modified: 2014-01-09 15:38 EST (History)
3 users (show)

See Also:


Attachments
Add the project chooser page to the class wizard. (41.72 KB, patch)
2009-10-09 09:56 EDT, Nil Goyette CLA
no flags Details | Diff
Add the project chooser page to the class wizard. (41.79 KB, patch)
2009-10-09 16:06 EDT, Nil Goyette CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Neil Bartlett CLA 2008-09-03 19:12:33 EDT
The New Class and New Package buttons are always enabled, even when there is no current selection in the Package Explorer. This means the wizard doesn't know which project to create the new element in, and we get an error message about the (invisible!) source folder field.

The buttons could be disabled when there is no selection, but this doesn't help when the wizards are accessed from the main File->New... menu (assuming bug 246087 is fixed). Solution is probably to insert an initial "select project" page when there is no workbench selection available.
Comment 1 Wayne Beaton CLA 2008-10-15 15:23:08 EDT
IMHO, we should try and do things as automagically as possible. The button should always be enabled. If there is a project highlighted, then that project's 'src' directory should be the target. If there are no projects in the workspace, then one should be created (I like the idea of creating a default "My Assignment" project). If there is one project in the workspace and it is not highlighted, then that project's 'src' directory should be the target. If there are multiple projects in the workspace, but none are highlighted, then an additional wizard page should ask.

Comment 2 Nil Goyette CLA 2009-09-22 21:00:36 EDT
Maxime Caron and me are working on that.
Comment 3 Nil Goyette CLA 2009-10-09 09:56:21 EDT
Created attachment 149237 [details]
Add the project chooser page to the class wizard.

Add a page to the class wizard when there's 2 projects or more in the project
explorer and none is selected. The new page show the list of project so the
user can choose to which project he wants to add the new class.
Comment 4 Nil Goyette CLA 2009-10-09 16:06:13 EDT
Created attachment 149276 [details]
Add the project chooser page to the class wizard.

The Finish button was enabled even on the first page.
It's corrected.
Comment 5 Cory Matheson CLA 2010-01-31 01:07:32 EST
Can we close this bug?

The new java wizard constructors address this issue using the aforementioned "automagically" technique.

Therefore, this bug can probably be closed right?
Comment 6 Wayne Beaton CLA 2010-02-03 11:38:44 EST
Agreed. Closing as WONTFIX