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