MCPcopy Index your code
hub / github.com/processing/processing / save

Method save

app/src/processing/app/Sketch.java:797–822  ·  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

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

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