Changeset 5862


Ignore:
Timestamp:
2003-11-18T08:32:00+13:00 (21 years ago)
Author:
jmt12
Message:

Changed the registerTooltip method a little so you can tell it whether the value you are giving it is a key, or the tooltip itself (for use with the descriptions of plugins and classifiers).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gli/src/org/greenstone/gatherer/Dictionary.java

    r5785 r5862  
    6767 * @version 2.3
    6868 */
    69 public class Dictionary 
     69public class Dictionary
    7070    extends HashMap {
    7171
     
    348348        // Update the component using the AWTEvent queue
    349349        ComponentDetails details = new ComponentDetails(true, text_key, args, false, null);
    350         ComponentUpdateTask task = new ComponentUpdateTask(component, details);
     350        ComponentUpdateTask task = new ComponentUpdateTask(component, details, true);
    351351        SwingUtilities.invokeLater(task);
    352352    }
     
    359359        // Update the component using the AWTEvent queue
    360360        ComponentDetails details = new ComponentDetails(false, null, null, true, tooltip_key);
    361         ComponentUpdateTask task = new ComponentUpdateTask(component, details);
     361        ComponentUpdateTask task = new ComponentUpdateTask(component, details, true);
    362362        SwingUtilities.invokeLater(task);
    363363    }
     
    394394
    395395        // Update the component using the AWTEvent queue
    396         ComponentUpdateTask task = new ComponentUpdateTask(component, details);
     396        ComponentUpdateTask task = new ComponentUpdateTask(component, details, true);
    397397        SwingUtilities.invokeLater(task);
    398398    }
    399399    }
    400400
    401 
    402     static public void registerTooltip(Component component, String tooltip_key)
     401    static public void registerTooltip(Component component, String tooltip_key) {
     402        self.registerTooltip(component, tooltip_key, true);
     403    }
     404
     405    static public void registerTooltip(Component component, String tooltip_key, boolean is_key)
    403406    {
    404407    if (component != null) {
     
    415418
    416419        // Update the component using the AWTEvent queue
    417         ComponentUpdateTask task = new ComponentUpdateTask(component, details);
     420        ComponentUpdateTask task = new ComponentUpdateTask(component, details, is_key);
    418421        SwingUtilities.invokeLater(task);
    419422    }
     
    448451    private String tooltip = null;
    449452
    450     public ComponentUpdateTask(Component component, ComponentDetails details)
     453    public ComponentUpdateTask(Component component, ComponentDetails details, boolean is_key)
    451454    {
    452455        this.component = component;
     
    456459        }
    457460        if (details.has_tooltip) {
    458         tooltip = self.oldget(details.tooltip_key, (String[]) null);
     461            if(is_key) {
     462            tooltip = self.oldget(details.tooltip_key, (String[]) null);
     463            }
     464            else {
     465                tooltip = details.tooltip_key;
     466            }
    459467        }
    460468    }
Note: See TracChangeset for help on using the changeset viewer.