Verified Owner
Top Description Inners Fields Constructors Methods
org.jabref.gui

public Class LibraryTab

extends Tab
implements CommandSelectionTab
Class Inheritance
Imports
java.io.IOException, .UncheckedIOException, java.nio.file.Path, java.util.List, .Optional, .Random, java.util.concurrent.Callable, java.util.function.BiConsumer, .Consumer, .Supplier, java.util.stream.Collectors, javafx.application.Platform, javafx.beans.property.BooleanProperty, .IntegerProperty, .ListProperty, .SimpleBooleanProperty, .SimpleIntegerProperty, .SimpleListProperty, javafx.beans.value.ObservableBooleanValue, javafx.collections.ListChangeListener, javafx.event.ActionEvent, .Event, javafx.scene.Node, javafx.scene.control.Alert, .ButtonBar, .ButtonType, .Tab, .TabPane, .TextArea, .Tooltip, org.jabref.gui.actions.StandardActions, org.jabref.gui.autocompleter.AutoCompletePreferences, .PersonNameSuggestionProvider, .SuggestionProvider, .SuggestionProviders, org.jabref.gui.autosaveandbackup.AutosaveManager, .BackupManager, org.jabref.gui.clipboard.ClipBoardManager, org.jabref.gui.collab.DatabaseChange, .DatabaseChangeList, .DatabaseChangeMonitor, org.jabref.gui.dialogs.AutosaveUiManager, org.jabref.gui.exporter.SaveDatabaseAction, org.jabref.gui.externalfiles.AutoRenameFileOnEntryChange, .ImportHandler, org.jabref.gui.fieldeditors.LinkedFileViewModel, org.jabref.gui.git.GitDiffDialogView, .GitPullScheduler, org.jabref.gui.icon.IconTheme, org.jabref.gui.importer.actions.OpenDatabaseAction, org.jabref.gui.linkedfile.DeleteFileAction, org.jabref.gui.maintable.BibEntryTableViewModel, .MainTable, .MainTableDataModel, org.jabref.gui.preferences.GuiPreferences, org.jabref.gui.undo.GuiUndoManager, org.jabref.gui.util.InsertUtil, .UiTaskExecutor, org.jabref.logic.ai.AiService, org.jabref.logic.citationstyle.CitationStyleCache, org.jabref.logic.command.CommandSelectionTab, org.jabref.logic.git.diff.GitDiffChecker, org.jabref.logic.git.util.GitHandlerRegistry, org.jabref.logic.importer.FetcherClientException, .FetcherException, .FetcherServerException, .ParserResult, org.jabref.logic.journals.JournalAbbreviationRepository, org.jabref.logic.l10n.Localization, org.jabref.logic.pdf.FileAnnotationCache, org.jabref.logic.search.SearchBackend, .SearchContext, org.jabref.logic.search.inmemory.InMemoryLuceneSearchBackend, org.jabref.logic.search.sqlbased.IndexManager, .PostgresServer, .SqlSearchBackend, org.jabref.logic.shared.DatabaseLocation, .DatabaseSynchronizer, org.jabref.logic.undo.UndoManager, org.jabref.logic.util.BackgroundTask, .CoarseChangeFilter, .OptionalObjectProperty, .TaskExecutor, org.jabref.logic.util.io.FileSnapshot, .FileUtil, org.jabref.model.FieldChange, .TransferInformation, .TransferMode, org.jabref.model.database.BibDatabase, .BibDatabaseContext, .BibDatabaseMode, org.jabref.model.database.event.BibDatabaseContextChangedEvent, .EntriesAddedEvent, .EntriesRemovedEvent, org.jabref.model.entry.Author, .BibEntry, .BibEntryTypesManager, .BibtexString, .LinkedFile, org.jabref.model.entry.event.EntriesEvent, .EntriesEventSource, .FieldChangedEvent, org.jabref.model.entry.field.FieldFactory, .StandardField, org.jabref.model.entry.types.StandardEntryType, org.jabref.model.groups.GroupTreeNode, org.jabref.model.metadata.event.MetaDataChangeSource, .MetaDataChangedEvent, org.jabref.model.search.query.SearchQuery, org.jabref.model.undo.UndoableRemoveEntries, org.jabref.model.util.DummyFileUpdateMonitor, .FileUpdateMonitor, com.airhacks.afterburner.injection.Injector, com.google.common.eventbus.Subscribe, com.tobiasdiez.easybind.EasyBind, com.tobiasdiez.easybind.Subscription, org.jspecify.annotations.NonNull, .Nullable, org.slf4j.Logger, .LoggerFactory

Represents the ui area where the notifier pane, the library table and the entry editor are shown.

Nested and Inner Type Summary

Modifier and TypeClass and Description
private class
private class
pack-priv static class
pack-priv static class

Field Summary

