64,13 → 64,13 |
c.fill = GridBagConstraints.BOTH; |
final JSeparator sep = new JSeparator(JSeparator.VERTICAL); |
this.add(sep, c); |
hideableComponents.add(sep); |
this.hideableComponents.add(sep); |
c.gridheight = 1; |
c.weightx = 1; |
c.gridx++; |
c.fill = GridBagConstraints.NONE; |
final LocaleSelector comboLang2 = new LocaleSelector(); |
hideableComponents.add(comboLang2); |
this.hideableComponents.add(comboLang2); |
comboLang2.setLocale(Locale.ENGLISH); |
this.add(comboLang2, c); |
// Singular |
81,10 → 81,10 |
this.add(new JLabel("Singulier", SwingConstants.RIGHT), c); |
c.gridx++; |
|
this.add(textSingular1, c); |
this.add(this.textSingular1, c); |
c.gridx += 2; |
hideableComponents.add(textSingular2); |
this.add(textSingular2, c); |
this.hideableComponents.add(this.textSingular2); |
this.add(this.textSingular2, c); |
|
// Plural |
c.gridx = 0; |
92,10 → 92,10 |
c.weightx = 0; |
this.add(new JLabel("Pluriel", SwingConstants.RIGHT), c); |
c.gridx++; |
this.add(textPlural1, c); |
this.add(this.textPlural1, c); |
c.gridx += 2; |
hideableComponents.add(textPlural2); |
this.add(textPlural2, c); |
this.hideableComponents.add(this.textPlural2); |
this.add(this.textPlural2, c); |
|
// Fields |
c.gridx = 0; |
111,7 → 111,7 |
c.gridx = 2; |
c.fill = GridBagConstraints.BOTH; |
final JSeparator sep2 = new JSeparator(JSeparator.VERTICAL); |
hideableComponents.add(sep2); |
this.hideableComponents.add(sep2); |
this.add(sep2, c); |
|
c.fill = GridBagConstraints.HORIZONTAL; |
122,14 → 122,14 |
this.add(new JLabel(fName, SwingConstants.RIGHT), c); |
c.gridx++; |
final JTextField t1 = new JTextField(); |
map1.put(fName, t1); |
fieldsMap.put(t1, fName); |
this.map1.put(fName, t1); |
this.fieldsMap.put(t1, fName); |
this.add(t1, c); |
c.gridx += 2; |
final JTextField t2 = new JTextField(); |
hideableComponents.add(t2); |
fieldsMap.put(t2, fName); |
map2.put(fName, t2); |
this.hideableComponents.add(t2); |
this.fieldsMap.put(t2, fName); |
this.map2.put(fName, t2); |
this.add(t2, c); |
c.gridy++; |
} |
189,22 → 189,22 |
} |
|
}); |
for (final JTextField textField : map1.values()) { |
for (final JTextField textField : this.map1.values()) { |
textField.getDocument().addDocumentListener(new SimpleDocumentListener() { |
|
@Override |
public void changedUpdate(DocumentEvent e, String text) { |
extension.setFieldTranslation(tableName, fieldsMap.get(textField), comboLang1.getLocale(), text); |
extension.setFieldTranslation(tableName, TableTranslationEditorPanel.this.fieldsMap.get(textField), comboLang1.getLocale(), text); |
} |
|
}); |
} |
for (final JTextField textField : map2.values()) { |
for (final JTextField textField : this.map2.values()) { |
textField.getDocument().addDocumentListener(new SimpleDocumentListener() { |
|
@Override |
public void changedUpdate(DocumentEvent e, String text) { |
extension.setFieldTranslation(tableName, fieldsMap.get(textField), comboLang2.getLocale(), text); |
extension.setFieldTranslation(tableName, TableTranslationEditorPanel.this.fieldsMap.get(textField), comboLang2.getLocale(), text); |
} |
|
}); |
215,11 → 215,11 |
private void updateUIFrom(Extension extension, String tableName, Object l1, Object l2) { |
if (l1 != null) { |
final String lang = l1.toString(); |
updateUI(extension, tableName, lang, textSingular1, textPlural1, map1); |
updateUI(extension, tableName, lang, this.textSingular1, this.textPlural1, this.map1); |
} |
if (l2 != null) { |
final String lang = l2.toString(); |
updateUI(extension, tableName, lang, textSingular2, textPlural2, map2); |
updateUI(extension, tableName, lang, this.textSingular2, this.textPlural2, this.map2); |
} |
|
} |