Skip to content

NodeFieldChangeEvent.Pre

final class NodeFieldChangeEvent.Pre<N extends Node, V>
Extends: NodeFieldChangeEvent<N,V>
Implements: ICancellableEvent
Package: dev.joid.lib.ui.event.impl.node · Module: core · Source: NodeFieldChangeEvent.java

The event of beforeChange on a field, which can refuse an edit.

It fires for what the user types, pastes, cuts or deletes, and for change(...); the text or the value given by a setter or a bound signal is never refused.

ReturnsSignatureSummary
Pre<N,V>create(N node, String previous, String text, V value, boolean valid) factoryCreates the event for a field, the text now, the text asked for, the value read from it and whether it is valid.

ReturnsSignatureSummary
voidcancel()Refuses the edit: the text stays as it was.
booleanisCancelled()If true, a listener refused the edit.
Inherited from NodeFieldChangeEvent (4)

getValue · getText · isValid · getPrevious

Inherited from NodeEvent (1)

getNode

<N extends Node, V> Pre<N,V> create(N node, String previous, String text, V value, boolean valid) factory

Creates the event for a field, the text now, the text asked for, the value read from it and whether it is valid.

void cancel()

Refuses the edit: the text stays as it was. Throws an IllegalStateException in a MONITOR listener.

boolean isCancelled()

If true, a listener refused the edit.


fluent returns the instance, typed for chaining · factory creates an instance · signal also accepts a value that follows signals, as a signal, an expression or a lambda (When does JOID compute this value again?) · hook called by JOID, override it · abstract you implement it · default interface method with a body · static called on the class · protected visible to subclasses

Report a problem with this page