public void run() { PackageExplorerPart activePackageExplorer= getActivePackageExplorer(); if (activePackageExplorer != null) { activePackageExplorer.tryToReveal(newElement); } } });
@Override public void run() { IWorkbenchPart activePart= getActivePart(); if (activePart instanceof IPackagesViewPart) { PackageExplorerPart view= PackageExplorerPart.openInActivePerspective(); view.tryToReveal(newElement); } } });
/** * Tries to reveal the given Java element * * @param element the element to reveal */ public void run(IJavaElement element) { if (element == null) return; PackageExplorerPart view= PackageExplorerPart.openInActivePerspective(); view.tryToReveal(element); }
/** * Tries to reveal the given Java element * * @param element the element to reveal */ public void run(IJavaElement element) { if (element == null) return; PackageExplorerPart view= PackageExplorerPart.openInActivePerspective(); view.tryToReveal(element); }
@Override public void run() { IWorkbenchPart activePart= getActivePart(); if (activePart instanceof IPackagesViewPart) { PackageExplorerPart view= PackageExplorerPart.openInActivePerspective(); view.tryToReveal(newElement); } } });
@Override public Object execute(ExecutionEvent event) throws ExecutionException { IJavaElement javaElement= (IJavaElement) event.getObjectParameterForExecution(PARAM_ID_ELEMENT_REF); PackageExplorerPart view= PackageExplorerPart.openInActivePerspective(); view.tryToReveal(javaElement); return null; }
@Override public void run() { final IWorkbenchPart activePart = getActivePart(); if (activePart instanceof IPackagesViewPart) { final PackageExplorerPart view = PackageExplorerPart.openInActivePerspective(); view.tryToReveal(newElement); } } });
public void run(IJavaElement element) { if (element == null) return; // reveal the top most element only IOpenable openable= element.getOpenable(); if (openable instanceof IJavaElement) element= (IJavaElement)openable; PackageExplorerPart view= PackageExplorerPart.openInActivePerspective(); view.tryToReveal(element); }
@Override public Object execute(ExecutionEvent event) throws ExecutionException { IJavaElement javaElement= (IJavaElement) event.getObjectParameterForExecution(PARAM_ID_ELEMENT_REF); PackageExplorerPart view= PackageExplorerPart.openInActivePerspective(); view.tryToReveal(javaElement); return null; }
public Object execute(ExecutionEvent event) throws ExecutionException { IJavaElement javaElement= (IJavaElement) event.getObjectParameterForExecution(PARAM_ID_ELEMENT_REF); PackageExplorerPart view= PackageExplorerPart.openInActivePerspective(); view.tryToReveal(javaElement); return null; }
public void run() { IStructuredSelection selection= (IStructuredSelection)fPackageExplorer.getSite().getSelectionProvider().getSelection(); Object element= selection.getFirstElement(); if (element instanceof ClassPathContainer.RequiredProjectWrapper) { ClassPathContainer.RequiredProjectWrapper wrapper= (ClassPathContainer.RequiredProjectWrapper) element; fPackageExplorer.tryToReveal(wrapper.getProject()); } } }
@Override public void run() { IStructuredSelection selection= (IStructuredSelection)fPackageExplorer.getSite().getSelectionProvider().getSelection(); Object element= selection.getFirstElement(); if (element instanceof ClassPathContainer.RequiredProjectWrapper) { ClassPathContainer.RequiredProjectWrapper wrapper= (ClassPathContainer.RequiredProjectWrapper) element; fPackageExplorer.tryToReveal(wrapper.getProject()); } } }
@Override public boolean show(ShowInContext context) { ISelection selection= context.getSelection(); if (selection instanceof IStructuredSelection) { // fix for 64634 Navigate/Show in/Package Explorer doesn't work IStructuredSelection structuredSelection= ((IStructuredSelection) selection); if (structuredSelection.size() == 1) { int res= tryToReveal(structuredSelection.getFirstElement()); if (res == IStatus.OK) return true; if (res == IStatus.CANCEL) return false; } else if (structuredSelection.size() > 1) { selectReveal(structuredSelection); return true; } } Object input= context.getInput(); if (input instanceof IEditorInput) { Object elementOfInput= getInputFromEditor((IEditorInput) input); return elementOfInput != null && (tryToReveal(elementOfInput) == IStatus.OK); } return false; }
public boolean show(ShowInContext context) { ISelection selection= context.getSelection(); if (selection instanceof IStructuredSelection) { // fix for 64634 Navigate/Show in/Package Explorer doesn't work IStructuredSelection structuredSelection= ((IStructuredSelection) selection); if (structuredSelection.size() == 1) { int res= tryToReveal(structuredSelection.getFirstElement()); if (res == IStatus.OK) return true; if (res == IStatus.CANCEL) return false; } else if (structuredSelection.size() > 1) { selectReveal(structuredSelection); return true; } } Object input= context.getInput(); if (input instanceof IEditorInput) { Object elementOfInput= getInputFromEditor((IEditorInput) input); return elementOfInput != null && (tryToReveal(elementOfInput) == IStatus.OK); } return false; }
@Override public void run() { IStructuredSelection selection= (IStructuredSelection)fPackageExplorer.getSite().getSelectionProvider().getSelection(); Object element= selection.getFirstElement(); if (element instanceof ClassPathContainer.RequiredProjectWrapper) { ClassPathContainer.RequiredProjectWrapper wrapper= (ClassPathContainer.RequiredProjectWrapper) element; fPackageExplorer.tryToReveal(wrapper.getProject()); } } }
@Override public boolean show(ShowInContext context) { ISelection selection= context.getSelection(); if (selection instanceof IStructuredSelection) { // fix for 64634 Navigate/Show in/Package Explorer doesn't work IStructuredSelection structuredSelection= ((IStructuredSelection) selection); if (structuredSelection.size() == 1) { int res= tryToReveal(structuredSelection.getFirstElement()); if (res == IStatus.OK) return true; if (res == IStatus.CANCEL) return false; } else if (structuredSelection.size() > 1) { selectReveal(structuredSelection); return true; } } Object input= context.getInput(); if (input instanceof IEditorInput) { Object elementOfInput= getInputFromEditor((IEditorInput) input); return elementOfInput != null && (tryToReveal(elementOfInput) == IStatus.OK); } return false; }
view.tryToReveal(packageFragment); return null;
view.tryToReveal(packageFragment); return null;
try { PackageExplorerPart view= (PackageExplorerPart) JavaPlugin.getActivePage().showView(JavaUI.ID_PACKAGES); view.tryToReveal(element); } catch (PartInitException e) { JavaPlugin.log(e);
try { PackageExplorerPart view= (PackageExplorerPart) JavaPlugin.getActivePage().showView(JavaUI.ID_PACKAGES); view.tryToReveal(element); } catch (PartInitException e) { JavaPlugin.log(e);