Bug 2248 - Navigator: New does not give container when multi-selected (1GEAURV)
Summary: Navigator: New does not give container when multi-selected (1GEAURV)
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 2.0   Edit
Hardware: All Windows 98
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Ryan Cooper CLA
QA Contact:
URL:
Whiteboard:
Keywords: usability
Depends on:
Blocks:
 
Reported: 2001-10-10 22:31 EDT by Nick Edgar CLA
Modified: 2002-04-12 16:06 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Nick Edgar CLA 2001-10-10 22:31:43 EDT
- select two resources in the navigator
- pop-up the context menu
- New is available
- choose File
- the container is not filled in

There are several options:
	1. Don't include New if multiple selection 
		- This doesn't apply to File / New though.
		- Should still be able to do New Project since it doesn't use selection.
	2. Pick first element in selection to derive container.
	3. Pick the common container of the elements.
		- Works OK if files selected, but could be confusing if folders selected
		- Doesn't work if projects selected.

Option 2 seems simplest.

NOTES:

NE (5/25/01 4:54:46 PM)
	Note that the plugin.xml specifies a selection type of IResource for New Folder and New File,
	but they don't specify the cardinality of the selection.
	Can wizards do this?  If so, the New menu needs to be smarter than the proposals above.
Comment 1 DJ Houghton CLA 2001-10-29 18:02:20 EST
PRODUCT VERSION:
110 JDK

Comment 2 Nick Edgar CLA 2002-01-25 22:22:30 EST
Pls verify in latest.
Comment 3 Nick Edgar CLA 2002-01-25 22:23:30 EST
Should also get a default container if current part is a file editor (has an 
IFileInput).  Is this case currently handled?
Comment 4 Simon Arsenault CLA 2002-03-25 14:57:13 EST
Please investigate and propose solution.
Comment 5 Ryan Cooper CLA 2002-04-12 12:56:05 EDT
The first problem has a simple solution (assuming we implement solution 2 
suggested above).

The second problem, of getting a default container, is not handled currently, 
and is more difficult. A simple solution invovles getting the active part from 
the workbench passed into the wizard page that has the container field. This 
would require making the getActivePart() method of WorkbenchPage public API (by 
adding it to IWorkbenchPage).

A more meaningful solution would be to change the selection service (by 
modifying AbstractSelectionService.getSelection()) to return something other 
than null if the active part is an editor. This would be benficial for other 
operations as well (such as Export) when the active part is an editor.
Comment 6 Simon Arsenault CLA 2002-04-12 16:06:01 EDT
File and Folder wizard pages updated to use first element in selection for 
initial container candidate. Actions to launch File>New>Other dialog and to 
launch individual new wizards have been updated so if the active part is an 
editor, and the input is a IFile, a selection is created with that IFile and 
passed along.