@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); } } });
@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 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); }
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() { IFile file= fEditor.getFile(); if (file == null) { return; } PackageExplorerPart view= PackageExplorerPart.openInActivePerspective(); if (!reveal(view, file)) { MessageDialog.openInformation(fEditor.getShell(), getDialogTitle(), SnippetMessages.getString("ShowInPackageViewAction.not_found")); //$NON-NLS-1$ } }
private void gotoType(IType type) { ICompilationUnit cu= (ICompilationUnit) type.getAncestor(IJavaElement.COMPILATION_UNIT); IJavaElement element= null; if (cu != null) { element= cu.getPrimary(); } else { element= type.getAncestor(IJavaElement.CLASS_FILE); } if (element != null) { PackageExplorerPart view= PackageExplorerPart.openInActivePerspective(); if (view != null) { view.selectReveal(new StructuredSelection(element)); if (!element.equals(getSelectedElement(view))) { MessageDialog.openInformation(fPackageExplorer.getSite().getShell(), getDialogTitle(), Messages.format(PackagesMessages.PackageExplorer_element_not_present, JavaElementLabels.getElementLabel(element, JavaElementLabels.ALL_DEFAULT))); } } } }
private void gotoType(IType type) { ICompilationUnit cu= (ICompilationUnit) type.getAncestor(IJavaElement.COMPILATION_UNIT); IJavaElement element= null; if (cu != null) { element= cu.getPrimary(); } else { element= type.getAncestor(IJavaElement.CLASS_FILE); } if (element != null) { PackageExplorerPart view= PackageExplorerPart.openInActivePerspective(); if (view != null) { view.selectReveal(new StructuredSelection(element)); if (!element.equals(getSelectedElement(view))) { MessageDialog.openInformation(fPackageExplorer.getSite().getShell(), getDialogTitle(), Messages.format(PackagesMessages.PackageExplorer_element_not_present, JavaElementLabels.getElementLabel(element, JavaElementLabels.ALL_DEFAULT))); } } } }
private void gotoType(IType type) { ICompilationUnit cu= (ICompilationUnit) type.getAncestor(IJavaElement.COMPILATION_UNIT); IJavaElement element= null; if (cu != null) { element= cu.getPrimary(); } else { element= type.getAncestor(IJavaElement.CLASS_FILE); } if (element != null) { PackageExplorerPart view= PackageExplorerPart.openInActivePerspective(); if (view != null) { view.selectReveal(new StructuredSelection(element)); if (!element.equals(getSelectedElement(view))) { MessageDialog.openInformation(fPackageExplorer.getSite().getShell(), getDialogTitle(), Messages.format(PackagesMessages.PackageExplorer_element_not_present, element.getElementName())); } } } }