branch feature/ReplaceComboByList updated (486367e -> fb7043d)
This is an automated email from the git hooks/post-receive script. New change to branch feature/ReplaceComboByList in repository faxtomail. See https://gitlab.nuiton.org/codelutin/faxtomail.git from 486367e Handle onEnter on the client combo adds 4c48e9c fixes #8325 [Liste des demandes] On ne retourne pas à la page 1 quand on change de dossier new 680442e Handle onEnter on the client combo new fb7043d Merge branch 'feature/ReplaceComboByList' of gitlab.nuiton.org:codelutin/faxtomail into feature/ReplaceComboByList The 2 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 fb7043d0406ead95a54cffaca71b982718f47b4a Merge: 680442e 486367e Author: Julien Ruchaud <julien.ruchaud@debux.org> Date: Wed Jun 8 12:47:22 2016 +0200 Merge branch 'feature/ReplaceComboByList' of gitlab.nuiton.org:codelutin/faxtomail into feature/ReplaceComboByList commit 680442e0330f8b61c0b8b166eccc23ffdd8b1088 Author: Julien Ruchaud <julien.ruchaud@debux.org> Date: Wed Jun 8 12:31:29 2016 +0200 Handle onEnter on the client combo Summary of changes: .../faxtomail/ui/swing/content/demande/DemandeListUIHandler.java | 1 - .../faxtomail/ui/swing/content/demande/DemandeUIHandler.java | 8 ++++---- 2 files changed, 4 insertions(+), 5 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/ReplaceComboByList in repository faxtomail. See https://gitlab.nuiton.org/codelutin/faxtomail.git commit 680442e0330f8b61c0b8b166eccc23ffdd8b1088 Author: Julien Ruchaud <julien.ruchaud@debux.org> Date: Wed Jun 8 12:31:29 2016 +0200 Handle onEnter on the client combo --- .../ui/swing/actions/ShowDemandeAction.java | 6 -- .../ui/swing/content/demande/DemandeUIHandler.java | 74 +++++++++++++++++++--- 2 files changed, 64 insertions(+), 16 deletions(-) diff --git a/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/ShowDemandeAction.java b/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/ShowDemandeAction.java index ba1abf9..da6a752 100644 --- a/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/ShowDemandeAction.java +++ b/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/ShowDemandeAction.java @@ -22,7 +22,6 @@ package com.franciaflex.faxtomail.ui.swing.actions; * #L% */ -import com.franciaflex.faxtomail.persistence.entities.Client; import com.franciaflex.faxtomail.persistence.entities.Email; import com.franciaflex.faxtomail.persistence.entities.FaxToMailUser; import com.franciaflex.faxtomail.persistence.entities.MailFolder; @@ -46,7 +45,6 @@ import java.awt.event.WindowAdapter; import java.awt.event.WindowEvent; import java.beans.PropertyChangeEvent; import java.beans.PropertyChangeListener; -import java.util.List; import static org.nuiton.i18n.I18n.t; @@ -180,10 +178,6 @@ public class ShowDemandeAction extends AbstractMainUIFaxToMailAction { currentEmail.setEditable(false); } } - - MailFolder folder = currentEmail.getMailFolder(); - List<Client> allowedClients = serviceContext.getClientService().getClientsForFolder(folder); - currentEmail.setAllowedClients(allowedClients); } @Override 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 888cea2..fda661e 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 @@ -69,10 +69,16 @@ import javax.swing.event.ListSelectionListener; import javax.swing.table.TableCellEditor; import java.awt.*; import java.awt.event.ActionEvent; +import java.awt.event.FocusEvent; +import java.awt.event.FocusListener; +import java.awt.event.InputMethodEvent; +import java.awt.event.InputMethodListener; +import java.awt.event.ItemListener; import java.awt.event.KeyAdapter; import java.awt.event.KeyEvent; import java.beans.PropertyChangeEvent; import java.beans.PropertyChangeListener; +import java.text.AttributedCharacterIterator; import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; @@ -82,6 +88,8 @@ import java.util.Date; import java.util.List; import java.util.Map; import java.util.Set; +import javax.swing.text.JTextComponent; +import jaxx.runtime.swing.model.JaxxFilterableComboBoxModel; import static org.nuiton.i18n.I18n.t; @@ -97,6 +105,8 @@ public class DemandeUIHandler extends AbstractFaxToMailUIHandler<DemandeUIModel, private static final Log log = LogFactory.getLog(DemandeUIHandler.class); protected BeanMonitor monitor; + + protected String clientSearch; protected PropertyChangeListener rangeRowListener = new PropertyChangeListener() { @Override @@ -433,19 +443,63 @@ public class DemandeUIHandler extends AbstractFaxToMailUIHandler<DemandeUIModel, } } - Date now = new Date(); - if (log.isInfoEnabled()) { - log.info("avant chargement combo clients " + now); - } - BeanFilterableComboBox<Client> clientComboBox = ui.getClientComboBox(); + // Handle combo search + final BeanFilterableComboBox<Client> clientComboBox = ui.getClientComboBox(); clientComboBox.getComboBoxModel().setWildcardCharacter(null); - initBeanFilterableComboBox(clientComboBox, model.getAllowedClients(), model.getClient()); + initBeanFilterableComboBox(clientComboBox, null, model.getClient()); - long time = new Date().getTime()- now.getTime(); - if (log.isInfoEnabled()) { - log.info("chargement combo clients " + time); - } + final JComboBox comboBox = clientComboBox.getCombobox(); + final JTextComponent editorComponent = (JTextComponent) comboBox.getEditor().getEditorComponent(); + + editorComponent.addKeyListener(new KeyAdapter() { + @Override + public void keyPressed(KeyEvent e) { + int keyCode = e.getKeyCode(); + if (keyCode == KeyEvent.VK_ENTER) { + clientSearch = editorComponent.getText(); + } else { + clientSearch = null; + } + } + + @Override + public void keyReleased(KeyEvent e) { + int keyCode = e.getKeyCode(); + if (keyCode == KeyEvent.VK_ENTER) { + FaxToMailServiceContext serviceContext = getContext().newServiceContext(); + MailFolder folder = getModel().getMailFolder(); + + List<Client> allowedClients = serviceContext.getClientService().getClientsForFolder(folder); + getModel().setAllowedClients(allowedClients); + clientComboBox.setData(allowedClients); + + editorComponent.setText(clientSearch); + } + } + }); + + clientComboBox.addPropertyChangeListener(BeanFilterableComboBox.PROPERTY_SELECTED_ITEM, new PropertyChangeListener() { + @Override + public void propertyChange(PropertyChangeEvent evt) { + if (clientSearch != null) { + JaxxFilterableComboBoxModel model = (JaxxFilterableComboBoxModel) comboBox.getModel(); + model.setFilterText(clientSearch); + editorComponent.setText(clientSearch); + } + } + }); + + editorComponent.addFocusListener(new FocusListener() { + @Override + public void focusGained(FocusEvent e) { + comboBox.showPopup(); + } + @Override + public void focusLost(FocusEvent e) { + } + }); + listModelIsModify(model); } -- 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/ReplaceComboByList in repository faxtomail. See https://gitlab.nuiton.org/codelutin/faxtomail.git commit fb7043d0406ead95a54cffaca71b982718f47b4a Merge: 680442e 486367e Author: Julien Ruchaud <julien.ruchaud@debux.org> Date: Wed Jun 8 12:47:22 2016 +0200 Merge branch 'feature/ReplaceComboByList' of gitlab.nuiton.org:codelutin/faxtomail into feature/ReplaceComboByList -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@codelutin.com>.
participants (1)
-
codelutin.com scm