try { fContentType= document.getContentType(fFramePosition.offset); if (fViewer instanceof ITextViewerExtension2) { ((ITextViewerExtension2) fViewer).prependAutoEditStrategy(fManager, fContentType); } else { Assert.isTrue(false); }  } catch (BadLocationException e) { handleException(fViewer.getTextWidget().getShell(), e); }
	public void enter() {		fFramePosition= (fInitialOffset == -1) ? fManager.getFirstPosition() : fManager.getPosition(fInitialOffset);		if (fFramePosition == null)			return;		// track final caret		IDocument document= fViewer.getDocument();		document.addPositionCategory(CARET_POSITION);		document.addPositionUpdater(fgUpdater);		try {			if (fFinalCaretOffset != -1)				document.addPosition(CARET_POSITION, new Position(fFinalCaretOffset));		} catch (BadLocationException e) {			handleException(fViewer.getTextWidget().getShell(), e);		} catch (BadPositionCategoryException e) {			JavaPlugin.log(e);			Assert.isTrue(false);		}		try {					fContentType= document.getContentType(fFramePosition.offset);			if (fViewer instanceof ITextViewerExtension2) {				((ITextViewerExtension2) fViewer).prependAutoEditStrategy(fManager, fContentType);			} else {				Assert.isTrue(false);			}		} catch (BadLocationException e) {			handleException(fViewer.getTextWidget().getShell(), e);		}		fViewer.addTextInputListener(this);		fViewer.addTextListener(this);						ITextViewerExtension extension= (ITextViewerExtension) fViewer;		extension.prependVerifyKeyListener(this);		StyledText text= fViewer.getTextWidget();					text.addVerifyListener(this);		text.addModifyListener(this);		text.addPaintListener(this);		text.showSelection();		Shell shell= text.getShell();		shell.addShellListener(this);		fgStore.addPropertyChangeListener(this);	}