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

Bug 42718

Summary: [Wizards] Interface for populating New wizard containers from selection
Product: [Eclipse Project] Platform Reporter: Jay Cagle <jcagle>
Component: UIAssignee: Platform-UI-Inbox <Platform-UI-Inbox>
Status: RESOLVED WONTFIX QA Contact:
Severity: enhancement    
Priority: P3 CC: Tod_Creasey
Version: 3.0Keywords: helpwanted
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard:

Description Jay Cagle CLA 2003-09-08 15:24:09 EDT
Custom navigator and other views often provide context menu choices for
launching various New wizards.  Often times the elements in these views are
custom classes.  It would be useful if there were an interface or adapter that
custom view elements could implement to return an IContainer to be used for
populating the initial container field in a New wizard dialog.

Currently wizards attempt to adapt the selected element to IResource and use
that to populate the initial container.  However, making a view element
adaptable to IResource brings other object contributions that aren't always
wanted.  It would be useful if there were a separate mechanism specifically for
the default container.
Comment 1 Tod Creasey CLA 2003-09-09 08:59:54 EDT
The wizard takes its current selection from 

window.getSelectionService().getSelection();

you can always set the current resource selection in the selection service 
from your view before invoking the wizards and get this behaviour.
Comment 2 Jay Cagle CLA 2003-09-14 14:56:57 EDT
That strikes me as a hack and not really workable.  The selection is the custom
node and not a resource.  In order to change the selection I would need to
intercept every action from the view.  Many of the view's actions are via object
contributions so there's no easy way of intercepting the action in order to
change the selection.  And doing so would mean that every action would now
appear to be targetted at the resource, which I don't want in all cases.  

Unless I'm missing something, that doesn't seem like a workable solution.
Comment 3 Jay Cagle CLA 2003-09-14 21:19:11 EDT
Check out NewContainerWizardPage.getInitialJavaElement() to see the contortions
JDT goes through to get a container from the selection.
Comment 4 Tod Creasey CLA 2003-10-09 10:29:41 EDT
This is not on the current 3.0 plan - please feel free to attach any suggested 
reworks. Also please note that we are trying our best not to break any 
existing APIs.
Comment 5 Tod Creasey CLA 2006-06-22 08:35:57 EDT
There are currently no plans to work on this feature