r2980 - in trunk/lima-swing/src/main/java/org/chorem/lima/ui: account accountsreports balance entrybook entrybooksreports financialperiod financialstatementchart financialstatementreport financialtransaction ledger
Author: jpepin Date: 2010-07-21 17:04:34 +0200 (Wed, 21 Jul 2010) New Revision: 2980 Url: http://chorem.org/repositories/revision/lima/2980 Log: Impl?\195?\169mentation de ServiceListener dans les rapports + debug. Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/account/AccountViewHandler.java trunk/lima-swing/src/main/java/org/chorem/lima/ui/accountsreports/AccountsReportsTableModel.java trunk/lima-swing/src/main/java/org/chorem/lima/ui/accountsreports/AccountsReportsView.jaxx trunk/lima-swing/src/main/java/org/chorem/lima/ui/accountsreports/AccountsReportsViewHandler.java trunk/lima-swing/src/main/java/org/chorem/lima/ui/balance/BalanceTableModel.java trunk/lima-swing/src/main/java/org/chorem/lima/ui/balance/BalanceView.jaxx trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybook/EntryBookTableModel.java trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybooksreports/EntryBooksReportsTableModel.java trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybooksreports/EntryBooksReportsView.jaxx trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialperiod/FinancialPeriodTableModel.java trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementchart/FinancialStatementChartViewHandler.java trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementreport/FinancialStatementReportTableModel.java trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementreport/FinancialStatementReportView.jaxx trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionTableModel.java trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionView.jaxx trunk/lima-swing/src/main/java/org/chorem/lima/ui/ledger/LedgerTableModel.java trunk/lima-swing/src/main/java/org/chorem/lima/ui/ledger/LedgerView.jaxx Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/account/AccountViewHandler.java =================================================================== --- trunk/lima-swing/src/main/java/org/chorem/lima/ui/account/AccountViewHandler.java 2010-07-21 14:02:18 UTC (rev 2979) +++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/account/AccountViewHandler.java 2010-07-21 15:04:34 UTC (rev 2980) @@ -65,7 +65,6 @@ accountService = LimaServiceFactory.getInstance().getService( AccountServiceMonitorable.class); - accountService.addListener(this); LimaServiceFactory.getInstance().getService( ImportServiceMonitorable.class).addListener(this); } Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/accountsreports/AccountsReportsTableModel.java =================================================================== --- trunk/lima-swing/src/main/java/org/chorem/lima/ui/accountsreports/AccountsReportsTableModel.java 2010-07-21 14:02:18 UTC (rev 2979) +++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/accountsreports/AccountsReportsTableModel.java 2010-07-21 15:04:34 UTC (rev 2980) @@ -26,9 +26,11 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.chorem.lima.beans.ReportsDatas; +import org.chorem.lima.business.FinancialTransactionServiceMonitorable; +import org.chorem.lima.business.ImportServiceMonitorable; import org.chorem.lima.business.LimaException; -import org.chorem.lima.business.ReportService; import org.chorem.lima.business.ReportServiceMonitorable; +import org.chorem.lima.business.ServiceListener; import org.chorem.lima.entity.Account; import org.chorem.lima.entity.Entry; import org.chorem.lima.service.LimaServiceFactory; @@ -44,16 +46,16 @@ * Last update : $Date: 2010-04-19 15:19:30 +0200 (lun. 19 avril 2010) $ * By : $Author: jpepin $ */ -public class AccountsReportsTableModel extends AbstractTableModel { +public class AccountsReportsTableModel extends AbstractTableModel implements ServiceListener { /** serialVersionUID. */ - private static final long serialVersionUID = 7578692417919755647L; + private static final long serialVersionUID = 1L; /** log. */ private static final Log log = LogFactory.getLog(AccountsReportsTableModel.class); /** Services. */ - protected ReportService reportService; + protected ReportServiceMonitorable reportService; /** Account. */ protected Account selectedAccount; @@ -75,6 +77,10 @@ reportService = LimaServiceFactory.getInstance().getService( ReportServiceMonitorable.class); + LimaServiceFactory.getInstance().getService( + ImportServiceMonitorable.class).addListener(this); + LimaServiceFactory.getInstance().getService( + FinancialTransactionServiceMonitorable.class).addListener(this); } @Override @@ -210,5 +216,12 @@ cacheDataList = getDataList(); fireTableDataChanged(); } + + @Override + public void notifyMethod(String serviceName, String methodeName) { + if (serviceName.contains("FinancialTransaction") || methodeName.contains("importAccount") || methodeName.contains("importAll")){ + refresh(); + } + } } Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/accountsreports/AccountsReportsView.jaxx =================================================================== --- trunk/lima-swing/src/main/java/org/chorem/lima/ui/accountsreports/AccountsReportsView.jaxx 2010-07-21 14:02:18 UTC (rev 2979) +++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/accountsreports/AccountsReportsView.jaxx 2010-07-21 15:04:34 UTC (rev 2980) @@ -49,9 +49,6 @@ ]]> </script> <row weightx="1" weighty="0" anchor="center"> - <cell anchor="west"> - <JButton text="lima.refresh" onActionPerformed="getHandler().refresh()"/> - </cell> <cell anchor="east"> <JLabel id="beginCalendarPanelLabel" text="lima.accountsreports.begincalendar"/> </cell> @@ -73,7 +70,7 @@ </cell> <cell anchor="west"> <JComboBox id="accountSelectorComboBox" - model="{modelAccounts}" + model="{getModelAccounts()}" renderer="{new org.chorem.lima.ui.combobox.AccountRenderer()}" onActionPerformed="getModelAccountsReportsTable().setAccount((Account) accountSelectorComboBox.getSelectedItem()); getHandler().refresh()" @@ -82,7 +79,7 @@ </cell> </row> <row> - <cell fill="both" weightx="1" weighty="1" columns="7"> + <cell fill="both" weightx="1" weighty="1" columns="6"> <JScrollPane> <org.jdesktop.swingx.JXTable id="accountsReportsTable" rowHeight="24" model="{getModelAccountsReportsTable()}" Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/accountsreports/AccountsReportsViewHandler.java =================================================================== --- trunk/lima-swing/src/main/java/org/chorem/lima/ui/accountsreports/AccountsReportsViewHandler.java 2010-07-21 14:02:18 UTC (rev 2979) +++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/accountsreports/AccountsReportsViewHandler.java 2010-07-21 15:04:34 UTC (rev 2980) @@ -47,9 +47,6 @@ public void refresh(){ tableModel = view.getModelAccountsReportsTable(); tableModel.refresh(); - - //comboBoxModel = view.getModelAccounts(); - //comboBoxModel.refresh(); /** * set text and amounts of labels credit, debit, solde Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/balance/BalanceTableModel.java =================================================================== --- trunk/lima-swing/src/main/java/org/chorem/lima/ui/balance/BalanceTableModel.java 2010-07-21 14:02:18 UTC (rev 2979) +++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/balance/BalanceTableModel.java 2010-07-21 15:04:34 UTC (rev 2980) @@ -27,9 +27,11 @@ import org.apache.commons.logging.LogFactory; import org.chorem.lima.beans.BalanceTrial; import org.chorem.lima.beans.ReportsDatas; +import org.chorem.lima.business.FinancialTransactionServiceMonitorable; +import org.chorem.lima.business.ImportServiceMonitorable; import org.chorem.lima.business.LimaException; -import org.chorem.lima.business.ReportService; import org.chorem.lima.business.ReportServiceMonitorable; +import org.chorem.lima.business.ServiceListener; import org.chorem.lima.service.LimaServiceFactory; import org.chorem.lima.util.ErrorHelper; @@ -43,7 +45,7 @@ * Last update : $Date: 2010-04-19 15:19:30 +0200 (lun. 19 avril 2010) $ * By : $Author: jpepin $ */ -public class BalanceTableModel extends AbstractTableModel { +public class BalanceTableModel extends AbstractTableModel implements ServiceListener { /** serialVersionUID. */ private static final long serialVersionUID = 7578692417919755647L; @@ -52,7 +54,7 @@ private static final Log log = LogFactory.getLog(BalanceTableModel.class); /** Services. */ - protected ReportService reportService; + protected ReportServiceMonitorable reportService; /** DatePicker Begin Date. */ protected Date selectedBeginDate; @@ -73,6 +75,10 @@ reportService = LimaServiceFactory.getInstance().getService( ReportServiceMonitorable.class); + LimaServiceFactory.getInstance().getService( + ImportServiceMonitorable.class).addListener(this); + LimaServiceFactory.getInstance().getService( + FinancialTransactionServiceMonitorable.class).addListener(this); } @Override @@ -202,4 +208,10 @@ fireTableDataChanged(); } + @Override + public void notifyMethod(String serviceName, String methodeName) { + if (serviceName.contains("FinancialTransaction") || methodeName.contains("importAccount") || methodeName.contains("importAll")){ + refresh(); + } + } } Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/balance/BalanceView.jaxx =================================================================== --- trunk/lima-swing/src/main/java/org/chorem/lima/ui/balance/BalanceView.jaxx 2010-07-21 14:02:18 UTC (rev 2979) +++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/balance/BalanceView.jaxx 2010-07-21 15:04:34 UTC (rev 2980) @@ -49,9 +49,6 @@ ]]> </script> <row weightx="1" weighty="0" anchor="center"> - <cell anchor="west"> - <JButton text="lima.refresh" onActionPerformed="getHandler().refresh()"/> - </cell> <cell anchor="east"> <JLabel id="beginCalendarPanelLabel" text="lima.accountsreports.begincalendar"/> </cell> @@ -78,7 +75,7 @@ </cell> </row> <row> - <cell fill="both" weightx="1" weighty="1" columns="7"> + <cell fill="both" weightx="1" weighty="1" columns="6"> <JScrollPane> <org.jdesktop.swingx.JXTable id="balanceTable" rowHeight="24" model="{getModelBalanceTable()}" Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybook/EntryBookTableModel.java =================================================================== --- trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybook/EntryBookTableModel.java 2010-07-21 14:02:18 UTC (rev 2979) +++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybook/EntryBookTableModel.java 2010-07-21 15:04:34 UTC (rev 2980) @@ -58,7 +58,6 @@ entryBookService = LimaServiceFactory.getInstance().getService( EntryBookServiceMonitorable.class); - entryBookService.addListener(this); LimaServiceFactory.getInstance().getService(ImportServiceMonitorable.class).addListener(this); } Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybooksreports/EntryBooksReportsTableModel.java =================================================================== --- trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybooksreports/EntryBooksReportsTableModel.java 2010-07-21 14:02:18 UTC (rev 2979) +++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybooksreports/EntryBooksReportsTableModel.java 2010-07-21 15:04:34 UTC (rev 2980) @@ -27,9 +27,11 @@ import org.apache.commons.logging.LogFactory; import org.chorem.lima.beans.ReportsDatas; import org.chorem.lima.beans.ReportsDatasImpl; +import org.chorem.lima.business.FinancialTransactionServiceMonitorable; +import org.chorem.lima.business.ImportServiceMonitorable; import org.chorem.lima.business.LimaException; -import org.chorem.lima.business.ReportService; import org.chorem.lima.business.ReportServiceMonitorable; +import org.chorem.lima.business.ServiceListener; import org.chorem.lima.entity.Entry; import org.chorem.lima.entity.EntryBook; import org.chorem.lima.service.LimaServiceFactory; @@ -45,16 +47,16 @@ * Last update : $Date: 2010-04-19 15:19:30 +0200 (lun. 19 avril 2010) $ * By : $Author: jpepin $ */ -public class EntryBooksReportsTableModel extends AbstractTableModel { +public class EntryBooksReportsTableModel extends AbstractTableModel implements ServiceListener { /** serialVersionUID. */ - private static final long serialVersionUID = 7578692417919755647L; + private static final long serialVersionUID = 1L; /** log. */ private static final Log log = LogFactory.getLog(EntryBooksReportsTableModel.class); /** Services. */ - protected ReportService reportService; + protected ReportServiceMonitorable reportService; /** Account. */ protected EntryBook selectedEntryBook; @@ -75,6 +77,10 @@ reportService = LimaServiceFactory.getInstance().getService( ReportServiceMonitorable.class); + LimaServiceFactory.getInstance().getService( + ImportServiceMonitorable.class).addListener(this); + LimaServiceFactory.getInstance().getService( + FinancialTransactionServiceMonitorable.class).addListener(this); } @Override @@ -212,5 +218,12 @@ cacheDataList = getDataList(); fireTableDataChanged(); } + + @Override + public void notifyMethod(String serviceName, String methodeName) { + if (serviceName.contains("FinancialTransaction") || methodeName.contains("importEntryBook") || methodeName.contains("importAll")){ + refresh(); + } + } } Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybooksreports/EntryBooksReportsView.jaxx =================================================================== --- trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybooksreports/EntryBooksReportsView.jaxx 2010-07-21 14:02:18 UTC (rev 2979) +++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybooksreports/EntryBooksReportsView.jaxx 2010-07-21 15:04:34 UTC (rev 2980) @@ -49,9 +49,6 @@ ]]> </script> <row weightx="1" weighty="0" anchor="center"> - <cell anchor="west"> - <JButton text="lima.refresh" onActionPerformed="getHandler().refresh()"/> - </cell> <cell anchor="east"> <JLabel id="beginCalendarPanelLabel" text="lima.accountsreports.begincalendar"/> </cell> @@ -82,7 +79,7 @@ </cell> </row> <row> - <cell fill="both" weightx="1" weighty="1" columns="7"> + <cell fill="both" weightx="1" weighty="1" columns="6"> <JScrollPane> <org.chorem.lima.ui.entrybooksreports.EntryBooksReportsTable id="table" sortable="false" rowHeight="24" Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialperiod/FinancialPeriodTableModel.java =================================================================== --- trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialperiod/FinancialPeriodTableModel.java 2010-07-21 14:02:18 UTC (rev 2979) +++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialperiod/FinancialPeriodTableModel.java 2010-07-21 15:04:34 UTC (rev 2980) @@ -62,7 +62,6 @@ financialPeriodService = LimaServiceFactory.getInstance().getService( FinancialPeriodServiceMonitorable.class); - financialPeriodService.addListener(this); LimaServiceFactory.getInstance().getService( ImportServiceMonitorable.class).addListener(this); LimaServiceFactory.getInstance().getService( Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementchart/FinancialStatementChartViewHandler.java =================================================================== --- trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementchart/FinancialStatementChartViewHandler.java 2010-07-21 14:02:18 UTC (rev 2979) +++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementchart/FinancialStatementChartViewHandler.java 2010-07-21 15:04:34 UTC (rev 2980) @@ -64,7 +64,6 @@ financialStatementService = LimaServiceFactory.getInstance().getService( FinancialStatementServiceMonitorable.class); - financialStatementService.addListener(this); LimaServiceFactory.getInstance().getService( ImportServiceMonitorable.class).addListener(this); } Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementreport/FinancialStatementReportTableModel.java =================================================================== --- trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementreport/FinancialStatementReportTableModel.java 2010-07-21 14:02:18 UTC (rev 2979) +++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementreport/FinancialStatementReportTableModel.java 2010-07-21 15:04:34 UTC (rev 2980) @@ -26,9 +26,11 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.chorem.lima.beans.FinancialStatementAmounts; -import org.chorem.lima.business.FinancialStatementService; import org.chorem.lima.business.FinancialStatementServiceMonitorable; +import org.chorem.lima.business.FinancialTransactionServiceMonitorable; +import org.chorem.lima.business.ImportServiceMonitorable; import org.chorem.lima.business.LimaException; +import org.chorem.lima.business.ServiceListener; import org.chorem.lima.service.LimaServiceFactory; import org.chorem.lima.util.ErrorHelper; @@ -42,16 +44,16 @@ * Last update : $Date: 2010-04-19 15:19:30 +0200 (lun. 19 avril 2010) $ * By : $Author: jpepin $ */ -public class FinancialStatementReportTableModel extends AbstractTableModel { +public class FinancialStatementReportTableModel extends AbstractTableModel implements ServiceListener { /** serialVersionUID. */ - private static final long serialVersionUID = 7578692417919755647L; + private static final long serialVersionUID = 1L; /** log. */ private static final Log log = LogFactory.getLog(FinancialStatementReportTableModel.class); /** Services. */ - protected FinancialStatementService financialStatementService; + protected FinancialStatementServiceMonitorable financialStatementService; /** DatePicker Begin Date. */ protected Date selectedBeginDate; @@ -69,6 +71,11 @@ financialStatementService = LimaServiceFactory.getInstance().getService( FinancialStatementServiceMonitorable.class); + financialStatementService.addListener(this); + LimaServiceFactory.getInstance().getService( + ImportServiceMonitorable.class).addListener(this); + LimaServiceFactory.getInstance().getService( + FinancialTransactionServiceMonitorable.class).addListener(this); } @Override @@ -203,5 +210,12 @@ FinancialStatementDocument financialStatementDocument = new FinancialStatementDocument(); financialStatementDocument.createDocuments(cacheDataList); } + + @Override + public void notifyMethod(String serviceName, String methodeName) { + if (serviceName.contains("FinancialTransaction") || methodeName.contains("FinancialStatement") || methodeName.contains("importAll")){ + refresh(); + } + } } Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementreport/FinancialStatementReportView.jaxx =================================================================== --- trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementreport/FinancialStatementReportView.jaxx 2010-07-21 14:02:18 UTC (rev 2979) +++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementreport/FinancialStatementReportView.jaxx 2010-07-21 15:04:34 UTC (rev 2980) @@ -49,9 +49,6 @@ ]]> </script> <row weightx="1" weighty="0" anchor="center"> - <cell anchor="west"> - <JButton text="lima.refresh" onActionPerformed="getHandler().refresh()"/> - </cell> <cell anchor="east"> <JLabel id="beginCalendarPanelLabel" text="lima.accountsreports.begincalendar"/> </cell> @@ -73,7 +70,7 @@ </cell> </row> <row> - <cell fill="both" weightx="1" weighty="1" columns="8"> + <cell fill="both" weightx="1" weighty="1" columns="7"> <JScrollPane> <org.chorem.lima.ui.financialstatementreport.FinancialStatementReportTable id="table" rowHeight="24" constructorParams="getHandler()" Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionTableModel.java =================================================================== --- trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionTableModel.java 2010-07-21 14:02:18 UTC (rev 2979) +++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionTableModel.java 2010-07-21 15:04:34 UTC (rev 2980) @@ -19,7 +19,6 @@ package org.chorem.lima.ui.financialtransaction; import static org.nuiton.i18n.I18n._; - import java.util.ArrayList; import java.util.Calendar; import java.util.Collections; @@ -29,14 +28,11 @@ import org.apache.commons.lang.time.DateUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import org.chorem.lima.business.EntryBookService; -import org.chorem.lima.business.EntryBookServiceMonitorable; -import org.chorem.lima.business.FinancialPeriodService; -import org.chorem.lima.business.FinancialPeriodServiceMonitorable; import org.chorem.lima.business.FinancialTransactionServiceMonitorable; +import org.chorem.lima.business.ImportServiceMonitorable; import org.chorem.lima.business.LimaBusinessException; import org.chorem.lima.business.LimaException; -import org.chorem.lima.business.FinancialTransactionService; +import org.chorem.lima.business.ServiceListener; import org.chorem.lima.business.utils.EntryComparator; import org.chorem.lima.entity.Account; import org.chorem.lima.entity.Entry; @@ -63,24 +59,18 @@ * Last update : $Date: 2010-05-14 13:22:26 +0200 (ven. 14 mai 2010) $ * By : $Author: jpepin $ */ -public class FinancialTransactionTableModel extends AbstractTableModel { +public class FinancialTransactionTableModel extends AbstractTableModel implements ServiceListener{ /** serialVersionUID. */ - private static final long serialVersionUID = 3914954536809622358L; + private static final long serialVersionUID = 1L; /** log. */ private static final Log log = LogFactory .getLog(FinancialTransactionTableModel.class); /** Transaction service. */ - protected final FinancialTransactionService financialTransactionService; + protected final FinancialTransactionServiceMonitorable financialTransactionService; - /** EntryBook service. */ - protected final EntryBookService entryBookService; - - /** FinancialPeriod service. */ - protected final FinancialPeriodService financialPeriodService; - /** selected financial period */ protected FinancialPeriod selectedFinancialPeriod; @@ -100,12 +90,9 @@ financialTransactionService = LimaServiceFactory.getInstance().getService( FinancialTransactionServiceMonitorable.class); - entryBookService = - LimaServiceFactory.getInstance().getService( - EntryBookServiceMonitorable.class); - financialPeriodService = - LimaServiceFactory.getInstance().getService( - FinancialPeriodServiceMonitorable.class); + financialTransactionService.addListener(this); + LimaServiceFactory.getInstance().getService( + ImportServiceMonitorable.class).addListener(this); } /** @@ -533,5 +520,12 @@ cacheDataList = getDataList(); fireTableRowsDeleted(row, getRowCount()); } + + @Override + public void notifyMethod(String serviceName, String methodeName) { + if (serviceName.contains("FinancialTransaction") || methodeName.contains("importEntries") || methodeName.contains("importAll")){ + refresh(); + } + } } Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionView.jaxx =================================================================== --- trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionView.jaxx 2010-07-21 14:02:18 UTC (rev 2979) +++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionView.jaxx 2010-07-21 15:04:34 UTC (rev 2980) @@ -42,9 +42,6 @@ </JPopupMenu> --> <row weightx="1" weighty="0" anchor="center"> - <cell anchor="west"> - <JButton text="lima.refresh" onActionPerformed="getHandler().refresh()"/> - </cell> <cell anchor="east"> <JLabel id="fiscalPeriodLabel" text="lima.charts.fiscalyear"/> </cell> @@ -83,7 +80,7 @@ </cell> </row> <row> - <cell fill="both" weightx="1" weighty="1" rows="3" columns="9"> + <cell fill="both" weightx="1" weighty="1" rows="3" columns="8"> <JScrollPane> <org.chorem.lima.ui.financialtransaction.FinancialTransactionTableModel id="financialTransactionTableModel"/> Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/ledger/LedgerTableModel.java =================================================================== --- trunk/lima-swing/src/main/java/org/chorem/lima/ui/ledger/LedgerTableModel.java 2010-07-21 14:02:18 UTC (rev 2979) +++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/ledger/LedgerTableModel.java 2010-07-21 15:04:34 UTC (rev 2980) @@ -30,9 +30,11 @@ import org.apache.commons.logging.LogFactory; import org.chorem.lima.beans.BalanceTrial; import org.chorem.lima.beans.ReportsDatas; +import org.chorem.lima.business.FinancialTransactionServiceMonitorable; +import org.chorem.lima.business.ImportServiceMonitorable; import org.chorem.lima.business.LimaException; -import org.chorem.lima.business.ReportService; import org.chorem.lima.business.ReportServiceMonitorable; +import org.chorem.lima.business.ServiceListener; import org.chorem.lima.business.utils.EntryComparator; import org.chorem.lima.entity.Entry; import org.chorem.lima.entity.EntryBook; @@ -49,7 +51,7 @@ * Last update : $Date: 2010-04-19 15:19:30 +0200 (lun. 19 avril 2010) $ * By : $Author: jpepin $ */ -public class LedgerTableModel extends AbstractTableModel { +public class LedgerTableModel extends AbstractTableModel implements ServiceListener { /** serialVersionUID. */ private static final long serialVersionUID = 7578692417919755647L; @@ -58,7 +60,7 @@ private static final Log log = LogFactory.getLog(LedgerTableModel.class); /** Services. */ - protected ReportService reportService; + protected ReportServiceMonitorable reportService; /** Account. */ protected EntryBook selectedEntryBook; @@ -78,8 +80,13 @@ */ public LedgerTableModel() { reportService = - LimaServiceFactory.getInstance().getService( - ReportServiceMonitorable.class); + LimaServiceFactory.getInstance().getService( + ReportServiceMonitorable.class); + reportService.addListener(this); + LimaServiceFactory.getInstance().getService( + ImportServiceMonitorable.class).addListener(this); + LimaServiceFactory.getInstance().getService( + FinancialTransactionServiceMonitorable.class).addListener(this); } @Override @@ -279,4 +286,11 @@ fireTableDataChanged(); } + @Override + public void notifyMethod(String serviceName, String methodeName) { + if (serviceName.contains("FinancialTransaction") || methodeName.contains("importAccount") || methodeName.contains("importAll")){ + refresh(); + } + } + } Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/ledger/LedgerView.jaxx =================================================================== --- trunk/lima-swing/src/main/java/org/chorem/lima/ui/ledger/LedgerView.jaxx 2010-07-21 14:02:18 UTC (rev 2979) +++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/ledger/LedgerView.jaxx 2010-07-21 15:04:34 UTC (rev 2980) @@ -48,9 +48,6 @@ ]]> </script> <row weightx="1" weighty="0" anchor="center"> - <cell anchor="west"> - <JButton text="lima.refresh" onActionPerformed="getHandler().refresh()"/> - </cell> <cell anchor="east"> <JLabel id="beginCalendarPanelLabel" text="lima.accountsreports.begincalendar"/> </cell> @@ -69,7 +66,7 @@ </cell> </row> <row> - <cell fill="both" weightx="1" weighty="1" columns="7"> + <cell fill="both" weightx="1" weighty="1" columns="6"> <JScrollPane> <org.chorem.lima.ui.ledger.LedgerTable id="table" sortable="false" rowHeight="24"
participants (1)
-
jpepin@users.chorem.org