// widget based on the message catalog
// TF:Mar 8, 2010:Re-used methods to reduce dependency on hard-coded strings
int msgNum = getMsgNumber(comp);
int msgSet = getMsgSet(comp);
if (msgNum > 0 && msgSet > 0) {
MsgCatalog catalog = MsgCatalog.getInstance();
if (catalog != null) {
if (comp instanceof JTextComponent) {
TextData value = TextValue.get((JTextComponent)comp);
String text = catalog.getString(msgSet, msgNum, value == null ? null : value.toString());
TextValue.set((JTextComponent)comp, text);
}
else if (comp instanceof JLabel) {
TextData value = TextValue.get((JLabel)comp);
String text = catalog.getString(msgSet, msgNum, value == null ? null : value.toString());
TextValue.set((JLabel)comp, text);
}
else if (comp instanceof JMenuItem) {
TextData value = MenuText.get((JMenuItem)comp);
String text = catalog.getString(msgSet, msgNum, value == null ? null : value.toString());
MenuText.set((JMenuItem)comp, text);
}
else if (comp instanceof JButton) {
TextData value = TextValue.get((JButton)comp);
String text = catalog.getString(msgSet, msgNum, value == null ? null : value.toString());
TextValue.set((JButton)comp, text);
}
//PM:24/4/08 added support for Panel and GridField
else if (comp instanceof Panel) {
TextData value = Caption.get((Panel)comp);
String text = catalog.getString(msgSet, msgNum, value == null ? null : value.toString());
Caption.set((Panel)comp, text);
}
else if (comp instanceof GridField) {
TextData value = Caption.get((GridField)comp);
String text = catalog.getString(msgSet, msgNum, value == null ? null : value.toString());
Caption.set((GridField)comp, text);
}
// CraigM:28/04/2008: Added support for check boxes
else if (comp instanceof JCheckBox) {
String value = ((JCheckBox)comp).getText();
String text = catalog.getString(msgSet, msgNum, value);
((JCheckBox)comp).setText(text);
}
// TF:26/06/2008:Added support for radio lists
else if (comp instanceof JCheckBox) {
String value = ((JCheckBox)comp).getText();
String text = catalog.getString(msgSet, msgNum, value);
((JCheckBox)comp).setText(text);
}
}
}
//PM:2/5/08