This is an automated email from the git hooks/post-receive script. New change to branch feature/1295-improveEditEntryView in repository lima. See http://git.chorem.org/lima.git at 016dc2a refs #1293 "Onglet Saisie des écritures" La saisie dans le champ jour est dirrectement prise en compte This branch includes the following new commits: new 016dc2a refs #1293 "Onglet Saisie des écritures" La saisie dans le champ jour est dirrectement prise en compte 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 016dc2afe4a2345e3b01bea7c2d5377b0a362e9d 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 -- 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/1295-improveEditEntryView in repository lima. See http://git.chorem.org/lima.git commit 016dc2afe4a2345e3b01bea7c2d5377b0a362e9d 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>.
participants (1)
-
chorem.org scm