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

public Class KeyBindingViewModel

extends Object
Class Inheritance
Imports
java.util.Optional, javafx.beans.property.SimpleStringProperty, .StringProperty, javafx.collections.FXCollections, .ObservableList, javafx.scene.input.KeyCode, .KeyCombination, .KeyEvent, org.jabref.gui.icon.IconTheme, .JabRefIcon, org.jabref.gui.keyboard.KeyBinding, .KeyBindingCategory, .KeyBindingRepository, org.jabref.logic.os.OS

This class represents a view model for objects of the KeyBinding class. It has two properties representing the localized name of an action and its key bind. It can also represent a key binding category instead of a key bind itself.

Field Summary

Modifier and TypeField and Description
private final KeyBindingCategory
private final ObservableList<KeyBindingViewModel>
private final SimpleStringProperty
private KeyBinding
private final KeyBindingRepository
private String
private final SimpleStringProperty

Constructor Summary

AccessConstructor and Description
public
KeyBindingViewModel(KeyBindingRepository keyBindingRepository, KeyBinding keyBinding, String binding)

public

Method Summary

Modifier and TypeMethod and Description
public void
public String
public ObservableList<KeyBindingViewModel>
public Optional<JabRefIcon>
public KeyBinding
public Optional<JabRefIcon>
public boolean
public StringProperty
public void
resetToDefault()

This method will reset the key bind of this models KeyBinding object to it's default bind

private void
private void
public boolean

Returns:

true if the KeyEvent is a valid binding, false else
setNewBinding
(KeyEvent
as KeyEvent
evt
)

Sets a a new key bind to this objects key binding object if the given key event is a valid combination of keys.

public StringProperty
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

categoryback to summary
private final KeyBindingCategory category
childrenback to summary
private final ObservableList<KeyBindingViewModel> children
displayNameback to summary
private final SimpleStringProperty displayName
keyBindingback to summary
private KeyBinding keyBinding
keyBindingRepositoryback to summary
private final KeyBindingRepository keyBindingRepository
realBindingback to summary
private String realBinding
shownBindingback to summary
private final SimpleStringProperty shownBinding

Constructor Detail

KeyBindingViewModelback to summary
public KeyBindingViewModel(KeyBindingRepository keyBindingRepository, KeyBinding keyBinding, String binding)
KeyBindingViewModelback to summary
public KeyBindingViewModel(KeyBindingRepository keyBindingRepository, KeyBindingCategory category)

Method Detail

clearback to summary
public void clear()
getBindingback to summary
public String getBinding()
getChildrenback to summary
public ObservableList<KeyBindingViewModel> getChildren()
getClearIconback to summary
public Optional<JabRefIcon> getClearIcon()
getKeyBindingback to summary
public KeyBinding getKeyBinding()
getResetIconback to summary
public Optional<JabRefIcon> getResetIcon()
isCategoryback to summary
public boolean isCategory()
namePropertyback to summary
public StringProperty nameProperty()
resetToDefaultback to summary
public void resetToDefault()

This method will reset the key bind of this models KeyBinding object to it's default bind

setBindingback to summary
private void setBinding(String bind)
setDisplayNameback to summary
private void setDisplayName()
setNewBindingback to summary
public boolean setNewBinding(KeyEvent evt)

Sets a a new key bind to this objects key binding object if the given key event is a valid combination of keys.

Parameters
evt:KeyEvent

as KeyEvent

Returns:boolean

true if the KeyEvent is a valid binding, false else

shownBindingPropertyback to summary
public StringProperty shownBindingProperty()