Verified Owner
Top Inners Fields Constructors Methods
org.jabref.gui.fieldeditors

public Class EditorTextArea

extends TextArea
implements Initializable, ContextMenuAddable
Class Inheritance
All Implemented Interfaces
org.jabref.gui.fieldeditors.ContextMenuAddable, javafx.fxml.Initializable
Imports
java.net.URL, java.util.List, .ResourceBundle, java.util.function.Supplier, javafx.application.Platform, javafx.event.EventHandler, javafx.fxml.Initializable, javafx.scene.Node, javafx.scene.control.ContextMenu, .MenuItem, .TextArea, javafx.scene.input.KeyCode, .KeyEvent, javafx.scene.layout.Region, javafx.scene.text.Text, org.jabref.gui.clipboard.ClipBoardManager, org.jabref.gui.fieldeditors.contextmenu.EditorContextAction, org.jabref.gui.keyboard.KeyBindingRepository, org.jspecify.annotations.NonNull

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class

Field Summary

Modifier and TypeField and Description
private int
private final ContextMenu
private boolean
private boolean
private Runnable
pasteActionHandler

Variable that contains user-defined behavior for paste action.

private boolean
private double
Inherited from javafx.scene.control.TextArea:
DEFAULT_PREF_COLUMN_COUNTDEFAULT_PREF_ROW_COUNT

Constructor Summary

AccessConstructor and Description
public
public
EditorTextArea(final String text)

Method Summary

Modifier and TypeMethod and Description
protected double
computePrefHeight(double width)

Overrides javafx.scene.control.Control.computePrefHeight.

Wraps at the last laid-out width (or the hint before the first layout) instead of reporting a horizontal content bias: a biased child makes the enclosing grid measure every row at a width, which lets sibling editors such as the tags field wrap at their preferred width and briefly show too tall — a visible jump on every entry switch.

public void
expand()

Shows the complete text instead of the collapsed collapsedRows, as the first focus does.

public void
initContextMenu(final Supplier<List<MenuItem>> items, KeyBindingRepository keyBindingRepository)

Implements org.jabref.gui.fieldeditors.ContextMenuAddable.initContextMenu.

Adds the given list of menu items to the context menu.

public void
initialize(URL location, ResourceBundle resources)

Implements javafx.fxml.Initializable.initialize.

Called to initialize a controller after its root element has been completely processed.

public void
paste()

Overrides javafx.scene.control.TextInputControl.paste.

Override javafx TextArea method applying TextArea.paste() and pasteActionHandler after

public void
setGrowWithContent(double widthHint, int collapsedRows)

Sizes the area to its wrapped text (one row when empty, growing as text is typed) instead of the fixed preferred row count.

public void
setPasteActionHandler(@NonNull Runnable
an instance of PasteActionHandler that describes paste behavior
handler
)

Set pasteActionHandler variable to passed handler

private void
Inherited from javafx.scene.control.TextArea:
createDefaultSkingetClassCssMetaDatagetControlCssMetaDatagetParagraphsgetPrefColumnCountgetPrefRowCountgetScrollLeftgetScrollTopisWrapTextprefColumnCountPropertyprefRowCountPropertyscrollLeftPropertyscrollTopPropertysetPrefColumnCountsetPrefRowCountsetScrollLeftsetScrollTopsetWrapTextwrapTextProperty

Field Detail

collapsedRowsback to summary
private int collapsedRows
contextMenuback to summary
private final ContextMenu contextMenu

Hides javafx.scene.control.Control.contextMenu.

expandedback to summary
private boolean expanded
growWithContentback to summary
private boolean growWithContent
pasteActionHandlerback to summary
private Runnable pasteActionHandler

Variable that contains user-defined behavior for paste action.

resetPendingback to summary
private boolean resetPending
widthHintback to summary
private double widthHint

Constructor Detail

EditorTextAreaback to summary
public EditorTextArea()
EditorTextAreaback to summary
public EditorTextArea(final String text)

Method Detail

computePrefHeightback to summary
protected double computePrefHeight(double width)

Overrides javafx.scene.control.Control.computePrefHeight.

Wraps at the last laid-out width (or the hint before the first layout) instead of reporting a horizontal content bias: a biased child makes the enclosing grid measure every row at a width, which lets sibling editors such as the tags field wrap at their preferred width and briefly show too tall — a visible jump on every entry switch.

Annotations
@Override
expandback to summary
public void expand()

Shows the complete text instead of the collapsed collapsedRows, as the first focus does. Callers use it to restore the expansion of a rebuilt editor (editors are rebuilt for the same entry when a field is added or "Show more" is toggled).

initContextMenuback to summary
public void initContextMenu(final Supplier<List<MenuItem>> items, KeyBindingRepository keyBindingRepository)

Implements org.jabref.gui.fieldeditors.ContextMenuAddable.initContextMenu.

Doc from org.jabref.gui.fieldeditors.ContextMenuAddable.initContextMenu.

Adds the given list of menu items to the context menu. The usage of Supplier prevents that the menus need to be instantiated at this point. They are populated when the user needs them which prevents many unnecessary allocations when the main table is just scrolled with the entry editor open.

Annotations
@Override
initializeback to summary
public void initialize(URL location, ResourceBundle resources)

Implements javafx.fxml.Initializable.initialize.

Doc from javafx.fxml.Initializable.initialize.

Called to initialize a controller after its root element has been completely processed.

Annotations
@Override
pasteback to summary
public void paste()

Overrides javafx.scene.control.TextInputControl.paste.

Override javafx TextArea method applying TextArea.paste() and pasteActionHandler after

Annotations
@Override
setGrowWithContentback to summary
public void setGrowWithContent(double widthHint, int collapsedRows)

Sizes the area to its wrapped text (one row when empty, growing as text is typed) instead of the fixed preferred row count. Intended for natural-height lists that scroll as a whole. widthHint is the width to wrap at until the first layout has set the real width — pass the width the same field had before, so a rebuilt editor is right in its very first frame. Until the area is focused for the first time it shows at most collapsedRows rows (with its own scrollbar); the first focus expands it to the full text (see expand) and it stays expanded, so moving the focus on never shrinks a row under the mouse.

setPasteActionHandlerback to summary
public void setPasteActionHandler(@NonNull Runnable handler)

Set pasteActionHandler variable to passed handler

Parameters
handler:@NonNull Runnable

an instance of PasteActionHandler that describes paste behavior

showBeginningWhileCollapsedback to summary
private void showBeginningWhileCollapsed()
org.jabref.gui.fieldeditors back to summary

private Class EditorTextArea.FieldTraversalEventHandler

extends Object
implements EventHandler<KeyEvent>
Class Inheritance
  • java.lang.Object
  • org.jabref.gui.fieldeditors.EditorTextArea.FieldTraversalEventHandler
All Implemented Interfaces
javafx.event.EventHandler, java.util.EventListener

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public void
handle(KeyEvent event)

Implements javafx.event.EventHandler.handle.

Invoked when a specific event of the type for which this handler is registered happens.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

FieldTraversalEventHandlerback to summary
private FieldTraversalEventHandler()

Method Detail

handleback to summary
public void handle(KeyEvent event)

Implements javafx.event.EventHandler.handle.

Doc from javafx.event.EventHandler.handle.

Invoked when a specific event of the type for which this handler is registered happens.

Annotations
@Override