branch feature/1316-Rendre-utilisable-la-selection-de-compte created (now b9125c4)
This is an automated email from the git hooks/post-receive script. New change to branch feature/1316-Rendre-utilisable-la-selection-de-compte in repository lima. See http://git.chorem.org/lima.git at b9125c4 refs #1316 changement de comportement, il est possible de rechercher un compte tant qu'aucune correspondance a été trouvée, une fois une correspondance unique trouvée la recherche est intérompue (peut-être reprise avec F12) et l'utilisateur peut alors passer sur une autre cellule This branch includes the following new commits: new f131e28 refs #1316 ajout de logs new b9125c4 refs #1316 changement de comportement, il est possible de rechercher un compte tant qu'aucune correspondance a été trouvée, une fois une correspondance unique trouvée la recherche est intérompue (peut-être reprise avec F12) et l'utilisateur peut alors passer sur une autre cellule 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 b9125c4632b88588cfdec3f1cf6df67167ec1d3c Author: dcosse <cosse@codelutin.com> Date: Sat Feb 20 17:43:00 2016 +0100 refs #1316 changement de comportement, il est possible de rechercher un compte tant qu'aucune correspondance a été trouvée, une fois une correspondance unique trouvée la recherche est intérompue (peut-être reprise avec F12) et l'utilisateur peut alors passer sur une autre cellule commit f131e2867c3305aafafa9957a1d1aeb54847e1f6 Author: dcosse <cosse@codelutin.com> Date: Sat Feb 20 17:39:23 2016 +0100 refs #1316 ajout de logs -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.
This is an automated email from the git hooks/post-receive script. New commit to branch feature/1316-Rendre-utilisable-la-selection-de-compte in repository lima. See http://git.chorem.org/lima.git commit f131e2867c3305aafafa9957a1d1aeb54847e1f6 Author: dcosse <cosse@codelutin.com> Date: Sat Feb 20 17:39:23 2016 +0100 refs #1316 ajout de logs --- .../src/main/java/org/chorem/lima/ui/combobox/AccountComboBox.java | 7 +++++-- .../src/main/java/org/chorem/lima/ui/common/AbstractLimaTable.java | 4 ++++ .../org/chorem/lima/ui/financialtransaction/AccountColumn.java | 4 ++++ 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/lima-swing/src/main/java/org/chorem/lima/ui/combobox/AccountComboBox.java b/lima-swing/src/main/java/org/chorem/lima/ui/combobox/AccountComboBox.java index 916e6c1..be46e16 100644 --- a/lima-swing/src/main/java/org/chorem/lima/ui/combobox/AccountComboBox.java +++ b/lima-swing/src/main/java/org/chorem/lima/ui/combobox/AccountComboBox.java @@ -24,6 +24,8 @@ package org.chorem.lima.ui.combobox; import jaxx.runtime.JAXXContext; import jaxx.runtime.swing.editor.bean.BeanFilterableComboBox; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; import org.chorem.lima.business.LimaServiceFactory; import org.chorem.lima.business.ServiceListener; import org.chorem.lima.business.api.AccountService; @@ -40,6 +42,8 @@ import java.util.List; */ public class AccountComboBox extends BeanFilterableComboBox<Account> implements ServiceListener { + private static final Log log = LogFactory.getLog(AccountComboBox.class); + protected AccountService accountService; protected boolean leafAccounts; @@ -55,8 +59,7 @@ public class AccountComboBox extends BeanFilterableComboBox<Account> implements private void initializeAccountComboBox() { leafAccounts = false; - accountService = - LimaServiceFactory.getService(AccountService.class); + accountService = LimaServiceFactory.getService(AccountService.class); LimaServiceFactory.addServiceListener(AccountService.class, this); LimaServiceFactory.addServiceListener(ImportService.class, this); init(DecoratorUtil.newMultiJXPathDecorator(Account.class, "${" + Account.PROPERTY_ACCOUNT_NUMBER + "}$s##${" + Account.PROPERTY_LABEL + "}$s", "##", " - "), getDataList()); diff --git a/lima-swing/src/main/java/org/chorem/lima/ui/common/AbstractLimaTable.java b/lima-swing/src/main/java/org/chorem/lima/ui/common/AbstractLimaTable.java index 9a36e58..ad9a46b 100644 --- a/lima-swing/src/main/java/org/chorem/lima/ui/common/AbstractLimaTable.java +++ b/lima-swing/src/main/java/org/chorem/lima/ui/common/AbstractLimaTable.java @@ -22,6 +22,8 @@ package org.chorem.lima.ui.common; * #L% */ +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; import org.chorem.lima.entity.Account; import org.chorem.lima.entity.EntryBook; import org.chorem.lima.ui.celleditor.AccountTableCellEditor; @@ -46,6 +48,8 @@ import java.util.Date; */ public abstract class AbstractLimaTable<H> extends JXTable { + protected static final Log log = LogFactory.getLog(AbstractLimaTable.class); + private static final long serialVersionUID = -4195941654485008887L; protected H handler; diff --git a/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/AccountColumn.java b/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/AccountColumn.java index 33e567a..0cca0cd 100644 --- a/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/AccountColumn.java +++ b/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/AccountColumn.java @@ -23,6 +23,8 @@ package org.chorem.lima.ui.financialtransaction; */ import org.apache.commons.lang3.StringUtils; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; import org.chorem.lima.entity.Account; import org.chorem.lima.entity.Entry; import org.chorem.lima.ui.celleditor.AccountTableCellEditor; @@ -36,6 +38,8 @@ import static org.nuiton.i18n.I18n.t; */ public class AccountColumn extends AbstractColumn<FinancialTransactionTableModel> { + protected static final Log log = LogFactory.getLog(AccountColumn.class); + public AccountColumn() { super(Account.class, t("lima.entry.account"), true); setCellEditor(new AccountTableCellEditor()); -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.
This is an automated email from the git hooks/post-receive script. New commit to branch feature/1316-Rendre-utilisable-la-selection-de-compte in repository lima. See http://git.chorem.org/lima.git commit b9125c4632b88588cfdec3f1cf6df67167ec1d3c Author: dcosse <cosse@codelutin.com> Date: Sat Feb 20 17:43:00 2016 +0100 refs #1316 changement de comportement, il est possible de rechercher un compte tant qu'aucune correspondance a été trouvée, une fois une correspondance unique trouvée la recherche est intérompue (peut-être reprise avec F12) et l'utilisateur peut alors passer sur une autre cellule --- .../lima/ui/celleditor/AccountTableCellEditor.java | 37 ++++++++++++++++++---- 1 file changed, 30 insertions(+), 7 deletions(-) diff --git a/lima-swing/src/main/java/org/chorem/lima/ui/celleditor/AccountTableCellEditor.java b/lima-swing/src/main/java/org/chorem/lima/ui/celleditor/AccountTableCellEditor.java index 5d6e734..799a1d0 100644 --- a/lima-swing/src/main/java/org/chorem/lima/ui/celleditor/AccountTableCellEditor.java +++ b/lima-swing/src/main/java/org/chorem/lima/ui/celleditor/AccountTableCellEditor.java @@ -61,29 +61,52 @@ public class AccountTableCellEditor extends AbstractCellEditor implements TableC accountComboBox.setShowDecorator(false); final JComboBox comboBox = accountComboBox.getCombobox(); - comboBox.getEditor().getEditorComponent().addKeyListener(new KeyAdapter() { + final ComboBoxEditor editor = comboBox.getEditor(); + + editor.getEditorComponent().addKeyListener(new KeyAdapter() { + @Override public void keyReleased(KeyEvent e) { + if (log.isDebugEnabled()) { + log.debug("keyReleased:" + e.getKeyCode()); + log.debug("items:" + comboBox.getItemCount()); + } + // in case of unique chose available this one is auto-selected if (accountComboBox.isEnterToSelectUniqueUniverse() && comboBox.getItemCount() == 1) { - // auto-select the account + if (log.isDebugEnabled()) { - log.debug("Auto-select unique result with *ENTER* or *TAB* key"); + log.debug("Auto-select unique result"); } e.consume(); - // edition is done + if (log.isDebugEnabled()) { + log.debug("setEditable false"); + } + + // set the account into the combobox + // disabled edition to avoid user taping other chars and unvolontary start a new research + // User can press Tab or Enter to leave the combo or F12 to edit it again + comboBox.getItemAt(0); comboBox.setSelectedIndex(0); - comboBox.getModel().setSelectedItem(comboBox.getSelectedItem()); - comboBox.hidePopup(); + editor.setItem(comboBox.getSelectedItem()); + comboBox.setEditable(false); + } } }); + } @Override public Component getTableCellEditorComponent(JTable table, Object value, boolean isSelected, int row, int column) { - if (value instanceof Account) { + // focus reach the combo by either coming into it or pressing F12 + // cell is set editable for user to be able to start a new research + accountComboBox.getCombobox().setEditable(true); + if (value != null && (value instanceof Account)) { + if (log.isDebugEnabled()) { + log.debug("set account:" + ((Account) value).getAccountNumber()); + } accountComboBox.setSelectedItem(value); } return accountComboBox; -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.
participants (1)
-
chorem.org scm