View Javadoc
1   package fr.ifremer.reefdb.ui.swing.content.manage.referential.user.local.replace;
2   
3   /*-
4    * #%L
5    * Reef DB :: UI
6    * $Id:$
7    * $HeadURL:$
8    * %%
9    * Copyright (C) 2014 - 2022 Ifremer
10   * %%
11   * This program is free software: you can redistribute it and/or modify
12   * it under the terms of the GNU Affero General Public License as published by
13   * the Free Software Foundation, either version 3 of the License, or
14   * (at your option) any later version.
15   * 
16   * This program is distributed in the hope that it will be useful,
17   * but WITHOUT ANY WARRANTY; without even the implied warranty of
18   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19   * GNU General Public License for more details.
20   * 
21   * You should have received a copy of the GNU Affero General Public License
22   * along with this program.  If not, see <http://www.gnu.org/licenses/>.
23   * #L%
24   */
25  
26  
27  import fr.ifremer.quadrige3.ui.swing.component.bean.ExtendedComboBox;
28  import fr.ifremer.reefdb.dto.referential.PersonDTO;
29  import fr.ifremer.reefdb.ui.swing.content.manage.referential.replace.AbstractReplaceUI;
30  import fr.ifremer.reefdb.ui.swing.util.ReefDbUI;
31  import java.awt.Dialog;
32  import java.awt.Dialog.ModalityType;
33  import java.awt.Frame;
34  import java.awt.GraphicsConfiguration;
35  import java.awt.Window;
36  import jaxx.runtime.JAXXContext;
37  import jaxx.runtime.JAXXObjectDescriptor;
38  import jaxx.runtime.JAXXUtil;
39  import org.apache.commons.logging.Log;
40  import org.apache.commons.logging.LogFactory;
41  import static org.nuiton.i18n.I18n.t;
42  
43  public class ReplaceUserUI extends AbstractReplaceUI<PersonDTO, ReplaceUserUIModel> implements ReefDbUI<ReplaceUserUIModel, ReplaceUserUIHandler> {
44  
45      /*-----------------------------------------------------------------------*/
46      /*------------------------- Other static fields -------------------------*/
47      /*-----------------------------------------------------------------------*/
48  
49      private static final String $jaxxObjectDescriptor = "H4sIAAAAAAAAALVTS08TURQ+rRQoiAKNBCIm+IjL20SW+OChREjRBMQQu9DbmdtyyXTmcu8ZGWI0/gR/gu7dmLhzZVy4duHG+BeMceHWeO502hlgDGzs4mZyHt/3ndPvvP0BJaPh4g6PIqZDH2VbsNWFra37jR3h4G1hHC0VBho6v0IRinUYdntxg3C5XrPt1aS9uhS0VeALP9M9V4Mhg/ueMNtCIMKFgx2OMdWNXnouUqHuovZE5aG+/vWz+Mp9+aYIEClSZ0eZOa4rnaSvBkXpIowT01Ne9bjfIhla+i3SO2JjSx435h5vi114AQM16FdcExjCpZOPHGPE/ZFCKGuhPO6IzRWEh03NZFOLttBMC9F0GyyUzOyRAOYEPhIea3OftwSlm8IyS+6x0FC9Fzj0mYCx9QSUMpsrSsV0/QilduAKD6H+f4jWLHrKNm6CUDuiJg3SPhrBYhAh3MhQ74bc1bIlZrPsyeJYQ3Cf3YlIiyvcbn8GHLluCcyC28xYWjGSaFwMEWkmqNg/MEp4VjtRqtZw/oBDyHss9V5qjkIdSjqkMMJk/ahd1ynVMerkIaNawDj7Z6Ly9cP398tdd/YR97nc0sxxkWuUDpTQKC312Y41Q5RedY2ruTqUjfDoMuPLm84RtpGkSRzxjdl2ZtvZXW62CaI08O3jp4knX05BcRmGvIC7y9zWr0AZtzVtIfDcSN2ajxWd3hukd9RqIzehRI9WNJlYSKdeYHEqom1M52yjJ6lR/vy7svFuvruRAimc+md5upXSI+iXvid9EV9scoy5FzqsjAjdID26vDOE7B2qxELT8TuTN/n4Y66UJx2OMvAXHPsiTD3LHEMnyBxL8jwKLdKVeED7dRUOu/MEnIP2IB7sK1r4mesuRz7TkL5LXr55BL5g39FjMW34mn1m8xEqhPAXAjtBFBAGAAA=";
50      private static final Log log = LogFactory.getLog(ReplaceUserUI.class);
51      private static final long serialVersionUID = 1L;
52  
53      /*-----------------------------------------------------------------------*/
54      /*--------------------------- Internal states ---------------------------*/
55      /*-----------------------------------------------------------------------*/
56  
57      private boolean allComponentsCreated;
58  
59      /*-----------------------------------------------------------------------*/
60      /*------------------------ Protected components  ------------------------*/
61      /*-----------------------------------------------------------------------*/
62  
63      protected final ReplaceUserUIHandler handler = createHandler();
64      protected ReplaceUserUI replaceUI = this;
65  
66      /*-----------------------------------------------------------------------*/
67      /*---------------------------- Constructors  ----------------------------*/
68      /*-----------------------------------------------------------------------*/
69  
70      public ReplaceUserUI(Frame param0, String param1, boolean param2) {
71          super(param0 ,param1 ,param2);
72          $initialize();
73      }
74  
75      public ReplaceUserUI(JAXXContext param0, Frame param1, String param2, boolean param3) {
76          super(param0 ,param1 ,param2 ,param3);
77          $initialize();
78      }
79  
80      public ReplaceUserUI(Frame param0, String param1) {
81          super(param0 ,param1);
82          $initialize();
83      }
84  
85      public ReplaceUserUI(JAXXContext param0, Frame param1, String param2) {
86          super(param0 ,param1 ,param2);
87          $initialize();
88      }
89  
90      public ReplaceUserUI(Frame param0, String param1, boolean param2, GraphicsConfiguration param3) {
91          super(param0 ,param1 ,param2 ,param3);
92          $initialize();
93      }
94  
95      public ReplaceUserUI(JAXXContext param0, Frame param1, String param2, boolean param3, GraphicsConfiguration param4) {
96          super(param0 ,param1 ,param2 ,param3 ,param4);
97          $initialize();
98      }
99  
100     public ReplaceUserUI(Dialog param0) {
101         super(param0);
102         $initialize();
103     }
104 
105     public ReplaceUserUI(JAXXContext param0, Dialog param1) {
106         super(param0 ,param1);
107         $initialize();
108     }
109 
110     public ReplaceUserUI(Frame param0, boolean param1) {
111         super(param0 ,param1);
112         $initialize();
113     }
114 
115     public ReplaceUserUI(JAXXContext param0, Frame param1, boolean param2) {
116         super(param0 ,param1 ,param2);
117         $initialize();
118     }
119 
120     public ReplaceUserUI() {
121         $initialize();
122     }
123 
124     public ReplaceUserUI(JAXXContext param0) {
125         super(param0);
126         $initialize();
127     }
128 
129     public ReplaceUserUI(Frame param0) {
130         super(param0);
131         $initialize();
132     }
133 
134     public ReplaceUserUI(JAXXContext param0, Frame param1) {
135         super(param0 ,param1);
136         $initialize();
137     }
138 
139     public ReplaceUserUI(Dialog param0, String param1, boolean param2, GraphicsConfiguration param3) {
140         super(param0 ,param1 ,param2 ,param3);
141         $initialize();
142     }
143 
144     public ReplaceUserUI(JAXXContext param0, Dialog param1, String param2, boolean param3, GraphicsConfiguration param4) {
145         super(param0 ,param1 ,param2 ,param3 ,param4);
146         $initialize();
147     }
148 
149     public ReplaceUserUI(Window param0) {
150         super(param0);
151         $initialize();
152     }
153 
154     public ReplaceUserUI(JAXXContext param0, Window param1) {
155         super(param0 ,param1);
156         $initialize();
157     }
158 
159     public ReplaceUserUI(Window param0, ModalityType param1) {
160         super(param0 ,param1);
161         $initialize();
162     }
163 
164     public ReplaceUserUI(JAXXContext param0, Window param1, ModalityType param2) {
165         super(param0 ,param1 ,param2);
166         $initialize();
167     }
168 
169     public ReplaceUserUI(Window param0, String param1) {
170         super(param0 ,param1);
171         $initialize();
172     }
173 
174     public ReplaceUserUI(JAXXContext param0, Window param1, String param2) {
175         super(param0 ,param1 ,param2);
176         $initialize();
177     }
178 
179     public ReplaceUserUI(Window param0, String param1, ModalityType param2) {
180         super(param0 ,param1 ,param2);
181         $initialize();
182     }
183 
184     public ReplaceUserUI(JAXXContext param0, Window param1, String param2, ModalityType param3) {
185         super(param0 ,param1 ,param2 ,param3);
186         $initialize();
187     }
188 
189     public ReplaceUserUI(Window param0, String param1, ModalityType param2, GraphicsConfiguration param3) {
190         super(param0 ,param1 ,param2 ,param3);
191         $initialize();
192     }
193 
194     public ReplaceUserUI(JAXXContext param0, Window param1, String param2, ModalityType param3, GraphicsConfiguration param4) {
195         super(param0 ,param1 ,param2 ,param3 ,param4);
196         $initialize();
197     }
198 
199     public ReplaceUserUI(Dialog param0, boolean param1) {
200         super(param0 ,param1);
201         $initialize();
202     }
203 
204     public ReplaceUserUI(JAXXContext param0, Dialog param1, boolean param2) {
205         super(param0 ,param1 ,param2);
206         $initialize();
207     }
208 
209     public ReplaceUserUI(Dialog param0, String param1) {
210         super(param0 ,param1);
211         $initialize();
212     }
213 
214     public ReplaceUserUI(JAXXContext param0, Dialog param1, String param2) {
215         super(param0 ,param1 ,param2);
216         $initialize();
217     }
218 
219     public ReplaceUserUI(Dialog param0, String param1, boolean param2) {
220         super(param0 ,param1 ,param2);
221         $initialize();
222     }
223 
224     public ReplaceUserUI(JAXXContext param0, Dialog param1, String param2, boolean param3) {
225         super(param0 ,param1 ,param2 ,param3);
226         $initialize();
227     }
228 
229     /*-----------------------------------------------------------------------*/
230     /*--------------------------- Statics methods ---------------------------*/
231     /*-----------------------------------------------------------------------*/
232 
233     public static JAXXObjectDescriptor $getJAXXObjectDescriptor() {
234         return JAXXUtil.decodeCompressedJAXXObjectDescriptor($jaxxObjectDescriptor);
235     }
236 
237     /*-----------------------------------------------------------------------*/
238     /*----------------------- Public acessor methods  -----------------------*/
239     /*-----------------------------------------------------------------------*/
240 
241     public ReplaceUserUIHandler getHandler() {
242         return handler;
243     }
244 
245     @Override
246     public ReplaceUserUIModel getModel() {
247         return (ReplaceUserUIModel) super.getModel();
248     }
249 
250     /*-----------------------------------------------------------------------*/
251     /*--------------------- Components creation methods ---------------------*/
252     /*-----------------------------------------------------------------------*/
253 
254     protected ReplaceUserUIHandler createHandler() {
255         return new ReplaceUserUIHandler();
256     }
257 
258     @Override
259     protected void createModel() {
260         $objectMap.put("model", model = getContextValue(ReplaceUserUIModel.class));
261     }
262 
263     @Override
264     protected void createReplaceButton() {
265         super.createReplaceButton();
266         replaceButton.setName("replaceButton");
267         replaceButton.putClientProperty("applicationAction", ReplaceUserAction.class);
268     }
269 
270     @Override
271     protected void createSourceListComboBox() {
272         super.createSourceListComboBox();
273         sourceListComboBox.setName("sourceListComboBox");
274     }
275 
276     @Override
277     protected void createTargetListComboBox() {
278         super.createTargetListComboBox();
279         targetListComboBox.setName("targetListComboBox");
280     }
281 
282     /*-----------------------------------------------------------------------*/
283     /*------------------------ Internal jaxx methods ------------------------*/
284     /*-----------------------------------------------------------------------*/
285 
286     private void $completeSetup() {
287         allComponentsCreated = true;
288         if (log.isDebugEnabled()) {
289             log.debug(this);
290         }
291         
292         // apply 2 property setters
293         sourceListComboBox.setBeanType(PersonDTO.class);
294         targetListComboBox.setBeanType(PersonDTO.class);
295         // late initializer
296         replaceUI.pack();
297     }
298 
299     private void $initialize() {
300         if (allComponentsCreated) {
301             return;
302         }
303         if (log.isDebugEnabled()) {
304             log.debug(this);
305         }
306         handler.beforeInit(this);
307         $objectMap.put("replaceUI", replaceUI);
308         // inline creation of replaceUI
309         setName("replaceUI");
310         setTitle(t("reefdb.replaceUser.title"));
311         
312         $completeSetup();
313         handler.afterInit(this);
314     }
315 
316 }