MCPcopy Index your code
hub / github.com/Col-E/Recaf / saveWorkspace

Method saveWorkspace

src/main/java/me/coley/recaf/ui/MainMenu.java:524–540  ·  view source on GitHub ↗

Save the current workspace to a file.

()

Source from the content-addressed store, hash-verified

522 * Save the current workspace to a file.
523 */
524 private void saveWorkspace() {
525 if (controller.getWorkspace() == null) {
526 return;
527 }
528 fcSaveWorkspace.setInitialDirectory(config().getRecentSaveWorkspaceDir());
529 File file = fcSaveWorkspace.showSaveDialog(null);
530 if (file != null) {
531 String json = WorkspaceIO.toJson(controller.getWorkspace());
532 try {
533 FileUtils.write(file, json, UTF_8);
534 config().recentSaveWorkspace = file.getAbsolutePath();
535 } catch(IOException ex) {
536 error(ex, "Failed to save workspace to file: {}", file.getName());
537 ExceptionAlert.show(ex, "Failed to save workspace to file: " + file.getName());
538 }
539 }
540 }
541
542 /**
543 * Update the recent files menu.

Callers

nothing calls this directly

Calls 7

configMethod · 0.95
toJsonMethod · 0.95
showMethod · 0.95
getNameMethod · 0.65
getWorkspaceMethod · 0.45
errorMethod · 0.45

Tested by

no test coverage detected