use of org.gephi.desktop.mrufiles.api.MostRecentFiles in project gephi by gephi.
the class ProjectControllerUIImpl method saveProject.
private void saveProject(Project project, File file) {
lockProjectActions();
final Runnable saveTask = controller.saveProject(project, file);
final String fileName = file.getName();
Runnable saveRunnable = new Runnable() {
@Override
public void run() {
saveTask.run();
//Status line
StatusDisplayer.getDefault().setStatusText(NbBundle.getMessage(ProjectControllerUIImpl.class, "ProjectControllerUI.status.saved", fileName));
}
};
if (saveTask instanceof LongTask) {
longTaskExecutor.execute((LongTask) saveTask, saveRunnable);
} else {
longTaskExecutor.execute(null, saveRunnable);
}
//Save MRU
MostRecentFiles mostRecentFiles = Lookup.getDefault().lookup(MostRecentFiles.class);
mostRecentFiles.addFile(file.getAbsolutePath());
}
Aggregations