Package docking

Class ToolTipManager


  • public class ToolTipManager
    extends java.lang.Object
    A tooltip manager that simply delegates to the Swing tooltip manager. This class replaces the previous tooltip manager that overrode much of the Swing tooltip manager's functionality.
    • Constructor Detail

      • ToolTipManager

        public ToolTipManager()
    • Method Detail

      • registerComponent

        public void registerComponent​(javax.swing.JComponent component)
        Registers a component for tooltip management.

        This will register key bindings to show and hide the tooltip text only if component has focus bindings. This is done so that components that are not normally focus traversable, such as JLabel, are not made focus traversable as a result of invoking this method.

        Parameters:
        component - a JComponent object to add
        See Also:
        Component.isFocusTraversable()
      • unregisterComponent

        public void unregisterComponent​(javax.swing.JComponent component)
        Removes a component from tooltip control.
        Parameters:
        component - a JComponent object to remove
      • getDismissDelay

        public int getDismissDelay()
      • getReshowDelay

        public int getReshowDelay()
      • isEnabled

        public boolean isEnabled()
      • getInitialDelay

        public int getInitialDelay()
      • isLightWeightPopupEnabled

        public boolean isLightWeightPopupEnabled()
      • setLightWeightPopupEnabled

        public void setLightWeightPopupEnabled​(boolean aFlag)
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • setToolTipText

        public static void setToolTipText​(javax.swing.JComponent c,
                                          java.lang.String text)
      • setEnabled

        public void setEnabled​(boolean flag)
        Enables or disables the tooltip.
        Parameters:
        flag - true to enable the tip, false otherwise
      • setInitialDelay

        public void setInitialDelay​(int milliseconds)
        Specifies the initial delay value.
        Parameters:
        milliseconds - the number of milliseconds to delay (after the cursor has paused) before displaying the tooltip
        See Also:
        getInitialDelay()
      • setDismissDelay

        public void setDismissDelay​(int milliseconds)
        Specifies the dismissal delay value.
        Parameters:
        milliseconds - the number of milliseconds to delay before taking away the tooltip
        See Also:
        getDismissDelay()
      • setReshowDelay

        public void setReshowDelay​(int milliseconds)
        Used to specify the amount of time before the user has to wait initialDelay milliseconds before a tooltip will be shown. That is, if the tooltip is hidden, and the user moves into a region of the same Component that has a valid tooltip within milliseconds milliseconds the tooltip will immediately be shown. Otherwise, if the user moves into a region with a valid tooltip after milliseconds milliseconds, the user will have to wait an additional initialDelay milliseconds before the tooltip is shown again.
        Parameters:
        milliseconds - time in milliseconds
        See Also:
        getReshowDelay()
      • hideTipWindow

        public void hideTipWindow()
        Hides any open tooltip window