/**
* Label that can update itself from {@link I18n}.
- *
+ *
* @author David ‘Bombe’ Roden <bombe@freenetproject.org>
* @version $Id$
*/
/**
* Creates a new label with the given I18n basename.
- *
+ *
* @param i18nBasename
* The I18n basename of the label
*/
/**
* Creates a new label with the given I18n basename that optionally is a
* label for the given component.
- *
+ *
* @param i18nBasename
* The I18n basename of the label
* @param component
/**
* Creates a new label with the given I18n basename that optionally is a
* label for the given component.
- *
+ *
* @param i18nBasename
* The I18n basename of the label
* @param arguments
/**
* Creates a new label with the given I18n basename that optionally is a
* label for the given component.
- *
+ *
* @param i18nBasename
* The I18n basename of the label
* @param component
super();
this.i18nBasename = i18nBasename;
this.arguments = arguments;
- updateI18n();
if (component != null) {
setLabelFor(component);
}
+ updateI18n();
}
/**
*/
public void updateI18n() {
setText(I18n.get(i18nBasename + ".name", arguments));
- setDisplayedMnemonic(I18n.getKey(i18nBasename + ".mnemonic"));
+ if (getLabelFor() != null) {
+ setDisplayedMnemonic(I18n.getKey(i18nBasename + ".mnemonic"));
+ }
}
}