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

pack-priv Class EntryEditorFocusUtils

extends Object
Class Inheritance
Imports
java.util.Collection, .Map, .Optional, javafx.application.Platform, javafx.scene.Node, .Parent, javafx.scene.control.Tab, .TabPane, .TextInputControl, javafx.scene.input.KeyCode, .KeyEvent, org.jabref.gui.util.UiTaskExecutor, org.jabref.logic.l10n.Localization, org.jabref.logic.util.NotificationService, org.jabref.model.database.BibDatabaseMode, org.jabref.model.entry.EntryConverter, org.jabref.model.entry.field.Field, .FieldFactory, .FieldTextMapper, org.jspecify.annotations.Nullable

Handles all focus and keyboard-navigation concerns for EntryEditor.

Owns: field-level focus capture/restore across entry changes; tab-to-tab keyboard navigation (Tab/Shift-Tab wrapping) and jump-to-field lookups. DOM traversal is delegated to EntryEditorFocusTraversal.

Field Summary

Modifier and TypeField and Description
private @Nullable Field
private final NotificationService
private final Node
private final TabPane

Constructor Summary

AccessConstructor and Description
pack-priv
EntryEditorFocusUtils(TabPane tabPane, Node sceneSource, NotificationService notificationService)

Method Summary

Modifier and TypeMethod and Description
private void
private Field
pack-priv void
private void
private void
focusField(Field field, Runnable onNotFound)

private void
private void
pack-priv void
private Optional<FieldsEditorTab>
private boolean
isBoundaryFieldInCurrentTab(Node node, boolean first)

pack-priv boolean
pack-priv boolean
pack-priv void
pack-priv void
pack-priv void
restoreLastFocusedField()

Restores focus to the last captured field (if any) and moves the caret to the end.

private void
pack-priv void
pack-priv void
setupNavigationForTab(FieldsEditorTab tab)

Installs Tab/Shift-Tab wrapping key filters on every focusable node inside tab's content.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

lastFocusedFieldback to summary
private @Nullable Field lastFocusedField
notificationServiceback to summary
private final NotificationService notificationService
sceneSourceback to summary
private final Node sceneSource
tabPaneback to summary
private final TabPane tabPane

Constructor Detail

EntryEditorFocusUtilsback to summary
pack-priv EntryEditorFocusUtils(TabPane tabPane, Node sceneSource, NotificationService notificationService)

Method Detail

addFieldViaAllFieldsTabback to summary
private void addFieldViaAllFieldsTab(Field field)
canonicalFieldForActiveModeback to summary
private Field canonicalFieldForActiveMode(Field field, BibDatabaseMode mode)
captureFocusedFieldback to summary
pack-priv void captureFocusedField()
findAndSetupTabNavigableNodesback to summary
private void findAndSetupTabNavigableNodes(Parent parent)
focusFieldback to summary
private void focusField(Field field, Runnable onNotFound)
focusFirstFieldInTabback to summary
private void focusFirstFieldInTab(FieldsEditorTab tab)
focusLastFieldInTabback to summary
private void focusLastFieldInTab(FieldsEditorTab tab)
focusOrAddFieldback to summary
pack-priv void focusOrAddField(Field field)
getTabContainingFieldback to summary
private Optional<FieldsEditorTab> getTabContainingField(Field field)
isBoundaryFieldInCurrentTabback to summary
private boolean isBoundaryFieldInCurrentTab(Node node, boolean first)
isFirstFieldInCurrentTabback to summary
pack-priv boolean isFirstFieldInCurrentTab(Node node)
isLastFieldInCurrentTabback to summary
pack-priv boolean isLastFieldInCurrentTab(Node node)
moveToNextTabAndFocusback to summary
pack-priv void moveToNextTabAndFocus()
moveToPreviousTabAndFocusback to summary
pack-priv void moveToPreviousTabAndFocus()
restoreLastFocusedFieldback to summary
pack-priv void restoreLastFocusedField()

Restores focus to the last captured field (if any) and moves the caret to the end. Clears the captured field afterwards so a subsequent entry change starts clean.

selectTabAndFieldback to summary
private void selectTabAndField(FieldsEditorTab tab, Field field)
setFocusToFieldback to summary
pack-priv void setFocusToField(Field field)
setupNavigationForTabback to summary
pack-priv void setupNavigationForTab(FieldsEditorTab tab)

Installs Tab/Shift-Tab wrapping key filters on every focusable node inside tab's content.