branch feature/1202 updated (93d92a4 -> 15b5e1b)
This is an automated email from the git hooks/post-receive script. New change to branch feature/1202 in repository lima. See http://git.chorem.org/lima.git from 93d92a4 refs #1202 : optimisation du rafraichissment de la page d'accueil new 15b5e1b refs #1202 : optimisation du temps de reponce de la saisie de écritures 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 15b5e1b410b47e686faaaecfb058ca09ba5c6e9d Author: Sylvain Bavencoff <bavencoff@codelutin.com> Date: Fri Mar 20 11:38:55 2015 +0100 refs #1202 : optimisation du temps de reponce de la saisie de écritures Summary of changes: .../FinancialTransactionViewHandler.java | 53 +++++++++++++--------- 1 file changed, 31 insertions(+), 22 deletions(-) -- 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/1202 in repository lima. See http://git.chorem.org/lima.git commit 15b5e1b410b47e686faaaecfb058ca09ba5c6e9d Author: Sylvain Bavencoff <bavencoff@codelutin.com> Date: Fri Mar 20 11:38:55 2015 +0100 refs #1202 : optimisation du temps de reponce de la saisie de écritures --- .../FinancialTransactionViewHandler.java | 53 +++++++++++++--------- 1 file changed, 31 insertions(+), 22 deletions(-) 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 c65b720..94c0160 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 @@ -95,9 +95,11 @@ public class FinancialTransactionViewHandler implements ServiceListener, TableMo protected ErrorHelper errorHelper; + protected boolean initializationComplete; + public FinancialTransactionViewHandler(FinancialTransactionView view) { this.view = view; - + initializationComplete = false; entryBookService = LimaServiceFactory.getService(EntryBookService.class); financialPeriodService = LimaServiceFactory.getService(FinancialPeriodService.class); fiscalPeriodService = LimaServiceFactory.getService(FiscalPeriodService.class); @@ -131,6 +133,9 @@ public class FinancialTransactionViewHandler implements ServiceListener, TableMo if (log.isDebugEnabled()) { log.debug(String.format("Loaded %d entry books", allEntryBooks.size())); } + if (!allEntryBooks.isEmpty()) { + view.getEntryBookComboBoxModel().setSelectedItem(allEntryBooks.get(0)); + } FinancialTransactionTableModel tableModel = view.getFinancialTransactionTableModel(); tableModel.addTableModelListener(this); @@ -155,6 +160,10 @@ public class FinancialTransactionViewHandler implements ServiceListener, TableMo } }); + + initializationComplete = true; + updateFinancialTransactions(); + } protected void initShortCuts() { @@ -301,9 +310,7 @@ public class FinancialTransactionViewHandler implements ServiceListener, TableMo } view.getFinancialPeriodComboBoxModel().setObjects(financialPeriods); view.getFinancialPeriodComboBoxModel().setSelectedItem(financialPeriods.get(0)); - - // update transactions - updateFinancialTransactions(); + // this instruction triggers updateFinancialTransaction(); } } @@ -334,27 +341,29 @@ public class FinancialTransactionViewHandler implements ServiceListener, TableMo * and entry book. */ public void updateFinancialTransactions() { - FinancialPeriod financialPeriod = (FinancialPeriod)view.getFinancialPeriodComboBox().getSelectedItem(); - EntryBook entryBook = (EntryBook)view.getEntryBookComboBox().getSelectedItem(); + if (initializationComplete) { + FinancialPeriod financialPeriod = (FinancialPeriod) view.getFinancialPeriodComboBox().getSelectedItem(); + EntryBook entryBook = (EntryBook) view.getEntryBookComboBox().getSelectedItem(); - // la selection de la financialPeriod est obligatoire - // sinon, tout un exercice, c'est trop lourd - // l'entry book par contre, est facultatif - if (financialPeriod == null) { - return; - } + // la selection de la financialPeriod est obligatoire + // sinon, tout un exercice, c'est trop lourd + // l'entry book par contre, est facultatif + if (financialPeriod == null) { + return; + } - List<FinancialTransaction> transactions; - if (entryBook == null) { - transactions = financialTransactionService.getAllFinancialTransactions(financialPeriod); - } else { - transactions = financialTransactionService.getAllFinancialTransactions(financialPeriod, entryBook); - } + List<FinancialTransaction> transactions; + if (entryBook == null) { + transactions = financialTransactionService.getAllFinancialTransactions(financialPeriod); + } else { + transactions = financialTransactionService.getAllFinancialTransactions(financialPeriod, entryBook); + } - FinancialTransactionTable table = view.getFinancialTransactionTable(); - FinancialTransactionTableModel tableModel = view.getFinancialTransactionTableModel(); - table.exit(); - tableModel.setTransactions(transactions); + FinancialTransactionTable table = view.getFinancialTransactionTable(); + FinancialTransactionTableModel tableModel = view.getFinancialTransactionTableModel(); + table.exit(); + tableModel.setTransactions(transactions); + } } public void selectionChanged() { -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.
participants (1)
-
chorem.org scm