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.
    Both parts are optional. Typically the static part remains constant while the dynamic part may change, but this is not a requirement. This interface defines methods to query and to set both parts of the tool tip for a given component. Components can be specified as native objects or by their name (the latter requires that a concrete implementation has access to a component store).

    Version:
    $Id: ToolTipManager.java 205 2012-01-29 18:29:57Z oheger $
    Author:
    Oliver Heger
    • 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 question
        tip - 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 question
        tip - 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 the setToolTip(Object, String) method) and this part.
        Parameters:
        component - the component in question
        tip - 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 like setAdditionalToolTip(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 question
        tip - the additional (dynamic) tool tip
        Throws:
        GUIRuntimeException - if the component name cannot be resolved