com.alee.managers.tooltip
Class TooltipManager

java.lang.Object
  extended by com.alee.managers.tooltip.TooltipManager

public class TooltipManager
extends java.lang.Object

This manager allows you to set extended tooltips for any Swing component with any possible content (would it be simple text or some JComponent ancestor) or show one-time tooltips at custom location inside any window.

Also this manager is integrated with HotkeyManager to provide components hotkeys on their tooltips.

Author:
Mikle Garin
See Also:
GlassPaneManager, HotkeyManager

Field Summary
protected static java.util.Map<java.awt.Component,java.awt.event.MouseAdapter> adapters
           
protected static boolean allowMultiplyTooltips
           
protected static int defaultDelay
          todo 1.
protected static boolean initialized
           
protected static java.util.List<WebCustomTooltip> oneTimeTooltips
           
protected static boolean showHotkeysInOneTimeTooltips
           
protected static boolean showHotkeysInTooltips
           
protected static java.util.Map<java.awt.Component,WebTimer> timers
           
protected static java.util.Map<java.awt.Component,java.util.List<WebCustomTooltip>> webTooltips
           
 
Constructor Summary
TooltipManager()
           
 
Method Summary
static WebCustomTooltip addTooltip(java.awt.Component component, javax.swing.Icon icon, java.lang.String tooltip)
           
static WebCustomTooltip addTooltip(java.awt.Component component, javax.swing.Icon icon, java.lang.String tooltip, TooltipWay tooltipWay)
           
static WebCustomTooltip addTooltip(java.awt.Component component, javax.swing.Icon icon, java.lang.String tooltip, TooltipWay tooltipWay, int delay)
           
static WebCustomTooltip addTooltip(java.awt.Component component, javax.swing.JComponent tooltip)
           
static WebCustomTooltip addTooltip(java.awt.Component component, javax.swing.JComponent tooltip, int delay)
           
static WebCustomTooltip addTooltip(java.awt.Component component, javax.swing.JComponent tooltip, TooltipWay tooltipWay)
           
static WebCustomTooltip addTooltip(java.awt.Component component, javax.swing.JComponent tooltip, TooltipWay tooltipWay, int delay)
           
protected static WebCustomTooltip addTooltip(java.awt.Component component, javax.swing.JComponent tooltip, TooltipWay tooltipWay, int delay, boolean clear)
           
static WebCustomTooltip addTooltip(java.awt.Component component, java.lang.String tooltip)
           
static WebCustomTooltip addTooltip(java.awt.Component component, java.lang.String tooltip, TooltipWay tooltipWay)
           
static WebCustomTooltip addTooltip(java.awt.Component component, java.lang.String tooltip, TooltipWay tooltipWay, int delay)
           
static int getDefaultDelay()
          Default tooltip show delay
static void hideAllTooltips()
          Hides all visible tooltips.
protected static void hideTooltips(java.awt.Component component)
           
static void initialize()
          TooltipManager initialization
static void installShowAllTooltipsAction(javax.swing.JComponent topComponent)
          Installs "show all hotkeys" action on window or component
static void installShowAllTooltipsAction(javax.swing.JComponent topComponent, HotkeyData hotkeyData)
           
static boolean isAllowMultiplyTooltips()
          Allow more than one tooltip per component
static boolean isShowHotkeysInOneTimeTooltips()
          Show hotkeys in one-time tooltips by default
static boolean isShowHotkeysInTooltips()
          Show hotkeys in tooltips by default
static void removeTooltip(java.awt.Component component, WebCustomTooltip tooltip)
           
static void removeTooltips(java.awt.Component component)
          Removes component tooltips
static void removeTooltips(java.awt.Component component, java.util.List<WebCustomTooltip> tooltips)
           
static void removeTooltips(java.awt.Component component, WebCustomTooltip... tooltips)
           
static void setAllowMultiplyTooltips(boolean allowMultiplyTooltips)
           
