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

public Class UserDefinedFieldsTab

extends FieldsEditorTab
Class Inheritance
Annotations
@NullMarked
Imports
java.util.Optional, .SequencedSet, java.util.concurrent.atomic.AtomicBoolean, javafx.application.Platform, javafx.beans.property.BooleanProperty, .SimpleBooleanProperty, org.jabref.gui.StateManager, org.jabref.gui.icon.IconTheme, org.jabref.gui.preferences.GuiPreferences, org.jabref.gui.preview.PreviewPanel, org.jabref.gui.undo.RedoAction, .UndoAction, org.jabref.logic.journals.JournalAbbreviationRepository, org.jabref.model.database.BibDatabaseContext, org.jabref.model.entry.BibEntry, org.jabref.model.entry.event.FieldChangedEvent, org.jabref.model.entry.field.Field, .InternalField, com.google.common.eventbus.Subscribe, com.tobiasdiez.easybind.EasyBind, org.jspecify.annotations.NullMarked

A user-defined tab showing the fields resolved from a EntryEditorTabModel.CustomizedFieldsTab (configured in the entry editor preferences).

Field Summary

Modifier and TypeField and Description
private final AtomicBoolean
entryTypeChangeQueued

Set when a coalesced burst contains an entry-type change, which forces a rebuild (see listen).

private final BooleanProperty
hasResolvedFields

Replaces the base class's content-driven visibility: a regex pattern's matches change when fields are set or cleared on the same entry (e.g. from the Main or Source tab), which the base class's entry-switch-only evaluation would miss.

private final EntryEditorTabModel.CustomizedFieldsTab
private final AtomicBoolean
refreshQueued

Set while a refresh is queued on the FX thread (events may arrive from background threads, e.g. fetchers), so bursts of field changes coalesce into one refresh instead of one each.

private Optional<BibEntry>
subscribedEntry

The entry whose event bus this tab is subscribed to, for live refresh of regex-captured fields.

Inherited from org.jabref.gui.entryeditor.FieldsEditorTab:
editorsgridPane

Constructor Summary

AccessConstructor and Description
public
UserDefinedFieldsTab(EntryEditorTabModel.CustomizedFieldsTab model, UndoAction undoAction, RedoAction redoAction, GuiPreferences preferences, JournalAbbreviationRepository journalAbbreviationRepository, StateManager stateManager, PreviewPanel previewPanel)

Method Summary

Modifier and TypeMethod and Description
protected void
protected SequencedSet<Field>
protected void
dispose()

Overrides org.jabref.gui.entryeditor.EntryEditorTab.dispose.

Releases listeners owned by this tab before it is discarded.

public void
listen(FieldChangedEvent event)

Refreshes the tab when a field is set or cleared from outside (Main tab, Source tab, fetchers, undo, …), since that can change which fields a regex pattern captures.

Inherited from org.jabref.gui.entryeditor.FieldsEditorTab:
createLabelAndEditorgetEditorContentgetShownFieldshandleFocuslayoutEditorsremovePreviewPanelFromThisTabrequestFocussetCompressedRowLayoutsetupPanelstretchContentToTabHeight

Field Detail

entryTypeChangeQueuedback to summary
private final AtomicBoolean entryTypeChangeQueued

Set when a coalesced burst contains an entry-type change, which forces a rebuild (see listen).

hasResolvedFieldsback to summary
private final BooleanProperty hasResolvedFields

Replaces the base class's content-driven visibility: a regex pattern's matches change when fields are set or cleared on the same entry (e.g. from the Main or Source tab), which the base class's entry-switch-only evaluation would miss.

modelback to summary
private final EntryEditorTabModel.CustomizedFieldsTab model
refreshQueuedback to summary
private final AtomicBoolean refreshQueued

Set while a refresh is queued on the FX thread (events may arrive from background threads, e.g. fetchers), so bursts of field changes coalesce into one refresh instead of one each.

subscribedEntryback to summary
private Optional<BibEntry> subscribedEntry

The entry whose event bus this tab is subscribed to, for live refresh of regex-captured fields.

Constructor Detail

UserDefinedFieldsTabback to summary
public UserDefinedFieldsTab(EntryEditorTabModel.CustomizedFieldsTab model, UndoAction undoAction, RedoAction redoAction, GuiPreferences preferences, JournalAbbreviationRepository journalAbbreviationRepository, StateManager stateManager, PreviewPanel previewPanel)

Method Detail

bindToEntryback to summary
protected void bindToEntry(BibEntry entry)

Overrides org.jabref.gui.entryeditor.FieldsEditorTab.bindToEntry.

Annotations
@Override
determineFieldsToShowback to summary
protected SequencedSet<Field> determineFieldsToShow(BibEntry entry)

Implements abstract org.jabref.gui.entryeditor.FieldsEditorTab.determineFieldsToShow.

Annotations
@Override
disposeback to summary
protected void dispose()

Overrides org.jabref.gui.entryeditor.EntryEditorTab.dispose.

Doc from org.jabref.gui.entryeditor.EntryEditorTab.dispose.

Releases listeners owned by this tab before it is discarded.

Annotations
@Override
listenback to summary
public void listen(FieldChangedEvent event)

Refreshes the tab when a field is set or cleared from outside (Main tab, Source tab, fetchers, undo, …), since that can change which fields a regex pattern captures. Event bursts coalesce into a single deferred refresh, and the refresh reads the entry's state at callback time (the event's payload is deliberately ignored), so a queued callback can never apply stale state. Rebuilds only when the resolved field set actually changes (or the entry type changed), so typing inside this tab's editors never steals focus.

Annotations
@Subscribe