All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.fxmisc.wellbehaved.event.InputHandler Maven / Gradle / Ivy

There is a newer version: 1.11
Show newest version
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;
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy