branch feature/ReplaceComboByList updated (fb7043d -> 4cb9b58)
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 fb7043d Merge branch 'feature/ReplaceComboByList' of gitlab.nuiton.org:codelutin/faxtomail into feature/ReplaceComboByList new a39f355 Handle onEnter on the client combo new a490a2f Handle onEnter on the client combo new 4cb9b58 Merge branch 'feature/ReplaceComboByList' of gitlab.nuiton.org:codelutin/faxtomail into feature/ReplaceComboByList The 3 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 4cb9b58cf93d2c98bf79b7fd3f3318d2a83125ca Merge: a490a2f fb7043d Author: Julien Ruchaud <julien.ruchaud@debux.org> Date: Wed Jun 8 12:54:16 2016 +0200 Merge branch 'feature/ReplaceComboByList' of gitlab.nuiton.org:codelutin/faxtomail into feature/ReplaceComboByList commit a490a2f965382ed65d48b87905cdedcbe19d805f Author: Julien Ruchaud <julien.ruchaud@debux.org> Date: Wed Jun 8 12:31:29 2016 +0200 Handle onEnter on the client combo commit a39f355bb5a880f4c976f344fc711608d210b1a7 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: -- 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 a39f355bb5a880f4c976f344fc711608d210b1a7 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..29af575 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,18 +443,62 @@ 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()); + + final JComboBox comboBox = clientComboBox.getCombobox(); + final JTextComponent editorComponent = (JTextComponent) comboBox.getEditor().getEditorComponent(); - long time = new Date().getTime()- now.getTime(); - if (log.isInfoEnabled()) { - log.info("chargement combo clients " + time); - } + 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 a490a2f965382ed65d48b87905cdedcbe19d805f Author: Julien Ruchaud <julien.ruchaud@debux.org> Date: Wed Jun 8 12:31:29 2016 +0200 Handle onEnter on the client combo --- .../faxtomail/ui/swing/content/demande/DemandeUIHandler.java | 4 ++-- 1 file changed, 2 insertions(+), 2 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 29af575..ee6e566 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 @@ -468,8 +468,8 @@ public class DemandeUIHandler extends AbstractFaxToMailUIHandler<DemandeUIModel, if (keyCode == KeyEvent.VK_ENTER) { FaxToMailServiceContext serviceContext = getContext().newServiceContext(); MailFolder folder = getModel().getMailFolder(); - List<Client> allowedClients = serviceContext.getClientService().getClientsForFolder(folder); + List<Client> allowedClients = serviceContext.getClientService().getClientsForFolder(folder); getModel().setAllowedClients(allowedClients); clientComboBox.setData(allowedClients); @@ -499,7 +499,7 @@ public class DemandeUIHandler extends AbstractFaxToMailUIHandler<DemandeUIModel, 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 4cb9b58cf93d2c98bf79b7fd3f3318d2a83125ca Merge: a490a2f fb7043d Author: Julien Ruchaud <julien.ruchaud@debux.org> Date: Wed Jun 8 12:54:16 2016 +0200 Merge branch 'feature/ReplaceComboByList' of gitlab.nuiton.org:codelutin/faxtomail into feature/ReplaceComboByList .../faxtomail/ui/swing/content/demande/DemandeUIHandler.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@codelutin.com>.
participants (1)
-
codelutin.com scm