if (tvSet.intValue() < 1) {
return;
}
AutoResizingComboBox rl = (AutoResizingComboBox) comp;
for (int i = 0; i < rl.getItemCount(); i++) {
ListElement le = (ListElement) rl.getItemAt(i);
le.reloadLabelText(mcat, tvSet.intValue());
}
return;
}
// ScrollList
if ((comp instanceof JList) && !(comp instanceof RadioList) && !(comp instanceof JListView)) {
Integer tvSet = (Integer) comp.getClientProperty("qq_TextValueSet");
if ((tvSet == null) || (tvSet.intValue() < 1)) {
tvSet = Integer.valueOf(defaultSet);
}
if (tvSet.intValue() < 1) {
return;
}
JList rl = (JList) comp;
for (int i = 0; i < rl.getModel().getSize(); i++) {
ListElement le = (ListElement) rl.getModel().getElementAt(i);
le.reloadLabelText(mcat, tvSet.intValue());
}
return;
}
if (msgSet > 0 && msgNumber > 0) {
if (comp instanceof JLabel) {
JLabel jl = (JLabel) comp;
jl.setText(mcat.getString(msgSet, msgNumber, jl.getText()));
labelWidth(jl);
return;
}
else if (comp instanceof JButton) {
JButton jb = (JButton) comp;
jb.setText(mcat.getString(msgSet, msgNumber, jb.getText()));
processMnemonic(jb);
packButton(jb);
return;
}
else if (comp instanceof JTabbedPane) {
JTabbedPane jtp = (JTabbedPane) comp;
for (int i = 0; i < jtp.getComponentCount(); i++) {
if (jtp.getComponentAt(i) instanceof JPanel) {
JPanel kid = (JPanel) jtp.getComponentAt(i);
int s = UIutils.getMsgSet(kid);
int n = UIutils.getMsgNumber(kid);
jtp.setTitleAt(i, mcat.getString(s, n, jtp.getTitleAt(i)));
}
}
}
else if (comp instanceof GridField) {
GridField gf = (GridField) comp;
TextData cap = gf.getCaption();
if (cap != null) {
gf.setCaption(new TextData(mcat.getString(msgSet, msgNumber, gf.getCaption().asString())));
}
else {
gf.setCaption(new TextData(mcat.getString(msgSet, msgNumber)));
}
}
else if (comp instanceof JPanel) {
JPanel gf = (JPanel) comp;
String cap = getCaption(gf);
if (cap != null) {
// TF:Mar 11, 2010:Changed this to use Caption.set instead of setCaption
// setCaption(gf, mcat.getString(msgSet, msgNumber, getCaption(gf)));
Caption.set(gf, mcat.getString(msgSet, msgNumber, getCaption(gf)));
}
else {
// TF:Mar 11, 2010:Changed this to use Caption.set instead of setCaption
// setCaption(gf, mcat.getString(msgSet, msgNumber));
Caption.set(gf, mcat.getString(msgSet, msgNumber));
}
if ((gf.getParent() != null) && (gf.getParent() instanceof JTabbedPane)) {
JTabbedPane jt = (JTabbedPane) comp.getParent();
int index = jt.indexOfComponent(comp);
if (index != -1) {
jt.setTitleAt(index, mcat.getString(msgSet, msgNumber, jt.getTitleAt(index)));
}
}
}
else if (comp instanceof JCheckBox) {
JCheckBox jtb = (JCheckBox) comp;
jtb.setText(mcat.getString(msgSet, msgNumber, jtb.getText()));
packCheck(jtb);
}
else {
_log.debug("UIutils.reloadLabelText() is not implemented for " + comp.getClass().getName());
}
}
if (comp instanceof RadioList) {
Integer tvSet = (Integer) comp.getClientProperty("qq_TextValueSet");
if ((tvSet == null) || (tvSet.intValue() < 1)) {
tvSet = Integer.valueOf(defaultSet);
}
if (tvSet.intValue() < 1) {
return;
}
RadioList rl = (RadioList) comp;
if (msgNumber > 0) {
rl.setCaption(mcat.getString(msgSet, msgNumber, TextData.valueOf(rl.getCaption())));
}
for (ListElement le : rl.getElementList()) {
le.reloadLabelText(mcat, tvSet.intValue());
}
// rl.update();
return;
}
else if (comp instanceof ListView){ //PM:23/4/08 added support for ListView