try {  int startOffset= fRememberedSelectionStartOffset.getOffset(); int endOffset= fRememberedSelectionEndOffset.getOffset();   if (fRememberedSelectionSign) { if (startOffset != -1) startOffset++; } else { if (endOffset != -1) endOffset++; }  if (startOffset == -1) startOffset= endOffset;  if (endOffset == -1) endOffset= startOffset;  IJavaElement element; if (endOffset == -1) {  element= fRememberedSelectionEndOffset.getElement(); if (element == null) element= fRememberedSelectionStartOffset.getElement(); if (element != null) setSelection(element); return; }  if (isValidSelection(startOffset, endOffset - startOffset)) selectAndReveal(startOffset, endOffset - startOffset); } finally { fRememberedSelectionStartOffset.clear(); fRememberedSelectionEndOffset.clear(); }
fRememberedSelection.restore();
	protected void restoreSelection() {				try {						int startOffset= fRememberedSelectionStartOffset.getOffset();			int endOffset= fRememberedSelectionEndOffset.getOffset();						// restore offset of right-most selected character plus one			if (fRememberedSelectionSign) {				if (startOffset != -1)					startOffset++;			} else {				if (endOffset != -1)					endOffset++;			}						if (startOffset == -1)				startOffset= endOffset; // fallback to carret offset						if (endOffset == -1)				endOffset= startOffset; // fallback to other offset						IJavaElement element;			if (endOffset == -1) {				 // fallback to element selection				element= fRememberedSelectionEndOffset.getElement();				if (element == null)					element= fRememberedSelectionStartOffset.getElement();				if (element != null)					setSelection(element);				return;			}									if (isValidSelection(startOffset, endOffset - startOffset))				selectAndReveal(startOffset, endOffset - startOffset);		} finally {			fRememberedSelectionStartOffset.clear();			fRememberedSelectionEndOffset.clear();		}	}