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

Customizable visibility timing for Tooltip

    XMLWordPrintable

    Details

    • Type: CSR
    • Status: Closed
    • Priority: P4
    • Resolution: Approved
    • Fix Version/s: 8u341
    • Component/s: javafx
    • Labels:
      None
    • Subcomponent:
    • Compatibility Kind:
      source
    • Compatibility Risk:
      minimal
    • Compatibility Risk Description:
      The Compatibility Risk is minimal since only new APIs are added.
    • Interface Kind:
      Java API
    • Scope:
      JDK

      Description

      Summary

      Add APIs to support customizable visibility timing for Tooltip

      Problem

      New APIs need to be added that allows an application to customize the visibility timing for tooltips on JavaFX controls.

      The ability to control these three properties: showDelay, showDuration, and hideDelay was added to JavaFX in JDK 9. The inability to control this functionality was missing functionality in the existing Tooltip API of JDK 8, as opposed to being a new feature.

      Solution

      Added below properties to support customizable visibility timing for Tooltip

      1. showDelayProperty
      2. showDurationProperty
      3. hideDelayProperty

      Added getter, setter and property methods for these properties.

      Specification

      javafx/scene/control/Tooltip.java

      +
      +    /**
      +     * The delay between the mouse entering the hovered node and when the associated tooltip will be shown to the user.
      +     * The default delay is 1000ms.
      +     *
      +     * @since JavaFX 8u341
      +     * @defaultvalue 1000ms
      +     */
      +    public final ObjectProperty<Duration> showDelayProperty()
      +    public final void setShowDelay(Duration showDelay)
      +    public final Duration getShowDelay()
      +    private final ObjectProperty<Duration> showDelayProperty
      
      +
      +    /**
      +     * The duration that the tooltip should remain showing for until it is no longer visible to the user.
      +     * If the mouse leaves the control before the showDuration finishes, then the tooltip will remain showing
      +     * for the duration specified in the {@link #hideDelayProperty()}, even if the remaining time of the showDuration
      +     * is less than the hideDelay duration. The default value is 5000ms.
      +     *
      +     * @since JavaFX 8u341
      +     * @defaultvalue 5000ms
      +     */
      +    public final ObjectProperty<Duration> showDurationProperty()
      +    public final void setShowDuration(Duration showDuration)
      +    public final Duration getShowDuration()
      +    private final ObjectProperty<Duration> showDurationProperty
      
      +
      +    /**
      +     * The duration in which to continue showing the tooltip after the mouse has left the node. Once this time has
      +     * elapsed the tooltip will hide. The default value is 200ms.
      +     *
      +     * @since JavaFX 8u341
      +     * @defaultvalue 200ms
      +     */
      +    public final ObjectProperty<Duration> hideDelayProperty()
      +    public final void setHideDelay(Duration hideDelay) 
      +    public final Duration getHideDelay()
      +    private final ObjectProperty<Duration> hideDelayProperty
      +
      

      javafx/scene/doc-files/cssref.html

      +        <tr>
      +            <td class="propertyname">-fx-show-delay</td>
      +            <td class="value"><a href="#typefont" class="typelink">&lt;duration&gt;</a></td>
      +            <td>1000ms</td>
      +            <td>&nbsp;</td>
      +        </tr>
      +        <tr>
      +            <td class="propertyname">-fx-show-duration</td>
      +            <td class="value"><a href="#typefont" class="typelink">&lt;duration&gt;</a></td>
      +            <td>5000ms</td>
      +            <td>&nbsp;</td>
      +        </tr>
      +        <tr>
      +            <td class="propertyname">-fx-hide-delay</td>
      +            <td class="value"><a href="#typefont" class="typelink">&lt;duration&gt;</a></td>
      +            <td>200ms</td>
      +            <td>&nbsp;</td>
      +        </tr>
      +
      

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              kabhishek Kumar Abhishek
              Reporter:
              josmithjfx John Smith (Inactive)
              Reviewed By:
              Kevin Rushforth
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: