MCPcopy Index your code
hub / github.com/benfry/processing4 / actionPerformed

Method actionPerformed

app/src/processing/app/ui/Editor.java:1123–1151  ·  view source on GitHub ↗
(ActionEvent e)

Source from the content-addressed store, hash-verified

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()) {

Callers

nothing calls this directly

Calls 15

updateUndoStateMethod · 0.95
stopCompoundEditMethod · 0.80
setCaretPositionMethod · 0.80
scrollToCaretMethod · 0.80
undoMethod · 0.80
updateRedoStateMethod · 0.80
getSavedProgramMethod · 0.80
getCurrentCodeMethod · 0.80
getCodeMethod · 0.80
getDocumentTextMethod · 0.80
repaintHeaderMethod · 0.80
popMethod · 0.45

Tested by

no test coverage detected