Overrides close() in PlugInFrame.
()
| 1363 | |
| 1364 | /** Overrides close() in PlugInFrame. */ |
| 1365 | public void close() { |
| 1366 | boolean okayToClose = true; |
| 1367 | ImageJ ij = IJ.getInstance(); |
| 1368 | if (!getTitle().equals("Errors") && changes && !IJ.isMacro() && ij!=null && !ij.quittingViaMacro()) { |
| 1369 | String msg = "Save changes to \"" + getTitle() + "\"?"; |
| 1370 | YesNoCancelDialog d = new YesNoCancelDialog(this, "Editor", msg); |
| 1371 | if (d.cancelPressed()) |
| 1372 | okayToClose = false; |
| 1373 | else if (d.yesPressed()) |
| 1374 | save(); |
| 1375 | } |
| 1376 | if (okayToClose) { |
| 1377 | //setVisible(false); |
| 1378 | dispose(); |
| 1379 | WindowManager.removeWindow(this); |
| 1380 | nWindows--; |
| 1381 | instance = null; |
| 1382 | changes = false; |
| 1383 | if (functionFinder!=null) |
| 1384 | functionFinder.close(); |
| 1385 | } |
| 1386 | } |
| 1387 | |
| 1388 | public void saveAs() { |
| 1389 | String name1 = getTitle(); |
nothing calls this directly
no test coverage detected