* @param component the component inside of the window.
* @param statusTextValue the status text value.
*/
public void setStatusTextForComponent(JComponent component, TextData statusTextValue) {
JFrame topLevelAncestor = (JFrame)component.getTopLevelAncestor();
TextData mappedProperty = (TextData)UIutils.getForm(topLevelAncestor).getClientProperty(cSTATUS_WIDGET);
if (mappedProperty != null){
if (!oldValueCache.containsKey(mappedProperty)) {
oldValueCache.put(mappedProperty, mappedProperty.toString());
mappedProperty.addPropertyChangeListener("value", oldValueChangeListener);
// TF:01/03/2010:Ensure we're only in the cache once, even if the status text field is changed
topLevelAncestor.removeWindowListener(windowClosingListener);
topLevelAncestor.addWindowListener(windowClosingListener);
}
// TF:01/03/2010:Always update the old value in the cache, as the mouse exit handler will expect a valid value
oldValueCache.put(mappedProperty, mappedProperty.toString());
if (statusTextValue != null) {
setStatusText(mappedProperty, statusTextValue.toString());
}
}
}