Interface ToolTipManager
-
- All Known Implementing Classes:
DefaultToolTipManager
public interface ToolTipManager
Definition of an interface for a component that manages the tool tips of UI elements.
Each UI element can be associated with a tool tip that is displayed when the mouse cursor is placed over the element. The tag handler classes for creating UI element provide corresponding options.
Assigning a tool tip text to an element is standard functionality. However, sometimes the texts for tool tips must be dynamically adapted depending on the current status of the element. For instance, an input element contains invalid data, and the tool tip is to be extended to display the validation messages, too. Or the tool tip of a disabled button should display additional information why this button cannot be pressed currently.
This interface provides functionality for dealing with tool tips for components that can change dynamically. The basic idea is that each component's tool tip consists of two parts:
- a static part describing the functionality of this component
- and a dynamic part containing information related to the current state of the component.
- Version:
- $Id: ToolTipManager.java 205 2012-01-29 18:29:57Z oheger $
- Author:
- Oliver Heger
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description String
getAdditionalToolTip(Object component)
Returns the additional (dynamic) tool tip for the specified component.String
getAdditionalToolTip(String componentName)
Returns the additional (dynamic) tool tip for the component with the given name.String
getToolTip(Object component)
Returns the tool tip of the specified component.String
getToolTip(String componentName)
Returns the tool tip for the component with the specified name.void
setAdditionalToolTip(Object component, String tip)
Sets the additional (dynamic) tool tip for the specified component.void
setAdditionalToolTip(String componentName, String tip)
Sets the additional (dynamic) tool tip for the component with the given name.void
setToolTip(Object component, String tip)
Sets the tool tip of the specified component.void
setToolTip(String componentName, String tip)
Sets the tool tip of the component with the given name.
-
-
-
Method Detail
-
getToolTip
String getToolTip(Object component)
Returns the tool tip of the specified component.- Parameters:
component
- the component in question- Returns:
- the tool tip of this component (can be null)
-
setToolTip
void setToolTip(Object component, String tip)
Sets the tool tip of the specified component. This is the static part of the component's tool tip.- Parameters:
component
- the component in questiontip
- the static tool tip for this component
-
getToolTip
String getToolTip(String componentName)
Returns the tool tip for the component with the specified name. If the name cannot be resolved, an exception is thrown.- Parameters:
componentName
- the name of the component in question- Returns:
- the tool tip of this component (can be null)
- Throws:
GUIRuntimeException
- if the component cannot be resolved
-
setToolTip
void setToolTip(String componentName, String tip)
Sets the tool tip of the component with the given name. This is the static part of the component's tool tip. If the name cannot be resolved, an exception is thrown.- Parameters:
componentName
- the name of the component in questiontip
- the static tool tip for this component- Throws:
GUIRuntimeException
- if the component name cannot be resolved
-
getAdditionalToolTip
String getAdditionalToolTip(Object component)
Returns the additional (dynamic) tool tip for the specified component.- Parameters:
component
- the component in question- Returns:
- the additional (dynamic) tool tip of this component (can be null)
-
setAdditionalToolTip
void setAdditionalToolTip(Object component, String tip)
Sets the additional (dynamic) tool tip for the specified component. The actual tool tip of this component is constructed from the static part (set through thesetToolTip(Object, String)
method) and this part.- Parameters:
component
- the component in questiontip
- the additional (dynamic) tool tip for this component
-
getAdditionalToolTip
String getAdditionalToolTip(String componentName)
Returns the additional (dynamic) tool tip for the component with the given name. If the name cannot be resolved, an exception is thrown.- Parameters:
componentName
- the name of the component in question- Returns:
- the additional (dynamic) tool tip of this component
- Throws:
GUIRuntimeException
- if the component name cannot be resolved
-
setAdditionalToolTip
void setAdditionalToolTip(String componentName, String tip)
Sets the additional (dynamic) tool tip for the component with the given name. This works likesetAdditionalToolTip(Object, String)
, but the component is specified using its name. If the name cannot be resolved, an exception is thrown.- Parameters:
componentName
- the name of the component in questiontip
- the additional (dynamic) tool tip- Throws:
GUIRuntimeException
- if the component name cannot be resolved
-
-