use of org.jabref.gui.util.FileDialogConfiguration in project jabref by JabRef.
the class ManageJournalAbbreviationsViewModel method addNewFile.
/**
* This method shall be used to add a new journal abbreviation file to the
* set of journal abbreviation files. It basically just calls the
* {@link #openFile(Path)}} method
*/
public void addNewFile() {
FileDialogConfiguration fileDialogConfiguration = new FileDialogConfiguration.Builder().addExtensionFilter(FileExtensions.TXT).build();
dialogService.showFileSaveDialog(fileDialogConfiguration).ifPresent(this::openFile);
}
use of org.jabref.gui.util.FileDialogConfiguration in project jabref by JabRef.
the class ManageJournalAbbreviationsViewModel method openFile.
public void openFile() {
FileDialogConfiguration fileDialogConfiguration = new FileDialogConfiguration.Builder().addExtensionFilter(FileExtensions.TXT).build();
dialogService.showFileOpenDialog(fileDialogConfiguration).ifPresent(this::openFile);
}
use of org.jabref.gui.util.FileDialogConfiguration in project jabref by JabRef.
the class ConnectToSharedDatabaseDialog method showFileChooser.
private void showFileChooser() {
FileDialogConfiguration fileDialogConfiguration = new FileDialogConfiguration.Builder().addExtensionFilter(FileExtensions.BIBTEX_DB).withDefaultExtension(FileExtensions.BIBTEX_DB).withInitialDirectory(Globals.prefs.get(JabRefPreferences.WORKING_DIRECTORY)).build();
DialogService ds = new FXDialogService();
Optional<Path> path = DefaultTaskExecutor.runInJavaFXThread(() -> ds.showFileOpenDialog(fileDialogConfiguration));
path.ifPresent(p -> fileLocationField.setText(p.toString()));
}
Aggregations