MCPcopy Create free account
hub / github.com/AstroImageJ/astroimagej / undo

Method undo

ij/src/main/java/ij/plugin/frame/Editor.java:812–828  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

810 }
811
812 void undo() {
813 if (IJ.isWindows()) {
814 IJ.showMessage("Editor", "Press Ctrl-Z to undo");
815 return;
816 }
817 if (IJ.debugMode) IJ.log("Undo1: "+undoBuffer.size());
818 int position = ta.getCaretPosition();
819 if (undoBuffer.size()>1) {
820 undoBuffer.remove(undoBuffer.size()-1);
821 String text = (String)undoBuffer.get(undoBuffer.size()-1);
822 performingUndo = true;
823 ta.setText(text);
824 if (position<=text.length())
825 ta.setCaretPosition(position-offset(position));
826 if (IJ.debugMode) IJ.log("Undo2: "+undoBuffer.size()+" "+text);
827 }
828 }
829
830 boolean copy() {
831 String s;

Callers 1

actionPerformedMethod · 0.95

Calls 9

isWindowsMethod · 0.95
showMessageMethod · 0.95
logMethod · 0.95
offsetMethod · 0.95
lengthMethod · 0.65
sizeMethod · 0.45
removeMethod · 0.45
getMethod · 0.45
setTextMethod · 0.45

Tested by

no test coverage detected