Getting IContainer from ISelection [message #201129] |
Tue, 24 February 2004 16:38  |
Eclipse User |
|
|
|
Originally posted by: ddurst.larubber.com
Currently I am writing a plugin that auto-generates some .xml files
for a type of project (I know thats ambig.)
Here is the issue, I have been strugling to find away to get
the currently "active" container or selected container inside the wizard
I am using.
Currently I have at my disposal is a ISelection.
So my approach is as follows:
if(selection instanceof IStructuredSelection) {
System.err.println("Structured Selection");
IStructuredSelection structuredSel = (IStructuredSelection)selection;
for(Iterator i = structuredSel.iterator();i.hasNext();){
System.err.println("Loop");
Object obj = i.next();
if(obj instanceof IContainer) {
IContainer container = (IContainer)obj;
System.err.println(container.getName());
}
}
}
But this only results in the output of
Structured Selection
Loop
and I get no container name.
Am I way off base? Is there any tutorials for this?
|
|
|
|
Powered by
FUDForum. Page generated in 0.07572 seconds