Package docking
Class ToolTipManager
- java.lang.Object
-
- docking.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 Summary
Constructors Constructor Description ToolTipManager()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getDismissDelay()
int
getInitialDelay()
int
getReshowDelay()
void
hideTipWindow()
Hides any open tooltip windowboolean
isEnabled()
boolean
isLightWeightPopupEnabled()
void
registerComponent(javax.swing.JComponent component)
Registers a component for tooltip management.void
setDismissDelay(int milliseconds)
Specifies the dismissal delay value.void
setEnabled(boolean flag)
Enables or disables the tooltip.void
setInitialDelay(int milliseconds)
Specifies the initial delay value.void
setLightWeightPopupEnabled(boolean aFlag)
void
setReshowDelay(int milliseconds)
Used to specify the amount of time before the user has to waitinitialDelay
milliseconds before a tooltip will be shown.static void
setToolTipText(javax.swing.JComponent c, java.lang.String text)
static ToolTipManager
sharedInstance()
java.lang.String
toString()
void
unregisterComponent(javax.swing.JComponent component)
Removes a component from tooltip control.
-
-
-
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 asJLabel
, are not made focus traversable as a result of invoking this method.- Parameters:
component
- aJComponent
object to add- See Also:
Component.isFocusTraversable()
-
unregisterComponent
public void unregisterComponent(javax.swing.JComponent component)
Removes a component from tooltip control.- Parameters:
component
- aJComponent
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 classjava.lang.Object
-
setToolTipText
public static void setToolTipText(javax.swing.JComponent c, java.lang.String text)
-
sharedInstance
public static ToolTipManager sharedInstance()
-
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 waitinitialDelay
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 withinmilliseconds
milliseconds the tooltip will immediately be shown. Otherwise, if the user moves into a region with a valid tooltip aftermilliseconds
milliseconds, the user will have to wait an additionalinitialDelay
milliseconds before the tooltip is shown again.- Parameters:
milliseconds
- time in milliseconds- See Also:
getReshowDelay()
-
hideTipWindow
public void hideTipWindow()
Hides any open tooltip window
-
-