Verified Owner
Top Description Fields Constructors Methods
org.jabref.gui.fieldeditors.contextmenu

public Class EditorContextAction

extends SimpleCommand
Class Inheritance
Imports
java.util.List, javafx.beans.binding.Bindings, .BooleanBinding, javafx.beans.property.BooleanProperty, javafx.scene.control.MenuItem, .PasswordField, .TextInputControl, javafx.scene.input.Clipboard, org.jabref.gui.actions.ActionFactory, .SimpleCommand, .StandardActions, org.jabref.gui.util.BindingsHelper, org.jabref.logic.os.OS, com.sun.javafx.scene.control.Properties

A context-menu command acting on one TextInputControl, through the control's own API.

StandardActions#UNDO and StandardActions#REDO therefore drive that control's private undo stack, which is right only where the control's text is not a value of the library — today that is the search field alone. In a field editor the same two items would fight the library's journal: Ctrl+Z there is routed to the global stack by the filter in org.jabref.gui.fieldeditors.FieldEditorFX#establishBinding (issue #11420), so a menu Undo would revert the control's text, the text listener would see a fresh edit, and the undo the user asked for would arrive on the stack as a new forward change.

That is why getDefaultContextMenuItems leaves both out. Wiring undo into a field editor's menu means routing it to org.jabref.gui.undo.UndoAction, not to the control.

Field Summary

Modifier and TypeField and Description
private final StandardActions
private static final boolean
private final TextInputControl
Inherited from org.jabref.gui.actions.SimpleCommand:
statusMessage

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
public static List<MenuItem>
getDefaultContextMenuItems(TextInputControl textInputControl)

The items every text field in the entry editor gets, deliberately without Undo and Redo: in a field editor those belong to the library's journal, not to the control.

Inherited from org.jabref.gui.actions.SimpleCommand:
getProgressprogressPropertysetExecutablestatusMessageProperty

Field Detail

commandback to summary
private final StandardActions command
SHOW_HANDLESback to summary
private static final boolean SHOW_HANDLES
textInputControlback to summary
private final TextInputControl textInputControl

Constructor Detail

EditorContextActionback to summary
public EditorContextAction(StandardActions command, TextInputControl textInputControl)

Method Detail

executeback to summary
public void execute()
Annotations
@Override
getDefaultContextMenuItemsback to summary
public static List<MenuItem> getDefaultContextMenuItems(TextInputControl textInputControl)

The items every text field in the entry editor gets, deliberately without Undo and Redo: in a field editor those belong to the library's journal, not to the control. See the class javadoc.