View Javadoc
1   package fr.ifremer.dali.ui.swing.content.manage.program.strategiesByLocation.strategies;
2   
3   /*
4    * #%L
5    * Dali :: UI
6    * $Id:$
7    * $HeadURL:$
8    * %%
9    * Copyright (C) 2014 - 2015 Ifremer
10   * %%
11   * This program is free software: you can redistribute it and/or modify
12   * it under the terms of the GNU Affero General Public License as published by
13   * the Free Software Foundation, either version 3 of the License, or
14   * (at your option) any later version.
15   * 
16   * This program is distributed in the hope that it will be useful,
17   * but WITHOUT ANY WARRANTY; without even the implied warranty of
18   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19   * GNU General Public License for more details.
20   * 
21   * You should have received a copy of the GNU Affero General Public License
22   * along with this program.  If not, see <http://www.gnu.org/licenses/>.
23   * #L%
24   */
25  
26  
27  import fr.ifremer.dali.dto.configuration.programStrategy.ProgramDTO;
28  import fr.ifremer.dali.ui.swing.util.table.AbstractDaliTableModel;
29  import fr.ifremer.dali.ui.swing.util.table.DaliColumnIdentifier;
30  import fr.ifremer.quadrige3.ui.swing.table.SwingTableColumnModel;
31  
32  import java.time.LocalDate;
33  
34  import static org.nuiton.i18n.I18n.n;
35  
36  /**
37   * Le modele pour le tableau des programmes.
38   */
39  public class StrategiesLieuTableModel extends AbstractDaliTableModel<StrategiesLieuTableRowModel> {
40  
41      /**
42       * Identifiant pour la colonne programme.
43       */
44      public static final DaliColumnIdentifier<StrategiesLieuTableRowModel> PROGRAM = DaliColumnIdentifier.newId(
45      		StrategiesLieuTableRowModel.PROPERTY_PROGRAM,
46              n("dali.property.program"),
47              n("dali.program.strategies.strategy.program.tip"),
48              ProgramDTO.class);
49  
50  	/**
51  	 * Identifiant pour la colonne libelle.
52  	 */
53      public static final DaliColumnIdentifier<StrategiesLieuTableRowModel> NAME = DaliColumnIdentifier.newId(
54      		StrategiesLieuTableRowModel.PROPERTY_NAME,
55              n("dali.program.strategies.strategy.name.short"),
56              n("dali.program.strategies.strategy.name.tip"),
57              String.class);
58  
59  	/**
60  	 * Identifiant pour la colonne date debut.
61  	 */
62      public static final DaliColumnIdentifier<StrategiesLieuTableRowModel> START_DATE = DaliColumnIdentifier.newId(
63      		StrategiesLieuTableRowModel.PROPERTY_START_DATE,
64              n("dali.program.strategies.strategy.startDate.short"),
65              n("dali.program.strategies.strategy.startDate.tip"),
66  			LocalDate.class);
67  
68  	/**
69  	 * Identifiant pour la colonne date fin.
70  	 */
71      public static final DaliColumnIdentifier<StrategiesLieuTableRowModel> END_DATE = DaliColumnIdentifier.newId(
72      		StrategiesLieuTableRowModel.PROPERTY_END_DATE,
73              n("dali.program.strategies.strategy.endDate.short"),
74              n("dali.program.strategies.strategy.endDate.tip"),
75  			LocalDate.class);
76  
77  	/**
78  	 * Constructor.
79  	 *
80  	 * @param columnModel Le modele pour les colonnes
81  	 */
82  	public StrategiesLieuTableModel(final SwingTableColumnModel columnModel) {
83  		super(columnModel, false, false);
84  	}
85  
86  	/** {@inheritDoc} */
87  	@Override
88  	public StrategiesLieuTableRowModel createNewRow() {
89  		return new StrategiesLieuTableRowModel();
90  	}
91  
92  	/** {@inheritDoc} */
93  	@Override
94  	public DaliColumnIdentifier<StrategiesLieuTableRowModel> getFirstColumnEditing() {
95  		return PROGRAM;
96  	}
97  }