branch feature/9645-filtreListeClient updated (d89f5da2 -> edd6d3cc)
This is an automated email from the git hooks/post-receive script. New change to branch feature/9645-filtreListeClient in repository faxtomail. See https://gitlab.nuiton.org/codelutin/faxtomail.git from d89f5da2 Wait for 3 chars to init clientComboBox new edd6d3cc Update data after 3 cars entered The 1 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "adds" were already present in the repository and have only been added to this reference. Detailed log of new commits: commit edd6d3cc7c470c4a5ed96236a7c71eaa18f1652c Author: Jean Couteau <jean.couteau@gmail.com> Date: Wed Jan 31 16:42:54 2018 +0100 Update data after 3 cars entered Summary of changes: .../ui/swing/content/demande/DemandeUIHandler.java | 23 ++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@codelutin.com>.
This is an automated email from the git hooks/post-receive script. New commit to branch feature/9645-filtreListeClient in repository faxtomail. See https://gitlab.nuiton.org/codelutin/faxtomail.git commit edd6d3cc7c470c4a5ed96236a7c71eaa18f1652c Author: Jean Couteau <jean.couteau@gmail.com> Date: Wed Jan 31 16:42:54 2018 +0100 Update data after 3 cars entered --- .../ui/swing/content/demande/DemandeUIHandler.java | 23 ++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeUIHandler.java b/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeUIHandler.java index 78341845..0cbfdae2 100644 --- a/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeUIHandler.java +++ b/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeUIHandler.java @@ -71,6 +71,7 @@ import java.awt.*; import java.awt.event.ActionEvent; import java.awt.event.KeyAdapter; import java.awt.event.KeyEvent; +import java.awt.event.KeyListener; import java.beans.PropertyChangeEvent; import java.beans.PropertyChangeListener; import java.util.ArrayList; @@ -436,19 +437,25 @@ public class DemandeUIHandler extends AbstractFaxToMailUIHandler<DemandeUIModel, KeyAdapter clientComboBoxKeyAdapter = new KeyAdapter() { @Override - public void keyPressed(KeyEvent e) { - if (clientComboBox.getComboBoxModel().getFilterText().length()==3){ + public void keyTyped(KeyEvent e) { + String text = clientComboBox.getComboBoxModel().getFilterText(); + text+=e.getKeyChar(); + if (text.length()==3){ //init list when 3 chars entered - - initBeanFilterableComboBox(clientComboBox, getContext().getClientCache(), getModel().getClient()); - } else if (clientComboBox.getComboBoxModel().getFilterText().length()<3){ + FaxToMailServiceContext serviceContext = getContext().newServiceContext(); + List<Client> clients = serviceContext.getClientService().getClientsForFolder(getContext().getCurrentMailFolder(),text); + clientComboBox.getComboBoxModel().removeAllElements(); + clientComboBox.getComboBoxModel().addAllElements(clients); + } else if (text.length()<3){ //empty list if less than 3 chars - initBeanFilterableComboBox(clientComboBox, Collections.singletonList(getModel().getClient()), getModel().getClient()); - } // do nothing if more than 3 chars entered (list already initialised) + clientComboBox.getComboBoxModel().removeAllElements(); + } else { + // do nothing if more than 3 chars entered + } } }; - clientComboBox.addKeyListener(clientComboBoxKeyAdapter); + clientComboBox.getCombobox().getEditor().getEditorComponent().addKeyListener(clientComboBoxKeyAdapter); listModelIsModify(model); } -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@codelutin.com>.
participants (1)
-
codelutin.com scm