Modifier and TypeField and Description
private final AiService
private FileAnnotationCache
private Runnable
private AutoRenameFileOnEntryChange
private boolean
private BibDatabaseContext
private final BooleanProperty
private final BooleanProperty
private final BooleanProperty
private Optional<DatabaseChangeMonitor>
private final ClipBoardManager
private CoarseChangeFilter
private org.jabref.logic.util.BackgroundTask<?>
private final DialogService
private com.tobiasdiez.easybind.Subscription
private final BibEntryTypesManager
private final FileUpdateMonitor
private final GitHandlerRegistry
private ImportHandler
private final JournalAbbreviationRepository
private final SimpleBooleanProperty
private static final Logger
private MainTable
private final GuiPreferences
private final IntegerProperty
private boolean
private PersonNameSuggestionProvider
private SearchContext
private final org.jabref.logic.util.OptionalObjectProperty<SearchQuery>
private ListProperty<GroupTreeNode>
private final StateManager
private SuggestionProviders
private final LibraryTabContainer
private MainTableDataModel
private final TaskExecutor
Inherited from javafx.scene.control.Tab:
CLOSED_EVENTSELECTION_CHANGED_EVENTTAB_CLOSE_REQUEST_EVENT

Constructor Summary

AccessConstructor and Description
private
LibraryTab(@NonNull BibDatabaseContext bibDatabaseContext, @NonNull LibraryTabContainer tabContainer, @NonNull DialogService dialogService, AiService aiService, @NonNull GuiPreferences preferences, @NonNull StateManager stateManager, FileUpdateMonitor fileUpdateMonitor, BibEntryTypesManager entryTypesManager, ClipBoardManager clipBoardManager, TaskExecutor taskExecutor, GitHandlerRegistry gitHandlerRegistry, boolean
Indicates whether the database context is a dummy. A dummy context is used to display a progress indicator while parsing the database.
isDummyContext
)

If the context is a dummy, the Lucene index should not be created, as both the dummy context and the actual context share the same index path BibDatabaseContext#getFulltextIndexPath().

Method Summary

Modifier and TypeMethod and Description
private static void
private static void
addModeInfo(StringBuilder text, BibDatabaseContext bibDatabaseContext)

private static void
public void
back()

public boolean
public BooleanProperty
public boolean
public BooleanProperty
public void
clearAndSelect(@NonNull BibEntry bibEntry)

This method selects the given entry, and scrolls it into view in the table.

public void
clearAndSelect(final List<BibEntry> bibEntries)

public void
private static void
private boolean

Returns:

true if the user chooses to close the database
confirmClose
()

Ask if the user really wants to close the given database.

public void
public static LibraryTab
createLibraryTab(org.jabref.logic.util.BackgroundTask<ParserResult>
The task to execute to load the data asynchronously.
dataLoadingTask
,
Path
the path to the file (loaded by the dataLoadingTask)
file
,
DialogService dialogService, AiService aiService, GuiPreferences preferences, StateManager stateManager, LibraryTabContainer tabContainer, FileUpdateMonitor fileUpdateMonitor, BibEntryTypesManager entryTypesManager, ClipBoardManager clipBoardManager, TaskExecutor taskExecutor, GitHandlerRegistry gitHandlerRegistry)

Creates a new library tab.

public static LibraryTab
createLibraryTab(Callable<BibDatabaseContext> connectionTask, BibDatabaseContext dummyContext, DialogService dialogService, AiService aiService, GuiPreferences preferences, StateManager stateManager, LibraryTabContainer tabContainer, FileUpdateMonitor fileUpdateMonitor, BibEntryTypesManager entryTypesManager, ClipBoardManager clipBoardManager, TaskExecutor taskExecutor, GitHandlerRegistry gitHandlerRegistry, BiConsumer<LibraryTab, BibDatabaseContext> onSuccess, Consumer<Exception> onFailure)

Creates a shared-library tab that displays the main table's loading indicator until connectionTask has connected.

public static LibraryTab
createLibraryTab(@NonNull BibDatabaseContext databaseContext, LibraryTabContainer tabContainer, DialogService dialogService, AiService aiService, GuiPreferences preferences, StateManager stateManager, FileUpdateMonitor fileUpdateMonitor, BibEntryTypesManager entryTypesManager, ClipBoardManager clipBoardManager, TaskExecutor taskExecutor, GitHandlerRegistry gitHandlerRegistry)

private void
public void
public void
cutEntry()

Copies the selection to the clipboard, then removes it from the library.

public void
deleteEntry()

Removes the selected entries and files linked to selected entries from the database

public void
private int
doCopyEntry(TransferMode transferMode, List<BibEntry> selectedEntries)

private int
doDeleteEntry(StandardActions
If DELETE_ENTRY the user will get asked if he really wants to delete the entries, and it will be localized as "deleted". If true the action will be localized as "cut"
mode
,
List<BibEntry> entries)

