View Javadoc
1   package fr.ifremer.dali.ui.swing.content.extraction.filters.period;
2   
3   /*
4    * #%L
5    * Dali :: UI
6    * $Id:$
7    * $HeadURL:$
8    * %%
9    * Copyright (C) 2014 - 2016 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   * Created by Ludovic on 18/01/2016.
37   */
38  public class ExtractionPeriodTableModel extends AbstractDaliTableModel<ExtractionPeriodRowModel> {
39  
40      /** Constant <code>START_DATE</code> */
41      public static final DaliColumnIdentifier<ExtractionPeriodRowModel> START_DATE = DaliColumnIdentifier.newId(
42              ExtractionPeriodRowModel.PROPERTY_START_DATE,
43              n("dali.extraction.period.startDate.label"),
44              n("dali.extraction.period.startDate.label"),
45              LocalDate.class,
46              true);
47  
48      /** Constant <code>END_DATE</code> */
49      public static final DaliColumnIdentifier<ExtractionPeriodRowModel> END_DATE = DaliColumnIdentifier.newId(
50              ExtractionPeriodRowModel.PROPERTY_END_DATE,
51              n("dali.extraction.period.endDate.label"),
52              n("dali.extraction.period.endDate.label"),
53              LocalDate.class,
54              true);
55  
56      /**
57       * <p>Constructor for ExtractionPeriodTableModel.</p>
58       *
59       */
60      public ExtractionPeriodTableModel(SwingTableColumnModel columnModel) {
61          super(columnModel, false, false);
62      }
63  
64      /** {@inheritDoc} */
65      @Override
66      public DaliColumnIdentifier<ExtractionPeriodRowModel> getFirstColumnEditing() {
67          return START_DATE;
68      }
69  
70      /** {@inheritDoc} */
71      @Override
72      public ExtractionPeriodRowModel createNewRow() {
73          return new ExtractionPeriodRowModel();
74      }
75  }