This is an automated email from the git hooks/post-receive script. New change to branch develop in repository lima. See http://git.chorem.org/lima.git from 13b9893 Merge branch 'feature/1289-SearchEntriescomputeSold' into develop new 26111c4 refs #1293 "Onglet Saisie des écritures" La saisie dans le champ jour est dirrectement prise en compte new 54e25dd refs #1293 Auto selection du compte si un seul compte correspond à la recherche new 785fc80 refs #1295 Même objet sélectionné entre la combobox et le model new c51843f Merge branch 'feature/1295-improveEditEntryView' into develop The 4 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 c51843f855cc7b9e512e5b642fdbfacba935265d Merge: 13b9893 785fc80 Author: dcosse <cosse@codelutin.com> Date: Sat Nov 28 07:37:05 2015 +0100 Merge branch 'feature/1295-improveEditEntryView' into develop commit 785fc805b17ab9ba7d003eb0828fe07661a11475 Author: dcosse <cosse@codelutin.com> Date: Thu Sep 24 15:56:37 2015 +0200 refs #1295 Même objet sélectionné entre la combobox et le model commit 54e25dd273e118c5a7df3c7dba3a21edc6635f5f Author: dcosse <cosse@codelutin.com> Date: Wed Sep 16 14:55:59 2015 +0200 refs #1293 Auto selection du compte si un seul compte correspond à la recherche commit 26111c4ea63593e5122ebaf4cf69dc0349bbac10 Author: dcosse <cosse@codelutin.com> Date: Wed Sep 16 00:07:52 2015 +0200 refs #1293 "Onglet Saisie des écritures" La saisie dans le champ jour est dirrectement prise en compte Summary of changes: .../lima/ui/celleditor/AccountTableCellEditor.java | 28 ++++++++++++++++---- .../lima/ui/celleditor/DayTableCellEditor.java | 30 ++++++++++------------ .../ui/financialtransaction/AccountColumn.java | 6 +++-- .../lima/ui/financialtransaction/DayColumn.java | 6 +++-- pom.xml | 2 +- 5 files changed, 45 insertions(+), 27 deletions(-) copy lima-business-api/src/main/java/org/chorem/lima/LimaTechnicalException.java => lima-swing/src/main/java/org/chorem/lima/ui/celleditor/DayTableCellEditor.java (64%) -- 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 develop in repository lima. See http://git.chorem.org/lima.git commit 26111c4ea63593e5122ebaf4cf69dc0349bbac10 Author: dcosse <cosse@codelutin.com> Date: Wed Sep 16 00:07:52 2015 +0200 refs #1293 "Onglet Saisie des écritures" La saisie dans le champ jour est dirrectement prise en compte --- .../lima/ui/celleditor/DayTableCellEditor.java | 41 ++++++++++++++++++++++ .../lima/ui/financialtransaction/DayColumn.java | 6 ++-- 2 files changed, 45 insertions(+), 2 deletions(-) diff --git a/lima-swing/src/main/java/org/chorem/lima/ui/celleditor/DayTableCellEditor.java b/lima-swing/src/main/java/org/chorem/lima/ui/celleditor/DayTableCellEditor.java new file mode 100644 index 0000000..1b0b385 --- /dev/null +++ b/lima-swing/src/main/java/org/chorem/lima/ui/celleditor/DayTableCellEditor.java @@ -0,0 +1,41 @@ +package org.chorem.lima.ui.celleditor; + +/* + * #%L + * Lima :: Swing + * %% + * Copyright (C) 2008 - 2014 CodeLutin + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this program. If not, see + * <http://www.gnu.org/licenses/gpl-3.0.html>. + * #L% + */ + +import org.apache.commons.lang3.StringUtils; + +/** + * @author Sylvain Bavencoff - bavencoff@codelutin.com + */ +public class DayTableCellEditor extends StringTableCellEditor { + + @Override + public Integer getCellEditorValue() { + Integer result = null; + String stringValue = super.getCellEditorValue().toString(); + if (StringUtils.isNumeric(stringValue)) { + result = Integer.parseInt(stringValue); + } + return result; + } +} diff --git a/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/DayColumn.java b/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/DayColumn.java index d59a5c2..979e328 100644 --- a/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/DayColumn.java +++ b/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/DayColumn.java @@ -24,6 +24,7 @@ package org.chorem.lima.ui.financialtransaction; import org.chorem.lima.entity.Entry; import org.chorem.lima.entity.FinancialTransaction; +import org.chorem.lima.ui.celleditor.DayTableCellEditor; import org.chorem.lima.ui.common.AbstractColumn; import org.chorem.lima.ui.common.FinancialTransactionTableModel; @@ -42,6 +43,7 @@ public class DayColumn extends AbstractColumn<FinancialTransactionTableModel> { public DayColumn(){ super(Integer.class, t("lima.financialTransaction.day"), true); + setCellEditor(new DayTableCellEditor()); } @Override @@ -67,6 +69,7 @@ public class DayColumn extends AbstractColumn<FinancialTransactionTableModel> { @Override public boolean setValueAt(Object value, int row) { FinancialTransaction transaction = tableModel.get(row).getFinancialTransaction(); + boolean update = false; if (value != null) { // valid that the day is into month range (date not > to 1rst day of next month) @@ -104,8 +107,7 @@ public class DayColumn extends AbstractColumn<FinancialTransactionTableModel> { if (newDay <= maximum) { calendar.set(Calendar.DAY_OF_MONTH, newDay); - Date newDate = calendar.getTime(); - result = newDate; + result = calendar.getTime(); } else { result = previousDate; } -- 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 develop in repository lima. See http://git.chorem.org/lima.git commit 54e25dd273e118c5a7df3c7dba3a21edc6635f5f Author: dcosse <cosse@codelutin.com> Date: Wed Sep 16 14:55:59 2015 +0200 refs #1293 Auto selection du compte si un seul compte correspond à la recherche --- .../lima/ui/celleditor/AccountTableCellEditor.java | 26 +++++++++++++++++----- .../ui/financialtransaction/AccountColumn.java | 6 +++-- pom.xml | 2 +- 3 files changed, 26 insertions(+), 8 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 f1fec63..0fdd3f1 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 @@ -27,12 +27,11 @@ import org.apache.commons.logging.LogFactory; import org.chorem.lima.entity.Account; import org.chorem.lima.ui.combobox.AccountComboBox; -import javax.swing.AbstractCellEditor; -import javax.swing.JTable; -import javax.swing.SwingUtilities; +import javax.swing.*; import javax.swing.table.TableCellEditor; import javax.swing.text.JTextComponent; -import java.awt.Component; +import java.awt.*; +import java.awt.event.KeyAdapter; import java.awt.event.KeyEvent; import java.awt.event.MouseEvent; import java.util.EventObject; @@ -60,6 +59,24 @@ public class AccountTableCellEditor extends AbstractCellEditor implements TableC accountComboBox = new AccountComboBox(); accountComboBox.setLeafAccounts(true); accountComboBox.setShowDecorator(false); + + final JComboBox comboBox = accountComboBox.getCombobox(); + comboBox.getEditor().getEditorComponent().addKeyListener(new KeyAdapter() { + @Override + public void keyReleased(KeyEvent e) { + if (accountComboBox.isEnterToSelectUniqueUniverse() && comboBox.getItemCount() == 1) { + + // auto-select the account + if (log.isDebugEnabled()) { + log.debug("Auto-select unique result with *ENTER* or *TAB* key"); + } + e.consume(); + // edition is done + comboBox.setSelectedIndex(0); + comboBox.hidePopup(); + } + } + }); } @Override @@ -106,5 +123,4 @@ public class AccountTableCellEditor extends AbstractCellEditor implements TableC boolean result = !(evt instanceof MouseEvent) || ((MouseEvent) evt).getClickCount() == 1; return result; } - } 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 ec431f3..e8484d0 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 @@ -25,6 +25,7 @@ package org.chorem.lima.ui.financialtransaction; import org.apache.commons.lang3.StringUtils; import org.chorem.lima.entity.Account; import org.chorem.lima.entity.Entry; +import org.chorem.lima.ui.celleditor.AccountTableCellEditor; import org.chorem.lima.ui.common.AbstractColumn; import org.chorem.lima.ui.common.FinancialTransactionTableModel; @@ -37,6 +38,7 @@ public class AccountColumn extends AbstractColumn<FinancialTransactionTableModel public AccountColumn() { super(Account.class, t("lima.entry.account"), true); + setCellEditor(new AccountTableCellEditor()); } @Override @@ -60,14 +62,14 @@ public class AccountColumn extends AbstractColumn<FinancialTransactionTableModel if (!tableModel.updateEntry(entry)) { update = revertAccountChange(entry, previousAccount); } else { - setDescripntionFieldIfNone(entry, account); + setDescriptionFieldIfNone(entry, account); } } return update; } - protected void setDescripntionFieldIfNone(Entry entry, Account account) { + protected void setDescriptionFieldIfNone(Entry entry, Account account) { if (StringUtils.isBlank(entry.getDescription()) && account != null && StringUtils.isNotBlank(account.getLabel())) { entry.setDescription(account.getLabel()); } diff --git a/pom.xml b/pom.xml index a2a368e..32a10b7 100644 --- a/pom.xml +++ b/pom.xml @@ -200,7 +200,7 @@ <itextVersion>4.2.1</itextVersion> <jasperreportsVersion>6.0.3</jasperreportsVersion> <javaxServletVersion>3.1.0</javaxServletVersion> - <jaxxVersion>2.24</jaxxVersion> + <jaxxVersion>2.26</jaxxVersion> <jbossTransactionVersion>1.0.0.Final</jbossTransactionVersion> <jdomVersion>2.0.5</jdomVersion> <jettyPluginVersion>9.2.3.v20140905</jettyPluginVersion> -- 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 develop in repository lima. See http://git.chorem.org/lima.git commit 785fc805b17ab9ba7d003eb0828fe07661a11475 Author: dcosse <cosse@codelutin.com> Date: Thu Sep 24 15:56:37 2015 +0200 refs #1295 Même objet sélectionné entre la combobox et le model --- .../main/java/org/chorem/lima/ui/celleditor/AccountTableCellEditor.java | 2 ++ 1 file changed, 2 insertions(+) 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 0fdd3f1..5d6e734 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 @@ -71,8 +71,10 @@ public class AccountTableCellEditor extends AbstractCellEditor implements TableC log.debug("Auto-select unique result with *ENTER* or *TAB* key"); } e.consume(); + // edition is done comboBox.setSelectedIndex(0); + comboBox.getModel().setSelectedItem(comboBox.getSelectedItem()); comboBox.hidePopup(); } } -- 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 develop in repository lima. See http://git.chorem.org/lima.git commit c51843f855cc7b9e512e5b642fdbfacba935265d Merge: 13b9893 785fc80 Author: dcosse <cosse@codelutin.com> Date: Sat Nov 28 07:37:05 2015 +0100 Merge branch 'feature/1295-improveEditEntryView' into develop .../lima/ui/celleditor/AccountTableCellEditor.java | 28 ++++++++++++--- .../lima/ui/celleditor/DayTableCellEditor.java | 41 ++++++++++++++++++++++ .../ui/financialtransaction/AccountColumn.java | 6 ++-- .../lima/ui/financialtransaction/DayColumn.java | 6 ++-- pom.xml | 2 +- 5 files changed, 73 insertions(+), 10 deletions(-) -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.
participants (1)
-
chorem.org scm