Revision 1644
org.gvsig.tools/library/trunk/org.gvsig.tools/org.gvsig.tools.swing/org.gvsig.tools.swing.impl/src/main/java/org/gvsig/tools/swing/impl/DefaultToolsSwingManager.java | ||
---|---|---|
14 | 14 |
import javax.swing.JSlider; |
15 | 15 |
import javax.swing.JTextField; |
16 | 16 |
import javax.swing.tree.TreeModel; |
17 |
import org.apache.commons.lang3.StringUtils; |
|
17 | 18 |
import org.gvsig.tools.ToolsLocator; |
18 | 19 |
import org.gvsig.tools.i18n.I18nManager; |
19 | 20 |
import org.gvsig.tools.swing.api.ActionListenerSupport; |
... | ... | |
146 | 147 |
@Override |
147 | 148 |
public void translate(AbstractButton component) { |
148 | 149 |
I18nManager i18n = ToolsLocator.getI18nManager(); |
149 |
component.setText(i18n.getTranslation(component.getText())); |
|
150 |
String s = component.getText(); |
|
151 |
if( !StringUtils.isEmpty(s) ) { |
|
152 |
component.setText(i18n.getTranslation(s)); |
|
153 |
} |
|
154 |
s = component.getToolTipText(); |
|
155 |
if( !StringUtils.isEmpty(s) ) { |
|
156 |
component.setText(i18n.getTranslation(s)); |
|
157 |
} |
|
150 | 158 |
} |
151 | 159 |
|
152 | 160 |
@Override |
153 | 161 |
public void translate(JLabel component) { |
154 | 162 |
I18nManager i18n = ToolsLocator.getI18nManager(); |
155 |
component.setText(i18n.getTranslation(component.getText())); |
|
163 |
String s = component.getText(); |
|
164 |
if( !StringUtils.isEmpty(s) ) { |
|
165 |
component.setText(i18n.getTranslation(s)); |
|
166 |
} |
|
167 |
s = component.getToolTipText(); |
|
168 |
if( !StringUtils.isEmpty(s) ) { |
|
169 |
component.setText(i18n.getTranslation(s)); |
|
170 |
} |
|
156 | 171 |
} |
157 | 172 |
} |
Also available in: Unified diff