Verified Owner
Top Fields Constructors Methods
org.jabref.gui.preferences.keybindings

public Class KeyBindingsTabViewModel

extends Object
implements PreferenceTabViewModel
Class Inheritance
All Implemented Interfaces
org.jabref.gui.preferences.PreferenceTabViewModel
Imports
java.util.ArrayList, .List, .Optional, javafx.beans.property.ListProperty, .ObjectProperty, .SimpleListProperty, .SimpleObjectProperty, javafx.collections.FXCollections, javafx.scene.control.Alert, .ButtonBar, .ButtonType, javafx.scene.input.KeyEvent, org.jabref.gui.DialogService, org.jabref.gui.keyboard.KeyBinding, .KeyBindingCategory, .KeyBindingRepository, org.jabref.gui.preferences.PreferenceTabViewModel, org.jabref.gui.preferences.keybindings.presets.BashKeyBindingPreset, .KeyBindingPreset, .NewEntryBindingPreset, org.jabref.logic.l10n.Localization, org.jabref.logic.util.OptionalObjectProperty, org.jspecify.annotations.NonNull

Field Summary

Modifier and TypeField and Description
private final DialogService
private final ListProperty<KeyBindingPreset>
private final KeyBindingRepository
keyBindingRepository

Working copy the tab edits; written back to liveKeyBindingRepository on store.

private final KeyBindingRepository
private final List<String>
private final ObjectProperty<KeyBindingViewModel>
private final org.jabref.logic.util.OptionalObjectProperty<KeyBindingViewModel>

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
public KeyBindingRepository
public List<String>
getRestartWarnings()

Overrides default org.jabref.gui.preferences.PreferenceTabViewModel.getRestartWarnings.

This method should be called after storing the preferences, to collect the properties, which require a restart of JabRef to load

public ListProperty<KeyBindingPreset>
public void
private boolean

Returns:

true if the term is found in the keybinding
matchesSearchTerm
(KeyBinding
keybinding to search in
keyBinding
,
String
term to search for
searchTerm
)

Searches for the term in the keybinding's localization, category, or key combination

public void
public ObjectProperty<KeyBindingViewModel>
public org.jabref.logic.util.OptionalObjectProperty<KeyBindingViewModel>
public void
public void
setValues()

Implements org.jabref.gui.preferences.PreferenceTabViewModel.setValues.

Read all keybindings from the keybinding repository and create table keybinding models for them

public void
storeSettings()

Implements org.jabref.gui.preferences.PreferenceTabViewModel.storeSettings.

This method is called when the user presses OK in the Preferences dialog.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

dialogServiceback to summary
private final DialogService dialogService
keyBindingPresetsback to summary
private final ListProperty<KeyBindingPreset> keyBindingPresets
keyBindingRepositoryback to summary
private final KeyBindingRepository keyBindingRepository

Working copy the tab edits; written back to liveKeyBindingRepository on store.

liveKeyBindingRepositoryback to summary
private final KeyBindingRepository liveKeyBindingRepository
restartWarningback to summary
private final List<String> restartWarning
rootKeyBindingback to summary
private final ObjectProperty<KeyBindingViewModel> rootKeyBinding
selectedKeyBindingback to summary
private final org.jabref.logic.util.OptionalObjectProperty<KeyBindingViewModel> selectedKeyBinding

Constructor Detail

KeyBindingsTabViewModelback to summary
public KeyBindingsTabViewModel(@NonNull KeyBindingRepository keyBindingRepository, @NonNull DialogService dialogService)

Method Detail

filterValuesback to summary
public void filterValues(String term)
getKeyBindingRepositoryback to summary
public KeyBindingRepository getKeyBindingRepository()
getRestartWarningsback to summary
public List<String> getRestartWarnings()

Overrides default org.jabref.gui.preferences.PreferenceTabViewModel.getRestartWarnings.

Doc from org.jabref.gui.preferences.PreferenceTabViewModel.getRestartWarnings.

This method should be called after storing the preferences, to collect the properties, which require a restart of JabRef to load

Annotations
@Override
keyBindingPresetsback to summary
public ListProperty<KeyBindingPreset> keyBindingPresets()
loadPresetback to summary
public void loadPreset(KeyBindingPreset preset)
matchesSearchTermback to summary
private boolean matchesSearchTerm(KeyBinding keyBinding, String searchTerm)

Searches for the term in the keybinding's localization, category, or key combination

Parameters
keyBinding:KeyBinding

keybinding to search in

searchTerm:String

term to search for

Returns:boolean

true if the term is found in the keybinding

resetToDefaultback to summary
public void resetToDefault()
rootKeyBindingPropertyback to summary
public ObjectProperty<KeyBindingViewModel> rootKeyBindingProperty()
selectedKeyBindingPropertyback to summary
public org.jabref.logic.util.OptionalObjectProperty<KeyBindingViewModel> selectedKeyBindingProperty()
setNewBindingForCurrentback to summary
public void setNewBindingForCurrent(KeyEvent event)
setValuesback to summary
public void setValues()

Implements org.jabref.gui.preferences.PreferenceTabViewModel.setValues.

Read all keybindings from the keybinding repository and create table keybinding models for them

Annotations
@Override
storeSettingsback to summary
public void storeSettings()

Implements org.jabref.gui.preferences.PreferenceTabViewModel.storeSettings.

Doc from org.jabref.gui.preferences.PreferenceTabViewModel.storeSettings.

This method is called when the user presses OK in the Preferences dialog. Implementing classes must make sure all settings presented get stored in PreferencesService.

Annotations
@Override