Top Fields Constructors Methods
org.jabref.gui.importer.actions

public Class OpenDatabaseAction

extends SimpleCommand
Class Inheritance
Imports
java.io.IOException, java.nio.file.Files, .Path, java.sql.SQLException, java.util.ArrayList, .Iterator, .List, .Objects, .Optional, javax.swing.undo.UndoManager, org.jabref.gui.ClipBoardManager, .DialogService, .LibraryTab, .LibraryTabContainer, .StateManager, org.jabref.gui.actions.SimpleCommand, org.jabref.gui.autosaveandbackup.BackupManager, org.jabref.gui.dialogs.BackupUIManager, org.jabref.gui.shared.SharedDatabaseUIManager, org.jabref.gui.undo.CountingUndoManager, org.jabref.gui.util.BackgroundTask, .FileDialogConfiguration, .TaskExecutor, .UiTaskExecutor, org.jabref.logic.importer.OpenDatabase, .ParserResult, org.jabref.logic.l10n.Localization, org.jabref.logic.shared.DatabaseNotSupportedException, org.jabref.logic.shared.exception.InvalidDBMSConnectionPropertiesException, .NotASharedDatabaseException, org.jabref.logic.util.StandardFileType, org.jabref.logic.util.io.FileHistory, org.jabref.model.entry.BibEntryTypesManager, org.jabref.model.util.FileUpdateMonitor, org.jabref.preferences.PreferencesService, org.slf4j.Logger, .LoggerFactory

Field Summary

Modifier and TypeField and Description
private final ClipBoardManager
private final DialogService
private final BibEntryTypesManager
private final FileUpdateMonitor
private static final Logger
private static final List<GUIPostOpenAction>
private final PreferencesService
private final StateManager
private final LibraryTabContainer
private final TaskExecutor
private final CountingUndoManager
Inherited from org.jabref.gui.actions.SimpleCommand:
statusMessage

Constructor Summary

AccessConstructor and Description
public
OpenDatabaseAction(LibraryTabContainer tabContainer, PreferencesService preferencesService, DialogService dialogService, StateManager stateManager, FileUpdateMonitor fileUpdateMonitor, BibEntryTypesManager entryTypesManager, CountingUndoManager undoManager, ClipBoardManager clipBoardManager, TaskExecutor taskExecutor)

Method Summary

Modifier and TypeMethod and Description
public void
private Path

Returns:

Path of current panel database directory or the working directory
getInitialDirectory
()

private ParserResult
public void
openFile(Path
the file, may be null or not existing
file
)

Opens the given file.

public void
openFiles(List<Path>
the filesToOpen, may be null or not existing
filesToOpen
)

Opens the given files.

public static void
openSharedDatabase(ParserResult parserResult, LibraryTabContainer tabContainer, DialogService dialogService, PreferencesService preferencesService, StateManager stateManager, BibEntryTypesManager entryTypesManager, FileUpdateMonitor fileUpdateMonitor, UndoManager undoManager, ClipBoardManager clipBoardManager, TaskExecutor taskExecutor)

private void
openTheFile(Path
the file, may be NOT null, but may not be existing
file
)

This is the real file opening.

public static void
performPostOpenActions(ParserResult
The result of the BIB file parse operation.
result
,
DialogService dialogService, PreferencesService preferencesService)

Go through the list of post open actions, and perform those that need to be performed.

Inherited from org.jabref.gui.actions.SimpleCommand:
getProgressprogressPropertysetExecutablestatusMessageProperty

Field Detail

clipboardManagerback to summary
private final ClipBoardManager clipboardManager
dialogServiceback to summary
private final DialogService dialogService
entryTypesManagerback to summary
private final BibEntryTypesManager entryTypesManager
fileUpdateMonitorback to summary
private final FileUpdateMonitor fileUpdateMonitor
LOGGERback to summary
private static final Logger LOGGER
POST_OPEN_ACTIONSback to summary
private static final List<GUIPostOpenAction> POST_OPEN_ACTIONS
preferencesServiceback to summary
private final PreferencesService preferencesService
stateManagerback to summary
private final StateManager stateManager
tabContainerback to summary
private final LibraryTabContainer tabContainer
taskExecutorback to summary
private final TaskExecutor taskExecutor
undoManagerback to summary
private final CountingUndoManager undoManager

Constructor Detail

OpenDatabaseActionback to summary
public OpenDatabaseAction(LibraryTabContainer tabContainer, PreferencesService preferencesService, DialogService dialogService, StateManager stateManager, FileUpdateMonitor fileUpdateMonitor, BibEntryTypesManager entryTypesManager, CountingUndoManager undoManager, ClipBoardManager clipBoardManager, TaskExecutor taskExecutor)

Method Detail

executeback to summary
public void execute()
Annotations
@Override
getInitialDirectoryback to summary
private Path getInitialDirectory()
Returns:Path

Path of current panel database directory or the working directory

loadDatabaseback to summary
private ParserResult loadDatabase(Path file) throws Exception
openFileback to summary
public void openFile(Path file)

Opens the given file. If null or 404, nothing happens. In case the file is already opened, that panel is raised.

Parameters
file:Path

the file, may be null or not existing

openFilesback to summary
public void openFiles(List<Path> filesToOpen)

Opens the given files. If one of it is null or 404, nothing happens. In case the file is already opened, that panel is raised.

Parameters
filesToOpen:List<Path>

the filesToOpen, may be null or not existing

openSharedDatabaseback to summary
public static void openSharedDatabase(ParserResult parserResult, LibraryTabContainer tabContainer, DialogService dialogService, PreferencesService preferencesService, StateManager stateManager, BibEntryTypesManager entryTypesManager, FileUpdateMonitor fileUpdateMonitor, UndoManager undoManager, ClipBoardManager clipBoardManager, TaskExecutor taskExecutor) throws SQLException, DatabaseNotSupportedException, InvalidDBMSConnectionPropertiesException, NotASharedDatabaseException
openTheFileback to summary
private void openTheFile(Path file)

This is the real file opening. Should be called via openFile(Path) Similar method: org.jabref.gui.frame.JabRefFrame#addTab(org.jabref.model.database.BibDatabaseContext, boolean).

Parameters
file:Path

the file, may be NOT null, but may not be existing

performPostOpenActionsback to summary
public static void performPostOpenActions(ParserResult result, DialogService dialogService, PreferencesService preferencesService)

Go through the list of post open actions, and perform those that need to be performed.

Parameters
result:ParserResult

The result of the BIB file parse operation.