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

public final Class PasswordFieldEditor

extends Object
Class Inheritance
Annotations
@NullMarked
Imports
java.util.function.Consumer, javafx.beans.property.StringProperty, javafx.scene.control.Button, javafx.scene.layout.HBox, org.jabref.gui.icon.IconTheme, .JabRefIcon, org.jabref.gui.util.ControlHelper, com.dlsc.gemsfx.EnhancedPasswordField, org.jspecify.annotations.NullMarked

Custom editor: a bound EnhancedPasswordField with an optional row of icon buttons in its right slot. EnhancedPasswordField is third-party, so the fluent subject is this wrapper; field() hands back the field once configuration is done — it does no work of its own, it just stops field from being reachable before the withers have run:
PasswordFieldEditor.create(viewModel.apiKeyProperty()) .withRevealButton() .withClearButton() .field();
PasswordFieldEditor.create(viewModel.apiKeyProperty())
                   .withRevealButton()
                   .withClearButton()
                   .field();

Every button follows the field's own disabled state, so disabling the field disables the row.

Field Summary

Modifier and TypeField and Description
private final HBox
private final EnhancedPasswordField

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static PasswordFieldEditor
public EnhancedPasswordField
public PasswordFieldEditor
withClearButton()

Empties the field and returns focus to it.

public PasswordFieldEditor
public PasswordFieldEditor
withRevealButton()

Toggles between masked and plain text.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

buttonsback to summary
private final HBox buttons
fieldback to summary
private final EnhancedPasswordField field

Constructor Detail

PasswordFieldEditorback to summary
private PasswordFieldEditor(StringProperty value)

Method Detail

createback to summary
public static PasswordFieldEditor create(StringProperty value)
fieldback to summary
public EnhancedPasswordField field()
withClearButtonback to summary
public PasswordFieldEditor withClearButton()

Empties the field and returns focus to it.

withIconButtonback to summary
public PasswordFieldEditor withIconButton(JabRefIcon icon, Consumer<EnhancedPasswordField> action)
withRevealButtonback to summary
public PasswordFieldEditor withRevealButton()

Toggles between masked and plain text.