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:
Modifier and Type | Method and 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.
|
String getToolTip(Object component)
component
- the component in questionvoid setToolTip(Object component, String tip)
component
- the component in questiontip
- the static tool tip for this componentString getToolTip(String componentName)
componentName
- the name of the component in questionGUIRuntimeException
- if the
component cannot be resolvedvoid setToolTip(String componentName, String tip)
componentName
- the name of the component in questiontip
- the static tool tip for this componentGUIRuntimeException
- if the
component name cannot be resolvedString getAdditionalToolTip(Object component)
component
- the component in questionvoid setAdditionalToolTip(Object component, String tip)
setToolTip(Object, String)
method) and this
part.component
- the component in questiontip
- the additional (dynamic) tool tip for this componentString getAdditionalToolTip(String componentName)
componentName
- the name of the component in questionGUIRuntimeException
- if the
component name cannot be resolvedvoid setAdditionalToolTip(String componentName, String tip)
setAdditionalToolTip(Object, String)
, but
the component is specified using its name. If the name cannot be
resolved, an exception is thrown.componentName
- the name of the component in questiontip
- the additional (dynamic) tool tipGUIRuntimeException
- if the
component name cannot be resolvedCopyright © 2016 The JGUIraffe Team. All rights reserved.