1 package fr.ifremer.dali.ui.swing.content.manage.referential.pmfm.matrix.table;
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26 import fr.ifremer.dali.decorator.DecoratorService;
27 import fr.ifremer.dali.dto.referential.pmfm.FractionDTO;
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.core.dto.referential.StatusDTO;
31 import fr.ifremer.quadrige3.ui.swing.table.SwingTableColumnModel;
32
33 import java.util.Date;
34
35 import static org.nuiton.i18n.I18n.n;
36
37
38
39
40 public class MatricesTableModel extends AbstractDaliTableModel<MatricesTableRowModel> {
41
42
43 public static final DaliColumnIdentifier<MatricesTableRowModel> NAME = DaliColumnIdentifier.newId(
44 MatricesTableRowModel.PROPERTY_NAME,
45 n("dali.property.name"),
46 n("dali.property.name"),
47 String.class,
48 true);
49
50
51 public static final DaliColumnIdentifier<MatricesTableRowModel> DESCRIPTION = DaliColumnIdentifier.newId(
52 MatricesTableRowModel.PROPERTY_DESCRIPTION,
53 n("dali.property.description"),
54 n("dali.property.description"),
55 String.class);
56
57
58 public static final DaliColumnIdentifier<MatricesTableRowModel> STATUS = DaliColumnIdentifier.newId(
59 MatricesTableRowModel.PROPERTY_STATUS,
60 n("dali.property.status"),
61 n("dali.property.status"),
62 StatusDTO.class,
63 true);
64
65
66 public static final DaliColumnIdentifier<MatricesTableRowModel> ASSOCIATED_FRACTIONS = DaliColumnIdentifier.newId(
67 MatricesTableRowModel.PROPERTY_FRACTIONS,
68 n("dali.property.pmfm.matrix.associatedFractions"),
69 n("dali.property.pmfm.matrix.associatedFractions"),
70 FractionDTO.class,
71 DecoratorService.COLLECTION_SIZE,
72 true);
73
74 public static final DaliColumnIdentifier<MatricesTableRowModel> COMMENT = DaliColumnIdentifier.newId(
75 MatricesTableRowModel.PROPERTY_COMMENT,
76 n("dali.property.comment"),
77 n("dali.property.comment"),
78 String.class,
79 false);
80
81 public static final DaliColumnIdentifier<MatricesTableRowModel> CREATION_DATE = DaliColumnIdentifier.newReadOnlyId(
82 MatricesTableRowModel.PROPERTY_CREATION_DATE,
83 n("dali.property.date.creation"),
84 n("dali.property.date.creation"),
85 Date.class);
86
87 public static final DaliColumnIdentifier<MatricesTableRowModel> UPDATE_DATE = DaliColumnIdentifier.newReadOnlyId(
88 MatricesTableRowModel.PROPERTY_UPDATE_DATE,
89 n("dali.property.date.modification"),
90 n("dali.property.date.modification"),
91 Date.class);
92
93
94
95
96
97
98
99 public MatricesTableModel(final SwingTableColumnModel columnModel, boolean createNewRowAllowed) {
100 super(columnModel, createNewRowAllowed, false);
101 }
102
103
104 @Override
105 public MatricesTableRowModel createNewRow() {
106 return new MatricesTableRowModel();
107 }
108
109
110 @Override
111 public DaliColumnIdentifier<MatricesTableRowModel> getFirstColumnEditing() {
112 return NAME;
113 }
114 }