Author: jpepin Date: 2010-07-15 12:27:28 +0200 (Thu, 15 Jul 2010) New Revision: 2970 Url: http://chorem.org/repositories/revision/lima/2970 Log: Ajout d'un listener sur la page d'accueil pour le rafraichissement. Added: trunk/lima-swing/src/main/java/org/chorem/lima/ui/home/HomeViewListener.java Modified: trunk/lima-swing/src/main/java/org/chorem/lima/LimaMain.java trunk/lima-swing/src/main/java/org/chorem/lima/ui/MainViewHandler.java Modified: trunk/lima-swing/src/main/java/org/chorem/lima/LimaMain.java =================================================================== --- trunk/lima-swing/src/main/java/org/chorem/lima/LimaMain.java 2010-07-15 09:47:22 UTC (rev 2969) +++ trunk/lima-swing/src/main/java/org/chorem/lima/LimaMain.java 2010-07-15 10:27:28 UTC (rev 2970) @@ -150,6 +150,7 @@ } return context; } + protected static void launch(LimaContext context) throws Exception { Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/MainViewHandler.java =================================================================== --- trunk/lima-swing/src/main/java/org/chorem/lima/ui/MainViewHandler.java 2010-07-15 09:47:22 UTC (rev 2969) +++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/MainViewHandler.java 2010-07-15 10:27:28 UTC (rev 2970) @@ -44,6 +44,7 @@ import org.chorem.lima.ui.financialtransaction.LetteringView; import org.chorem.lima.ui.financialtransactionunbalanced.FinancialTransactionUnbalancedView; import org.chorem.lima.ui.home.HomeView; +import org.chorem.lima.ui.home.HomeViewListener; import org.chorem.lima.ui.importexport.ImportExport; import org.chorem.lima.ui.importexport.ImportExportEnum; import org.chorem.lima.ui.ledger.LedgerView; @@ -279,6 +280,7 @@ public void showHomeView(JAXXContext rootContext) { MainView mainView = getUI(rootContext); HomeView homeView = new HomeView(mainView); + homeView.addComponentListener(new HomeViewListener(homeView)); mainView.showTab(_("lima.tab.home"), homeView, false); } /** @@ -294,6 +296,9 @@ * Show account tree table view to create or modify accounts * @param rootContext */ + + + public void showEntryBookView(JAXXContext rootContext) { MainView mainView = getUI(rootContext); EntryBookView entryBookView= new EntryBookView(mainView); Added: trunk/lima-swing/src/main/java/org/chorem/lima/ui/home/HomeViewListener.java =================================================================== --- trunk/lima-swing/src/main/java/org/chorem/lima/ui/home/HomeViewListener.java (rev 0) +++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/home/HomeViewListener.java 2010-07-15 10:27:28 UTC (rev 2970) @@ -0,0 +1,60 @@ +/* *##% Lima Swing + * Copyright (C) 2008 - 2010 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 2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * ##%*/ + +package org.chorem.lima.ui.home; + +import java.awt.event.ComponentEvent; +import java.awt.event.ComponentListener; + +/** + * Listener refresh home datas when tab home is on front + */ +public class HomeViewListener implements ComponentListener { + + + private HomeView view; + + public HomeViewListener(HomeView view) { + this.view = view; + // TODO Auto-generated constructor stub + } + + @Override + public void componentHidden(ComponentEvent e) { + // TODO Auto-generated method stub + + } + + @Override + public void componentMoved(ComponentEvent e) { + // TODO Auto-generated method stub + + } + + @Override + public void componentResized(ComponentEvent e) { + // TODO Auto-generated method stub + + } + + @Override + public void componentShown(ComponentEvent e) { + view.getHandler().refresh(); + } + +}