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

Method save

app/src/processing/app/Sketch.java:804–829  ·  view source on GitHub ↗

Save all code in the current sketch. This just forces the files to save in place, so if it's an untitled (un-saved) sketch, saveAs() should be called instead. (This is handled inside Editor.handleSave()).

()

Source from the content-addressed store, hash-verified

802 * called instead. (This is handled inside Editor.handleSave()).
803 */
804 public boolean save() throws IOException {
805 // make sure the user didn't hide the sketch folder
806 ensureExistence();
807
808 // first get the contents of the editor text area
809 updateSketchCodes();
810
811 // don't do anything if not actually modified
812 //if (!modified) return false;
813
814 if (isReadOnly()) {
815 // if the files are read-only, need to first do a "save as".
816 Messages.showMessage(Language.text("save_file.messages.is_read_only"),
817 Language.text("save_file.messages.is_read_only.description"));
818 // if the user cancels, give up on the save()
819 if (!saveAs()) return false;
820 }
821
822 for (SketchCode sc : code) {
823 if (sc.isModified()) {
824 sc.save();
825 }
826 }
827 calcModified();
828 return true;
829 }
830
831
832 /**

Callers 2

saveAsMethod · 0.95
ensureExistenceMethod · 0.45

Calls 8

ensureExistenceMethod · 0.95
updateSketchCodesMethod · 0.95
isReadOnlyMethod · 0.95
showMessageMethod · 0.95
textMethod · 0.95
saveAsMethod · 0.95
calcModifiedMethod · 0.95
isModifiedMethod · 0.45

Tested by

no test coverage detected