static void setDefaultDelay(int delay)
           
static void setShowHotkeysInOneTimeTooltips(boolean showHotkeysInOneTimeTooltips)
           
static void setShowHotkeysInTooltips(boolean showHotkeysInTooltips)
           
static WebCustomTooltip setTooltip(java.awt.Component component, javax.swing.Icon icon, java.lang.String tooltip)
           
static WebCustomTooltip setTooltip(java.awt.Component component, javax.swing.Icon icon, java.lang.String tooltip, TooltipWay tooltipWay)
           
static WebCustomTooltip setTooltip(java.awt.Component component, javax.swing.Icon icon, java.lang.String tooltip, TooltipWay tooltipWay, int delay)
           
static WebCustomTooltip setTooltip(java.awt.Component component, javax.swing.JComponent tooltip)
           
static WebCustomTooltip setTooltip(java.awt.Component component, javax.swing.JComponent tooltip, int delay)
           
static WebCustomTooltip setTooltip(java.awt.Component component, javax.swing.JComponent tooltip, TooltipWay tooltipWay)
           
static WebCustomTooltip setTooltip(java.awt.Component component, javax.swing.JComponent tooltip, TooltipWay tooltipWay, int delay)
           
static WebCustomTooltip setTooltip(java.awt.Component component, java.lang.String tooltip)
          Registers standart tooltip
static WebCustomTooltip setTooltip(java.awt.Component component, java.lang.String tooltip, TooltipWay tooltipWay)
           
static WebCustomTooltip setTooltip(java.awt.Component component, java.lang.String tooltip, TooltipWay tooltipWay, int delay)
           
static void showAllTooltips()
          Displays all tooltips for all visible windows
static void showAllTooltips(java.awt.Component component)
          Displays all tooltips for component's window
protected static void showAllTooltips(java.awt.Window window)
           
static WebCustomTooltip showOneTimeTooltip(java.awt.Component component, java.awt.Point point, javax.swing.Icon icon, java.lang.String tooltip)
           
static WebCustomTooltip showOneTimeTooltip(java.awt.Component component, java.awt.Point point, javax.swing.Icon icon, java.lang.String tooltip, TooltipWay tooltipWay)
           
static WebCustomTooltip showOneTimeTooltip(java.awt.Component component, java.awt.Point point, javax.swing.JComponent tooltip)
           
static WebCustomTooltip showOneTimeTooltip(java.awt.Component component, java.awt.Point point, javax.swing.JComponent tooltip, TooltipWay tooltipWay)
           
static WebCustomTooltip showOneTimeTooltip(java.awt.Component component, java.awt.Point point, java.lang.String tooltip)
          Shows one-time tooltip
static WebCustomTooltip showOneTimeTooltip(java.awt.Component component, java.awt.Point point, java.lang.String tooltip, TooltipWay tooltipWay)
           
static WebCustomTooltip showOneTimeTooltip(WebCustomTooltip customTooltip)
           
protected static WebCustomTooltip showOneTimeTooltip(WebCustomTooltip customTooltip, boolean destroyOnClose)
           
static boolean showTooltips(java.awt.Component component)
          Displays component tooltips
static boolean showTooltips(java.awt.Component component, boolean delayed)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

defaultDelay

protected static int defaultDelay
todo 1. Synchronize actions on data maps and lists


allowMultiplyTooltips

protected static boolean allowMultiplyTooltips

showHotkeysInTooltips

protected static boolean showHotkeysInTooltips

showHotkeysInOneTimeTooltips

protected static boolean showHotkeysInOneTimeTooltips

webTooltips

protected static final java.util.Map<java.awt.Component,java.util.List<WebCustomTooltip>> webTooltips

adapters

protected static final java.util.Map<java.awt.Component,java.awt.event.MouseAdapter> adapters

timers

protected static final java.util.Map<java.awt.Component,WebTimer> timers

oneTimeTooltips

protected static final java.util.List<WebCustomTooltip> oneTimeTooltips

