memento.putString(ID_DISPLAY_VIEW, contents);
memento.putString(CONTENTS, contents); int numberOfLines= doc.getNumberOfLines(); String lineDelimiter; for (int i=1; i < numberOfLines; i++) { try { lineDelimiter= doc.getLineDelimiter(i-1); int correction= (lineDelimiter == null ? 0 : lineDelimiter.length()); memento.putInteger(LINE_OFFSET + i, (doc.getLineOffset(i) - correction)); } catch (BadLocationException ble) { DebugUIUtils.logError(ble); } } int position= 0; int count = 0; while (position != -1) { position= contents.indexOf('\t', position); if (position != -1) { memento.putInteger(TABS + count++, position); position++; } }
	public void saveState(IMemento memento) {		if (fSourceViewer != null) {			String contents= fSourceViewer.getDocument().get();			if (contents.length() > 0) {				memento.putString(ID_DISPLAY_VIEW, contents);			}			} else if (fRestoredContents != null) {			memento.putString(ID_DISPLAY_VIEW, fRestoredContents);		}	}