try { ISourceRange range= ((ISourceReference)element).getSourceRange(); if (range != null) revealInEditor(part, range.getOffset(), range.getLength()); } catch (JavaModelException e) {  }
if (range != null) revealInEditor(part, range.getOffset(), range.getLength()); } catch (JavaModelException e) {
	public static void revealInEditor(IEditorPart part, IJavaElement element) {		if (element == null)			return;				if (part instanceof JavaEditor)			((JavaEditor) part).setSelection(element);		else if (element instanceof ISourceReference) {						// Support for non-Java editor			try {				ISourceRange range= ((ISourceReference)element).getSourceRange();				if (range != null)					revealInEditor(part, range.getOffset(), range.getLength());			} catch (JavaModelException e) {				// don't reveal			}		}	}