From 3d80f3c3eef92b16de939d6fcc71aac52d7a534b Mon Sep 17 00:00:00 2001 From: Nathanael Jourdane Date: Fri, 11 Mar 2016 12:09:27 +0100 Subject: [PATCH] bugFix: targetName field allows customized names. --- src/main/java/eu/omp/irap/vespa/epntapclient/view/ParamField.java | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/src/main/java/eu/omp/irap/vespa/epntapclient/view/ParamField.java b/src/main/java/eu/omp/irap/vespa/epntapclient/view/ParamField.java index 3818fdf..87c2651 100644 --- a/src/main/java/eu/omp/irap/vespa/epntapclient/view/ParamField.java +++ b/src/main/java/eu/omp/irap/vespa/epntapclient/view/ParamField.java @@ -234,21 +234,22 @@ public abstract class ParamField extends JPanel { Runnable updateComboBox = new Runnable() { @Override public void run() { - comboBox.removeAllItems(); - for (String s : getItems(lastContent)) { - comboBox.addItem(s); + System.out.println("run updateComboBox"); + String content = field.getText(); + if (content.length() >= 2 && !content.equals(lastContent)) { + lastContent = content; + comboBox.removeAllItems(); + for (String s : getItems(content)) { + comboBox.addItem(s); + } + comboBox.getEditor().setItem(content); + requestView.updateParam(paramName, content); } - comboBox.getEditor().setItem(lastContent); } }; public void update(JTextField field) { - String content = field.getText(); - if (content.length() >= 2 && !content.equals(lastContent)) { - lastContent = content; - SwingUtilities.invokeLater(updateComboBox); - requestView.updateParam(paramName, content); - } + SwingUtilities.invokeLater(updateComboBox); } } -- libgit2 0.21.2