initialized

protected static boolean initialized
Constructor Detail

TooltipManager

public TooltipManager()
Method Detail

initialize

public static void initialize()
TooltipManager initialization


hideAllTooltips

public static void hideAllTooltips()
Hides all visible tooltips.


setTooltip

public static WebCustomTooltip setTooltip(java.awt.Component component,
                                          java.lang.String tooltip)
Registers standart tooltip


setTooltip

public static WebCustomTooltip setTooltip(java.awt.Component component,
                                          javax.swing.Icon icon,
                                          java.lang.String tooltip)

setTooltip

public static WebCustomTooltip setTooltip(java.awt.Component component,
                                          java.lang.String tooltip,
                                          TooltipWay tooltipWay)

setTooltip

public static WebCustomTooltip setTooltip(java.awt.Component component,
                                          javax.swing.Icon icon,
                                          java.lang.String tooltip,
                                          TooltipWay tooltipWay)

setTooltip

public static WebCustomTooltip setTooltip(java.awt.Component component,
                                          java.lang.String tooltip,
                                          TooltipWay tooltipWay,
                                          int delay)

setTooltip

public static WebCustomTooltip setTooltip(java.awt.Component component,
                                          javax.swing.Icon icon,
                                          java.lang.String tooltip,
                                          TooltipWay tooltipWay,
                                          int delay)

setTooltip

public static WebCustomTooltip setTooltip(java.awt.Component component,
                                          javax.swing.JComponent tooltip)

setTooltip

public static WebCustomTooltip setTooltip(java.awt.Component component,
                                          javax.swing.JComponent tooltip,
                                          int delay)

setTooltip

public static WebCustomTooltip setTooltip(java.awt.Component component,
                                          javax.swing.JComponent tooltip,
                                          TooltipWay tooltipWay)

setTooltip

public static WebCustomTooltip setTooltip(java.awt.Component component,
                                          javax.swing.JComponent tooltip,
                                          TooltipWay tooltipWay,
                                          int delay)

addTooltip

public static WebCustomTooltip addTooltip(java.awt.Component component,
                                          java.lang.String tooltip)

addTooltip

public static WebCustomTooltip addTooltip(java.awt.Component component,
                                          javax.swing.Icon icon,
                                          java.lang.String tooltip)

addTooltip

public static WebCustomTooltip addTooltip(java.awt.Component component,
                                          java.lang.String tooltip,
                                          TooltipWay tooltipWay)

addTooltip

public static WebCustomTooltip addTooltip(java.awt.Component component,
                                          javax.swing.Icon icon,
                                          java.lang.String tooltip,
                                          TooltipWay tooltipWay)

addTooltip

public static WebCustomTooltip addTooltip(java.awt.Component component,
                                          java.lang.String tooltip,
                                          TooltipWay tooltipWay,
                                          int delay)

addTooltip

public static WebCustomTooltip addTooltip(java.awt.Component component,
                                          javax.swing.Icon icon,
                                          java.lang.String tooltip,
                                          TooltipWay tooltipWay,
                                          int delay)

addTooltip

public static WebCustomTooltip addTooltip(java.awt.Component component,
                                          javax.swing.JComponent tooltip)

addTooltip

public static WebCustomTooltip addTooltip(java.awt.Component component,
                                          javax.swing.JComponent tooltip,
                                          int delay)

addTooltip

public static WebCustomTooltip addTooltip(java.awt.Component component,
                                          javax.swing.JComponent tooltip,
                                          TooltipWay tooltipWay)

addTooltip

public static WebCustomTooltip addTooltip(java.awt.Component component,
                                          javax.swing.JComponent tooltip,
                                          TooltipWay tooltipWay,
                                          int delay)

addTooltip

protected static WebCustomTooltip addTooltip(java.awt.Component component,
                                             javax.swing.JComponent tooltip,
                                             TooltipWay tooltipWay,
                                             int delay,
                                             boolean clear)

