if (range != null && offset > -1 && length > 0) { if (getSourceViewer() != null) { getSourceViewer().revealRange(offset, length); getSourceViewer().setSelectedRange(offset, length); } }
} } else if (reference instanceof IImportDeclaration) { String name= ((IImportDeclaration) reference).getElementName(); if (name != null && name.length() > 0) { String content= reference.getSource(); offset= range.getOffset() + content.indexOf(name); length= name.length(); } } else if (reference instanceof IPackageDeclaration) { String name= ((IPackageDeclaration) reference).getElementName(); if (name != null && name.length() > 0) { String content= reference.getSource(); offset= range.getOffset() + content.indexOf(name); length= name.length(); } }  if (offset > -1 && length > 0) { if (getSourceViewer() != null) { getSourceViewer().revealRange(offset, length); getSourceViewer().setSelectedRange(offset, length);
	protected void setSelection(ISourceReference reference, boolean moveCursor) {				if (reference != null) {						try {								ISourceRange range= reference.getSourceRange();				if (range == null)					return;								int offset= range.getOffset();				int length= range.getLength();								if (offset > -1 && length >= 0) {									setHighlightRange(offset, length, moveCursor);										if (moveCursor && (reference instanceof IMember)) {						range= ((IMember) reference).getNameRange();						offset= range.getOffset();						length= range.getLength();						if (range != null && offset > -1 && length > 0) {							if (getSourceViewer() != null) {								getSourceViewer().revealRange(offset, length);								getSourceViewer().setSelectedRange(offset, length);							}						}					}				}								return;							} catch (JavaModelException x) {			} catch (IllegalArgumentException x) {			}		}				if (moveCursor)			resetHighlightRange();	}