(ActionEvent e)
| 1121 | } |
| 1122 | |
| 1123 | public void actionPerformed(ActionEvent e) { |
| 1124 | stopCompoundEdit(); |
| 1125 | |
| 1126 | try { |
| 1127 | final Integer caret = caretUndoStack.pop(); |
| 1128 | caretRedoStack.push(caret); |
| 1129 | textarea.setCaretPosition(caret); |
| 1130 | textarea.scrollToCaret(); |
| 1131 | } catch (Exception ignore) { } |
| 1132 | |
| 1133 | try { |
| 1134 | undo.undo(); |
| 1135 | } catch (CannotUndoException ignored) { } |
| 1136 | |
| 1137 | updateUndoState(); |
| 1138 | redoAction.updateRedoState(); |
| 1139 | if (sketch != null) { |
| 1140 | sketch.setModified(!getText().equals(sketch.getCurrentCode().getSavedProgram())); |
| 1141 | // Go through all tabs; Replace All, Rename or Undo could have changed them |
| 1142 | for (SketchCode sc : sketch.getCode()) { |
| 1143 | if (sc.getDocument() != null) { |
| 1144 | try { |
| 1145 | sc.setModified(!sc.getDocumentText().equals(sc.getSavedProgram())); |
| 1146 | } catch (BadLocationException ignore) { } |
| 1147 | } |
| 1148 | } |
| 1149 | repaintHeader(); |
| 1150 | } |
| 1151 | } |
| 1152 | |
| 1153 | protected void updateUndoState() { |
| 1154 | if (undo.canUndo() || compoundEdit != null && compoundEdit.isInProgress()) { |
nothing calls this directly
no test coverage detected