Actually handle the save command. If 'immediately' is set to false, this will happen in another thread so that the message area will update and the save button will stay highlighted while the save is happening. If 'immediately' is true, then it will happen immediately. This is used during a quit, be
(boolean immediately)
| 2128 | * <A HREF="https://download.processing.org/bugzilla/276.html">Bug 276</A>. |
| 2129 | */ |
| 2130 | public boolean handleSave(boolean immediately) { |
| 2131 | // This was a mistake (rectified in 0136) that would cause long-running |
| 2132 | // sketches to be interrupted, causing much sadness. |
| 2133 | //handleStop(); |
| 2134 | |
| 2135 | if (sketch.isUntitled()) { |
| 2136 | return handleSaveAs(); |
| 2137 | // need to get the name, user might also cancel here |
| 2138 | |
| 2139 | } else if (immediately) { |
| 2140 | handleSaveImpl(); |
| 2141 | |
| 2142 | } else { |
| 2143 | EventQueue.invokeLater(this::handleSaveImpl); |
| 2144 | } |
| 2145 | return true; |
| 2146 | } |
| 2147 | |
| 2148 | |
| 2149 | protected void handleSaveImpl() { |
no test coverage detected