Community
Participate
Working Groups
- 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.
PRODUCT VERSION: 110 JDK
Pls verify in latest.
Should also get a default container if current part is a file editor (has an IFileInput). Is this case currently handled?
Please investigate and propose solution.
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.
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.