public boolean undoIt() { try { document.deleteCommand(position, strng.length()); } catch (Exception e) { return false; } // try return true; } // undoIt()
/** * Perform the command encapsulated by this object. * * @return true if this call to doCommand was successful and can be undone. */ public boolean doIt() { try { document.insertStringCommand(position, strng); } catch (Exception e) { return false; } // try return true; } // doIt()