View Javadoc
1   package fr.ifremer.tutti.ui.swing.content.home;
2   
3   /*
4    * #%L
5    * Tutti :: UI
6    * $Id:$
7    * $HeadURL:$
8    * %%
9    * Copyright (C) 2012 - 2017 Ifremer
10   * %%
11   * This program is free software: you can redistribute it and/or modify
12   * it under the terms of the GNU General Public License as
13   * published by the Free Software Foundation, either version 3 of the
14   * License, or (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 General Public
22   * License along with this program.  If not, see
23   * <http://www.gnu.org/licenses/gpl-3.0.html>.
24   * #L%
25   */
26  
27  import fr.ifremer.tutti.persistence.entities.data.Cruise;
28  import fr.ifremer.tutti.persistence.entities.data.Program;
29  import fr.ifremer.tutti.persistence.entities.protocol.TuttiProtocol;
30  import fr.ifremer.tutti.ui.swing.TuttiHelpBroker;
31  import fr.ifremer.tutti.ui.swing.TuttiUIContext;
32  import fr.ifremer.tutti.ui.swing.util.TuttiUI;
33  import fr.ifremer.tutti.ui.swing.util.TuttiUIUtil;
34  import java.awt.BorderLayout;
35  import java.awt.Component;
36  import java.awt.Container;
37  import java.awt.GridBagConstraints;
38  import java.awt.GridLayout;
39  import java.awt.Insets;
40  import java.awt.LayoutManager;
41  import java.util.ArrayList;
42  import java.util.Arrays;
43  import java.util.HashMap;
44  import java.util.List;
45  import java.util.Map;
46  import java.util.TreeMap;
47  import javax.swing.JButton;
48  import javax.swing.JComboBox;
49  import javax.swing.JLabel;
50  import javax.swing.JPanel;
51  import jaxx.runtime.JAXXBinding;
52  import jaxx.runtime.JAXXContext;
53  import jaxx.runtime.JAXXObject;
54  import jaxx.runtime.JAXXObjectDescriptor;
55  import jaxx.runtime.JAXXUtil;
56  import jaxx.runtime.JAXXValidator;
57  import jaxx.runtime.SwingUtil;
58  import jaxx.runtime.binding.DefaultJAXXBinding;
59  import jaxx.runtime.context.DefaultJAXXContext;
60  import jaxx.runtime.swing.Table;
61  import jaxx.runtime.swing.editor.bean.BeanFilterableComboBox;
62  import jaxx.runtime.swing.help.JAXXHelpUI;
63  import jaxx.runtime.validator.swing.SwingValidator;
64  import jaxx.runtime.validator.swing.SwingValidatorUtil;
65  import jaxx.runtime.validator.swing.meta.Validator;
66  import jaxx.runtime.validator.swing.meta.ValidatorField;
67  import jaxx.runtime.validator.swing.ui.ImageValidationUI;
68  import org.apache.commons.logging.Log;
69  import org.apache.commons.logging.LogFactory;
70  import static org.nuiton.i18n.I18n.t;
71  
72  public class SelectCruiseUI extends JPanel implements JAXXHelpUI<TuttiHelpBroker>, TuttiUI<SelectCruiseUIModel, SelectCruiseUIHandler>, JAXXObject, JAXXValidator {
73  
74      /*-----------------------------------------------------------------------*/
75      /*------------------ Constants for all public bindings ------------------*/
76      /*-----------------------------------------------------------------------*/
77  
78      public static final String BINDING_CLONE_PROTOCOL_BUTTON_ENABLED = "cloneProtocolButton.enabled";
79      public static final String BINDING_CRUISE_COMBOBOX_ENABLED = "cruiseCombobox.enabled";
80      public static final String BINDING_CRUISE_COMBOBOX_SELECTED_ITEM = "cruiseCombobox.selectedItem";
81      public static final String BINDING_CRUISE_LABEL_ICON = "cruiseLabel.icon";
82      public static final String BINDING_DELETE_PROTOCOL_BUTTON_ENABLED = "deleteProtocolButton.enabled";
83      public static final String BINDING_EDIT_CATCHES_BUTTON_ENABLED = "editCatchesButton.enabled";
84      public static final String BINDING_EDIT_CRUISE_BUTTON_ENABLED = "editCruiseButton.enabled";
85      public static final String BINDING_EDIT_CRUISE_COMBO_BOX_ENABLED = "editCruiseComboBox.enabled";
86      public static final String BINDING_EDIT_PROGRAM_BUTTON_ENABLED = "editProgramButton.enabled";
87      public static final String BINDING_EDIT_PROTOCOL_BUTTON_ENABLED = "editProtocolButton.enabled";
88      public static final String BINDING_EDIT_PROTOCOL_COMBO_BOX_ENABLED = "editProtocolComboBox.enabled";
89      public static final String BINDING_EXPORT_PROTOCOL_BUTTON_ENABLED = "exportProtocolButton.enabled";
90      public static final String BINDING_IMPORT_PROTOCOL_BUTTON_ENABLED = "importProtocolButton.enabled";
91      public static final String BINDING_NEW_CRUISE_BUTTON_ENABLED = "newCruiseButton.enabled";
92      public static final String BINDING_NEW_PROTOCOL_BUTTON_ENABLED = "newProtocolButton.enabled";
93      public static final String BINDING_NEW_PROTOCOL_COMBO_BOX_ENABLED = "newProtocolComboBox.enabled";
94      public static final String BINDING_PROGRAM_COMBOBOX_ENABLED = "programCombobox.enabled";
95      public static final String BINDING_PROGRAM_COMBOBOX_SELECTED_ITEM = "programCombobox.selectedItem";
96      public static final String BINDING_PROTOCOL_COMBOBOX_ENABLED = "protocolCombobox.enabled";
97      public static final String BINDING_PROTOCOL_COMBOBOX_SELECTED_ITEM = "protocolCombobox.selectedItem";
98      public static final String BINDING_VALIDATE_CATCHES_BUTTON_ENABLED = "validateCatchesButton.enabled";
99      public static final String BINDING_WARNING_CONTAINER_VISIBLE = "warningContainer.visible";
100 
101     /*-----------------------------------------------------------------------*/
102     /*------------------------- Other static fields -------------------------*/
103     /*-----------------------------------------------------------------------*/
104 
105     private static final String $jaxxObjectDescriptor = "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";
106     private static final Log log = LogFactory.getLog(SelectCruiseUI.class);
107     private static final long serialVersionUID = 1L;
108 
109     /*-----------------------------------------------------------------------*/
110     /*--------------------------- Internal states ---------------------------*/
111     /*-----------------------------------------------------------------------*/
112 
113     protected List<Object> $activeBindings = new ArrayList<Object>();
114     protected Map<String, Object> $bindingSources = new HashMap<String, Object>();
115     protected final Map<String, JAXXBinding> $bindings = new TreeMap<String, JAXXBinding>();
116     protected Map<String, Object> $objectMap = new HashMap<String, Object>();
117     protected Map<?, ?> $previousValues = new HashMap<Object, Object>();
118     private boolean allComponentsCreated;
119     protected final JAXXContext delegateContext = new DefaultJAXXContext();
120 
121     /*-----------------------------------------------------------------------*/
122     /*------------------------ Protected components  ------------------------*/
123     /*-----------------------------------------------------------------------*/
124 
125     protected TuttiHelpBroker broker;
126     protected JButton calcifiedPiecesSamplingReportButton;
127     protected JButton cloneProtocolButton;
128     @ValidatorField( validatorId = "validator",  propertyName = "cruise",  editorName = "cruiseCombobox")
129     protected BeanFilterableComboBox<Cruise> cruiseCombobox;
130     protected JLabel cruiseLabel;
131     protected JButton deleteProtocolButton;
132     protected JButton editCatchesButton;
133     protected JButton editCruiseButton;
134     protected JComboBox editCruiseComboBox;
135     protected JButton editProgramButton;
136     protected JButton editProtocolButton;
137     protected JComboBox editProtocolComboBox;
138     protected JButton exportCruiseForSumatraButton;
139     protected JButton exportProtocolButton;
140     protected final SelectCruiseUIHandler handler = createHandler();
141     protected JButton importProtocolButton;
142     protected SelectCruiseUIModel model;
143     protected JButton newCruiseButton;
144     protected JButton newProgramButton;
145     protected JButton newProtocolButton;
146     protected JComboBox newProtocolComboBox;
147     @ValidatorField( validatorId = "validator",  propertyName = "program",  editorName = "programCombobox")
148     protected BeanFilterableComboBox<Program> programCombobox;
149     protected JLabel programLabel;
150     @ValidatorField( validatorId = "validator",  propertyName = "protocol",  editorName = "protocolCombobox")
151     protected BeanFilterableComboBox<TuttiProtocol> protocolCombobox;
152     protected JLabel protocolLabel;
153     protected SelectCruiseUI selectCruiseTopPanel = this;
154     protected JButton sendCruiseReportButton;
155     protected JButton speciesToConfirmReportForCruiseButton;
156     protected JButton validateCatchesButton;
157     @Validator( validatorId = "validator")
158     protected SwingValidator<SelectCruiseUIModel> validator;
159     protected List<String> validatorIds = new ArrayList<String>();
160     protected JPanel warningContainer;
161     protected JLabel warningLabel;
162 
163     /*-----------------------------------------------------------------------*/
164     /*------------------------- Private components  -------------------------*/
165     /*-----------------------------------------------------------------------*/
166 
167     private JLabel $JLabel0;
168     private JLabel $JLabel1;
169     private JLabel $JLabel2;
170     private JPanel $JPanel0;
171     private JPanel $JPanel1;
172     private JPanel $JPanel2;
173     private JPanel $JPanel3;
174     private JPanel $JPanel4;
175     private Table $Table0;
176 
177     /*-----------------------------------------------------------------------*/
178     /*---------------------- Raw body code from script ----------------------*/
179     /*-----------------------------------------------------------------------*/
180 
181     protected TuttiUIContext uiContext;
182 
183     /*-----------------------------------------------------------------------*/
184     /*---------------------------- Constructors  ----------------------------*/
185     /*-----------------------------------------------------------------------*/
186 
187     public SelectCruiseUI(TuttiUI parentUI) {
188         TuttiUIUtil.setParentUI(this, parentUI);
189                 uiContext = TuttiUIUtil.getApplicationContext(parentUI);
190             $initialize();
191     }
192 
193     public SelectCruiseUI(LayoutManager param0, boolean param1) {
194         super(param0 ,param1);
195         $initialize();
196     }
197 
198     public SelectCruiseUI(JAXXContext parentContext, LayoutManager param1, boolean param2) {
199         super(param1 ,param2);
200         JAXXUtil.initContext(this, parentContext);
201         $initialize();
202     }
203 
204     public SelectCruiseUI(LayoutManager param0) {
205         super(param0);
206         $initialize();
207     }
208 
209     public SelectCruiseUI(JAXXContext parentContext, LayoutManager param1) {
210         super(param1);
211         JAXXUtil.initContext(this, parentContext);
212         $initialize();
213     }
214 
215     public SelectCruiseUI() {
216         $initialize();
217     }
218 
219     public SelectCruiseUI(JAXXContext parentContext) {
220         JAXXUtil.initContext(this, parentContext);
221         $initialize();
222     }
223 
224     public SelectCruiseUI(boolean param0) {
225         super(param0);
226         $initialize();
227     }
228 
229     public SelectCruiseUI(JAXXContext parentContext, boolean param1) {
230         super(param1);
231         JAXXUtil.initContext(this, parentContext);
232         $initialize();
233     }
234 
235     /*-----------------------------------------------------------------------*/
236     /*--------------------------- Statics methods ---------------------------*/
237     /*-----------------------------------------------------------------------*/
238 
239     public static JAXXObjectDescriptor $getJAXXObjectDescriptor() {
240         return JAXXUtil.decodeCompressedJAXXObjectDescriptor($jaxxObjectDescriptor);
241     }
242 
243     /*-----------------------------------------------------------------------*/
244     /*---------------------- JAXXObject implementation ----------------------*/
245     /*-----------------------------------------------------------------------*/
246 
247     @Override
248     public void applyDataBinding(String $binding) {
249         if (allComponentsCreated && $bindings.containsKey($binding)) {
250             getDataBinding($binding).applyDataBinding();
251         }
252         processDataBinding($binding);
253     }
254 
255     @Override
256     public void firePropertyChange(String propertyName, Object oldValue, Object newValue) {
257         super.firePropertyChange(propertyName, oldValue, newValue);
258     }
259 
260     @Override
261     public Map<String, Object> get$objectMap() {
262         return $objectMap;
263     }
264 
265     @Override
266     public JAXXBinding getDataBinding(String bindingId) {
267         return $bindings.get(bindingId);
268     }
269 
270     @Override
271     public JAXXBinding[] getDataBindings() {
272         return $bindings.values().toArray(new JAXXBinding[$bindings.size()]);
273     }
274 
275     @Override
276     public Object getObjectById(String id) {
277         return $objectMap.get(id);
278     }
279 
280     @Override
281     public void processDataBinding(String $binding, boolean $force) {
282         if (!$force && $activeBindings.contains($binding)) { 
283             return;
284         }
285         $activeBindings.add($binding);
286         try {
287             if (allComponentsCreated && $bindings.containsKey($binding)) {
288                 getDataBinding($binding).processDataBinding();
289             }
290         } finally {
291             $activeBindings.remove($binding);
292         }
293     }
294 
295     @Override
296     public void processDataBinding(String $binding) {
297         processDataBinding($binding, false);
298     }
299 
300     @Override
301     public void registerDataBinding(JAXXBinding binding) {
302         $bindings.put(binding.getId(), binding);
303     }
304 
305     @Override
306     public void removeDataBinding(String $binding) {
307         if (allComponentsCreated && $bindings.containsKey($binding)) {
308             getDataBinding($binding).removeDataBinding();
309         }
310     }
311 
312     /*-----------------------------------------------------------------------*/
313     /*--------------------- JAXXContext implementation  ---------------------*/
314     /*-----------------------------------------------------------------------*/
315 
316     @Override
317     public <T> T getContextValue(Class<T> clazz) {
318         return delegateContext.getContextValue(clazz, null);
319     }
320 
321     @Override
322     public <T> T getContextValue(Class<T> clazz, String name) {
323         return delegateContext.getContextValue(clazz, name);
324     }
325 
326     @Override
327     public JAXXContext getDelegateContext() {
328         return delegateContext;
329     }
330 
331     @Override
332     public <O extends Container> O getParentContainer(Class<O> clazz) {
333         return SwingUtil.getParentContainer(this, clazz);
334     }
335 
336     @Override
337     public <O extends Container> O getParentContainer(Object source, Class<O> clazz) {
338         return SwingUtil.getParentContainer(source, clazz);
339     }
340 
341     @Override
342     public <T> void removeContextValue(Class<T> clazz) {
343         delegateContext.removeContextValue(clazz, null);
344     }
345 
346     @Override
347     public <T> void removeContextValue(Class<T> clazz, String name) {
348         delegateContext.removeContextValue(clazz, name);
349     }
350 
351     @Override
352     public <T> void setContextValue(T o) {
353         delegateContext.setContextValue(o, null);
354     }
355 
356     @Override
357     public <T> void setContextValue(T o, String name) {
358         delegateContext.setContextValue(o, name);
359     }
360 
361     /*-----------------------------------------------------------------------*/
362     /*-------------------- JAXXValidator implementation  --------------------*/
363     /*-----------------------------------------------------------------------*/
364 
365     @Override
366     public SwingValidator<?> getValidator(String validatorId) {
367         return (SwingValidator<?>) (validatorIds.contains(validatorId) ? getObjectById(validatorId) : null);
368     }
369 
370     @Override
371     public List<String> getValidatorIds() {
372         return validatorIds;
373     }
374 
375     @Override
376     public void registerValidatorFields() {
377         SwingValidatorUtil.detectValidatorFields(this);
378     }
379 
380     /*-----------------------------------------------------------------------*/
381     /*----------------------- Public acessor methods  -----------------------*/
382     /*-----------------------------------------------------------------------*/
383 
384     public TuttiHelpBroker getBroker() {
385         return broker;
386     }
387 
388     public JButton getCalcifiedPiecesSamplingReportButton() {
389         return calcifiedPiecesSamplingReportButton;
390     }
391 
392     public JButton getCloneProtocolButton() {
393         return cloneProtocolButton;
394     }
395 
396     public BeanFilterableComboBox<Cruise> getCruiseCombobox() {
397         return cruiseCombobox;
398     }
399 
400     public JLabel getCruiseLabel() {
401         return cruiseLabel;
402     }
403 
404     public JButton getDeleteProtocolButton() {
405         return deleteProtocolButton;
406     }
407 
408     public JButton getEditCatchesButton() {
409         return editCatchesButton;
410     }
411 
412     public JButton getEditCruiseButton() {
413         return editCruiseButton;
414     }
415 
416     public JComboBox getEditCruiseComboBox() {
417         return editCruiseComboBox;
418     }
419 
420     public JButton getEditProgramButton() {
421         return editProgramButton;
422     }
423 
424     public JButton getEditProtocolButton() {
425         return editProtocolButton;
426     }
427 
428     public JComboBox getEditProtocolComboBox() {
429         return editProtocolComboBox;
430     }
431 
432     public JButton getExportCruiseForSumatraButton() {
433         return exportCruiseForSumatraButton;
434     }
435 
436     public JButton getExportProtocolButton() {
437         return exportProtocolButton;
438     }
439 
440     public SelectCruiseUIHandler getHandler() {
441         return handler;
442     }
443 
444     public JButton getImportProtocolButton() {
445         return importProtocolButton;
446     }
447 
448     public SelectCruiseUIModel getModel() {
449         return model;
450     }
451 
452     public JButton getNewCruiseButton() {
453         return newCruiseButton;
454     }
455 
456     public JButton getNewProgramButton() {
457         return newProgramButton;
458     }
459 
460     public JButton getNewProtocolButton() {
461         return newProtocolButton;
462     }
463 
464     public JComboBox getNewProtocolComboBox() {
465         return newProtocolComboBox;
466     }
467 
468     public BeanFilterableComboBox<Program> getProgramCombobox() {
469         return programCombobox;
470     }
471 
472     public JLabel getProgramLabel() {
473         return programLabel;
474     }
475 
476     public BeanFilterableComboBox<TuttiProtocol> getProtocolCombobox() {
477         return protocolCombobox;
478     }
479 
480     public JLabel getProtocolLabel() {
481         return protocolLabel;
482     }
483 
484     public JButton getSendCruiseReportButton() {
485         return sendCruiseReportButton;
486     }
487 
488     public JButton getSpeciesToConfirmReportForCruiseButton() {
489         return speciesToConfirmReportForCruiseButton;
490     }
491 
492     public JButton getValidateCatchesButton() {
493         return validateCatchesButton;
494     }
495 
496     public SwingValidator<SelectCruiseUIModel> getValidator() {
497         return validator;
498     }
499 
500     public JPanel getWarningContainer() {
501         return warningContainer;
502     }
503 
504     public JLabel getWarningLabel() {
505         return warningLabel;
506     }
507 
508     /*-----------------------------------------------------------------------*/
509     /*---------------------------- Other methods ----------------------------*/
510     /*-----------------------------------------------------------------------*/
511 
512     @Override
513     public void registerHelpId(TuttiHelpBroker broker, Component component, String helpId) {
514         broker.installUI(component, helpId);
515     }
516 
517     @Override
518     public void showHelp(String helpId) {
519         getBroker().showHelp(this, helpId);
520     }
521 
522     /*-----------------------------------------------------------------------*/
523     /*--------------------- Protected acessors methods  ---------------------*/
524     /*-----------------------------------------------------------------------*/
525 
526     protected JLabel get$JLabel0() {
527         return $JLabel0;
528     }
529 
530     protected JLabel get$JLabel1() {
531         return $JLabel1;
532     }
533 
534     protected JLabel get$JLabel2() {
535         return $JLabel2;
536     }
537 
538     protected JPanel get$JPanel0() {
539         return $JPanel0;
540     }
541 
542     protected JPanel get$JPanel1() {
543         return $JPanel1;
544     }
545 
546     protected JPanel get$JPanel2() {
547         return $JPanel2;
548     }
549 
550     protected JPanel get$JPanel3() {
551         return $JPanel3;
552     }
553 
554     protected JPanel get$JPanel4() {
555         return $JPanel4;
556     }
557 
558     protected Table get$Table0() {
559         return $Table0;
560     }
561 
562     /*-----------------------------------------------------------------------*/
563     /*--------------------- Components creation methods ---------------------*/
564     /*-----------------------------------------------------------------------*/
565 
566     protected void addChildrenToSelectCruiseTopPanel() {
567         if (!allComponentsCreated) {
568             return;
569         }
570         add(editCruiseButton);
571         add(sendCruiseReportButton);
572         add(exportCruiseForSumatraButton);
573         add(calcifiedPiecesSamplingReportButton);
574         add(speciesToConfirmReportForCruiseButton);
575         add(newProtocolButton);
576         add(importProtocolButton);
577         add(editProtocolButton);
578         add(cloneProtocolButton);
579         add(exportProtocolButton);
580         add(deleteProtocolButton);
581         add($Table0, BorderLayout.CENTER);
582     }
583 
584     protected void addChildrenToValidator() {
585         if (!allComponentsCreated) {
586             return;
587         }
588         validator.setUiClass(ImageValidationUI.class);
589         validator.setBean(model);
590     }
591 
592     protected void addChildrenToWarningContainer() {
593         if (!allComponentsCreated) {
594             return;
595         }
596         warningContainer.add(warningLabel, BorderLayout.CENTER);
597     }
598 
599     protected void createBroker() {
600         $objectMap.put("broker", broker = new TuttiHelpBroker("tutti.selectCruise.help"));
601     }
602 
603     protected void createCalcifiedPiecesSamplingReportButton() {
604         $objectMap.put("calcifiedPiecesSamplingReportButton", calcifiedPiecesSamplingReportButton = new JButton());
605         
606         calcifiedPiecesSamplingReportButton.setName("calcifiedPiecesSamplingReportButton");
607         calcifiedPiecesSamplingReportButton.setText(t("tutti.selectCruise.action.calcifiedPiecesSamplingReport"));
608         calcifiedPiecesSamplingReportButton.setToolTipText(t("tutti.selectCruise.action.calcifiedPiecesSamplingReport.tip"));
609         calcifiedPiecesSamplingReportButton.putClientProperty("help", "tutti.selectCruise.action.calcifiedPiecesSamplingReport.help");
610         calcifiedPiecesSamplingReportButton.putClientProperty("applicationAction", fr.ifremer.tutti.ui.swing.content.home.actions.CalcifiedPiecesSamplingReportAction.class);
611     }
612 
613     protected void createCloneProtocolButton() {
614         $objectMap.put("cloneProtocolButton", cloneProtocolButton = new JButton());
615         
616         cloneProtocolButton.setName("cloneProtocolButton");
617         cloneProtocolButton.setText(t("tutti.selectCruise.action.cloneProtocol"));
618         cloneProtocolButton.setToolTipText(t("tutti.selectCruise.action.cloneProtocol.tip"));
619         cloneProtocolButton.putClientProperty("help", "tutti.selectCruise.action.cloneProtocol.help");
620         cloneProtocolButton.putClientProperty("applicationAction", fr.ifremer.tutti.ui.swing.content.home.actions.CloneProtocolAction.class);
621     }
622 
623     protected void createCruiseCombobox() {
624         $objectMap.put("cruiseCombobox", cruiseCombobox = new BeanFilterableComboBox<Cruise>(this));
625         
626         cruiseCombobox.setName("cruiseCombobox");
627         cruiseCombobox.setProperty("cruise");
628         cruiseCombobox.setShowReset(true);
629         cruiseCombobox.putClientProperty("help", "tutti.selectCruise.field.cruise.help");
630         cruiseCombobox.putClientProperty("validatorLabel", t("tutti.selectCruise.field.cruise"));
631     }
632 
633     protected void createCruiseLabel() {
634         $objectMap.put("cruiseLabel", cruiseLabel = new JLabel());
635         
636         cruiseLabel.setName("cruiseLabel");
637         cruiseLabel.setText(t("tutti.selectCruise.field.cruise"));
638         cruiseLabel.setToolTipText(t("tutti.selectCruise.field.cruise.tip"));
639         cruiseLabel.putClientProperty("help", "tutti.selectCruise.field.cruise.help");
640     }
641 
642     protected void createDeleteProtocolButton() {
643         $objectMap.put("deleteProtocolButton", deleteProtocolButton = new JButton());
644         
645         deleteProtocolButton.setName("deleteProtocolButton");
646         deleteProtocolButton.setText(t("tutti.selectCruise.action.deleteProtocol"));
647         deleteProtocolButton.setToolTipText(t("tutti.selectCruise.action.deleteProtocol.tip"));
648         deleteProtocolButton.putClientProperty("help", "tutti.selectCruise.action.deleteProtocol.help");
649         deleteProtocolButton.putClientProperty("applicationAction", fr.ifremer.tutti.ui.swing.content.home.actions.DeleteProtocolAction.class);
650     }
651 
652     protected void createEditCatchesButton() {
653         $objectMap.put("editCatchesButton", editCatchesButton = new JButton());
654         
655         editCatchesButton.setName("editCatchesButton");
656         editCatchesButton.setText(t("tutti.selectCruise.action.editCatches"));
657         editCatchesButton.setToolTipText(t("tutti.selectCruise.action.editCatches.tip"));
658         editCatchesButton.putClientProperty("help", "tutti.selectCruise.action.editCatches.help");
659         editCatchesButton.putClientProperty("applicationAction", fr.ifremer.tutti.ui.swing.content.home.actions.EditCatchesAction.class);
660     }
661 
662     protected void createEditCruiseButton() {
663         $objectMap.put("editCruiseButton", editCruiseButton = new JButton());
664         
665         editCruiseButton.setName("editCruiseButton");
666         editCruiseButton.setText(t("tutti.selectCruise.action.editCruise"));
667         editCruiseButton.setToolTipText(t("tutti.selectCruise.action.editCruise.tip"));
668         editCruiseButton.putClientProperty("help", "tutti.selectCruise.action.editCruise.help");
669         editCruiseButton.putClientProperty("applicationAction", fr.ifremer.tutti.ui.swing.content.home.actions.EditCruiseAction.class);
670     }
671 
672     protected void createEditCruiseComboBox() {
673         $objectMap.put("editCruiseComboBox", editCruiseComboBox = new JComboBox());
674         
675         editCruiseComboBox.setName("editCruiseComboBox");
676         editCruiseComboBox.putClientProperty("comboboxActions", Arrays.asList(editCruiseButton, sendCruiseReportButton, exportCruiseForSumatraButton, calcifiedPiecesSamplingReportButton, speciesToConfirmReportForCruiseButton));
677     }
678 
679     protected void createEditProgramButton() {
680         $objectMap.put("editProgramButton", editProgramButton = new JButton());
681         
682         editProgramButton.setName("editProgramButton");
683         editProgramButton.setText(t("tutti.selectCruise.action.editProgram"));
684         editProgramButton.setToolTipText(t("tutti.selectCruise.action.editProgram.tip"));
685         editProgramButton.putClientProperty("help", "tutti.selectCruise.action.editProgram.help");
686         editProgramButton.putClientProperty("applicationAction", fr.ifremer.tutti.ui.swing.content.home.actions.EditProgramAction.class);
687     }
688 
689     protected void createEditProtocolButton() {
690         $objectMap.put("editProtocolButton", editProtocolButton = new JButton());
691         
692         editProtocolButton.setName("editProtocolButton");
693         editProtocolButton.setText(t("tutti.selectCruise.action.editProtocol"));
694         editProtocolButton.setToolTipText(t("tutti.selectCruise.action.editProtocol.tip"));
695         editProtocolButton.putClientProperty("help", "tutti.selectCruise.action.editProtocol.help");
696         editProtocolButton.putClientProperty("applicationAction", fr.ifremer.tutti.ui.swing.content.home.actions.EditProtocolAction.class);
697     }
698 
699     protected void createEditProtocolComboBox() {
700         $objectMap.put("editProtocolComboBox", editProtocolComboBox = new JComboBox());
701         
702         editProtocolComboBox.setName("editProtocolComboBox");
703         editProtocolComboBox.putClientProperty("comboboxActions", Arrays.asList(editProtocolButton, cloneProtocolButton, exportProtocolButton, deleteProtocolButton));
704     }
705 
706     protected void createExportCruiseForSumatraButton() {
707         $objectMap.put("exportCruiseForSumatraButton", exportCruiseForSumatraButton = new JButton());
708         
709         exportCruiseForSumatraButton.setName("exportCruiseForSumatraButton");
710         exportCruiseForSumatraButton.setText(t("tutti.selectCruise.action.exportCruiseForSumatra"));
711         exportCruiseForSumatraButton.setToolTipText(t("tutti.selectCruise.action.exportCruiseForSumatra.tip"));
712         exportCruiseForSumatraButton.putClientProperty("help", "tutti.selectCruise.action.exportCruiseForSumatra.help");
713         exportCruiseForSumatraButton.putClientProperty("applicationAction", fr.ifremer.tutti.ui.swing.content.home.actions.ExportCruiseForSumatraAction.class);
714     }
715 
716     protected void createExportProtocolButton() {
717         $objectMap.put("exportProtocolButton", exportProtocolButton = new JButton());
718         
719         exportProtocolButton.setName("exportProtocolButton");
720         exportProtocolButton.setText(t("tutti.selectCruise.action.exportProtocol"));
721         exportProtocolButton.setToolTipText(t("tutti.selectCruise.action.exportProtocol.tip"));
722         exportProtocolButton.putClientProperty("help", "tutti.selectCruise.action.exportProtocol.help");
723         exportProtocolButton.putClientProperty("applicationAction", fr.ifremer.tutti.ui.swing.content.home.actions.ExportProtocolAction.class);
724     }
725 
726     protected SelectCruiseUIHandler createHandler() {
727         return new SelectCruiseUIHandler();
728     }
729 
730     protected void createImportProtocolButton() {
731         $objectMap.put("importProtocolButton", importProtocolButton = new JButton());
732         
733         importProtocolButton.setName("importProtocolButton");
734         importProtocolButton.setText(t("tutti.selectCruise.action.importProtocol"));
735         importProtocolButton.setToolTipText(t("tutti.selectCruise.action.importProtocol.tip"));
736         importProtocolButton.putClientProperty("help", "tutti.selectCruise.action.importProtocol.help");
737         importProtocolButton.putClientProperty("applicationAction", fr.ifremer.tutti.ui.swing.content.home.actions.ImportProtocolAction.class);
738     }
739 
740     protected void createModel() {
741         $objectMap.put("model", model = getContextValue(SelectCruiseUIModel.class));
742     }
743 
744     protected void createNewCruiseButton() {
745         $objectMap.put("newCruiseButton", newCruiseButton = new JButton());
746         
747         newCruiseButton.setName("newCruiseButton");
748         newCruiseButton.setText(t("tutti.selectCruise.action.newCruise"));
749         newCruiseButton.setToolTipText(t("tutti.selectCruise.action.newCruise.tip"));
750         newCruiseButton.putClientProperty("help", "tutti.selectCruise.action.newCruise.help");
751         newCruiseButton.putClientProperty("applicationAction", fr.ifremer.tutti.ui.swing.content.home.actions.NewCruiseAction.class);
752     }
753 
754     protected void createNewProgramButton() {
755         $objectMap.put("newProgramButton", newProgramButton = new JButton());
756         
757         newProgramButton.setName("newProgramButton");
758         newProgramButton.setText(t("tutti.selectCruise.action.newProgram"));
759         newProgramButton.setToolTipText(t("tutti.selectCruise.action.newProgram.tip"));
760         newProgramButton.putClientProperty("help", "tutti.selectCruise.action.newProgram.help");
761         newProgramButton.putClientProperty("applicationAction", fr.ifremer.tutti.ui.swing.content.home.actions.NewProgramAction.class);
762     }
763 
764     protected void createNewProtocolButton() {
765         $objectMap.put("newProtocolButton", newProtocolButton = new JButton());
766         
767         newProtocolButton.setName("newProtocolButton");
768         newProtocolButton.setText(t("tutti.selectCruise.action.newProtocol"));
769         newProtocolButton.setToolTipText(t("tutti.selectCruise.action.newProtocol.tip"));
770         newProtocolButton.putClientProperty("help", "tutti.selectCruise.action.newProtocol.help");
771         newProtocolButton.putClientProperty("applicationAction", fr.ifremer.tutti.ui.swing.content.home.actions.NewProtocolAction.class);
772     }
773 
774     protected void createNewProtocolComboBox() {
775         $objectMap.put("newProtocolComboBox", newProtocolComboBox = new JComboBox());
776         
777         newProtocolComboBox.setName("newProtocolComboBox");
778         newProtocolComboBox.putClientProperty("comboboxActions", Arrays.asList(newProtocolButton, importProtocolButton));
779     }
780 
781     protected void createProgramCombobox() {
782         $objectMap.put("programCombobox", programCombobox = new BeanFilterableComboBox<Program>(this));
783         
784         programCombobox.setName("programCombobox");
785         programCombobox.setProperty("program");
786         programCombobox.setShowReset(true);
787         programCombobox.putClientProperty("help", "tutti.selectCruise.field.program.help");
788         programCombobox.putClientProperty("validatorLabel", t("tutti.selectCruise.field.program"));
789     }
790 
791     protected void createProgramLabel() {
792         $objectMap.put("programLabel", programLabel = new JLabel());
793         
794         programLabel.setName("programLabel");
795         programLabel.setText(t("tutti.selectCruise.field.program"));
796         programLabel.setToolTipText(t("tutti.selectCruise.field.program.tip"));
797         programLabel.putClientProperty("help", "tutti.selectCruise.field.program.help");
798     }
799 
800     protected void createProtocolCombobox() {
801         $objectMap.put("protocolCombobox", protocolCombobox = new BeanFilterableComboBox<TuttiProtocol>(this));
802         
803         protocolCombobox.setName("protocolCombobox");
804         protocolCombobox.setProperty("protocol");
805         protocolCombobox.setShowReset(true);
806         protocolCombobox.putClientProperty("help", "tutti.selectCruise.field.protocol.help");
807         protocolCombobox.putClientProperty("validatorLabel", t("tutti.selectCruise.field.protocol"));
808     }
809 
810     protected void createProtocolLabel() {
811         $objectMap.put("protocolLabel", protocolLabel = new JLabel());
812         
813         protocolLabel.setName("protocolLabel");
814         protocolLabel.setText(t("tutti.selectCruise.field.protocol"));
815         protocolLabel.setToolTipText(t("tutti.selectCruise.field.protocol.tip"));
816         protocolLabel.putClientProperty("help", "tutti.selectCruise.field.protocol.help");
817     }
818 
819     protected void createSendCruiseReportButton() {
820         $objectMap.put("sendCruiseReportButton", sendCruiseReportButton = new JButton());
821         
822         sendCruiseReportButton.setName("sendCruiseReportButton");
823         sendCruiseReportButton.setText(t("tutti.selectCruise.action.sendCruiseReport"));
824         sendCruiseReportButton.setToolTipText(t("tutti.selectCruise.action.sendCruiseReport.tip"));
825         sendCruiseReportButton.putClientProperty("help", "tutti.selectCruise.action.sendCruiseReport.help");
826         sendCruiseReportButton.putClientProperty("applicationAction", fr.ifremer.tutti.ui.swing.content.home.actions.SendCruiseReportAction.class);
827     }
828 
829     protected void createSpeciesToConfirmReportForCruiseButton() {
830         $objectMap.put("speciesToConfirmReportForCruiseButton", speciesToConfirmReportForCruiseButton = new JButton());
831         
832         speciesToConfirmReportForCruiseButton.setName("speciesToConfirmReportForCruiseButton");
833         speciesToConfirmReportForCruiseButton.setText(t("tutti.selectCruise.action.speciesToConfirmReportForCruise"));
834         speciesToConfirmReportForCruiseButton.setToolTipText(t("tutti.selectCruise.action.speciesToConfirmReportForCruise.tip"));
835         speciesToConfirmReportForCruiseButton.putClientProperty("help", "tutti.selectCruise.action.speciesToConfirmReportForCruise.help");
836         speciesToConfirmReportForCruiseButton.putClientProperty("applicationAction", fr.ifremer.tutti.ui.swing.content.home.actions.SpeciesToConfirmReportForCruiseAction.class);
837     }
838 
839     protected void createValidateCatchesButton() {
840         $objectMap.put("validateCatchesButton", validateCatchesButton = new JButton());
841         
842         validateCatchesButton.setName("validateCatchesButton");
843         validateCatchesButton.setText(t("tutti.selectCruise.action.validateCatches"));
844         validateCatchesButton.setToolTipText(t("tutti.selectCruise.action.validateCatches.tip"));
845         validateCatchesButton.putClientProperty("help", "tutti.selectCruise.action.validateCatches.help");
846         validateCatchesButton.putClientProperty("applicationAction", fr.ifremer.tutti.ui.swing.content.home.actions.ValidateCatchesAction.class);
847     }
848 
849     protected void createValidator() {
850         $objectMap.put("validator", validator = SwingValidator.newValidator(SelectCruiseUIModel.class, null));
851     }
852 
853     protected void createWarningContainer() {
854         $objectMap.put("warningContainer", warningContainer = new JPanel());
855         
856         warningContainer.setName("warningContainer");
857         warningContainer.setLayout(new BorderLayout(10, 10));
858     }
859 
860     protected void createWarningLabel() {
861         $objectMap.put("warningLabel", warningLabel = new JLabel());
862         
863         warningLabel.setName("warningLabel");
864         warningLabel.setText(t("tutti.selectCruise.warn.invalid.selected.data"));
865     }
866 
867     /*-----------------------------------------------------------------------*/
868     /*------------------------ Internal jaxx methods ------------------------*/
869     /*-----------------------------------------------------------------------*/
870 
871     private void $completeSetup() {
872         allComponentsCreated = true;
873         if (log.isDebugEnabled()) {
874             log.debug(this);
875         }
876         addChildrenToSelectCruiseTopPanel();
877         addChildrenToValidator();
878         // inline complete setup of $Table0
879         $Table0.add($JPanel0, new GridBagConstraints(0, 0, 3, 1, 0.0, 0.2, 10, 1, new Insets(3, 3, 3, 3), 0, 0));
880         $Table0.add(warningContainer, new GridBagConstraints(0, 1, 3, 1, 0.0, 0.0, 10, 1, new Insets(3, 3, 3, 3), 0, 0));
881         $Table0.add(programLabel, new GridBagConstraints(0, 2, 1, 1, 0.0, 0.0, 17, 1, new Insets(3, 3, 3, 3), 0, 0));
882         $Table0.add(SwingUtil.boxComponentWithJxLayer(programCombobox), new GridBagConstraints(1, 2, 1, 1, 1.0, 0.0, 10, 1, new Insets(3, 3, 3, 3), 0, 0));
883         $Table0.add($JPanel1, new GridBagConstraints(2, 2, 1, 1, 0.0, 0.0, 10, 1, new Insets(3, 3, 3, 3), 0, 0));
884         $Table0.add(cruiseLabel, new GridBagConstraints(0, 3, 1, 1, 0.0, 0.0, 10, 1, new Insets(3, 3, 3, 3), 0, 0));
885         $Table0.add(SwingUtil.boxComponentWithJxLayer(cruiseCombobox), new GridBagConstraints(1, 3, 1, 1, 0.0, 0.0, 10, 1, new Insets(3, 3, 3, 3), 0, 0));
886         $Table0.add($JPanel2, new GridBagConstraints(2, 3, 1, 1, 0.0, 0.0, 10, 1, new Insets(3, 3, 3, 3), 0, 0));
887         $Table0.add(protocolLabel, new GridBagConstraints(0, 4, 1, 1, 0.0, 0.0, 10, 1, new Insets(3, 3, 3, 3), 0, 0));
888         $Table0.add(SwingUtil.boxComponentWithJxLayer(protocolCombobox), new GridBagConstraints(1, 4, 1, 1, 0.0, 0.0, 10, 1, new Insets(3, 3, 3, 3), 0, 0));
889         $Table0.add($JPanel3, new GridBagConstraints(2, 4, 1, 1, 0.0, 0.0, 10, 1, new Insets(3, 3, 3, 3), 0, 0));
890         $Table0.add($JPanel4, new GridBagConstraints(0, 5, 3, 2, 0.0, 0.3, 10, 1, new Insets(3, 3, 3, 3), 0, 0));
891         // inline complete setup of $JPanel0
892         $JPanel0.add($JLabel0, BorderLayout.CENTER);
893         addChildrenToWarningContainer();
894         // inline complete setup of $JPanel1
895         $JPanel1.add(editProgramButton);
896         $JPanel1.add(newProgramButton);
897         // inline complete setup of $JPanel2
898         $JPanel2.add(editCruiseComboBox);
899         $JPanel2.add(newCruiseButton);
900         // inline complete setup of $JPanel3
901         $JPanel3.add(editProtocolComboBox);
902         $JPanel3.add(newProtocolComboBox);
903         // inline complete setup of $JPanel4
904         $JPanel4.add(editCatchesButton);
905         $JPanel4.add(validateCatchesButton);
906         $JPanel4.add($JLabel1);
907         $JPanel4.add($JLabel2);
908         
909         // apply 22 data bindings
910         JAXXUtil.applyDataBinding(this, $bindings.keySet());
911         
912         // apply 38 property setters
913         programCombobox.setBeanType(Program.class);
914         cruiseCombobox.setBeanType(Cruise.class);
915         protocolCombobox.setBeanType(TuttiProtocol.class);
916         editCruiseButton.setIcon(SwingUtil.createActionIcon("edit"));
917         sendCruiseReportButton.setIcon(SwingUtil.createActionIcon("email"));
918         exportCruiseForSumatraButton.setIcon(SwingUtil.createActionIcon("export"));
919         calcifiedPiecesSamplingReportButton.setIcon(SwingUtil.createActionIcon("report"));
920         speciesToConfirmReportForCruiseButton.setIcon(SwingUtil.createActionIcon("report"));
921         newProtocolButton.setIcon(SwingUtil.createActionIcon("add"));
922         importProtocolButton.setIcon(SwingUtil.createActionIcon("import"));
923         editProtocolButton.setIcon(SwingUtil.createActionIcon("edit"));
924         cloneProtocolButton.setIcon(SwingUtil.createActionIcon("copy"));
925         exportProtocolButton.setIcon(SwingUtil.createActionIcon("export"));
926         deleteProtocolButton.setIcon(SwingUtil.createActionIcon("delete"));
927         warningContainer.setBackground(new java.awt.Color(245, 218, 88));
928         warningLabel.setBorder(new javax.swing.border.EmptyBorder(5, 10, 5, 10));
929         warningLabel.setIcon(SwingUtil.createActionIcon("warning"));
930         programLabel.setIcon(SwingUtil.createActionIcon("program"));
931         programCombobox.setBean(model);
932         editProgramButton.setIcon(SwingUtil.createActionIcon("edit"));
933         newProgramButton.setIcon(SwingUtil.createActionIcon("add"));
934         cruiseLabel.setLabelFor(cruiseCombobox);
935         cruiseCombobox.setBean(model);
936         newCruiseButton.setIcon(SwingUtil.createActionIcon("add"));
937         protocolLabel.setLabelFor(protocolCombobox);
938         protocolLabel.setIcon(SwingUtil.createActionIcon("protocol"));
939         protocolCombobox.setBean(model);
940         editCatchesButton.setMnemonic(SwingUtil.getFirstCharAt(t("tutti.selectCruise.action.editCatches.mnemonic"),'Z'));
941         editCatchesButton.setIcon(SwingUtil.createActionIcon("edit"));
942         validateCatchesButton.setMnemonic(SwingUtil.getFirstCharAt(t("tutti.selectCruise.action.validateCatches.mnemonic"),'Z'));
943         validateCatchesButton.setIcon(SwingUtil.createActionIcon("validate"));
944         // late initializer
945         // help broker setup
946         TuttiHelpBroker _broker = getBroker();
947         registerHelpId(_broker, selectCruiseTopPanel, "tutti.selectCruise.help");
948         registerHelpId(_broker, editCruiseButton, "tutti.selectCruise.action.editCruise.help");
949         registerHelpId(_broker, sendCruiseReportButton, "tutti.selectCruise.action.sendCruiseReport.help");
950         registerHelpId(_broker, exportCruiseForSumatraButton, "tutti.selectCruise.action.exportCruiseForSumatra.help");
951         registerHelpId(_broker, calcifiedPiecesSamplingReportButton, "tutti.selectCruise.action.calcifiedPiecesSamplingReport.help");
952         registerHelpId(_broker, speciesToConfirmReportForCruiseButton, "tutti.selectCruise.action.speciesToConfirmReportForCruise.help");
953         registerHelpId(_broker, newProtocolButton, "tutti.selectCruise.action.newProtocol.help");
954         registerHelpId(_broker, importProtocolButton, "tutti.selectCruise.action.importProtocol.help");
955         registerHelpId(_broker, editProtocolButton, "tutti.selectCruise.action.editProtocol.help");
956         registerHelpId(_broker, cloneProtocolButton, "tutti.selectCruise.action.cloneProtocol.help");
957         registerHelpId(_broker, exportProtocolButton, "tutti.selectCruise.action.exportProtocol.help");
958         registerHelpId(_broker, deleteProtocolButton, "tutti.selectCruise.action.deleteProtocol.help");
959         registerHelpId(_broker, programLabel, "tutti.selectCruise.field.program.help");
960         registerHelpId(_broker, programCombobox, "tutti.selectCruise.field.program.help");
961         registerHelpId(_broker, editProgramButton, "tutti.selectCruise.action.editProgram.help");
962         registerHelpId(_broker, newProgramButton, "tutti.selectCruise.action.newProgram.help");
963         registerHelpId(_broker, cruiseLabel, "tutti.selectCruise.field.cruise.help");
964         registerHelpId(_broker, cruiseCombobox, "tutti.selectCruise.field.cruise.help");
965         registerHelpId(_broker, newCruiseButton, "tutti.selectCruise.action.newCruise.help");
966         registerHelpId(_broker, protocolLabel, "tutti.selectCruise.field.protocol.help");
967         registerHelpId(_broker, protocolCombobox, "tutti.selectCruise.field.protocol.help");
968         registerHelpId(_broker, editCatchesButton, "tutti.selectCruise.action.editCatches.help");
969         registerHelpId(_broker, validateCatchesButton, "tutti.selectCruise.action.validateCatches.help");
970         _broker.prepareUI(this);
971         // register 1 validator(s)
972         validatorIds = SwingValidatorUtil.detectValidators(this);
973         SwingValidatorUtil.installUI(this);
974     }
975 
976     private void $initialize() {
977         if (allComponentsCreated) {
978             return;
979         }
980         if (log.isDebugEnabled()) {
981             log.debug(this);
982         }
983         handler.beforeInit(this);
984         $objectMap.put("selectCruiseTopPanel", selectCruiseTopPanel);
985         createModel();
986         createValidator();
987         createBroker();
988         createEditCruiseButton();
989         createSendCruiseReportButton();
990         createExportCruiseForSumatraButton();
991         createCalcifiedPiecesSamplingReportButton();
992         createSpeciesToConfirmReportForCruiseButton();
993         createNewProtocolButton();
994         createImportProtocolButton();
995         createEditProtocolButton();
996         createCloneProtocolButton();
997         createExportProtocolButton();
998         createDeleteProtocolButton();
999         // inline creation of $Table0
1000         $objectMap.put("$Table0", $Table0 = new Table());
1001         
1002         $Table0.setName("$Table0");
1003         // inline creation of $JPanel0
1004         $objectMap.put("$JPanel0", $JPanel0 = new JPanel());
1005         
1006         $JPanel0.setName("$JPanel0");
1007         $JPanel0.setLayout(new BorderLayout());
1008         // inline creation of $JLabel0
1009         $objectMap.put("$JLabel0", $JLabel0 = new JLabel());
1010         
1011         $JLabel0.setName("$JLabel0");
1012         createWarningContainer();
1013         createWarningLabel();
1014         createProgramLabel();
1015         createProgramCombobox();
1016         // inline creation of $JPanel1
1017         $objectMap.put("$JPanel1", $JPanel1 = new JPanel());
1018         
1019         $JPanel1.setName("$JPanel1");
1020         $JPanel1.setLayout(new GridLayout(1,0));
1021         createEditProgramButton();
1022         createNewProgramButton();
1023         createCruiseLabel();
1024         createCruiseCombobox();
1025         // inline creation of $JPanel2
1026         $objectMap.put("$JPanel2", $JPanel2 = new JPanel());
1027         
1028         $JPanel2.setName("$JPanel2");
1029         $JPanel2.setLayout(new GridLayout(1,0));
1030         createEditCruiseComboBox();
1031         createNewCruiseButton();
1032         createProtocolLabel();
1033         createProtocolCombobox();
1034         // inline creation of $JPanel3
1035         $objectMap.put("$JPanel3", $JPanel3 = new JPanel());
1036         
1037         $JPanel3.setName("$JPanel3");
1038         $JPanel3.setLayout(new GridLayout(1,0));
1039         createEditProtocolComboBox();
1040         createNewProtocolComboBox();
1041         // inline creation of $JPanel4
1042         $objectMap.put("$JPanel4", $JPanel4 = new JPanel());
1043         
1044         $JPanel4.setName("$JPanel4");
1045         $JPanel4.setLayout(new GridLayout(2,0));
1046         createEditCatchesButton();
1047         createValidateCatchesButton();
1048         // inline creation of $JLabel1
1049         $objectMap.put("$JLabel1", $JLabel1 = new JLabel());
1050         
1051         $JLabel1.setName("$JLabel1");
1052         // inline creation of $JLabel2
1053         $objectMap.put("$JLabel2", $JLabel2 = new JLabel());
1054         
1055         $JLabel2.setName("$JLabel2");
1056         // inline creation of selectCruiseTopPanel
1057         setName("selectCruiseTopPanel");
1058         setLayout(new BorderLayout());
1059         selectCruiseTopPanel.putClientProperty("help", "tutti.selectCruise.help");
1060         
1061         // registers 22 data bindings
1062         $registerDefaultBindings();
1063         $completeSetup();
1064         handler.afterInit(this);
1065     }
1066 
1067     private void $registerDefaultBindings() {
1068         // register 22 data bindings
1069         registerDataBinding(new DefaultJAXXBinding(this, BINDING_EDIT_CRUISE_BUTTON_ENABLED, true) {
1070         
1071             @Override
1072             public void applyDataBinding() {
1073                 if (model != null) {
1074                     model.addPropertyChangeListener("cruiseFound", this);
1075                 }
1076             }
1077         
1078             @Override
1079             public void processDataBinding() {
1080                 if (model != null) {
1081                     editCruiseButton.setEnabled(model.isCruiseFound());
1082                 }
1083             }
1084         
1085             @Override
1086             public void removeDataBinding() {
1087                 if (model != null) {
1088                     model.removePropertyChangeListener("cruiseFound", this);
1089                 }
1090             }
1091         });
1092         registerDataBinding(new DefaultJAXXBinding(this, BINDING_NEW_PROTOCOL_BUTTON_ENABLED, true) {
1093         
1094             @Override
1095             public void applyDataBinding() {
1096                 if (model != null) {
1097                     model.addPropertyChangeListener("programFound", this);
1098                 }
1099             }
1100         
1101             @Override
1102             public void processDataBinding() {
1103                 if (model != null) {
1104                     newProtocolButton.setEnabled(model.isProgramFound());
1105                 }
1106             }
1107         
1108             @Override
1109             public void removeDataBinding() {
1110                 if (model != null) {
1111                     model.removePropertyChangeListener("programFound", this);
1112                 }
1113             }
1114         });
1115         registerDataBinding(new DefaultJAXXBinding(this, BINDING_IMPORT_PROTOCOL_BUTTON_ENABLED, true) {
1116         
1117             @Override
1118             public void applyDataBinding() {
1119                 if (model != null) {
1120                     model.addPropertyChangeListener("programFound", this);
1121                 }
1122             }
1123         
1124             @Override
1125             public void processDataBinding() {
1126                 if (model != null) {
1127                     importProtocolButton.setEnabled(model.isProgramFound());
1128                 }
1129             }
1130         
1131             @Override
1132             public void removeDataBinding() {
1133                 if (model != null) {
1134                     model.removePropertyChangeListener("programFound", this);
1135                 }
1136             }
1137         });
1138         registerDataBinding(new DefaultJAXXBinding(this, BINDING_EDIT_PROTOCOL_BUTTON_ENABLED, true, true) {
1139         
1140             @Override
1141             public void applyDataBinding() {
1142                 if (model != null) {
1143                     model.addPropertyChangeListener("protocolFound", this);
1144                 }
1145                 if (model != null) {
1146                     model.addPropertyChangeListener("programFound", this);
1147                 }
1148             }
1149         
1150             @Override
1151             public void processDataBinding() {
1152                 if (model != null) {
1153                     editProtocolButton.setEnabled(model.isProtocolFound() && model.isProgramFound());
1154                 }
1155             }
1156         
1157             @Override
1158             public void removeDataBinding() {
1159                 if (model != null) {
1160                     model.removePropertyChangeListener("protocolFound", this);
1161                 }
1162                 if (model != null) {
1163                     model.removePropertyChangeListener("programFound", this);
1164                 }
1165             }
1166         });
1167         registerDataBinding(new DefaultJAXXBinding(this, BINDING_CLONE_PROTOCOL_BUTTON_ENABLED, true, true) {
1168         
1169             @Override
1170             public void applyDataBinding() {
1171                 if (model != null) {
1172                     model.addPropertyChangeListener("protocolFound", this);
1173                 }
1174                 if (model != null) {
1175                     model.addPropertyChangeListener("programFound", this);
1176                 }
1177             }
1178         
1179             @Override
1180             public void processDataBinding() {
1181                 if (model != null) {
1182                     cloneProtocolButton.setEnabled(model.isProtocolFound() && model.isProgramFound());
1183                 }
1184             }
1185         
1186             @Override
1187             public void removeDataBinding() {
1188                 if (model != null) {
1189                     model.removePropertyChangeListener("protocolFound", this);
1190                 }
1191                 if (model != null) {
1192                     model.removePropertyChangeListener("programFound", this);
1193                 }
1194             }
1195         });
1196         registerDataBinding(new DefaultJAXXBinding(this, BINDING_EXPORT_PROTOCOL_BUTTON_ENABLED, true) {
1197         
1198             @Override
1199             public void applyDataBinding() {
1200                 if (model != null) {
1201                     model.addPropertyChangeListener("protocolFound", this);
1202                 }
1203             }
1204         
1205             @Override
1206             public void processDataBinding() {
1207                 if (model != null) {
1208                     exportProtocolButton.setEnabled(model.isProtocolFound());
1209                 }
1210             }
1211         
1212             @Override
1213             public void removeDataBinding() {
1214                 if (model != null) {
1215                     model.removePropertyChangeListener("protocolFound", this);
1216                 }
1217             }
1218         });
1219         registerDataBinding(new DefaultJAXXBinding(this, BINDING_DELETE_PROTOCOL_BUTTON_ENABLED, true) {
1220         
1221             @Override
1222             public void applyDataBinding() {
1223                 if (model != null) {
1224                     model.addPropertyChangeListener("protocolFound", this);
1225                 }
1226             }
1227         
1228             @Override
1229             public void processDataBinding() {
1230                 if (model != null) {
1231                     deleteProtocolButton.setEnabled(model.isProtocolFound());
1232                 }
1233             }
1234         
1235             @Override
1236             public void removeDataBinding() {
1237                 if (model != null) {
1238                     model.removePropertyChangeListener("protocolFound", this);
1239                 }
1240             }
1241         });
1242         registerDataBinding(new DefaultJAXXBinding(this, BINDING_WARNING_CONTAINER_VISIBLE, true) {
1243         
1244             @Override
1245             public void applyDataBinding() {
1246                 if (model != null) {
1247                     model.addPropertyChangeListener("valid", this);
1248                 }
1249             }
1250         
1251             @Override
1252             public void processDataBinding() {
1253                 if (model != null) {
1254                     warningContainer.setVisible(!model.isValid());
1255                 }
1256             }
1257         
1258             @Override
1259             public void removeDataBinding() {
1260                 if (model != null) {
1261                     model.removePropertyChangeListener("valid", this);
1262                 }
1263             }
1264         });
1265         registerDataBinding(new DefaultJAXXBinding(this, BINDING_PROGRAM_COMBOBOX_SELECTED_ITEM, true) {
1266         
1267             @Override
1268             public void applyDataBinding() {
1269                 if (model != null) {
1270                     model.addPropertyChangeListener("program", this);
1271                 }
1272             }
1273         
1274             @Override
1275             public void processDataBinding() {
1276                 if (model != null) {
1277                     programCombobox.setSelectedItem(model.getProgram());
1278                 }
1279             }
1280         
1281             @Override
1282             public void removeDataBinding() {
1283                 if (model != null) {
1284                     model.removePropertyChangeListener("program", this);
1285                 }
1286             }
1287         });
1288         registerDataBinding(new DefaultJAXXBinding(this, BINDING_PROGRAM_COMBOBOX_ENABLED, true) {
1289         
1290             @Override
1291             public void applyDataBinding() {
1292                 if (programCombobox != null) {
1293                     programCombobox.addPropertyChangeListener("empty", this);
1294                 }
1295             }
1296         
1297             @Override
1298             public void processDataBinding() {
1299                 if (programCombobox != null) {
1300                     programCombobox.setEnabled(!programCombobox.isEmpty());
1301                 }
1302             }
1303         
1304             @Override
1305             public void removeDataBinding() {
1306                 if (programCombobox != null) {
1307                     programCombobox.removePropertyChangeListener("empty", this);
1308                 }
1309             }
1310         });
1311         registerDataBinding(new DefaultJAXXBinding(this, BINDING_EDIT_PROGRAM_BUTTON_ENABLED, true) {
1312         
1313             @Override
1314             public void applyDataBinding() {
1315                 if (model != null) {
1316                     model.addPropertyChangeListener("program", this);
1317                 }
1318             }
1319         
1320             @Override
1321             public void processDataBinding() {
1322                 if (model != null) {
1323                     editProgramButton.setEnabled(model.getProgram() != null);
1324                 }
1325             }
1326         
1327             @Override
1328             public void removeDataBinding() {
1329                 if (model != null) {
1330                     model.removePropertyChangeListener("program", this);
1331                 }
1332             }
1333         });
1334         registerDataBinding(new DefaultJAXXBinding(this, BINDING_CRUISE_LABEL_ICON, true) {
1335         
1336             @Override
1337             public void applyDataBinding() {
1338                 if (model != null) {
1339                     model.addPropertyChangeListener("cruise", this);
1340                 }
1341             }
1342         
1343             @Override
1344             public void processDataBinding() {
1345                 if (model != null) {
1346                     cruiseLabel.setIcon(TuttiUIUtil.getCruiseIcon(model.getCruise()));
1347                 }
1348             }
1349         
1350             @Override
1351             public void removeDataBinding() {
1352                 if (model != null) {
1353                     model.removePropertyChangeListener("cruise", this);
1354                 }
1355             }
1356         });
1357         registerDataBinding(new DefaultJAXXBinding(this, BINDING_CRUISE_COMBOBOX_SELECTED_ITEM, true) {
1358         
1359             @Override
1360             public void applyDataBinding() {
1361                 if (model != null) {
1362                     model.addPropertyChangeListener("cruise", this);
1363                 }
1364             }
1365         
1366             @Override
1367             public void processDataBinding() {
1368                 if (model != null) {
1369                     cruiseCombobox.setSelectedItem(model.getCruise());
1370                 }
1371             }
1372         
1373             @Override
1374             public void removeDataBinding() {
1375                 if (model != null) {
1376                     model.removePropertyChangeListener("cruise", this);
1377                 }
1378             }
1379         });
1380         registerDataBinding(new DefaultJAXXBinding(this, BINDING_CRUISE_COMBOBOX_ENABLED, true) {
1381         
1382             @Override
1383             public void applyDataBinding() {
1384                 if (cruiseCombobox != null) {
1385                     cruiseCombobox.addPropertyChangeListener("empty", this);
1386                 }
1387             }
1388         
1389             @Override
1390             public void processDataBinding() {
1391                 if (cruiseCombobox != null) {
1392                     cruiseCombobox.setEnabled(!cruiseCombobox.isEmpty());
1393                 }
1394             }
1395         
1396             @Override
1397             public void removeDataBinding() {
1398                 if (cruiseCombobox != null) {
1399                     cruiseCombobox.removePropertyChangeListener("empty", this);
1400                 }
1401             }
1402         });
1403         registerDataBinding(new DefaultJAXXBinding(this, BINDING_EDIT_CRUISE_COMBO_BOX_ENABLED, true, true) {
1404         
1405             @Override
1406             public void applyDataBinding() {
1407                 if (model != null) {
1408                     model.addPropertyChangeListener("programFound", this);
1409                 }
1410                 if (model != null) {
1411                     model.addPropertyChangeListener("cruiseFound", this);
1412                 }
1413             }
1414         
1415             @Override
1416             public void processDataBinding() {
1417                 if (model != null) {
1418                     editCruiseComboBox.setEnabled(model.isProgramFound() && model.isCruiseFound());
1419                 }
1420             }
1421         
1422             @Override
1423             public void removeDataBinding() {
1424                 if (model != null) {
1425                     model.removePropertyChangeListener("programFound", this);
1426                 }
1427                 if (model != null) {
1428                     model.removePropertyChangeListener("cruiseFound", this);
1429                 }
1430             }
1431         });
1432         registerDataBinding(new DefaultJAXXBinding(this, BINDING_NEW_CRUISE_BUTTON_ENABLED, true) {
1433         
1434             @Override
1435             public void applyDataBinding() {
1436                 if (model != null) {
1437                     model.addPropertyChangeListener("programFound", this);
1438                 }
1439             }
1440         
1441             @Override
1442             public void processDataBinding() {
1443                 if (model != null) {
1444                     newCruiseButton.setEnabled(model.isProgramFound());
1445                 }
1446             }
1447         
1448             @Override
1449             public void removeDataBinding() {
1450                 if (model != null) {
1451                     model.removePropertyChangeListener("programFound", this);
1452                 }
1453             }
1454         });
1455         registerDataBinding(new DefaultJAXXBinding(this, BINDING_PROTOCOL_COMBOBOX_SELECTED_ITEM, true) {
1456         
1457             @Override
1458             public void applyDataBinding() {
1459                 if (model != null) {
1460                     model.addPropertyChangeListener("protocol", this);
1461                 }
1462             }
1463         
1464             @Override
1465             public void processDataBinding() {
1466                 if (model != null) {
1467                     protocolCombobox.setSelectedItem(model.getProtocol());
1468                 }
1469             }
1470         
1471             @Override
1472             public void removeDataBinding() {
1473                 if (model != null) {
1474                     model.removePropertyChangeListener("protocol", this);
1475                 }
1476             }
1477         });
1478         registerDataBinding(new DefaultJAXXBinding(this, BINDING_PROTOCOL_COMBOBOX_ENABLED, true) {
1479         
1480             @Override
1481             public void applyDataBinding() {
1482                 if (protocolCombobox != null) {
1483                     protocolCombobox.addPropertyChangeListener("empty", this);
1484                 }
1485             }
1486         
1487             @Override
1488             public void processDataBinding() {
1489                 if (protocolCombobox != null) {
1490                     protocolCombobox.setEnabled(!protocolCombobox.isEmpty());
1491                 }
1492             }
1493         
1494             @Override
1495             public void removeDataBinding() {
1496                 if (protocolCombobox != null) {
1497                     protocolCombobox.removePropertyChangeListener("empty", this);
1498                 }
1499             }
1500         });
1501         registerDataBinding(new DefaultJAXXBinding(this, BINDING_EDIT_PROTOCOL_COMBO_BOX_ENABLED, true) {
1502         
1503             @Override
1504             public void applyDataBinding() {
1505                 if (model != null) {
1506                     model.addPropertyChangeListener("protocolFound", this);
1507                 }
1508             }
1509         
1510             @Override
1511             public void processDataBinding() {
1512                 if (model != null) {
1513                     editProtocolComboBox.setEnabled(model.isProtocolFound());
1514                 }
1515             }
1516         
1517             @Override
1518             public void removeDataBinding() {
1519                 if (model != null) {
1520                     model.removePropertyChangeListener("protocolFound", this);
1521                 }
1522             }
1523         });
1524         registerDataBinding(new DefaultJAXXBinding(this, BINDING_NEW_PROTOCOL_COMBO_BOX_ENABLED, true) {
1525         
1526             @Override
1527             public void applyDataBinding() {
1528                 if (model != null) {
1529                     model.addPropertyChangeListener("programFound", this);
1530                 }
1531             }
1532         
1533             @Override
1534             public void processDataBinding() {
1535                 if (model != null) {
1536                     newProtocolComboBox.setEnabled(model.isProgramFound());
1537                 }
1538             }
1539         
1540             @Override
1541             public void removeDataBinding() {
1542                 if (model != null) {
1543                     model.removePropertyChangeListener("programFound", this);
1544                 }
1545             }
1546         });
1547         registerDataBinding(new DefaultJAXXBinding(this, BINDING_EDIT_CATCHES_BUTTON_ENABLED, true, true) {
1548         
1549             @Override
1550             public void applyDataBinding() {
1551                 if (model != null) {
1552                     model.addPropertyChangeListener("valid", this);
1553                 }
1554                 if (model != null) {
1555                     model.addPropertyChangeListener("cruiseFound", this);
1556                 }
1557             }
1558         
1559             @Override
1560             public void processDataBinding() {
1561                 if (model != null) {
1562                     editCatchesButton.setEnabled(model.isValid() && model.isCruiseFound());
1563                 }
1564             }
1565         
1566             @Override
1567             public void removeDataBinding() {
1568                 if (model != null) {
1569                     model.removePropertyChangeListener("valid", this);
1570                 }
1571                 if (model != null) {
1572                     model.removePropertyChangeListener("cruiseFound", this);
1573                 }
1574             }
1575         });
1576         registerDataBinding(new DefaultJAXXBinding(this, BINDING_VALIDATE_CATCHES_BUTTON_ENABLED, true, true) {
1577         
1578             @Override
1579             public void applyDataBinding() {
1580                 if (model != null) {
1581                     model.addPropertyChangeListener("valid", this);
1582                 }
1583                 if (model != null) {
1584                     model.addPropertyChangeListener("cruiseFound", this);
1585                 }
1586             }
1587         
1588             @Override
1589             public void processDataBinding() {
1590                 if (model != null) {
1591                     validateCatchesButton.setEnabled(model.isValid() && model.isCruiseFound());
1592                 }
1593             }
1594         
1595             @Override
1596             public void removeDataBinding() {
1597                 if (model != null) {
1598                     model.removePropertyChangeListener("valid", this);
1599                 }
1600                 if (model != null) {
1601                     model.removePropertyChangeListener("cruiseFound", this);
1602                 }
1603             }
1604         });
1605     }
1606 
1607 }