r3122 - trunk/lima-swing/src/main/java/org/chorem/lima/ui/combobox
Author: echatellier Date: 2011-05-13 14:11:59 +0200 (Fri, 13 May 2011) New Revision: 3122 Url: http://chorem.org/repositories/revision/lima/3122 Log: Improve code, remove duplicated. Add javadoc "VERY IMPORTANT" ;) Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/combobox/FinancialPeriodComboBoxModel.java Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/combobox/FinancialPeriodComboBoxModel.java =================================================================== --- trunk/lima-swing/src/main/java/org/chorem/lima/ui/combobox/FinancialPeriodComboBoxModel.java 2011-05-13 12:04:23 UTC (rev 3121) +++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/combobox/FinancialPeriodComboBoxModel.java 2011-05-13 12:11:59 UTC (rev 3122) @@ -64,20 +64,19 @@ protected FiscalPeriod selectedFiscalPeriod; - //constructor for blocked financial period only + /** + * Constructor for locked period list. + */ public FinancialPeriodComboBoxModel() { - financialPeriodService = - LimaServiceFactory.getInstance().getService( - FinancialPeriodServiceMonitorable.class); - financialPeriodService.addListener(this); - LimaServiceFactory.getInstance().getService( - FiscalPeriodServiceMonitorable.class).addListener(this); - LimaServiceFactory.getInstance().getService( - ImportServiceMonitorable.class).addListener(this); - datasCache=getDataList(); + this(false); } - //constructor for all financial period + /** + * Constructor for period list. + * + * @param all if {@code true}, display all available period, otherwize + * display only locked ones + */ public FinancialPeriodComboBoxModel(boolean all) { financialPeriodService = LimaServiceFactory.getInstance().getService( @@ -87,7 +86,12 @@ FiscalPeriodServiceMonitorable.class).addListener(this); LimaServiceFactory.getInstance().getService( ImportServiceMonitorable.class).addListener(this); - datasCache=getAllDataList(); + if (all) { + datasCache=getAllDataList(); + } + else { + datasCache=getDataList(); + } } public void setFiscalPeriod(FiscalPeriod fiscalPeriod){
participants (1)
-
echatellier@users.chorem.org