fAssistant.uninstall(); fAssistant= null;
Display display= text.getDisplay(); if (display != null && !display.isDisposed()) { display.asyncExec(new Runnable() { public void run() { if (fAssistant != null)  { fAssistant.uninstall(); fAssistant= null; } } }); }
	private void leave(int flags) {		fInitialOffset= -1;				if ((flags & UNINSTALL) != 0)			fManager.uninstall((flags & COMMIT) != 0);		fgStore.removePropertyChangeListener(this);				if (fFrameColor != null) {			fFrameColor.dispose();			fFrameColor= null;		}							StyledText text= fViewer.getTextWidget();			text.removePaintListener(this);		text.removeModifyListener(this);		text.removeVerifyListener(this);		Shell shell= text.getShell();		shell.removeShellListener(this);				if (fAssistant != null) {			fAssistant.uninstall();			fAssistant= null;		}		ITextViewerExtension extension= (ITextViewerExtension) fViewer;		extension.removeVerifyKeyListener(this);				IRewriteTarget target= extension.getRewriteTarget();		target.endCompoundChange();		if (fViewer instanceof ITextViewerExtension2 && fContentType != null)			((ITextViewerExtension2) fViewer).removeAutoEditStrategy(fManager, fContentType);		fContentType= null;		fViewer.removeTextListener(this);		fViewer.removeTextInputListener(this);				try {			IDocument document= fViewer.getDocument();			if (((flags & COMMIT) != 0) &&				((flags & DOCUMENT_CHANGED) == 0) &&				((flags & UPDATE_CARET) != 0))			{				Position[] positions= document.getPositions(fPositionCategoryName);				if ((positions != null) && (positions.length != 0)) {										if (fViewer instanceof ITextViewerExtension3) {						ITextViewerExtension3 extension3= (ITextViewerExtension3) fViewer;						int widgetOffset= extension3.modelOffset2WidgetOffset(positions[0].getOffset());						if (widgetOffset >= 0)							text.setSelection(widgetOffset, widgetOffset);												} else {						IRegion region= fViewer.getVisibleRegion();						int offset= positions[0].getOffset() - region.getOffset();						if ((offset >= 0) && (offset <= region.getLength()))							text.setSelection(offset, offset);					}				}			}			document.removePositionUpdater(fUpdater);			document.removePositionCategory(fPositionCategoryName);						if (fExitListener != null)				fExitListener.exit(					((flags & COMMIT) != 0) ||					((flags & DOCUMENT_CHANGED) != 0));		} catch (BadPositionCategoryException e) {			JavaPlugin.log(e);			Assert.isTrue(false);		}		if ((flags & DOCUMENT_CHANGED) == 0)			text.redraw();	}