org.fxmisc.wellbehaved.event.InputHandler Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of richtextfx Show documentation
Show all versions of richtextfx Show documentation
FX-Text-Area for formatted text and other special effects.
package org.fxmisc.wellbehaved.event;
import javafx.event.Event;
import javafx.event.EventHandler;
@FunctionalInterface
public interface InputHandler extends EventHandler {
public enum Result { PROCEED, CONSUME, IGNORE }
Result process(T event);
@Override
default void handle(T event) {
switch(process(event)) {
case CONSUME: event.consume(); break;
case PROCEED: /* do nothing */ break;
case IGNORE: /* do nothing */ break;
}
}
}