Object firstElement = treeSelection.getFirstElement();
if (firstElement instanceof IJavaScriptElement) {
// it's JS element, follow opening JS editor
ScriptExplorerPart part = getPart();
IViewSite viewSite = part.getViewSite();
OpenAction openAction = new OpenAction(viewSite);
if (openAction != null && openAction.isEnabled()) {
openAction.run();
return;
}
}
}
// use our action to do the open operation
IAction openAction = fNavigateActionGroup.getOpenAction();
if (openAction != null && openAction.isEnabled()) {
openAction.run();
return;
}
}