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

[MenuButton] Add setOn* APIs to set event handlers for show/hide event types

XMLWordPrintable

    • Icon: CSR CSR
    • Resolution: Approved
    • Icon: P4 P4
    • 10
    • javafx
    • None
    • minimal
    • Java API
    • JDK

      Summary

      Add the APIs to set event handlers for show & hide related events for MenuButton control.

      Problem

      MenuButton does not have APIs to set event handlers for show & hide related events.

      Solution

      • There are four show & hide related events: ON_SHOWING, ON_SHOWN, ON_HIDING, ON_HIDDEN.
      • For these events, four APIs should be added as: setOnShowing(), setOnShown(), setOnHiding(), setOnHidden().
      • Similar APIs are already present for controls like ChoiceBox, ComboBox, Dialog.

      Specification

      /**
       * Called just prior to the {@code ContextMenu} being shown.
       * @return the on showing property
       * @since 10
       */
      public final ObjectProperty<EventHandler<Event>> onShowingProperty() { }
      public final void setOnShowing(EventHandler<Event> value) { }
      public final EventHandler<Event> getOnShowing() { }
      
      /**
       * Called just after the {@code ContextMenu} is shown.
       * @return the on shown property
       * @since 10
       */
      public final ObjectProperty<EventHandler<Event>> onShownProperty() { }
      public final void setOnShown(EventHandler<Event> value) { }
      public final EventHandler<Event> getOnShown() { }
      
      /**
       * Called just prior to the {@code ContextMenu} being hidden.
       * @return the on hiding property
       * @since 10
       */
      public final ObjectProperty<EventHandler<Event>> onHidingProperty() { }
      public final void setOnHiding(EventHandler<Event> value) { }
      public final EventHandler<Event> getOnHiding() { }
      
      /**
       * Called just after the {@code ContextMenu} has been hidden.
       * @return the on hidden property
       * @since 10
       */
      public final ObjectProperty<EventHandler<Event>> onHiddenProperty() { }
      public final void setOnHidden(EventHandler<Event> value) { }
      public final EventHandler<Event> getOnHidden() { }

            arapte Ambarish Rapte
            arapte Ambarish Rapte
            Kevin Rushforth, Philip Race
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: