Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8090675

Common super-interface for objects that allow to register event handlers/filters.

    XMLWordPrintable

Details

    • Enhancement
    • Resolution: Duplicate
    • P4
    • None
    • None
    • javafx

    Description

      When writing helper tools for event handling, I have to write two versions, one for Node and one for Scene.

      I suggest adding an interface with the following methods that both Node and Scene would implement (they already implement the methods anyway):

          <T extends Event> void addEventFilter(EventType<T> eventType, EventHandler<? super T> eventFilter);
          <T extends Event> void addEventHandler(EventType<T> eventType, EventHandler<? super T> eventHandler);
          <T extends Event> void removeEventFilter(EventType<T> eventType, EventHandler<? super T> eventFilter);
          <T extends Event> void removeEventHandler(EventType<T> eventType, EventHandler<? super T> eventHandler);

      Also, maybe it makes sense for this new interface to extend EventTarget.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              tmikula Tomas Mikula
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                Imported: