store.setValue("componentRoot", root);
}
protected IStructuredSelection getSelection() {
IWorkbenchPartSite site = Workbench.getInstance().getActiveWorkbenchWindow()
.getActivePage().getActivePart().getSite();
if (site != null && site.getSelectionProvider() != null) {
final ISelection partSelection = site
.getSelectionProvider().getSelection();
if (partSelection != null) {
if (partSelection instanceof IStructuredSelection) {
return (IStructuredSelection) partSelection;
} else if (partSelection instanceof ITextSelection) {
IResource resource = ResourceUtil.getResource(site.getWorkbenchWindow().getActivePage()
.getActiveEditor().getEditorInput());
if(resource != null) {
return new StructuredSelection(resource);
}
else return new StructuredSelection();