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 93d92a461f78a47c5e7e682e57067e22576597a2 Author: Sylvain Bavencoff <bavencoff@codelutin.com> Date: Fri Mar 20 10:54:39 2015 +0100 refs #1202 : optimisation du rafraichissment de la page d'accueil --- .../java/org/chorem/lima/ui/MainViewHandler.java | 14 ++++++++++++- .../lima/ui/home/FinancialTransactionsPane.java | 4 +--- .../java/org/chorem/lima/ui/home/HomeView.jaxx | 23 ++++++++++++++++++---- 3 files changed, 33 insertions(+), 8 deletions(-) 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 02fe187..7c23447 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 @@ -51,6 +51,8 @@ import org.nuiton.widget.SwingSession; import javax.swing.*; import javax.swing.border.LineBorder; +import javax.swing.event.ChangeEvent; +import javax.swing.event.ChangeListener; import javax.swing.plaf.BorderUIResource; import java.awt.*; import java.awt.event.ActionEvent; @@ -356,8 +358,18 @@ public class MainViewHandler { public void showHomeView(JAXXContext rootContext) { MainView mainView = getUI(rootContext); - HomeView homeView = new HomeView(mainView); + final HomeView homeView = new HomeView(mainView); showTab(mainView, t("lima.home"), homeView, false); + final JTabbedPane contentTabbedPane = mainView.getContentTabbedPane(); + contentTabbedPane.addChangeListener(new ChangeListener() { + @Override + public void stateChanged(ChangeEvent e) { + if (contentTabbedPane.getSelectedComponent().equals(homeView)) { + homeView.refresh(); + } + } + }); + } public void showIdentity(JAXXContext rootContext) { diff --git a/lima-swing/src/main/java/org/chorem/lima/ui/home/FinancialTransactionsPane.java b/lima-swing/src/main/java/org/chorem/lima/ui/home/FinancialTransactionsPane.java index 062a453..ea4f438 100644 --- a/lima-swing/src/main/java/org/chorem/lima/ui/home/FinancialTransactionsPane.java +++ b/lima-swing/src/main/java/org/chorem/lima/ui/home/FinancialTransactionsPane.java @@ -141,9 +141,7 @@ public class FinancialTransactionsPane extends AbstractHomePane implements Servi @Override public void notifyMethod(String serviceName, String methodeName) { log.debug("Nom de la méthode : " + methodeName); - if (methodeName.contains("FiscalPeriod") || methodeName.contains("FinancialTransaction") - || methodeName.contains("Entry") || methodeName.contains("importEntries") - || methodeName.contains("importAll") || methodeName.contains("importAs")) { + if (methodeName.contains("importEntries") || methodeName.contains("importAll") || methodeName.contains("importAs")) { refresh(); } } 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 68fa44f..7e0670c 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 @@ -29,6 +29,17 @@ jaxx.runtime.SwingUtil </import> + <script><![CDATA[ + + public void refresh() { + accountsPane.refresh(); + entryBooksPane.refresh(); + fiscalYearsPane.refresh(); + financialTransactionsPane.refresh(); + } + ]]> + </script> + <row> <cell anchor="southeast"> <JPanel id='accountPanel' @@ -47,7 +58,8 @@ </row> <row fill="both"> <cell columns="2" weightx="1" weighty="0.9"> - <JEditorPane initializer='new AccountsPane(this)'/> + <AccountsPane id="accountsPane" + initializer='new AccountsPane(this)'/> </cell> </row> </Table> @@ -70,7 +82,8 @@ </row> <row fill="both"> <cell columns="2" weightx="1" weighty="0.9"> - <JEditorPane initializer='new EntryBooksPane(this)'/> + <EntryBooksPane id="entryBooksPane" + initializer='new EntryBooksPane(this)'/> </cell> </row> </Table> @@ -95,7 +108,8 @@ </row> <row fill="both"> <cell columns="2" weightx="1" weighty="0.9"> - <JEditorPane initializer='new FiscalYearsPane(this)'/> + <FiscalYearsPane id="fiscalYearsPane" + initializer='new FiscalYearsPane(this)'/> </cell> </row> </Table> @@ -118,7 +132,8 @@ </row> <row fill="both"> <cell columns="2" weightx="1" weighty="0.9"> - <JEditorPane initializer='new FinancialTransactionsPane(this)'/> + <FinancialTransactionsPane id="financialTransactionsPane" + initializer='new FinancialTransactionsPane(this)'/> </cell> </row> </Table> -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.