fViewer.addTextInputListener(this);
	public void enter() {		// 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) { // ignore		} catch (BadPositionCategoryException e) {			JavaPlugin.log(e);			openErrorDialog(fViewer.getTextWidget().getShell(), e);		}				StyledText text= fViewer.getTextWidget();					text.addModifyListener(this);		text.addVerifyKeyListener(this);		text.addPaintListener(this);		text.showSelection();		fFramePosition= fManager.getFirstPosition();		if (fFramePosition == null)			leave(true);		// XXX workaround:		// turn off template editing if visible region		// is smaller than the whole document		if (false) {			IRegion region= fViewer.getVisibleRegion();			if ((region.getOffset() != 0) || (region.getLength() != document.getLength()))				leave(true);		}	}