if (fSourceRegion != null && (isDelete(command) || isClosingBracket(command))) {  command.addCommand(fUndoEvent.getOffset(), fUndoEvent.getLength(), fUndoEvent.getText(), fDocumentListener); command.owner= fDocumentListener; command.doit= false; fSourceRegion= null; fUndoEvent= null;
if (fSourceRegion != null) {  if (isBackspace(command) || isClosingBracket(command)) {  command.addCommand(fUndoEvent.getOffset(), fUndoEvent.getLength(), fUndoEvent.getText(), fDocumentListener); command.owner= fDocumentListener; command.doit= false; fSourceRegion= null; fUndoEvent= null; } else if (isDelete(command)) {  command.caretOffset= command.offset; command.offset= fUndoEvent.getOffset(); command.length= fUndoEvent.getLength(); command.text= fUndoEvent.getText(); command.owner= fDocumentListener; command.doit= false; fSourceRegion= null; fUndoEvent= null; }
	public void customizeDocumentCommand(IDocument document, DocumentCommand command) {		try {			if (!command.doit)				return;			if (fSourceRegion != null && (isDelete(command) || isClosingBracket(command))) {				// restore				command.addCommand(fUndoEvent.getOffset(), fUndoEvent.getLength(), fUndoEvent.getText(), fDocumentListener);				command.owner= fDocumentListener;				command.doit= false;				fSourceRegion= null;				fUndoEvent= null;			} else if (command.text != null && command.text.equals("{")) //$NON-NLS-1$				smartBraces(document, command);		} catch (BadLocationException e) {			JavaPlugin.log(e);			}	}