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

Method handleSaveAs

java/src/processing/mode/java/JavaEditor.java:659–684  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

657
658
659 public boolean handleSaveAs() {
660 //System.out.println("handleSaveAs");
661 String oldName = getSketch().getCode(0).getFileName();
662 //System.out.println("old name: " + oldName);
663 boolean saved = super.handleSaveAs();
664 if (saved) {
665 // re-set breakpoints in first tab (name has changed)
666 List<LineBreakpoint> bps = debugger.getBreakpoints(oldName);
667 debugger.clearBreakpoints(oldName);
668 String newName = getSketch().getCode(0).getFileName();
669 //System.out.println("new name: " + newName);
670 for (LineBreakpoint bp : bps) {
671 LineID line = new LineID(newName, bp.lineID().lineIdx());
672 //System.out.println("setting: " + line);
673 debugger.setBreakpoint(line);
674 }
675 // add breakpoint marker comments to source file
676 for (SketchCode code : getSketch().getCode()) {
677 addBreakpointComments(code.getFileName());
678 }
679
680 // set new name of variable inspector
681 //inspector.setTitle(getSketch().getName());
682 }
683 return saved;
684 }
685
686
687 /**

Callers

nothing calls this directly

Calls 9

addBreakpointCommentsMethod · 0.95
getCodeMethod · 0.80
getSketchMethod · 0.80
getBreakpointsMethod · 0.80
clearBreakpointsMethod · 0.80
lineIdxMethod · 0.80
lineIDMethod · 0.80
setBreakpointMethod · 0.80
getFileNameMethod · 0.45

Tested by

no test coverage detected