1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
| /**
* Lookup selected objects in UI.
* @return
*/
protected List<Object> lookupSelectedElements() {
IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
ISelection selection = page.getSelection();
if(selection instanceof IStructuredSelection) {
IStructuredSelection structuredSelection = (IStructuredSelection)selection;
return structuredSelection.toList();
}
else if( selection instanceof TreeSelection) {
TreeSelection treeSelection = (TreeSelection)selection;
return treeSelection.toList();
}
return null;
} |