branch develop updated (c8767165 -> 6c389d0b)
This is an automated email from the git hooks/post-receive script. New change to branch develop in repository lima. See https://gitlab.nuiton.org/chorem/lima.git from c8767165 refs #1373 récuppération de modifications écrasées new 6c389d0b refs #1394 ne rafraîchir l'interface que si nécessaire et que la partie concernée 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 6c389d0bf911b6fb5199c607b04379354bfbe9a0 Author: David Cossé <cosse@codelutin.com> Date: Sat Oct 14 14:41:10 2017 +0200 refs #1394 ne rafraîchir l'interface que si nécessaire et que la partie concernée Summary of changes: .../chorem/lima/enums/MainUiRefreshComponent.java | 10 ++++++++ .../src/main/java/org/chorem/lima/ui/MainView.jaxx | 3 +++ .../java/org/chorem/lima/ui/MainViewHandler.java | 30 +++++++++++++++++++++- .../chorem/lima/ui/account/AccountViewHandler.java | 18 +++++++++++++ .../ui/accountViewer/AccountViewerViewHandler.java | 14 ++++------ .../lima/ui/entrybook/EntryBookViewHandler.java | 19 ++++++++++++++ .../FinancialTransactionViewHandler.java | 14 +++++----- .../FinancialTransactionUnbalancedViewHandler.java | 18 +++++++++++++ .../ui/fiscalperiod/FiscalPeriodViewHandler.java | 21 +++++++-------- .../java/org/chorem/lima/ui/home/HomeView.jaxx | 29 ++++++++++++++++----- 10 files changed, 143 insertions(+), 33 deletions(-) create mode 100644 lima-swing/src/main/java/org/chorem/lima/enums/MainUiRefreshComponent.java -- 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 https://gitlab.nuiton.org/chorem/lima.git commit 6c389d0bf911b6fb5199c607b04379354bfbe9a0 Author: David Cossé <cosse@codelutin.com> Date: Sat Oct 14 14:41:10 2017 +0200 refs #1394 ne rafraîchir l'interface que si nécessaire et que la partie concernée --- .../chorem/lima/enums/MainUiRefreshComponent.java | 10 ++++++++ .../src/main/java/org/chorem/lima/ui/MainView.jaxx | 3 +++ .../java/org/chorem/lima/ui/MainViewHandler.java | 30 +++++++++++++++++++++- .../chorem/lima/ui/account/AccountViewHandler.java | 18 +++++++++++++ .../ui/accountViewer/AccountViewerViewHandler.java | 14 ++++------ .../lima/ui/entrybook/EntryBookViewHandler.java | 19 ++++++++++++++ .../FinancialTransactionViewHandler.java | 14 +++++----- .../FinancialTransactionUnbalancedViewHandler.java | 18 +++++++++++++ .../ui/fiscalperiod/FiscalPeriodViewHandler.java | 21 +++++++-------- .../java/org/chorem/lima/ui/home/HomeView.jaxx | 29 ++++++++++++++++----- 10 files changed, 143 insertions(+), 33 deletions(-) diff --git a/lima-swing/src/main/java/org/chorem/lima/enums/MainUiRefreshComponent.java b/lima-swing/src/main/java/org/chorem/lima/enums/MainUiRefreshComponent.java new file mode 100644 index 00000000..0f23913c --- /dev/null +++ b/lima-swing/src/main/java/org/chorem/lima/enums/MainUiRefreshComponent.java @@ -0,0 +1,10 @@ +package org.chorem.lima.enums; + +public enum MainUiRefreshComponent { + ACCOUNT_PANE, + ENTRY_BOOK_PANE, + FINANCIAL_TRANSACTION_PANE, + FISCAL_YEAR_PANE, + NONE, + ALL, +} diff --git a/lima-swing/src/main/java/org/chorem/lima/ui/MainView.jaxx b/lima-swing/src/main/java/org/chorem/lima/ui/MainView.jaxx index 5203d088..7d59735d 100644 --- a/lima-swing/src/main/java/org/chorem/lima/ui/MainView.jaxx +++ b/lima-swing/src/main/java/org/chorem/lima/ui/MainView.jaxx @@ -32,8 +32,11 @@ org.chorem.lima.LimaSwingConfig org.chorem.lima.LimaSwingApplicationContext org.chorem.lima.enums.ImportExportEnum + org.chorem.lima.enums.MainUiRefreshComponent </import> + <MainUiRefreshComponent id="mainUiRefreshComponent" javaBean='null'/> + <script><![CDATA[ void $afterCompleteSetup() { diff --git a/lima-swing/src/main/java/org/chorem/lima/ui/MainViewHandler.java b/lima-swing/src/main/java/org/chorem/lima/ui/MainViewHandler.java index 2cb7dd06..5cc9c320 100644 --- a/lima-swing/src/main/java/org/chorem/lima/ui/MainViewHandler.java +++ b/lima-swing/src/main/java/org/chorem/lima/ui/MainViewHandler.java @@ -33,6 +33,7 @@ import org.chorem.lima.LimaTechnicalException; import org.chorem.lima.business.LimaServiceFactory; import org.chorem.lima.business.api.OptionsService; import org.chorem.lima.enums.ImportExportEnum; +import org.chorem.lima.enums.MainUiRefreshComponent; import org.chorem.lima.ui.account.AccountView; import org.chorem.lima.ui.accountViewer.AccountViewerView; import org.chorem.lima.ui.celleditor.NumberSeparatorCellRenderer; @@ -484,6 +485,30 @@ public class MainViewHandler { MainView mainView = getUI(rootContext); ImportExport importExport = new ImportExport(mainView); importExport.processImportExport(type, true); + + switch (type) { + case CSV_ALL_IMPORT: + mainView.setMainUiRefreshComponent(MainUiRefreshComponent.ALL); + break; + case CSV_ENTRYBOOKS_IMPORT: + mainView.setMainUiRefreshComponent(MainUiRefreshComponent.ENTRY_BOOK_PANE); + break; + case CSV_ENTRIES_IMPORT: + mainView.setMainUiRefreshComponent(MainUiRefreshComponent.FINANCIAL_TRANSACTION_PANE); + break; + case CSV_FINANCIALSTATEMENTS_IMPORT: + mainView.setMainUiRefreshComponent(MainUiRefreshComponent.FINANCIAL_TRANSACTION_PANE); + break; + case EBP_ACCOUNTCHARTS_IMPORT: + mainView.setMainUiRefreshComponent(MainUiRefreshComponent.ACCOUNT_PANE); + break; + case EBP_ENTRIES_IMPORT: + mainView.setMainUiRefreshComponent(MainUiRefreshComponent.FINANCIAL_TRANSACTION_PANE); + break; + case EBP_ENTRYBOOKS_IMPORT: + mainView.setMainUiRefreshComponent(MainUiRefreshComponent.ENTRY_BOOK_PANE); + break; + } } public void openLimaHttpUi(MainView ui) { @@ -592,7 +617,10 @@ public class MainViewHandler { public void stateChanged(ChangeEvent e) { JTabbedPane source = (JTabbedPane) e.getSource(); if (source.getSelectedIndex()==0) { - homeView.refresh(); + MainView mainView = LimaSwingApplicationContext.MAIN_UI_ENTRY_DEF.getContextValue(homeView); + MainUiRefreshComponent compo = mainView.getMainUiRefreshComponent(); + homeView.refresh(compo); + mainView.setMainUiRefreshComponent(MainUiRefreshComponent.NONE); } } diff --git a/lima-swing/src/main/java/org/chorem/lima/ui/account/AccountViewHandler.java b/lima-swing/src/main/java/org/chorem/lima/ui/account/AccountViewHandler.java index 06f71014..39778692 100644 --- a/lima-swing/src/main/java/org/chorem/lima/ui/account/AccountViewHandler.java +++ b/lima-swing/src/main/java/org/chorem/lima/ui/account/AccountViewHandler.java @@ -24,6 +24,7 @@ package org.chorem.lima.ui.account; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; +import org.chorem.lima.LimaSwingApplicationContext; import org.chorem.lima.LimaSwingConfig; import org.chorem.lima.business.LimaServiceFactory; import org.chorem.lima.business.ServiceListener; @@ -37,6 +38,8 @@ import org.chorem.lima.business.exceptions.UsedAccountException; import org.chorem.lima.entity.Account; import org.chorem.lima.enums.AccountsChartEnum; import org.chorem.lima.enums.ImportExportEnum; +import org.chorem.lima.enums.MainUiRefreshComponent; +import org.chorem.lima.ui.MainView; import org.chorem.lima.ui.importexport.ImportExport; import org.chorem.lima.util.ErrorHelper; import org.jdesktop.swingx.JXTreeTable; @@ -292,6 +295,10 @@ public class AccountViewHandler implements ServiceListener { model.insertNodeInto(newNode, node, node.getChildCount()); treeTable.expandPath(new TreePath(model.getPathToRoot(node))); + + MainView mainView = LimaSwingApplicationContext.MAIN_UI_ENTRY_DEF.getContextValue(view); + mainView.setMainUiRefreshComponent(MainUiRefreshComponent.ACCOUNT_PANE); + } catch (AlreadyExistAccountException e) { errorHelper.showErrorMessage(t("lima.account.add.error.alreadyExist", e.getAccountNumber())); } catch (InvalidAccountNumberException e) { @@ -383,6 +390,9 @@ public class AccountViewHandler implements ServiceListener { accountForm.setAccount(selectedAccount); accountForm.setLocationRelativeTo(view); accountForm.setVisible(true); + + MainView mainView = LimaSwingApplicationContext.MAIN_UI_ENTRY_DEF.getContextValue(view); + mainView.setMainUiRefreshComponent(MainUiRefreshComponent.ACCOUNT_PANE); } } @@ -447,6 +457,10 @@ public class AccountViewHandler implements ServiceListener { // remove node model.removeNodeFromParent(lastNode); + + MainView mainView = LimaSwingApplicationContext.MAIN_UI_ENTRY_DEF.getContextValue(view); + mainView.setMainUiRefreshComponent(MainUiRefreshComponent.ACCOUNT_PANE); + } catch (UsedAccountException e) { errorHelper.showErrorMessage(t("lima.account.remove.error.usedAccount", e.getAccountNumber())); } catch (UnexistingAccount unexistingAccount) { @@ -497,6 +511,10 @@ public class AccountViewHandler implements ServiceListener { break; } loadAllAccounts(); + + MainView mainView = LimaSwingApplicationContext.MAIN_UI_ENTRY_DEF.getContextValue(view); + mainView.setMainUiRefreshComponent(MainUiRefreshComponent.ACCOUNT_PANE); + } } diff --git a/lima-swing/src/main/java/org/chorem/lima/ui/accountViewer/AccountViewerViewHandler.java b/lima-swing/src/main/java/org/chorem/lima/ui/accountViewer/AccountViewerViewHandler.java index 8a9659f3..b9cfa78a 100644 --- a/lima-swing/src/main/java/org/chorem/lima/ui/accountViewer/AccountViewerViewHandler.java +++ b/lima-swing/src/main/java/org/chorem/lima/ui/accountViewer/AccountViewerViewHandler.java @@ -47,8 +47,6 @@ import org.chorem.lima.util.BigDecimalToString; import org.chorem.lima.util.ErrorHelper; import javax.swing.*; -import javax.swing.event.ListSelectionEvent; -import javax.swing.event.ListSelectionListener; import java.awt.event.ActionEvent; import java.awt.event.InputEvent; import java.awt.event.ItemEvent; @@ -155,13 +153,11 @@ public class AccountViewerViewHandler { } protected void addListeners() { - accountViewerSelectionModel.addListSelectionListener(new ListSelectionListener() { - @Override - public void valueChanged(ListSelectionEvent e) { - if (!e.getValueIsAdjusting()) { - view.getHandler().balanceAndActions(); - updateSoldStatus(); - } + accountViewerSelectionModel.addListSelectionListener(e -> { + if (!e.getValueIsAdjusting()) { + view.getHandler().balanceAndActions(); + updateSoldStatus(); + } }); } diff --git a/lima-swing/src/main/java/org/chorem/lima/ui/entrybook/EntryBookViewHandler.java b/lima-swing/src/main/java/org/chorem/lima/ui/entrybook/EntryBookViewHandler.java index f91dad86..5f010360 100644 --- a/lima-swing/src/main/java/org/chorem/lima/ui/entrybook/EntryBookViewHandler.java +++ b/lima-swing/src/main/java/org/chorem/lima/ui/entrybook/EntryBookViewHandler.java @@ -24,6 +24,7 @@ package org.chorem.lima.ui.entrybook; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; +import org.chorem.lima.LimaSwingApplicationContext; import org.chorem.lima.LimaSwingConfig; import org.chorem.lima.business.LimaServiceFactory; import org.chorem.lima.business.ServiceListener; @@ -35,6 +36,8 @@ import org.chorem.lima.entity.EntryBook; import org.chorem.lima.entity.EntryBookImpl; import org.chorem.lima.enums.EntryBooksChartEnum; import org.chorem.lima.enums.ImportExportEnum; +import org.chorem.lima.enums.MainUiRefreshComponent; +import org.chorem.lima.ui.MainView; import org.chorem.lima.ui.importexport.ImportExport; import org.chorem.lima.util.ErrorHelper; import org.jdesktop.swingx.JXTable; @@ -192,6 +195,10 @@ public class EntryBookViewHandler implements ServiceListener { // service call try { newEntryBook = entryBookService.createEntryBook(newEntryBook); + + MainView mainView = LimaSwingApplicationContext.MAIN_UI_ENTRY_DEF.getContextValue(view); + mainView.setMainUiRefreshComponent(MainUiRefreshComponent.ENTRY_BOOK_PANE); + } catch (AlreadyExistEntryBookException e) { errorHelper.showErrorMessage(t("lima.entryBook.alreadyExistEntryBook", e.getEntryBook().getCode())); } @@ -241,6 +248,10 @@ public class EntryBookViewHandler implements ServiceListener { // ui refresh entryBookTableModel.updateEntryBook(selectedEntryBook); + + MainView mainView = LimaSwingApplicationContext.MAIN_UI_ENTRY_DEF.getContextValue(view); + mainView.setMainUiRefreshComponent(MainUiRefreshComponent.ENTRY_BOOK_PANE); + } } } @@ -266,6 +277,10 @@ public class EntryBookViewHandler implements ServiceListener { try { entryBookService.removeEntryBook(selectedEntryBook); entryBookTableModel.remove(selectedEntryBook); + + MainView mainView = LimaSwingApplicationContext.MAIN_UI_ENTRY_DEF.getContextValue(view); + mainView.setMainUiRefreshComponent(MainUiRefreshComponent.ENTRY_BOOK_PANE); + } catch (UsedEntryBookException e) { errorHelper.showErrorMessage(t("lima.entryBook.delete.used.error", e.getEntryBook().getCode(), e.getEntryBook().getLabel())); } @@ -320,6 +335,10 @@ public class EntryBookViewHandler implements ServiceListener { break; } loadAllEntryBooks(); + + MainView mainView = LimaSwingApplicationContext.MAIN_UI_ENTRY_DEF.getContextValue(view); + mainView.setMainUiRefreshComponent(MainUiRefreshComponent.ENTRY_BOOK_PANE); + } } 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 ab9621e5..5bc1f20d 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 @@ -28,7 +28,9 @@ import jaxx.runtime.SwingUtil; import org.apache.commons.lang.StringUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; +import org.chorem.lima.LimaSwingApplicationContext; import org.chorem.lima.LimaSwingConfig; +import org.chorem.lima.business.LimaServiceFactory; import org.chorem.lima.business.ServiceListener; import org.chorem.lima.business.api.EntryBookService; import org.chorem.lima.business.api.FinancialPeriodService; @@ -48,7 +50,8 @@ import org.chorem.lima.entity.FinancialPeriod; import org.chorem.lima.entity.FinancialTransaction; import org.chorem.lima.entity.FinancialTransactionImpl; import org.chorem.lima.entity.FiscalPeriod; -import org.chorem.lima.business.LimaServiceFactory; +import org.chorem.lima.enums.MainUiRefreshComponent; +import org.chorem.lima.ui.MainView; import org.chorem.lima.ui.common.FinancialTransactionTableModel; import org.chorem.lima.util.BigDecimalToString; import org.chorem.lima.util.ErrorHelper; @@ -118,7 +121,7 @@ public class FinancialTransactionViewHandler implements ServiceListener, TableMo * Init all combo box in view. */ public void init() { - + MainView mainView = LimaSwingApplicationContext.MAIN_UI_ENTRY_DEF.getContextValue(view); // fiscal periods List<FiscalPeriod> fiscalPeriods = fiscalPeriodService.getAllUnblockedFiscalPeriods(); view.getFiscalPeriodComboBoxModel().setObjects(fiscalPeriods); @@ -147,10 +150,7 @@ public class FinancialTransactionViewHandler implements ServiceListener, TableMo table.getColumnModel().addColumnModelListener(this); SwingUtil.fixTableColumnWidth(table, 0, 40); - tableModel.addTableModelListener(new TableModelListener() { - - @Override - public void tableChanged(TableModelEvent e) { + tableModel.addTableModelListener(e -> { boolean mustRecompute = e.getType() == TableModelEvent.DELETE || e.getType() == TableModelEvent.INSERT @@ -159,9 +159,9 @@ public class FinancialTransactionViewHandler implements ServiceListener, TableMo if (mustRecompute) { computeBalanceStatusText(); + mainView.setMainUiRefreshComponent(MainUiRefreshComponent.FINANCIAL_TRANSACTION_PANE); } - } }); initializationComplete = true; diff --git a/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionunbalanced/FinancialTransactionUnbalancedViewHandler.java b/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionunbalanced/FinancialTransactionUnbalancedViewHandler.java index 65fa7ce2..8bb48dbf 100644 --- a/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionunbalanced/FinancialTransactionUnbalancedViewHandler.java +++ b/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionunbalanced/FinancialTransactionUnbalancedViewHandler.java @@ -24,6 +24,7 @@ package org.chorem.lima.ui.financialtransactionunbalanced; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; +import org.chorem.lima.LimaSwingApplicationContext; import org.chorem.lima.LimaSwingConfig; import org.chorem.lima.business.exceptions.AfterLastFiscalPeriodException; import org.chorem.lima.business.exceptions.BeforeFirstFiscalPeriodException; @@ -32,6 +33,8 @@ import org.chorem.lima.business.exceptions.LockedFinancialPeriodException; import org.chorem.lima.entity.Entry; import org.chorem.lima.entity.EntryImpl; import org.chorem.lima.entity.FinancialTransaction; +import org.chorem.lima.enums.MainUiRefreshComponent; +import org.chorem.lima.ui.MainView; import org.chorem.lima.ui.combobox.FiscalPeriodComboBoxModel; import org.chorem.lima.ui.financialtransaction.FinancialTransactionDefaultTable; import org.chorem.lima.util.ErrorHelper; @@ -178,6 +181,10 @@ public class FinancialTransactionUnbalancedViewHandler { row, row); table.changeSelection(row, 1, false, false); table.editCellAt(row, 1); + + MainView mainView = LimaSwingApplicationContext.MAIN_UI_ENTRY_DEF.getContextValue(view); + mainView.setMainUiRefreshComponent(MainUiRefreshComponent.FINANCIAL_TRANSACTION_PANE); + } catch (LockedFinancialPeriodException e) { errorHelper.showErrorMessage(t("lima.entries.add.entry.error.lockedFinancialPeriod", e.getFinancialPeriod().getBeginDate(), @@ -240,6 +247,10 @@ public class FinancialTransactionUnbalancedViewHandler { table.changeSelection(indexSelectedRow, 1, false, false); table.editCellAt(indexSelectedRow, 1); } + + MainView mainView = LimaSwingApplicationContext.MAIN_UI_ENTRY_DEF.getContextValue(view); + mainView.setMainUiRefreshComponent(MainUiRefreshComponent.FINANCIAL_TRANSACTION_PANE); + } catch (LockedFinancialPeriodException e) { errorHelper.showErrorMessage(t("lima.entries.remove.entry.error.lockedFinancialPeriod", e.getFinancialPeriod().getBeginDate(), @@ -296,6 +307,9 @@ public class FinancialTransactionUnbalancedViewHandler { indexSelectedRow, indexSelectedRow); table.changeSelection(indexSelectedRow, 1, false, false); table.editCellAt(indexSelectedRow, 1); + + MainView mainView = LimaSwingApplicationContext.MAIN_UI_ENTRY_DEF.getContextValue(view); + mainView.setMainUiRefreshComponent(MainUiRefreshComponent.FINANCIAL_TRANSACTION_PANE); } } catch (LockedFinancialPeriodException e) { errorHelper.showErrorMessage(t("lima.entries.remove.transaction.error.lockedFinancialPeriod", @@ -368,6 +382,10 @@ public class FinancialTransactionUnbalancedViewHandler { selectionModel.setSelectionInterval(rowSelected, rowSelected); table.changeSelection(rowSelected, 1, false, false); table.editCellAt(rowSelected, 1); + + MainView mainView = LimaSwingApplicationContext.MAIN_UI_ENTRY_DEF.getContextValue(view); + mainView.setMainUiRefreshComponent(MainUiRefreshComponent.FINANCIAL_TRANSACTION_PANE); + } else { entry.setAmount(previousAmount); entry.setDebit(previousDebit); diff --git a/lima-swing/src/main/java/org/chorem/lima/ui/fiscalperiod/FiscalPeriodViewHandler.java b/lima-swing/src/main/java/org/chorem/lima/ui/fiscalperiod/FiscalPeriodViewHandler.java index fec4cf6c..a2b99128 100644 --- a/lima-swing/src/main/java/org/chorem/lima/ui/fiscalperiod/FiscalPeriodViewHandler.java +++ b/lima-swing/src/main/java/org/chorem/lima/ui/fiscalperiod/FiscalPeriodViewHandler.java @@ -26,7 +26,9 @@ import org.apache.commons.lang.StringUtils; import org.apache.commons.lang3.time.DateUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; +import org.chorem.lima.LimaSwingApplicationContext; import org.chorem.lima.LimaSwingConfig; +import org.chorem.lima.business.LimaServiceFactory; import org.chorem.lima.business.ServiceListener; import org.chorem.lima.business.api.FinancialTransactionService; import org.chorem.lima.business.api.FiscalPeriodService; @@ -45,19 +47,13 @@ import org.chorem.lima.entity.EntryBookImpl; import org.chorem.lima.entity.FinancialTransaction; import org.chorem.lima.entity.FiscalPeriod; import org.chorem.lima.entity.FiscalPeriodImpl; -import org.chorem.lima.business.LimaServiceFactory; +import org.chorem.lima.enums.MainUiRefreshComponent; +import org.chorem.lima.ui.MainView; import org.chorem.lima.util.BigDecimalToString; import org.chorem.lima.util.ErrorHelper; import org.nuiton.util.DateUtil; -import javax.swing.AbstractAction; -import javax.swing.ActionMap; -import javax.swing.DefaultListSelectionModel; -import javax.swing.InputMap; -import javax.swing.JComponent; -import javax.swing.JOptionPane; -import javax.swing.KeyStroke; -import javax.swing.SwingWorker; +import javax.swing.*; import javax.swing.event.ListSelectionEvent; import java.awt.event.ActionEvent; import java.awt.event.KeyEvent; @@ -107,6 +103,8 @@ public class FiscalPeriodViewHandler implements ServiceListener { public void init() { + MainView mainView = LimaSwingApplicationContext.MAIN_UI_ENTRY_DEF.getContextValue(view); + InputMap inputMap = view.getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT); ActionMap actionMap = view.getActionMap(); @@ -118,6 +116,7 @@ public class FiscalPeriodViewHandler implements ServiceListener { @Override public void actionPerformed(ActionEvent e) { + mainView.setMainUiRefreshComponent(MainUiRefreshComponent.FISCAL_YEAR_PANE); addFiscalPeriod(); } }); @@ -128,6 +127,7 @@ public class FiscalPeriodViewHandler implements ServiceListener { actionMap.put(binding, new AbstractAction() { @Override public void actionPerformed(ActionEvent e) { + mainView.setMainUiRefreshComponent(MainUiRefreshComponent.FISCAL_YEAR_PANE); updateFiscalPeriod(); } }); @@ -138,6 +138,7 @@ public class FiscalPeriodViewHandler implements ServiceListener { actionMap.put(binding, new AbstractAction() { @Override public void actionPerformed(ActionEvent e) { + mainView.setMainUiRefreshComponent(MainUiRefreshComponent.FISCAL_YEAR_PANE); deleteFiscalPeriod(); } }); @@ -148,11 +149,11 @@ public class FiscalPeriodViewHandler implements ServiceListener { actionMap.put(binding, new AbstractAction() { @Override public void actionPerformed(ActionEvent e) { + mainView.setMainUiRefreshComponent(MainUiRefreshComponent.FISCAL_YEAR_PANE); blockFiscalPeriod(); } }); - loadAllFiscalPeriod(); } diff --git a/lima-swing/src/main/java/org/chorem/lima/ui/home/HomeView.jaxx b/lima-swing/src/main/java/org/chorem/lima/ui/home/HomeView.jaxx index 7e0670cc..424691a5 100644 --- a/lima-swing/src/main/java/org/chorem/lima/ui/home/HomeView.jaxx +++ b/lima-swing/src/main/java/org/chorem/lima/ui/home/HomeView.jaxx @@ -27,16 +27,33 @@ javax.swing.BoxLayout javax.swing.border.EtchedBorder jaxx.runtime.SwingUtil + org.chorem.lima.enums.MainUiRefreshComponent </import> <script><![CDATA[ - public void refresh() { - accountsPane.refresh(); - entryBooksPane.refresh(); - fiscalYearsPane.refresh(); - financialTransactionsPane.refresh(); - } + public void refresh(MainUiRefreshComponent component) { + switch (component) { + case ACCOUNT_PANE: + accountsPane.refresh(); + break; + case ENTRY_BOOK_PANE: + entryBooksPane.refresh(); + break; + case FINANCIAL_TRANSACTION_PANE: + financialTransactionsPane.refresh(); + break; + case FISCAL_YEAR_PANE: + fiscalYearsPane.refresh(); + break; + case ALL: + accountsPane.refresh(); + entryBooksPane.refresh(); + financialTransactionsPane.refresh(); + fiscalYearsPane.refresh(); + break; + } + } ]]> </script> -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.
participants (1)
-
chorem.org scm