View Javadoc
1   package fr.ifremer.dali.ui.swing.content.observation.survey.history;
2   
3   /*-
4    * #%L
5    * Dali :: UI
6    * %%
7    * Copyright (C) 2014 - 2017 Ifremer
8    * %%
9    * This program is free software: you can redistribute it and/or modify
10   * it under the terms of the GNU Affero General Public License as published by
11   * the Free Software Foundation, either version 3 of the License, or
12   * (at your option) any later version.
13   * 
14   * This program is distributed in the hope that it will be useful,
15   * but WITHOUT ANY WARRANTY; without even the implied warranty of
16   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17   * GNU General Public License for more details.
18   * 
19   * You should have received a copy of the GNU Affero General Public License
20   * along with this program.  If not, see <http://www.gnu.org/licenses/>.
21   * #L%
22   */
23  
24  import fr.ifremer.dali.dto.referential.PersonDTO;
25  import fr.ifremer.dali.dto.system.ValidationHistoryDTO;
26  import fr.ifremer.dali.ui.swing.util.table.AbstractDaliTableModel;
27  import fr.ifremer.dali.ui.swing.util.table.DaliColumnIdentifier;
28  import fr.ifremer.quadrige3.ui.swing.table.SwingTableColumnModel;
29  
30  import java.util.Date;
31  
32  import static org.nuiton.i18n.I18n.n;
33  
34  /**
35   * @author peck7 on 26/09/2017.
36   */
37  public class ValidationHistoryTableModel extends AbstractDaliTableModel<ValidationHistoryRowModel> {
38  
39      public static final DaliColumnIdentifier<ValidationHistoryRowModel> DATE = DaliColumnIdentifier.newId(
40              ValidationHistoryDTO.PROPERTY_DATE,
41              n("dali.property.date.validation"),
42              n("dali.property.date.validation"),
43              Date.class
44      );
45  
46      public static final DaliColumnIdentifier<ValidationHistoryRowModel> COMMENT = DaliColumnIdentifier.newId(
47              ValidationHistoryDTO.PROPERTY_COMMENT,
48              n("dali.property.comment.validation"),
49              n("dali.property.comment.validation"),
50              String.class
51      );
52  
53      public static final DaliColumnIdentifier<ValidationHistoryRowModel> RECORDER_PERSON = DaliColumnIdentifier.newId(
54              ValidationHistoryDTO.PROPERTY_RECORDER_PERSON,
55              n("dali.property.user.recorder"),
56              n("dali.property.user.recorder"),
57              PersonDTO.class
58      );
59  
60      /**
61       * <p>Constructor for AbstractDaliTableModel.</p>
62       *
63       */
64      public ValidationHistoryTableModel(SwingTableColumnModel columnModel) {
65          super(columnModel, false, false);
66      }
67  
68      @Override
69      public DaliColumnIdentifier<ValidationHistoryRowModel> getFirstColumnEditing() {
70          return null;
71      }
72  
73      @Override
74      public ValidationHistoryRowModel createNewRow() {
75          return new ValidationHistoryRowModel();
76      }
77  }