hideTooltips

protected static void hideTooltips(java.awt.Component component)

showTooltips

public static boolean showTooltips(java.awt.Component component)
Displays component tooltips


showTooltips

public static boolean showTooltips(java.awt.Component component,
                                   boolean delayed)

showAllTooltips

public static void showAllTooltips(java.awt.Component component)
Displays all tooltips for component's window


showAllTooltips

protected static void showAllTooltips(java.awt.Window window)

showAllTooltips

public static void showAllTooltips()
Displays all tooltips for all visible windows


installShowAllTooltipsAction

public static void installShowAllTooltipsAction(javax.swing.JComponent topComponent)
Installs "show all hotkeys" action on window or component


installShowAllTooltipsAction

public static void installShowAllTooltipsAction(javax.swing.JComponent topComponent,
                                                HotkeyData hotkeyData)

removeTooltips

public static void removeTooltips(java.awt.Component component)
Removes component tooltips


removeTooltips

public static void removeTooltips(java.awt.Component component,
                                  WebCustomTooltip... tooltips)

removeTooltips

public static void removeTooltips(java.awt.Component component,
                                  java.util.List<WebCustomTooltip> tooltips)

removeTooltip

public static void removeTooltip(java.awt.Component component,
                                 WebCustomTooltip tooltip)

showOneTimeTooltip

public static WebCustomTooltip showOneTimeTooltip(java.awt.Component component,
                                                  java.awt.Point point,
                                                  java.lang.String tooltip)
Shows one-time tooltip


showOneTimeTooltip

public static WebCustomTooltip showOneTimeTooltip(java.awt.Component component,
                                                  java.awt.Point point,
                                                  javax.swing.Icon icon,
                                                  java.lang.String tooltip)

showOneTimeTooltip

public static WebCustomTooltip showOneTimeTooltip(java.awt.Component component,
                                                  java.awt.Point point,
                                                  java.lang.String tooltip,
                                                  TooltipWay tooltipWay)

showOneTimeTooltip

public static WebCustomTooltip showOneTimeTooltip(java.awt.Component component,
                                                  java.awt.Point point,
                                                  javax.swing.Icon icon,
                                                  java.lang.String tooltip,
                                                  TooltipWay tooltipWay)

showOneTimeTooltip

public static WebCustomTooltip showOneTimeTooltip(java.awt.Component component,
                                                  java.awt.Point point,
                                                  javax.swing.JComponent tooltip)

showOneTimeTooltip

public static WebCustomTooltip showOneTimeTooltip(java.awt.Component component,
                                                  java.awt.Point point,
                                                  javax.swing.JComponent tooltip,
                                                  TooltipWay tooltipWay)

showOneTimeTooltip

public static WebCustomTooltip showOneTimeTooltip(WebCustomTooltip customTooltip)

showOneTimeTooltip

protected static WebCustomTooltip showOneTimeTooltip(WebCustomTooltip customTooltip,
                                                     boolean destroyOnClose)

getDefaultDelay

public static int getDefaultDelay()
Default tooltip show delay


setDefaultDelay

public static void setDefaultDelay(int delay)

isAllowMultiplyTooltips

public static boolean isAllowMultiplyTooltips()
Allow more than one tooltip per component


setAllowMultiplyTooltips

public static void setAllowMultiplyTooltips(boolean allowMultiplyTooltips)

isShowHotkeysInTooltips

public static boolean isShowHotkeysInTooltips()
Show hotkeys in tooltips by default


setShowHotkeysInTooltips

public static void setShowHotkeysInTooltips(boolean showHotkeysInTooltips)

isShowHotkeysInOneTimeTooltips

public static boolean isShowHotkeysInOneTimeTooltips()
Show hotkeys in one-time tooltips by default


setShowHotkeysInOneTimeTooltips

public static void setShowHotkeysInOneTimeTooltips(boolean showHotkeysInOneTimeTooltips)