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 8da87c9d890676829ed1aed1a444015f72653dfc Author: Tony CHEMIT <chemit@codelutin.com> Date: Wed Apr 8 09:39:24 2015 +0200 refs #1209: A l'ajout automatique d'une écriture le focus ne correspond pas à la cellule éditée --- .../ui/financialtransaction/FinancialTransactionTable.java | 11 ++++++----- .../FinancialTransactionViewHandler.java | 13 ++++++------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionTable.java b/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionTable.java index cae0c9c..ce6e084 100644 --- a/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionTable.java +++ b/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionTable.java @@ -96,13 +96,11 @@ public class FinancialTransactionTable extends FinancialTransactionDefaultTable< BigDecimal debit = transaction.getAmountDebit(); if (credit.compareTo(debit) != 0) { table.handler.addEntry(); - column = 2; - row++; + // addEntry entry change selection end = true; } else if (row >= nbRows - 1) { table.handler.addFinancialTransaction(); - column = 0; - row++; + // addFinancialTransaction change selection end = true; } else { column = 0; @@ -116,7 +114,10 @@ public class FinancialTransactionTable extends FinancialTransactionDefaultTable< column++; } } while (!end && !tableModel.isCellEditable(row,column)); - changeSelection(row, column, false, false); + + if (!end) { + changeSelection(row, column, false, false); + } } } } diff --git a/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionViewHandler.java b/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionViewHandler.java index b9f869b..44ab57b 100644 --- a/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionViewHandler.java +++ b/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionViewHandler.java @@ -475,7 +475,7 @@ public class FinancialTransactionViewHandler implements ServiceListener, TableMo int index = tableModel.indexOf(transaction); selectionModel.setSelectionInterval(index, index); table.changeSelection(index, 1, false, false); - table.editCellAt(index, 1); + table.requestFocus(); table.scrollRowToVisible(Math.max(0, index - 5)); table.scrollRowToVisible(Math.min(tableModel.size() -1 , index + transaction.sizeEntry() + 5)); } catch (LockedFinancialPeriodException e) { @@ -532,7 +532,7 @@ public class FinancialTransactionViewHandler implements ServiceListener, TableMo selectionModel.setSelectionInterval(index, index); //focus on second column table.changeSelection(index, 1, false, false); - table.editCellAt(index, 1); + table.requestFocus(); } catch (LockedFinancialPeriodException e) { errorHelper.showErrorMessage(t("lima.entries.paste.entry.error.lockedFinancialPeriod", e.getFinancialPeriod().getBeginDate(), @@ -584,7 +584,7 @@ public class FinancialTransactionViewHandler implements ServiceListener, TableMo selectionModel.setSelectionInterval(addIndex, addIndex); // set focus on date table.changeSelection(addIndex, 0, false, false); - table.editCellAt(addIndex, 0); + table.requestFocus(); table.scrollRowToVisible(Math.max(0, addIndex - 5)); table.scrollRowToVisible(Math.min(tableModel.size() - 1, addIndex + 5)); } catch (LockedFinancialPeriodException e) { @@ -691,7 +691,7 @@ public class FinancialTransactionViewHandler implements ServiceListener, TableMo row, row); // set focus on voucher table.changeSelection(row, 1, false, false); - table.editCellAt(row, 1); + table.requestFocus(); } catch (LockedFinancialPeriodException e) { errorHelper.showErrorMessage(t("lima.entries.add.entry.error.lockedFinancialPeriod", e.getFinancialPeriod().getBeginDate(), @@ -742,7 +742,7 @@ public class FinancialTransactionViewHandler implements ServiceListener, TableMo selectionModel.setSelectionInterval( indexSelectedRow, indexSelectedRow); table.changeSelection(indexSelectedRow, 1, false, false); - table.editCellAt(indexSelectedRow, 1); + table.requestFocus(); } } catch (LockedFinancialPeriodException e) { errorHelper.showErrorMessage(t("lima.entries.remove.transaction.error.lockedFinancialPeriod", @@ -787,7 +787,7 @@ public class FinancialTransactionViewHandler implements ServiceListener, TableMo selectionModel.setSelectionInterval( indexSelectedRow, indexSelectedRow); table.changeSelection(indexSelectedRow, 1, false, false); - table.editCellAt(indexSelectedRow, 1); + table.requestFocus(); } } catch (LockedFinancialPeriodException e) { errorHelper.showErrorMessage(t("lima.entries.remove.entry.error.lockedFinancialPeriod", @@ -842,7 +842,6 @@ public class FinancialTransactionViewHandler implements ServiceListener, TableMo int firstRow = tableModel.indexOf(transaction); int lastRow = firstRow + transaction.sizeEntry() - 1; tableModel.fireTableRowsUpdated(firstRow, lastRow); - table.editCellAt(selectedRow, selectedColumn); } catch (LockedEntryBookException e) { errorHelper.showErrorMessage(t("lima.entries.assign.error.lockedEntryBook", e.getClosedPeriodicEntryBook().getEntryBook().getCode(), -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.