1 package fr.ifremer.reefdb.ui.swing.content.manage.referential.replace;
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
27 import fr.ifremer.quadrige3.ui.core.dto.referential.BaseReferentialDTO;
28 import fr.ifremer.reefdb.ui.swing.util.AbstractReefDbBeanUIModel;
29
30 import java.util.List;
31
32
33
34
35
36
37 public class AbstractReplaceUIModel<E extends BaseReferentialDTO> extends AbstractReefDbBeanUIModel<E, AbstractReplaceUIModel<E>> {
38
39 private static final long serialVersionUID = 1L;
40
41
42 public static final String PROPERTY_SOURCE_LIST = "sourceList";
43
44
45 public static final String PROPERTY_TARGET_LIST = "targetList";
46
47
48 public static final String PROPERTY_SELECTED_SOURCE = "selectedSource";
49
50
51 public static final String PROPERTY_SELECTED_TARGET = "selectedTarget";
52
53
54 public static final String PROPERTY_DELETE = "delete";
55
56 protected List<E> sourceList;
57
58 protected List<E> targetList;
59
60 protected E selectedSource;
61
62 protected E selectedTarget;
63
64 protected boolean delete = true;
65
66 protected String decoratorContext = null;
67
68
69
70
71 public AbstractReplaceUIModel() {
72 super(null, null);
73 }
74
75
76
77
78
79
80 public List<E> getSourceList() {
81 return sourceList;
82 }
83
84
85
86
87
88
89 public void setSourceList(List<E> sourceList) {
90 this.sourceList = sourceList;
91 firePropertyChange(PROPERTY_SOURCE_LIST, null, sourceList);
92 }
93
94
95
96
97
98
99 public List<E> getTargetList() {
100 return targetList;
101 }
102
103
104
105
106
107
108 public void setTargetList(List<E> targetList) {
109 this.targetList = targetList;
110 firePropertyChange(PROPERTY_TARGET_LIST, null, targetList);
111 }
112
113
114
115
116
117
118 public E getSelectedTarget() {
119 return selectedTarget;
120 }
121
122
123
124
125
126
127 public void setSelectedTarget(E selectedTarget) {
128 E oldvalue = getSelectedTarget();
129 this.selectedTarget = selectedTarget;
130 firePropertyChange(PROPERTY_SELECTED_TARGET, oldvalue, selectedTarget);
131 }
132
133
134
135
136
137
138 public E getSelectedSource() {
139 return selectedSource;
140 }
141
142
143
144
145
146
147 public void setSelectedSource(E selectedSource) {
148 E oldvalue = getSelectedSource();
149 this.selectedSource = selectedSource;
150 firePropertyChange(PROPERTY_SELECTED_SOURCE, oldvalue, selectedSource);
151 }
152
153
154
155
156
157
158 public boolean isDelete() {
159 return delete;
160 }
161
162
163
164
165
166
167 public void setDelete(boolean delete) {
168 this.delete = delete;
169 }
170
171
172
173
174
175
176 public String getDecoratorContext() {
177 return decoratorContext;
178 }
179
180
181
182
183
184
185 public void setDecoratorContext(String decoratorContext) {
186 this.decoratorContext = decoratorContext;
187 }
188
189
190 @Override
191 protected E newBean() {
192 return null;
193 }
194 }