Commit 3d80f3c3eef92b16de939d6fcc71aac52d7a534b
1 parent
090a1158
Exists in
master
bugFix: targetName field allows customized names.
Showing
1 changed file
with
11 additions
and
10 deletions
Show diff stats
src/main/java/eu/omp/irap/vespa/epntapclient/view/ParamField.java
... | ... | @@ -234,21 +234,22 @@ public abstract class ParamField extends JPanel { |
234 | 234 | Runnable updateComboBox = new Runnable() { |
235 | 235 | @Override |
236 | 236 | public void run() { |
237 | - comboBox.removeAllItems(); | |
238 | - for (String s : getItems(lastContent)) { | |
239 | - comboBox.addItem(s); | |
237 | + System.out.println("run updateComboBox"); | |
238 | + String content = field.getText(); | |
239 | + if (content.length() >= 2 && !content.equals(lastContent)) { | |
240 | + lastContent = content; | |
241 | + comboBox.removeAllItems(); | |
242 | + for (String s : getItems(content)) { | |
243 | + comboBox.addItem(s); | |
244 | + } | |
245 | + comboBox.getEditor().setItem(content); | |
246 | + requestView.updateParam(paramName, content); | |
240 | 247 | } |
241 | - comboBox.getEditor().setItem(lastContent); | |
242 | 248 | } |
243 | 249 | }; |
244 | 250 | |
245 | 251 | public void update(JTextField field) { |
246 | - String content = field.getText(); | |
247 | - if (content.length() >= 2 && !content.equals(lastContent)) { | |
248 | - lastContent = content; | |
249 | - SwingUtilities.invokeLater(updateComboBox); | |
250 | - requestView.updateParam(paramName, content); | |
251 | - } | |
252 | + SwingUtilities.invokeLater(updateComboBox); | |
252 | 253 | } |
253 | 254 | } |
254 | 255 | ... | ... |