sourceViewer.revealRange(offset, length); sourceViewer.setSelectedRange(offset, length);
try  { textWidget.setRedraw(false); sourceViewer.revealRange(offset, length); sourceViewer.setSelectedRange(offset, length); } finally { textWidget.setRedraw(true); }
	protected void setSelection(ISourceReference reference, boolean moveCursor) {				ISelection selection= getSelectionProvider().getSelection();		if (selection instanceof TextSelection) {			TextSelection textSelection= (TextSelection) selection;			if (textSelection.getOffset() != 0 || textSelection.getLength() != 0)				markInNavigationHistory();		}				if (reference != null) {						StyledText  textWidget= null;						ISourceViewer sourceViewer= getSourceViewer();			if (sourceViewer != null)				textWidget= sourceViewer.getTextWidget();						if (textWidget == null)				return;							try {								ISourceRange range= reference.getSourceRange();				if (range == null)					return;								int offset= range.getOffset();				int length= range.getLength();								if (offset < 0 || length < 0)					return;									textWidget.setRedraw(false);								setHighlightRange(offset, length, moveCursor);				if (!moveCursor)					return;															offset= -1;				length= -1;								if (reference instanceof IMember) {					range= ((IMember) reference).getNameRange();					if (range != null) {						offset= range.getOffset();						length= range.getLength();					}				} else if (reference instanceof IImportDeclaration) {					String name= ((IImportDeclaration) reference).getElementName();					if (name != null && name.length() > 0) {						String content= reference.getSource();						if (content != null) {							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();						if (content != null) {							offset= range.getOffset() + content.indexOf(name);							length= name.length();						}					}				}								if (offset > -1 && length > 0) {					sourceViewer.revealRange(offset, length);					sourceViewer.setSelectedRange(offset, length);					markInNavigationHistory();				}							} catch (JavaModelException x) {			} catch (IllegalArgumentException x) {			} finally {				if (textWidget != null)					textWidget.setRedraw(true);			}								} else if (moveCursor) {			resetHighlightRange();			markInNavigationHistory();		}	}