Verified Owner
Top Description Inners Fields Methods
org.jabref.gui.walkthrough.declarative

public Interface Trigger

Annotations
@FunctionalInterface
Imports
java.util.ArrayList, .List, .Objects, java.util.function.Function, .Supplier, java.util.regex.Pattern, javafx.beans.value.ChangeListener, javafx.collections.ListChangeListener, .ObservableList, javafx.event.ActionEvent, .Event, .EventDispatcher, .EventHandler, .EventType, javafx.scene.Node, javafx.scene.control.ListView, .TextInputControl, javafx.scene.input.MouseEvent, javafx.util.Duration, org.jabref.gui.fieldeditors.LinkedFilesEditor, .LinkedFilesEditorViewModel, org.jabref.gui.util.DelayedExecution, org.jabref.gui.walkthrough.utils.WalkthroughUtils, org.jspecify.annotations.NonNull, org.slf4j.Logger, .LoggerFactory

Defines a trigger for when navigation should occur on a target node.

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class

Field Summary

Modifier and TypeField and Description
public static final Logger

Method Summary

Modifier and TypeMethod and Description
public Runnable

Returns:

a runnable to clean up the listeners
attach
(@NonNull Node
the node to attach the listeners to
node
,
Runnable
the runnable to execute before navigation
beforeNavigate
,
Runnable
the runnable to execute when navigation occurs
onNavigate
)

Attaches the navigation triggers to the target node.

public static Trigger.Builder
public static Trigger
public static Trigger
public static Trigger
public static Trigger
public static Trigger
public static Trigger
onTextEquals(String expected)

public static Trigger
public static Trigger

Field Detail

LOGGERback to summary
public static final Logger LOGGER

Method Detail

attachback to summary
public Runnable attach(@NonNull Node node, Runnable beforeNavigate, Runnable onNavigate)

Attaches the navigation triggers to the target node. beforeNavigate and onNavigate are guaranteed to run at most once.

Parameters
node:@NonNull Node

the node to attach the listeners to

beforeNavigate:Runnable

the runnable to execute before navigation

onNavigate:Runnable

the runnable to execute when navigation occurs

Returns:Runnable

a runnable to clean up the listeners

createback to summary
public static Trigger.Builder create()
onClickback to summary
public static Trigger onClick()
onDoubleClickback to summary
public static Trigger onDoubleClick()
onFetchFulltextCompletedback to summary
public static Trigger onFetchFulltextCompleted()
onFileAddedToListViewback to summary
public static Trigger onFileAddedToListView()
onHoverback to summary
public static Trigger onHover()
onTextEqualsback to summary
public static Trigger onTextEquals(String expected)
onTextInputback to summary
public static Trigger onTextInput()
onTextMatchesRegexback to summary
public static Trigger onTextMatchesRegex(String regex)
org.jabref.gui.walkthrough.declarative back to summary

public Class Trigger.Builder

extends Object
Class Inheritance

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static interface

Field Summary

Modifier and TypeField and Description
private static final Duration
private Trigger.Builder.PredicateGenerator
private static final Duration
private static final Supplier<Void>
private Duration
private boolean

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public Trigger
public Trigger.Builder
onClick()

Triggers navigation on a single mouse click (more precisely, press) or when an action is performed (for Menu and Button)

public Trigger.Builder
public Trigger.Builder
public Trigger.Builder
public Trigger.Builder
public Trigger.Builder
public Trigger.Builder
public Trigger.Builder
public Trigger.Builder
private void
public Trigger.Builder

Returns:

this builder
withTimeout
(Duration
The timeout duration. Defaults to 1000ms.
timeout
)

The timeout after which navigation is triggered automatically.

public Trigger.Builder

Returns:

this builder
withWindowChangeListener
()

If set, navigation will also be triggered when a window is closed.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

DEFAULT_TIMEOUTback to summary
private static final Duration DEFAULT_TIMEOUT
generatorback to summary
private Trigger.Builder.PredicateGenerator generator
NAVIGATION_DELAYback to summary
private static final Duration NAVIGATION_DELAY
NOTHINGback to summary
private static final Supplier<Void> NOTHING
timeoutback to summary
private Duration timeout
withWindowChangeListenerback to summary
private boolean withWindowChangeListener

Constructor Detail

Builderback to summary
public Builder()

Method Detail

buildback to summary
public Trigger build()
onClickback to summary
public Trigger.Builder onClick()

Triggers navigation on a single mouse click (more precisely, press) or when an action is performed (for Menu and Button)

onDoubleClickback to summary
public Trigger.Builder onDoubleClick()
onFetchFulltextCompletedback to summary
public Trigger.Builder onFetchFulltextCompleted()
onFileAddedToListViewback to summary
public Trigger.Builder onFileAddedToListView()
onHoverback to summary
public Trigger.Builder onHover()
onRightClickback to summary
public Trigger.Builder onRightClick()
onTextEqualsback to summary
public Trigger.Builder onTextEquals(@NonNull String expected)
onTextInputback to summary
public Trigger.Builder onTextInput()
onTextMatchesRegexback to summary
public Trigger.Builder onTextMatchesRegex(@NonNull String regex)
setGeneratorback to summary
private void setGenerator(Trigger.Builder.PredicateGenerator newGenerator)
withTimeoutback to summary
public Trigger.Builder withTimeout(Duration timeout)

The timeout after which navigation is triggered automatically.

Parameters
timeout:Duration

The timeout duration. Defaults to 1000ms.

Returns:Trigger.Builder

this builder

withWindowChangeListenerback to summary
public Trigger.Builder withWindowChangeListener()

If set, navigation will also be triggered when a window is closed.

Returns:Trigger.Builder

this builder

org.jabref.gui.walkthrough.declarative back to summary

private Interface Trigger.Builder.PredicateGenerator

Annotations
@FunctionalInterface

Method Summary

Modifier and TypeMethod and Description
public Runnable

Returns:

A cleanup runnable that detaches the trigger.
create
(Node
The node to attach the trigger to.
node
,
Function<Supplier<?>, ?>
A function that wraps the original event handler. It takes a Supplier representing the original action and returns the result of that action.
onNavigate
)

Modify the node's event dispatch chain or register custom logic to trigger Trigger when desired conditions are met.

Method Detail

createback to summary
public Runnable create(Node node, Function<Supplier<?>, ?> onNavigate)

Modify the node's event dispatch chain or register custom logic to trigger Trigger when desired conditions are met.

Parameters
node:Node

The node to attach the trigger to.

onNavigate:Function<Supplier<?>, ?>

A function that wraps the original event handler. It takes a Supplier representing the original action and returns the result of that action.

Returns:Runnable

A cleanup runnable that detaches the trigger.