}
}
public static void showInEditor(ToolComponent cls){
try{
//get an handle to the Tool navigator
CommonNavigator toolNavigator = (CommonNavigator)PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().showView(ToolPlugin.TOOL_NAVIGATOR_ID);
//open it in the active page
IWorkbenchWindow window=PlatformUI.getWorkbench().getActiveWorkbenchWindow();
IWorkbenchPage page = window.getActivePage();
//get the IFile for the class
IFile cdf = cls.getFile();
StructuredSelection target = null;
if (cdf == null){
// we have a library class
target = new StructuredSelection(cls);
} else {
target = new StructuredSelection(cdf);
}
//select and reveal the cdf in the navigator
// CommonViewer viewer = toolNavigator.getCommonViewer();
// viewer.expandToLevel(target, 1);
toolNavigator.selectReveal(target);
if (cdf!=null){
//now open it in the cdf editor
IEditorInput editorInput = new FileEditorInput(cdf);
//invoke the editor
page.openEditor(editorInput, ClassEditor.ID);