Removes the selected entries and files linked to selected entries from the database

public void
dropEntry(BibDatabaseContext sourceBibDatabaseContext, List<BibEntry> originalEntries, List<BibEntry> entriesToAdd, TransferMode mode)

public void
public FileAnnotationCache
public SuggestionProvider<Author>
public BibDatabaseContext
public BibDatabase
getDatabase()

Put an asterisk behind the filename to indicate the database has changed.

public ObservableBooleanValue
public MainTable
public SearchContext
public List<BibEntry>

Returns:

A list containing the selected entries. Is never null.
getSelectedEntries
()

Get an array containing the currently selected entries.

public SuggestionProviders
getSuggestionProviders()

Returns a collection of suggestion providers, which are populated from the current library.

public UndoManager
getUndoManager()

The journal to record a change to this library on.

private int
getUntitledLibraryNumber()

Returns an index for a new untitled library to generate names like "untitled (1)", "untitled (2)", etc.

private List<BibEntry>
private void
initializeComponentsAndListeners(boolean isDummyContext)

public void
insertEntries(final List<BibEntry>
the list of entries to insert; must not be empty
entries
)

Inserts the given entries into the database and updates the UI accordingly.

public void
insertEntry(final BibEntry bibEntry)

public void
private boolean
private boolean
public boolean
public boolean
private GuiUndoManager
public void
listen(BibDatabaseContextChangedEvent event)

Marks the changes the journal does not know about, so that changedProperty can derive the rest from it.

private BibDatabaseContext
loadSavedFile()

Parses the file on disk; its TeX groups must not register with the shared file monitor because the snapshot is discarded after the diff.

private void
private void
onClosed(Event event)

Perform necessary cleanup when this Library is closed.

private void
private void
private void
private BibDatabaseContext
public void
public void
public boolean
public void
public void
resetChangedProperties(@Nullable FileSnapshot
the on-disk state the library matches, as reported by the writer that committed it; null to determine it from the file (e.g. after merging all external changes)
diskState
)

All call sites mean "in-memory library now matches the disk", so file events for that state need no scan.

public void
public IntegerProperty
public void
resumeChangeMonitor()

Resuming also scans for external changes that arrived while the monitor was suspended, e.g. a concurrent write that aborted the suspended save — the standard external-changes review flow is offered for them.

public org.jabref.logic.util.OptionalObjectProperty<SearchQuery>
public ListProperty<GroupTreeNode>
public void
public void
public void
private void
private void
setDataLoadingTask(org.jabref.logic.util.BackgroundTask<?> dataLoadingTask)

public void
setSaving(boolean saving)

private void
setupAutoCompletion()

Set up autocompletion for this database

public void
public void
private boolean

Returns:

true if user confirm to delete entry
showDeleteConfirmationDialog
(int
number of entries user is selecting
numberOfEntries
)

Initializes a pop-up dialog box to confirm whether the user wants to delete the selected entry Keep track of user preference: if the user prefers not to ask before deleting, delete the selected entry without displaying the dialog box

private void
private void
private void
showDiffToSavedFile()

Shows the unsaved in-memory changes compared to the file on disk (or to an empty library if never saved).

public void
startDataLoadingTask()

Starts a loading task after its tab has been added to the tab container.

public void
pack-priv static IconTheme.JabRefIcons
public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

public void
updateNavigationState()

Updates the StateManager with current navigation state Only update if this is the active tab

public void
updateTabTitle(boolean isChanged)

Sets the title of the tab modification-asterisk filename – path-fragment

The modification-asterisk (*) is shown if the file was modified since last save (path-fragment is only shown if filename is not (globally) unique)

Example: *jabref-authors.bib – testbib

Inherited from javafx.scene.control.Tab:
addEventFilteraddEventHandlerbuildEventDispatchChainclosablePropertycontentPropertycontextMenuPropertydisabledPropertydisablePropertygetClassCssMetaDatagetContentgetContextMenugetCssMetaDatagetGraphicgetIdgetOnClosedgetOnCloseRequestgetOnSelectionChangedgetPropertiesgetPseudoClassStatesgetStylegetStyleableParentgetStyleClassgetTabPanegetTextgetTooltipgetTypeSelectorgetUserDatagraphicPropertyhasPropertiesidPropertyisClosableisDisableisDisabledisSelectedonClosedPropertyonCloseRequestPropertyonSelectionChangedPropertyremoveEventFilterremoveEventHandlerselectedPropertysetClosablesetContentsetContextMenusetDisablesetGraphicsetIdsetOnClosedsetOnCloseRequestsetOnSelectionChangedsetStylesetTextsetTooltipsetUserDatastylePropertytabPanePropertytextPropertytooltipProperty