View Javadoc
1   package fr.ifremer.dali.ui.swing.content.manage.program.strategiesByLocation.programs;
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.ui.swing.util.table.AbstractDaliTableModel;
28  import fr.ifremer.dali.ui.swing.util.table.DaliColumnIdentifier;
29  import fr.ifremer.quadrige3.ui.swing.table.SwingTableColumnModel;
30  
31  import java.time.LocalDate;
32  
33  import static org.nuiton.i18n.I18n.n;
34  
35  /**
36   * Le modele pour le tableau des programmes.
37   */
38  public class StrategiesProgrammeTableModel extends AbstractDaliTableModel<StrategiesProgrammeTableRowModel> {
39  
40  	/**
41  	 * Identifiant pour la colonne libelle.
42  	 */
43      public static final DaliColumnIdentifier<StrategiesProgrammeTableRowModel> NAME = DaliColumnIdentifier.newId(
44      		StrategiesProgrammeTableRowModel.PROPERTY_NAME,
45              n("dali.program.strategies.program.name.short"),
46              n("dali.program.strategies.program.name.tip"),
47              String.class);
48  
49  	/**
50  	 * Identifiant pour la colonne date debut.
51  	 */
52      public static final DaliColumnIdentifier<StrategiesProgrammeTableRowModel> START_DATE = DaliColumnIdentifier.newId(
53      		StrategiesProgrammeTableRowModel.PROPERTY_START_DATE,
54              n("dali.program.strategies.program.startDate.short"),
55              n("dali.program.strategies.program.startDate.tip"),
56  			LocalDate.class);
57  
58  	/**
59  	 * Identifiant pour la colonne date fin.
60  	 */
61      public static final DaliColumnIdentifier<StrategiesProgrammeTableRowModel> END_DATE = DaliColumnIdentifier.newId(
62      		StrategiesProgrammeTableRowModel.PROPERTY_END_DATE,
63              n("dali.program.strategies.program.endDate.short"),
64              n("dali.program.strategies.program.endDate.tip"),
65  			LocalDate.class);
66  
67  	/**
68  	 * Constructor.
69  	 *
70  	 * @param columnModel Le modele pour les colonnes
71  	 */
72  	public StrategiesProgrammeTableModel(final SwingTableColumnModel columnModel) {
73  		super(columnModel, false, false);
74  	}
75  
76  	/** {@inheritDoc} */
77  	@Override
78  	public StrategiesProgrammeTableRowModel createNewRow() {
79  		return new StrategiesProgrammeTableRowModel();
80  	}
81  
82  	/** {@inheritDoc} */
83  	@Override
84  	public DaliColumnIdentifier<StrategiesProgrammeTableRowModel> getFirstColumnEditing() {
85  		return NAME;
86  	}
87  }