private ReplaceEdit createUndoEdit(final IDocument document,final int offset,final int length,final String text){
  String currentText=null;
  try {
    currentText=document.get(offset,length);
  }
 catch (  BadLocationException cannotHappen) {
  }
  if (fCachedString != null && fCachedString.equals(currentText))   currentText=fCachedString;
 else   fCachedString=currentText;
  return new ReplaceEdit(offset,text != null ? text.length() : 0,currentText);
}

private ReplaceEdit createUndoEdit ( final IDocument document , final int offset , final int length , final String text ) { String currentText = null ; try { currentText = document . get ( offset , length ) ; } catch ( BadLocationException cannotHappen ) { } if ( fCachedString != null && fCachedString . equals ( currentText ) ) currentText = fCachedString ; else fCachedString = currentText ; return new ReplaceEdit ( offset , text != null ? text . length ( ) : 0 , currentText ) ; }
creates the corresponding text edit to the event .
