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())); } } } }
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))); } } } }