1 package fr.ifremer.dali.ui.swing.util.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.quadrige3.ui.core.dto.referential.AbstractBaseReferentialDTOBean;
27 import fr.ifremer.quadrige3.ui.swing.table.AbstractTableModel;
28 import fr.ifremer.quadrige3.ui.swing.table.SwingTableColumnModel;
29 import org.nuiton.jaxx.application.swing.table.ColumnIdentifier;
30
31
32
33
34
35
36
37
38 public abstract class AbstractDaliTableModel<R extends AbstractDaliRowUIModel<?, ?>> extends AbstractTableModel<R> {
39
40
41
42
43
44
45
46 public AbstractDaliTableModel(SwingTableColumnModel columnModel, boolean createNewRow, boolean createEmptyRowIsEmpty) {
47 super(columnModel, createNewRow, createEmptyRowIsEmpty);
48 }
49
50 @Override
51 public boolean isCellEditable(int rowIndex, int columnIndex, ColumnIdentifier<R> propertyName) {
52
53 if (AbstractBaseReferentialDTOBean.PROPERTY_CREATION_DATE.equals(propertyName.getPropertyName())
54 || AbstractBaseReferentialDTOBean.PROPERTY_UPDATE_DATE.equals(propertyName.getPropertyName())) {
55 return false;
56 }
57
58 return super.isCellEditable(rowIndex, columnIndex, propertyName);
59 }
60 }