1 package fr.ifremer.tutti.ui.swing.content.operation.catches.accidental;
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25 import fr.ifremer.tutti.ui.swing.content.operation.catches.AbstractTuttiBatchUIModel;
26 import fr.ifremer.tutti.ui.swing.content.operation.catches.EditCatchesUIModel;
27 import org.nuiton.jaxx.application.swing.tab.TabContentModel;
28 import org.apache.commons.collections4.CollectionUtils;
29
30 import static org.nuiton.i18n.I18n.n;
31
32
33
34
35
36 public class AccidentalBatchUIModel extends AbstractTuttiBatchUIModel<AccidentalBatchRowModel, AccidentalBatchUIModel>
37 implements TabContentModel {
38
39 private static final long serialVersionUID = 1L;
40
41 public static final String PROPERTY_REMOVE_BATCH_ENABLED = "removeBatchEnabled";
42
43
44 protected boolean removeBatchEnabled;
45
46 public AccidentalBatchUIModel(EditCatchesUIModel catchesUIModel) {
47 super(catchesUIModel);
48 }
49
50 public boolean isRemoveBatchEnabled() {
51 return removeBatchEnabled;
52 }
53
54 public void setRemoveBatchEnabled(boolean removeBatchEnabled) {
55 this.removeBatchEnabled = removeBatchEnabled;
56 firePropertyChange(PROPERTY_REMOVE_BATCH_ENABLED, null, removeBatchEnabled);
57 }
58
59
60
61
62
63 @Override
64 public boolean isEmpty() {
65 boolean result = true;
66 if (CollectionUtils.isNotEmpty(getRows())) {
67
68
69 for (AccidentalBatchRowModel row : rows) {
70 if (row.isValid()) {
71
72
73 result = false;
74 break;
75 }
76 }
77 }
78 return result;
79 }
80
81 @Override
82 public String getTitle() {
83 return n("tutti.label.tab.accidental");
84 }
85
86 @Override
87 public String getIcon() {
88 return null;
89 }
90
91 @Override
92 public boolean isCloseable() {
93 return false;
94 }
95
96 }