View Javadoc
1   package fr.ifremer.tutti.ui.swing.content.cruise;
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.Program;
28  import fr.ifremer.tutti.persistence.entities.referential.Gear;
29  import fr.ifremer.tutti.persistence.entities.referential.Person;
30  import fr.ifremer.tutti.persistence.entities.referential.TuttiLocation;
31  import fr.ifremer.tutti.persistence.entities.referential.Vessel;
32  import fr.ifremer.tutti.ui.swing.TuttiHelpBroker;
33  import fr.ifremer.tutti.ui.swing.util.TuttiUI;
34  import fr.ifremer.tutti.ui.swing.util.TuttiUIUtil;
35  import fr.ifremer.tutti.ui.swing.util.attachment.ButtonAttachment;
36  import java.awt.BorderLayout;
37  import java.awt.Component;
38  import java.awt.Container;
39  import java.awt.GridBagConstraints;
40  import java.awt.GridLayout;
41  import java.awt.Insets;
42  import java.awt.LayoutManager;
43  import java.awt.event.ActionEvent;
44  import java.awt.event.ActionListener;
45  import java.awt.event.FocusEvent;
46  import java.awt.event.FocusListener;
47  import java.awt.event.KeyEvent;
48  import java.awt.event.KeyListener;
49  import java.util.ArrayList;
50  import java.util.HashMap;
51  import java.util.List;
52  import java.util.Map;
53  import java.util.TreeMap;
54  import javax.swing.BorderFactory;
55  import javax.swing.ButtonGroup;
56  import javax.swing.JButton;
57  import javax.swing.JLabel;
58  import javax.swing.JMenuItem;
59  import javax.swing.JPanel;
60  import javax.swing.JPopupMenu;
61  import javax.swing.JRadioButton;
62  import javax.swing.JScrollPane;
63  import javax.swing.JSeparator;
64  import javax.swing.JTextArea;
65  import javax.swing.JTextField;
66  import javax.swing.JToolBar;
67  import javax.swing.SwingConstants;
68  import jaxx.runtime.JAXXBinding;
69  import jaxx.runtime.JAXXContext;
70  import jaxx.runtime.JAXXObject;
71  import jaxx.runtime.JAXXObjectDescriptor;
72  import jaxx.runtime.JAXXUtil;
73  import jaxx.runtime.JAXXValidator;
74  import jaxx.runtime.SwingUtil;
75  import jaxx.runtime.binding.DefaultJAXXBinding;
76  import jaxx.runtime.binding.SimpleJAXXObjectBinding;
77  import jaxx.runtime.context.DefaultJAXXContext;
78  import jaxx.runtime.swing.CardLayout2Ext;
79  import jaxx.runtime.swing.JAXXButtonGroup;
80  import jaxx.runtime.swing.Table;
81  import jaxx.runtime.swing.editor.SimpleTimeEditor;
82  import jaxx.runtime.swing.editor.bean.BeanDoubleList;
83  import jaxx.runtime.swing.editor.bean.BeanFilterableComboBox;
84  import jaxx.runtime.swing.help.JAXXHelpUI;
85  import jaxx.runtime.validator.swing.SwingValidator;
86  import jaxx.runtime.validator.swing.SwingValidatorUtil;
87  import jaxx.runtime.validator.swing.meta.Validator;
88  import jaxx.runtime.validator.swing.meta.ValidatorField;
89  import jaxx.runtime.validator.swing.ui.ImageValidationUI;
90  import org.apache.commons.logging.Log;
91  import org.apache.commons.logging.LogFactory;
92  import org.jdesktop.swingx.JXDatePicker;
93  import org.jdesktop.swingx.JXTitledPanel;
94  import org.nuiton.jaxx.widgets.number.NumberEditor;
95  import static org.nuiton.i18n.I18n.t;
96  
97  public class EditCruiseUI extends JPanel implements JAXXHelpUI<TuttiHelpBroker>, TuttiUI<EditCruiseUIModel, EditCruiseUIHandler>, JAXXObject, JAXXValidator {
98  
99      /*-----------------------------------------------------------------------*/
100     /*------------------ Constants for all public bindings ------------------*/
101     /*-----------------------------------------------------------------------*/
102 
103     public static final String BINDING_ATTACHMENTS_BUTTON_ENABLED = "attachmentsButton.enabled";
104     public static final String BINDING_BEGIN_DATE_FIELD_DATE = "beginDateField.date";
105     public static final String BINDING_COMMENT_FIELD_TEXT = "commentField.text";
106     public static final String BINDING_DEPARTURE_LOCATION_COMBO_BOX_SELECTED_ITEM = "departureLocationComboBox.selectedItem";
107     public static final String BINDING_EDIT_GEAR_CARACTERISTICS_ITEM_ENABLED = "editGearCaracteristicsItem.enabled";
108     public static final String BINDING_END_DATE_FIELD_DATE = "endDateField.date";
109     public static final String BINDING_FILTER_VESSEL_ALL_BUTTON_SELECTED = "filterVesselAllButton.selected";
110     public static final String BINDING_FILTER_VESSEL_FISHING_BUTTON_SELECTED = "filterVesselFishingButton.selected";
111     public static final String BINDING_FILTER_VESSEL_SCIENTIFIC_BUTTON_SELECTED = "filterVesselScientificButton.selected";
112     public static final String BINDING_GENERATE_NAME_BUTTON_ENABLED = "generateNameButton.enabled";
113     public static final String BINDING_MULTIRIG_NUMBER_FIELD_NUMBER_PATTERN = "multirigNumberField.numberPattern";
114     public static final String BINDING_MULTIRIG_NUMBER_FIELD_NUMBER_VALUE = "multirigNumberField.numberValue";
115     public static final String BINDING_NAME_FIELD_TEXT = "nameField.text";
116     public static final String BINDING_PROGRAM_COMBO_BOX_SELECTED_ITEM = "programComboBox.selectedItem";
117     public static final String BINDING_RESET_BUTTON_ENABLED = "resetButton.enabled";
118     public static final String BINDING_RETURN_LOCATION_COMBO_BOX_SELECTED_ITEM = "returnLocationComboBox.selectedItem";
119     public static final String BINDING_SAVE_BUTTON_ENABLED = "saveButton.enabled";
120     public static final String BINDING_SURVEY_PART_FIELD_TEXT = "surveyPartField.text";
121     public static final String BINDING_VESSEL_COMBO_BOX_SELECTED_ITEM = "vesselComboBox.selectedItem";
122     public static final String BINDING_VIEW_GEAR_CARACTERISTICS_ITEM_ENABLED = "viewGearCaracteristicsItem.enabled";
123 
124     /*-----------------------------------------------------------------------*/
125     /*------------------------- Other static fields -------------------------*/
126     /*-----------------------------------------------------------------------*/
127 
128     private static final String $jaxxObjectDescriptor = "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";
129     private static final Log log = LogFactory.getLog(EditCruiseUI.class);
130     private static final long serialVersionUID = 1L;
131 
132     /*-----------------------------------------------------------------------*/
133     /*--------------------------- Internal states ---------------------------*/
134     /*-----------------------------------------------------------------------*/
135 
136     protected List<Object> $activeBindings = new ArrayList<Object>();
137     protected Map<String, Object> $bindingSources = new HashMap<String, Object>();
138     protected final Map<String, JAXXBinding> $bindings = new TreeMap<String, JAXXBinding>();
139     protected Map<String, Object> $objectMap = new HashMap<String, Object>();
140     protected Map<?, ?> $previousValues = new HashMap<Object, Object>();
141     private boolean allComponentsCreated;
142     protected final JAXXContext delegateContext = new DefaultJAXXContext();
143 
144     /*-----------------------------------------------------------------------*/
145     /*------------------------ Protected components  ------------------------*/
146     /*-----------------------------------------------------------------------*/
147 
148     protected ButtonAttachment attachmentsButton;
149     @ValidatorField( validatorId = "validator",  propertyName = "beginDate",  editorName = "beginDateField")
150     protected JXDatePicker beginDateField;
151     protected JLabel beginDateLabel;
152     protected SimpleTimeEditor beginTimeField;
153     protected TuttiHelpBroker broker;
154     protected JButton closeButton;
155     protected JTextArea commentField;
156     @ValidatorField( validatorId = "validator",  propertyName = "comment",  editorName = "commentPane")
157     protected JScrollPane commentPane;
158     protected JScrollPane cruiseScrollPane;
159     @ValidatorField( validatorId = "validator",  propertyName = "departureLocation",  editorName = "departureLocationComboBox")
160     protected BeanFilterableComboBox<TuttiLocation> departureLocationComboBox;
161     protected JLabel departureLocationLabel;
162     protected EditCruiseUI editCruiseTopPanel = this;
163     protected JMenuItem editGearCaracteristicsItem;
164     @ValidatorField( validatorId = "validator",  propertyName = "endDate",  editorName = "endDateField")
165     protected JXDatePicker endDateField;
166     protected JLabel endDateLabel;
167     protected SimpleTimeEditor endTimeField;
168     protected JRadioButton filterVesselAllButton;
169     protected JRadioButton filterVesselFishingButton;
170     protected JLabel filterVesselLabel;
171     protected JRadioButton filterVesselScientificButton;
172     protected JAXXButtonGroup filterVesselType;
173     protected GearCaracteristicsEditorUI gearCaracteristicsEditor;
174     protected JXTitledPanel gearCaracteristicsEditorTitledPanel;
175     @ValidatorField( validatorId = "validator",  propertyName = "gear",  editorName = "gearList")
176     protected BeanDoubleList<Gear> gearList;
177     protected JPopupMenu gearMenuPopup;
178     protected JButton generateNameButton;
179     protected final EditCruiseUIHandler handler = createHandler();
180     @ValidatorField( validatorId = "validator",  propertyName = "headOfMission",  editorName = "headOfMissionList")
181     protected BeanDoubleList<Person> headOfMissionList;
182     @ValidatorField( validatorId = "validator",  propertyName = "headOfSortRoom",  editorName = "headOfSortRoomList")
183     protected BeanDoubleList<Person> headOfSortRoomList;
184     protected CardLayout2Ext mainPanelLayout;
185     protected EditCruiseUIModel model;
186     @ValidatorField( validatorId = "validator",  propertyName = "multirigNumber",  editorName = "multirigNumberField")
187     protected NumberEditor multirigNumberField;
188     protected JLabel multirigNumberLabel;
189     @ValidatorField( validatorId = "validator",  propertyName = "name",  editorName = "nameField")
190     protected JTextField nameField;
191     protected JLabel nameLabel;
192     protected JButton nameResetButton;
193     @ValidatorField( validatorId = "validator",  propertyName = "program",  editorName = "programComboBox")
194     protected BeanFilterableComboBox<Program> programComboBox;
195     protected JLabel programLabel;
196     protected JButton resetButton;
197     @ValidatorField( validatorId = "validator",  propertyName = "returnLocation",  editorName = "returnLocationComboBox")
198     protected BeanFilterableComboBox<TuttiLocation> returnLocationComboBox;
199     protected JLabel returnLocationLabel;
200     protected JButton saveButton;
201     @ValidatorField( validatorId = "validator",  propertyName = "surveyPart",  editorName = "surveyPartField")
202     protected JTextField surveyPartField;
203     protected JLabel surveyPartLabel;
204     protected JButton surveyPartResetButton;
205     protected JToolBar topToolBar;
206     @Validator( validatorId = "validator")
207     protected SwingValidator<EditCruiseUIModel> validator;
208     protected List<String> validatorIds = new ArrayList<String>();
209     @ValidatorField( validatorId = "validator",  propertyName = "vessel",  editorName = "vesselComboBox")
210     protected BeanFilterableComboBox<Vessel> vesselComboBox;
211     protected JPanel vesselFilterPane;
212     protected JLabel vesselLabel;
213     protected JMenuItem viewGearCaracteristicsItem;
214 
215     /*-----------------------------------------------------------------------*/
216     /*------------------------- Private components  -------------------------*/
217     /*-----------------------------------------------------------------------*/
218 
219     private JLabel $JLabel0;
220     private JPanel $JPanel0;
221     private JPanel $JPanel1;
222     private JPanel $JPanel2;
223     private JPanel $JPanel3;
224     private JPanel $JPanel4;
225     private JPanel $JPanel5;
226     private JPanel $JPanel6;
227     private JSeparator $JSeparator0;
228     private JToolBar $JToolBar0;
229     private JToolBar $JToolBar1;
230     private Table $Table0;
231 
232     /*-----------------------------------------------------------------------*/
233     /*---------------------------- Constructors  ----------------------------*/
234     /*-----------------------------------------------------------------------*/
235 
236     public EditCruiseUI(TuttiUI parentUI) {
237         TuttiUIUtil.setParentUI(this, parentUI);
238             $initialize();
239     }
240 
241     public EditCruiseUI(LayoutManager param0, boolean param1) {
242         super(param0 ,param1);
243         $initialize();
244     }
245 
246     public EditCruiseUI(JAXXContext parentContext, LayoutManager param1, boolean param2) {
247         super(param1 ,param2);
248         JAXXUtil.initContext(this, parentContext);
249         $initialize();
250     }
251 
252     public EditCruiseUI(LayoutManager param0) {
253         super(param0);
254         $initialize();
255     }
256 
257     public EditCruiseUI(JAXXContext parentContext, LayoutManager param1) {
258         super(param1);
259         JAXXUtil.initContext(this, parentContext);
260         $initialize();
261     }
262 
263     public EditCruiseUI() {
264         $initialize();
265     }
266 
267     public EditCruiseUI(JAXXContext parentContext) {
268         JAXXUtil.initContext(this, parentContext);
269         $initialize();
270     }
271 
272     public EditCruiseUI(boolean param0) {
273         super(param0);
274         $initialize();
275     }
276 
277     public EditCruiseUI(JAXXContext parentContext, boolean param1) {
278         super(param1);
279         JAXXUtil.initContext(this, parentContext);
280         $initialize();
281     }
282 
283     /*-----------------------------------------------------------------------*/
284     /*--------------------------- Statics methods ---------------------------*/
285     /*-----------------------------------------------------------------------*/
286 
287     public static JAXXObjectDescriptor $getJAXXObjectDescriptor() {
288         return JAXXUtil.decodeCompressedJAXXObjectDescriptor($jaxxObjectDescriptor);
289     }
290 
291     /*-----------------------------------------------------------------------*/
292     /*---------------------- JAXXObject implementation ----------------------*/
293     /*-----------------------------------------------------------------------*/
294 
295     @Override
296     public void applyDataBinding(String $binding) {
297         if (allComponentsCreated && $bindings.containsKey($binding)) {
298             getDataBinding($binding).applyDataBinding();
299         }
300         processDataBinding($binding);
301     }
302 
303     @Override
304     public void firePropertyChange(String propertyName, Object oldValue, Object newValue) {
305         super.firePropertyChange(propertyName, oldValue, newValue);
306     }
307 
308     @Override
309     public Map<String, Object> get$objectMap() {
310         return $objectMap;
311     }
312 
313     @Override
314     public JAXXBinding getDataBinding(String bindingId) {
315         return $bindings.get(bindingId);
316     }
317 
318     @Override
319     public JAXXBinding[] getDataBindings() {
320         return $bindings.values().toArray(new JAXXBinding[$bindings.size()]);
321     }
322 
323     @Override
324     public Object getObjectById(String id) {
325         return $objectMap.get(id);
326     }
327 
328     @Override
329     public void processDataBinding(String $binding, boolean $force) {
330         if (!$force && $activeBindings.contains($binding)) { 
331             return;
332         }
333         $activeBindings.add($binding);
334         try {
335             if (allComponentsCreated && $bindings.containsKey($binding)) {
336                 getDataBinding($binding).processDataBinding();
337             }
338         } finally {
339             $activeBindings.remove($binding);
340         }
341     }
342 
343     @Override
344     public void processDataBinding(String $binding) {
345         processDataBinding($binding, false);
346     }
347 
348     @Override
349     public void registerDataBinding(JAXXBinding binding) {
350         $bindings.put(binding.getId(), binding);
351     }
352 
353     @Override
354     public void removeDataBinding(String $binding) {
355         if (allComponentsCreated && $bindings.containsKey($binding)) {
356             getDataBinding($binding).removeDataBinding();
357         }
358     }
359 
360     /*-----------------------------------------------------------------------*/
361     /*--------------------- JAXXContext implementation  ---------------------*/
362     /*-----------------------------------------------------------------------*/
363 
364     @Override
365     public <T> T getContextValue(Class<T> clazz) {
366         return delegateContext.getContextValue(clazz, null);
367     }
368 
369     @Override
370     public <T> T getContextValue(Class<T> clazz, String name) {
371         return delegateContext.getContextValue(clazz, name);
372     }
373 
374     @Override
375     public JAXXContext getDelegateContext() {
376         return delegateContext;
377     }
378 
379     @Override
380     public <O extends Container> O getParentContainer(Class<O> clazz) {
381         return SwingUtil.getParentContainer(this, clazz);
382     }
383 
384     @Override
385     public <O extends Container> O getParentContainer(Object source, Class<O> clazz) {
386         return SwingUtil.getParentContainer(source, clazz);
387     }
388 
389     @Override
390     public <T> void removeContextValue(Class<T> clazz) {
391         delegateContext.removeContextValue(clazz, null);
392     }
393 
394     @Override
395     public <T> void removeContextValue(Class<T> clazz, String name) {
396         delegateContext.removeContextValue(clazz, name);
397     }
398 
399     @Override
400     public <T> void setContextValue(T o) {
401         delegateContext.setContextValue(o, null);
402     }
403 
404     @Override
405     public <T> void setContextValue(T o, String name) {
406         delegateContext.setContextValue(o, name);
407     }
408 
409     /*-----------------------------------------------------------------------*/
410     /*-------------------- JAXXValidator implementation  --------------------*/
411     /*-----------------------------------------------------------------------*/
412 
413     @Override
414     public SwingValidator<?> getValidator(String validatorId) {
415         return (SwingValidator<?>) (validatorIds.contains(validatorId) ? getObjectById(validatorId) : null);
416     }
417 
418     @Override
419     public List<String> getValidatorIds() {
420         return validatorIds;
421     }
422 
423     @Override
424     public void registerValidatorFields() {
425         SwingValidatorUtil.detectValidatorFields(this);
426     }
427 
428     /*-----------------------------------------------------------------------*/
429     /*---------------------------- Event methods ----------------------------*/
430     /*-----------------------------------------------------------------------*/
431 
432     public void doActionPerformed__on__beginDateField(ActionEvent event) {
433         if (log.isDebugEnabled()) {
434             log.debug(event);
435         }
436         handler.setDate(event, "beginDate");
437     }
438 
439     public void doActionPerformed__on__endDateField(ActionEvent event) {
440         if (log.isDebugEnabled()) {
441             log.debug(event);
442         }
443         handler.setDate(event, "endDate");
444     }
445 
446     public void doActionPerformed__on__filterVesselAllButton(ActionEvent event) {
447         if (log.isDebugEnabled()) {
448             log.debug(event);
449         }
450         model.setVesselType(VesselTypeEnum.ALL);
451     }
452 
453     public void doActionPerformed__on__filterVesselFishingButton(ActionEvent event) {
454         if (log.isDebugEnabled()) {
455             log.debug(event);
456         }
457         model.setVesselType(VesselTypeEnum.FISHING);
458     }
459 
460     public void doActionPerformed__on__filterVesselScientificButton(ActionEvent event) {
461         if (log.isDebugEnabled()) {
462             log.debug(event);
463         }
464         model.setVesselType(VesselTypeEnum.SCIENTIFIC);
465     }
466 
467     public void doActionPerformed__on__nameResetButton(ActionEvent event) {
468         if (log.isDebugEnabled()) {
469             log.debug(event);
470         }
471         model.setName(null);
472     }
473 
474     public void doActionPerformed__on__surveyPartResetButton(ActionEvent event) {
475         if (log.isDebugEnabled()) {
476             log.debug(event);
477         }
478         model.setSurveyPart(null);
479     }
480 
481     public void doFocusGained__on__commentPane(FocusEvent event) {
482         if (log.isDebugEnabled()) {
483             log.debug(event);
484         }
485         commentField.requestFocus();
486     }
487 
488     public void doKeyReleased__on__commentField(KeyEvent event) {
489         if (log.isDebugEnabled()) {
490             log.debug(event);
491         }
492         handler.setText(event, "comment");
493     }
494 
495     public void doKeyReleased__on__nameField(KeyEvent event) {
496         if (log.isDebugEnabled()) {
497             log.debug(event);
498         }
499         handler.setText(event, "name");
500     }
501 
502     public void doKeyReleased__on__surveyPartField(KeyEvent event) {
503         if (log.isDebugEnabled()) {
504             log.debug(event);
505         }
506         handler.setText(event, "surveyPart");
507     }
508 
509     /*-----------------------------------------------------------------------*/
510     /*----------------------- Public acessor methods  -----------------------*/
511     /*-----------------------------------------------------------------------*/
512 
513     public ButtonAttachment getAttachmentsButton() {
514         return attachmentsButton;
515     }
516 
517     public JXDatePicker getBeginDateField() {
518         return beginDateField;
519     }
520 
521     public JLabel getBeginDateLabel() {
522         return beginDateLabel;
523     }
524 
525     public SimpleTimeEditor getBeginTimeField() {
526         return beginTimeField;
527     }
528 
529     public TuttiHelpBroker getBroker() {
530         return broker;
531     }
532 
533     public JButton getCloseButton() {
534         return closeButton;
535     }
536 
537     public JTextArea getCommentField() {
538         return commentField;
539     }
540 
541     public JScrollPane getCommentPane() {
542         return commentPane;
543     }
544 
545     public JScrollPane getCruiseScrollPane() {
546         return cruiseScrollPane;
547     }
548 
549     public BeanFilterableComboBox<TuttiLocation> getDepartureLocationComboBox() {
550         return departureLocationComboBox;
551     }
552 
553     public JLabel getDepartureLocationLabel() {
554         return departureLocationLabel;
555     }
556 
557     public JMenuItem getEditGearCaracteristicsItem() {
558         return editGearCaracteristicsItem;
559     }
560 
561     public JXDatePicker getEndDateField() {
562         return endDateField;
563     }
564 
565     public JLabel getEndDateLabel() {
566         return endDateLabel;
567     }
568 
569     public SimpleTimeEditor getEndTimeField() {
570         return endTimeField;
571     }
572 
573     public JRadioButton getFilterVesselAllButton() {
574         return filterVesselAllButton;
575     }
576 
577     public JRadioButton getFilterVesselFishingButton() {
578         return filterVesselFishingButton;
579     }
580 
581     public JLabel getFilterVesselLabel() {
582         return filterVesselLabel;
583     }
584 
585     public JRadioButton getFilterVesselScientificButton() {
586         return filterVesselScientificButton;
587     }
588 
589     public JAXXButtonGroup getFilterVesselType() {
590         return filterVesselType;
591     }
592 
593     public GearCaracteristicsEditorUI getGearCaracteristicsEditor() {
594         return gearCaracteristicsEditor;
595     }
596 
597     public JXTitledPanel getGearCaracteristicsEditorTitledPanel() {
598         return gearCaracteristicsEditorTitledPanel;
599     }
600 
601     public BeanDoubleList<Gear> getGearList() {
602         return gearList;
603     }
604 
605     public JPopupMenu getGearMenuPopup() {
606         return gearMenuPopup;
607     }
608 
609     public JButton getGenerateNameButton() {
610         return generateNameButton;
611     }
612 
613     public EditCruiseUIHandler getHandler() {
614         return handler;
615     }
616 
617     public BeanDoubleList<Person> getHeadOfMissionList() {
618         return headOfMissionList;
619     }
620 
621     public BeanDoubleList<Person> getHeadOfSortRoomList() {
622         return headOfSortRoomList;
623     }
624 
625     public CardLayout2Ext getMainPanelLayout() {
626         return mainPanelLayout;
627     }
628 
629     public EditCruiseUIModel getModel() {
630         return model;
631     }
632 
633     public NumberEditor getMultirigNumberField() {
634         return multirigNumberField;
635     }
636 
637     public JLabel getMultirigNumberLabel() {
638         return multirigNumberLabel;
639     }
640 
641     public JTextField getNameField() {
642         return nameField;
643     }
644 
645     public JLabel getNameLabel() {
646         return nameLabel;
647     }
648 
649     public JButton getNameResetButton() {
650         return nameResetButton;
651     }
652 
653     public BeanFilterableComboBox<Program> getProgramComboBox() {
654         return programComboBox;
655     }
656 
657     public JLabel getProgramLabel() {
658         return programLabel;
659     }
660 
661     public JButton getResetButton() {
662         return resetButton;
663     }
664 
665     public BeanFilterableComboBox<TuttiLocation> getReturnLocationComboBox() {
666         return returnLocationComboBox;
667     }
668 
669     public JLabel getReturnLocationLabel() {
670         return returnLocationLabel;
671     }
672 
673     public JButton getSaveButton() {
674         return saveButton;
675     }
676 
677     public JTextField getSurveyPartField() {
678         return surveyPartField;
679     }
680 
681     public JLabel getSurveyPartLabel() {
682         return surveyPartLabel;
683     }
684 
685     public JButton getSurveyPartResetButton() {
686         return surveyPartResetButton;
687     }
688 
689     public JToolBar getTopToolBar() {
690         return topToolBar;
691     }
692 
693     public SwingValidator<EditCruiseUIModel> getValidator() {
694         return validator;
695     }
696 
697     public BeanFilterableComboBox<Vessel> getVesselComboBox() {
698         return vesselComboBox;
699     }
700 
701     public JPanel getVesselFilterPane() {
702         return vesselFilterPane;
703     }
704 
705     public JLabel getVesselLabel() {
706         return vesselLabel;
707     }
708 
709     public JMenuItem getViewGearCaracteristicsItem() {
710         return viewGearCaracteristicsItem;
711     }
712 
713     /*-----------------------------------------------------------------------*/
714     /*---------------------------- Other methods ----------------------------*/
715     /*-----------------------------------------------------------------------*/
716 
717     @Override
718     public void registerHelpId(TuttiHelpBroker broker, Component component, String helpId) {
719         broker.installUI(component, helpId);
720     }
721 
722     @Override
723     public void showHelp(String helpId) {
724         getBroker().showHelp(this, helpId);
725     }
726 
727     /*-----------------------------------------------------------------------*/
728     /*--------------------- Protected acessors methods  ---------------------*/
729     /*-----------------------------------------------------------------------*/
730 
731     protected JLabel get$JLabel0() {
732         return $JLabel0;
733     }
734 
735     protected JPanel get$JPanel0() {
736         return $JPanel0;
737     }
738 
739     protected JPanel get$JPanel1() {
740         return $JPanel1;
741     }
742 
743     protected JPanel get$JPanel2() {
744         return $JPanel2;
745     }
746 
747     protected JPanel get$JPanel3() {
748         return $JPanel3;
749     }
750 
751     protected JPanel get$JPanel4() {
752         return $JPanel4;
753     }
754 
755     protected JPanel get$JPanel5() {
756         return $JPanel5;
757     }
758 
759     protected JPanel get$JPanel6() {
760         return $JPanel6;
761     }
762 
763     protected JSeparator get$JSeparator0() {
764         return $JSeparator0;
765     }
766 
767     protected JToolBar get$JToolBar0() {
768         return $JToolBar0;
769     }
770 
771     protected JToolBar get$JToolBar1() {
772         return $JToolBar1;
773     }
774 
775     protected Table get$Table0() {
776         return $Table0;
777     }
778 
779     /*-----------------------------------------------------------------------*/
780     /*--------------------- Components creation methods ---------------------*/
781     /*-----------------------------------------------------------------------*/
782 
783     protected void addChildrenToCommentPane() {
784         if (!allComponentsCreated) {
785             return;
786         }
787         commentPane.getViewport().add(commentField);
788     }
789 
790     protected void addChildrenToCruiseScrollPane() {
791         if (!allComponentsCreated) {
792             return;
793         }
794         cruiseScrollPane.getViewport().add($Table0);
795     }
796 
797     protected void addChildrenToEditCruiseTopPanel() {
798         if (!allComponentsCreated) {
799             return;
800         }
801         add(topToolBar);
802         add($JPanel0, EditCruiseUIHandler.CRUISE_CARD);
803         add(gearCaracteristicsEditorTitledPanel, EditCruiseUIHandler.GEAR_CARACTERISTICS_CARD);
804     }
805 
806     protected void addChildrenToFilterVesselAllButton() {
807         if (!allComponentsCreated) {
808             return;
809         }
810         { ButtonGroup $buttonGroup = filterVesselType; filterVesselAllButton.putClientProperty("$buttonGroup", $buttonGroup); $buttonGroup.add(filterVesselAllButton); }
811     }
812 
813     protected void addChildrenToFilterVesselFishingButton() {
814         if (!allComponentsCreated) {
815             return;
816         }
817         { ButtonGroup $buttonGroup = filterVesselType; filterVesselFishingButton.putClientProperty("$buttonGroup", $buttonGroup); $buttonGroup.add(filterVesselFishingButton); }
818     }
819 
820     protected void addChildrenToFilterVesselScientificButton() {
821         if (!allComponentsCreated) {
822             return;
823         }
824         { ButtonGroup $buttonGroup = filterVesselType; filterVesselScientificButton.putClientProperty("$buttonGroup", $buttonGroup); $buttonGroup.add(filterVesselScientificButton); }
825     }
826 
827     protected void addChildrenToGearCaracteristicsEditorTitledPanel() {
828         if (!allComponentsCreated) {
829             return;
830         }
831         gearCaracteristicsEditorTitledPanel.add(gearCaracteristicsEditor);
832     }
833 
834     protected void addChildrenToGearMenuPopup() {
835         if (!allComponentsCreated) {
836             return;
837         }
838         gearMenuPopup.add(editGearCaracteristicsItem);
839         gearMenuPopup.add(viewGearCaracteristicsItem);
840     }
841 
842     protected void addChildrenToTopToolBar() {
843         if (!allComponentsCreated) {
844             return;
845         }
846         topToolBar.add(attachmentsButton);
847     }
848 
849     protected void addChildrenToValidator() {
850         if (!allComponentsCreated) {
851             return;
852         }
853         validator.setUiClass(ImageValidationUI.class);
854         validator.setBean(model);
855     }
856 
857     protected void addChildrenToVesselFilterPane() {
858         if (!allComponentsCreated) {
859             return;
860         }
861         vesselFilterPane.add(filterVesselLabel);
862         vesselFilterPane.add(filterVesselAllButton);
863         vesselFilterPane.add(filterVesselScientificButton);
864         vesselFilterPane.add(filterVesselFishingButton);
865     }
866 
867     protected void createAttachmentsButton() {
868         $objectMap.put("attachmentsButton", attachmentsButton = new ButtonAttachment(getHandler().getContext(), getModel()));
869         
870         attachmentsButton.setName("attachmentsButton");
871         attachmentsButton.setFocusable(false);
872     }
873 
874     protected void createBeginDateField() {
875         $objectMap.put("beginDateField", beginDateField = new JXDatePicker());
876         
877         beginDateField.setName("beginDateField");
878         beginDateField.addActionListener(JAXXUtil.getEventListener(ActionListener.class, "actionPerformed", this, "doActionPerformed__on__beginDateField"));
879         beginDateField.putClientProperty("help", "tutti.editCruise.field.beginDate.help");
880         beginDateField.putClientProperty("selectOnFocus", true);
881         beginDateField.putClientProperty("validatorLabel", t("tutti.editCruise.field.beginDate"));
882     }
883 
884     protected void createBeginDateLabel() {
885         $objectMap.put("beginDateLabel", beginDateLabel = new JLabel());
886         
887         beginDateLabel.setName("beginDateLabel");
888         beginDateLabel.setText(t("tutti.editCruise.field.beginDate"));
889         beginDateLabel.setToolTipText(t("tutti.editCruise.field.beginDate.tip"));
890         beginDateLabel.putClientProperty("help", "tutti.editCruise.field.beginDate.help");
891     }
892 
893     protected void createBeginTimeField() {
894         $objectMap.put("beginTimeField", beginTimeField = new SimpleTimeEditor(this));
895         
896         beginTimeField.setName("beginTimeField");
897         beginTimeField.setProperty("beginTime");
898         beginTimeField.putClientProperty("help", "tutti.editCruise.field.beginTime.help");
899         beginTimeField.putClientProperty("selectOnFocus", true);
900     }
901 
902     protected void createBroker() {
903         $objectMap.put("broker", broker = new TuttiHelpBroker("tutti.editCruise.help"));
904     }
905 
906     protected void createCloseButton() {
907         $objectMap.put("closeButton", closeButton = new JButton());
908         
909         closeButton.setName("closeButton");
910         closeButton.setText(t("tutti.editCruise.action.closeEditCruise"));
911         closeButton.setToolTipText(t("tutti.editCruise.action.closeEditCruise.tip"));
912         closeButton.putClientProperty("help", "tutti.editCruise.action.close.help");
913         closeButton.putClientProperty("applicationAction", fr.ifremer.tutti.ui.swing.content.actions.OpenHomeScreenAction.class);
914     }
915 
916     protected void createCommentField() {
917         $objectMap.put("commentField", commentField = new JTextArea());
918         
919         commentField.setName("commentField");
920         commentField.setColumns(15);
921         commentField.setLineWrap(true);
922         commentField.setWrapStyleWord(true);
923         commentField.addKeyListener(JAXXUtil.getEventListener(KeyListener.class, "keyReleased", this, "doKeyReleased__on__commentField"));
924         commentField.putClientProperty("validatorLabel", t("tutti.editCruise.field.comment"));
925     }
926 
927     protected void createCommentPane() {
928         $objectMap.put("commentPane", commentPane = new JScrollPane());
929         
930         commentPane.setName("commentPane");
931         commentPane.setToolTipText(t("tutti.editCruise.field.comment.tip"));
932         commentPane.addFocusListener(JAXXUtil.getEventListener(FocusListener.class, "focusGained", this, "doFocusGained__on__commentPane"));
933         commentPane.putClientProperty("help", "tutti.editCruise.field.comment.help");
934     }
935 
936     protected void createCruiseScrollPane() {
937         $objectMap.put("cruiseScrollPane", cruiseScrollPane = new JScrollPane());
938         
939         cruiseScrollPane.setName("cruiseScrollPane");
940         cruiseScrollPane.putClientProperty("onlyVerticalScrollable", true);
941     }
942 
943     protected void createDepartureLocationComboBox() {
944         $objectMap.put("departureLocationComboBox", departureLocationComboBox = new BeanFilterableComboBox<TuttiLocation>(this));
945         
946         departureLocationComboBox.setName("departureLocationComboBox");
947         departureLocationComboBox.setProperty("departureLocation");
948         departureLocationComboBox.setShowReset(true);
949         departureLocationComboBox.putClientProperty("help", "tutti.editCruise.field.departureLocation.help");
950         departureLocationComboBox.putClientProperty("validatorLabel", t("tutti.editCruise.field.departureLocation"));
951     }
952 
953     protected void createDepartureLocationLabel() {
954         $objectMap.put("departureLocationLabel", departureLocationLabel = new JLabel());
955         
956         departureLocationLabel.setName("departureLocationLabel");
957         departureLocationLabel.setText(t("tutti.editCruise.field.departureLocation"));
958         departureLocationLabel.setToolTipText(t("tutti.editCruise.field.departureLocation.tip"));
959         departureLocationLabel.putClientProperty("help", "tutti.editCruise.field.departureLocation.help");
960     }
961 
962     protected void createEditGearCaracteristicsItem() {
963         $objectMap.put("editGearCaracteristicsItem", editGearCaracteristicsItem = new JMenuItem());
964         
965         editGearCaracteristicsItem.setName("editGearCaracteristicsItem");
966         editGearCaracteristicsItem.setText(t("tutti.editCruise.action.editGearCaracteristics"));
967         editGearCaracteristicsItem.setToolTipText(t("tutti.editCruise.action.editGearCaracteristics.tip"));
968         editGearCaracteristicsItem.putClientProperty("help", "tutti.editCruise.action.editGearCaracteristics.help");
969         editGearCaracteristicsItem.putClientProperty("applicationAction", fr.ifremer.tutti.ui.swing.content.cruise.actions.EditGearCaracteristicsAction.class);
970     }
971 
972     protected void createEndDateField() {
973         $objectMap.put("endDateField", endDateField = new JXDatePicker());
974         
975         endDateField.setName("endDateField");
976         endDateField.addActionListener(JAXXUtil.getEventListener(ActionListener.class, "actionPerformed", this, "doActionPerformed__on__endDateField"));
977         endDateField.putClientProperty("help", "tutti.editCruise.field.endDate.help");
978         endDateField.putClientProperty("selectOnFocus", true);
979         endDateField.putClientProperty("validatorLabel", t("tutti.editCruise.field.endDate"));
980     }
981 
982     protected void createEndDateLabel() {
983         $objectMap.put("endDateLabel", endDateLabel = new JLabel());
984         
985         endDateLabel.setName("endDateLabel");
986         endDateLabel.setText(t("tutti.editCruise.field.endDate"));
987         endDateLabel.setToolTipText(t("tutti.editCruise.field.endDate.tip"));
988         endDateLabel.putClientProperty("help", "tutti.editCruise.field.endDate.help");
989     }
990 
991     protected void createEndTimeField() {
992         $objectMap.put("endTimeField", endTimeField = new SimpleTimeEditor(this));
993         
994         endTimeField.setName("endTimeField");
995         endTimeField.setProperty("endTime");
996         endTimeField.putClientProperty("help", "tutti.editCruise.field.endTime.help");
997         endTimeField.putClientProperty("selectOnFocus", true);
998     }
999 
1000     protected void createFilterVesselAllButton() {
1001         $objectMap.put("filterVesselAllButton", filterVesselAllButton = new JRadioButton());
1002         
1003         filterVesselAllButton.setName("filterVesselAllButton");
1004         filterVesselAllButton.setText(t("tutti.editCruise.filterVesselType.all"));
1005         { filterVesselAllButton.putClientProperty("$value", "all");  Object $buttonGroup = filterVesselAllButton.getClientProperty("$buttonGroup"); if ($buttonGroup instanceof JAXXButtonGroup) { ((JAXXButtonGroup) $buttonGroup).updateSelectedValue(); } }
1006         
1007         filterVesselAllButton.setToolTipText(t("tutti.editCruise.filterVesselType.all.tip"));
1008         filterVesselAllButton.addActionListener(JAXXUtil.getEventListener(ActionListener.class, "actionPerformed", this, "doActionPerformed__on__filterVesselAllButton"));
1009         filterVesselAllButton.putClientProperty("skipAction", true);
1010     }
1011 
1012     protected void createFilterVesselFishingButton() {
1013         $objectMap.put("filterVesselFishingButton", filterVesselFishingButton = new JRadioButton());
1014         
1015         filterVesselFishingButton.setName("filterVesselFishingButton");
1016         filterVesselFishingButton.setText(t("tutti.editCruise.filterVesselType.fishing"));
1017         { filterVesselFishingButton.putClientProperty("$value", "fishing");  Object $buttonGroup = filterVesselFishingButton.getClientProperty("$buttonGroup"); if ($buttonGroup instanceof JAXXButtonGroup) { ((JAXXButtonGroup) $buttonGroup).updateSelectedValue(); } }
1018         
1019         filterVesselFishingButton.setToolTipText(t("tutti.editCruise.filterVesselType.fishing.tip"));
1020         filterVesselFishingButton.addActionListener(JAXXUtil.getEventListener(ActionListener.class, "actionPerformed", this, "doActionPerformed__on__filterVesselFishingButton"));
1021         filterVesselFishingButton.putClientProperty("skipAction", true);
1022     }
1023 
1024     protected void createFilterVesselLabel() {
1025         $objectMap.put("filterVesselLabel", filterVesselLabel = new JLabel());
1026         
1027         filterVesselLabel.setName("filterVesselLabel");
1028         filterVesselLabel.setText(t("tutti.editCruise.filterVesselType"));
1029         filterVesselLabel.setToolTipText(t("tutti.editCruise.filterVessel.tip"));
1030         filterVesselLabel.putClientProperty("help", "tutti.editCruise.filterVessel.help");
1031         filterVesselLabel.putClientProperty("strongStyle", true);
1032     }
1033 
1034     protected void createFilterVesselScientificButton() {
1035         $objectMap.put("filterVesselScientificButton", filterVesselScientificButton = new JRadioButton());
1036         
1037         filterVesselScientificButton.setName("filterVesselScientificButton");
1038         filterVesselScientificButton.setText(t("tutti.editCruise.filterVesselType.scientific"));
1039         { filterVesselScientificButton.putClientProperty("$value", "scientific");  Object $buttonGroup = filterVesselScientificButton.getClientProperty("$buttonGroup"); if ($buttonGroup instanceof JAXXButtonGroup) { ((JAXXButtonGroup) $buttonGroup).updateSelectedValue(); } }
1040         
1041         filterVesselScientificButton.setToolTipText(t("tutti.editCruise.filterVesselType.scientific.tip"));
1042         filterVesselScientificButton.addActionListener(JAXXUtil.getEventListener(ActionListener.class, "actionPerformed", this, "doActionPerformed__on__filterVesselScientificButton"));
1043         filterVesselScientificButton.putClientProperty("skipAction", true);
1044     }
1045 
1046     protected void createFilterVesselType() {
1047         $objectMap.put("filterVesselType", filterVesselType = new JAXXButtonGroup());
1048     }
1049 
1050     protected void createGearCaracteristicsEditor() {
1051         $objectMap.put("gearCaracteristicsEditor", gearCaracteristicsEditor = new GearCaracteristicsEditorUI(this));
1052         
1053         gearCaracteristicsEditor.setName("gearCaracteristicsEditor");
1054     }
1055 
1056     protected void createGearCaracteristicsEditorTitledPanel() {
1057         $objectMap.put("gearCaracteristicsEditorTitledPanel", gearCaracteristicsEditorTitledPanel = new JXTitledPanel());
1058         
1059         gearCaracteristicsEditorTitledPanel.setName("gearCaracteristicsEditorTitledPanel");
1060         gearCaracteristicsEditorTitledPanel.setTitle(t("tutti.editCruise.gearCaracteristics.title"));
1061     }
1062 
1063     protected void createGearList() {
1064         $objectMap.put("gearList", gearList = new BeanDoubleList<Gear>());
1065         
1066         gearList.setName("gearList");
1067         gearList.setShowSelectPopupEnabled(true);
1068         gearList.setProperty("gear");
1069         gearList.setShowReset(true);
1070         gearList.setUseMultiSelect(true);
1071         gearList.setToolTipText(t("tutti.editCruise.field.gear.tip"));
1072         gearList.putClientProperty("help", "tutti.editCruise.field.gear.help");
1073         gearList.putClientProperty("validatorLabel", t("tutti.editCruise.field.gear"));
1074     }
1075 
1076     protected void createGearMenuPopup() {
1077         $objectMap.put("gearMenuPopup", gearMenuPopup = new JPopupMenu());
1078         
1079         gearMenuPopup.setName("gearMenuPopup");
1080     }
1081 
1082     protected void createGenerateNameButton() {
1083         $objectMap.put("generateNameButton", generateNameButton = new JButton());
1084         
1085         generateNameButton.setName("generateNameButton");
1086         generateNameButton.setText(t("tutti.editCruise.action.generateCampaignName"));
1087         generateNameButton.setToolTipText(t("tutti.editCruise.action.generateName.tip"));
1088         generateNameButton.putClientProperty("help", "tutti.editCruise.action.generateName.help");
1089         generateNameButton.putClientProperty("simpleAction", fr.ifremer.tutti.ui.swing.content.cruise.actions.GenerateCampaignNameAction.class);
1090     }
1091 
1092     protected EditCruiseUIHandler createHandler() {
1093         return new EditCruiseUIHandler();
1094     }
1095 
1096     protected void createHeadOfMissionList() {
1097         $objectMap.put("headOfMissionList", headOfMissionList = new BeanDoubleList<Person>());
1098         
1099         headOfMissionList.setName("headOfMissionList");
1100         headOfMissionList.setShowSelectPopupEnabled(true);
1101         headOfMissionList.setProperty("headOfMission");
1102         headOfMissionList.setShowReset(true);
1103         headOfMissionList.setToolTipText(t("tutti.editCruise.field.headOfMission.tip"));
1104         headOfMissionList.putClientProperty("help", "tutti.editCruise.field.headOfMission.help");
1105         headOfMissionList.putClientProperty("validatorLabel", t("tutti.editCruise.field.headOfMission"));
1106     }
1107 
1108     protected void createHeadOfSortRoomList() {
1109         $objectMap.put("headOfSortRoomList", headOfSortRoomList = new BeanDoubleList<Person>());
1110         
1111         headOfSortRoomList.setName("headOfSortRoomList");
1112         headOfSortRoomList.setShowSelectPopupEnabled(true);
1113         headOfSortRoomList.setProperty("headOfSortRoom");
1114         headOfSortRoomList.setShowReset(true);
1115         headOfSortRoomList.setToolTipText(t("tutti.editCruise.field.headOfSortRoom.tip"));
1116         headOfSortRoomList.putClientProperty("help", "tutti.editCruise.field.headOfSortRoom.help");
1117         headOfSortRoomList.putClientProperty("validatorLabel", t("tutti.editCruise.field.headOfSortRoom"));
1118     }
1119 
1120     protected void createMainPanelLayout() {
1121         $objectMap.put("mainPanelLayout", mainPanelLayout = new CardLayout2Ext(this, "editCruiseTopPanel"));
1122     }
1123 
1124     protected void createModel() {
1125         $objectMap.put("model", model = getContextValue(EditCruiseUIModel.class));
1126     }
1127 
1128     protected void createMultirigNumberField() {
1129         $objectMap.put("multirigNumberField", multirigNumberField = new NumberEditor(this));
1130         
1131         multirigNumberField.setName("multirigNumberField");
1132         multirigNumberField.setProperty("multirigNumber");
1133         multirigNumberField.setShowReset(true);
1134         multirigNumberField.putClientProperty("help", "tutti.editCruise.field.multirigNumber.help");
1135         multirigNumberField.putClientProperty("selectOnFocus", true);
1136         multirigNumberField.putClientProperty("validatorLabel", t("tutti.editCruise.field.multirigNumber"));
1137     }
1138 
1139     protected void createMultirigNumberLabel() {
1140         $objectMap.put("multirigNumberLabel", multirigNumberLabel = new JLabel());
1141         
1142         multirigNumberLabel.setName("multirigNumberLabel");
1143         multirigNumberLabel.setText(t("tutti.editCruise.field.multirigNumber"));
1144         multirigNumberLabel.setToolTipText(t("tutti.editCruise.field.multirigNumber.tip"));
1145         multirigNumberLabel.putClientProperty("help", "tutti.editCruise.field.multirigNumber.help");
1146     }
1147 
1148     protected void createNameField() {
1149         $objectMap.put("nameField", nameField = new JTextField());
1150         
1151         nameField.setName("nameField");
1152         nameField.setColumns(15);
1153         nameField.addKeyListener(JAXXUtil.getEventListener(KeyListener.class, "keyReleased", this, "doKeyReleased__on__nameField"));
1154         nameField.putClientProperty("help", "tutti.editCruise.field.name.help");
1155         nameField.putClientProperty("selectOnFocus", true);
1156         nameField.putClientProperty("validatorLabel", t("tutti.editCruise.field.name"));
1157     }
1158 
1159     protected void createNameLabel() {
1160         $objectMap.put("nameLabel", nameLabel = new JLabel());
1161         
1162         nameLabel.setName("nameLabel");
1163         nameLabel.setText(t("tutti.editCruise.field.name"));
1164         nameLabel.setToolTipText(t("tutti.editCruise.field.name.tip"));
1165         nameLabel.putClientProperty("help", "tutti.editCruise.field.name.help");
1166     }
1167 
1168     protected void createNameResetButton() {
1169         $objectMap.put("nameResetButton", nameResetButton = new JButton());
1170         
1171         nameResetButton.setName("nameResetButton");
1172         nameResetButton.setFocusable(false);
1173         nameResetButton.setToolTipText(t("tutti.editCruise.action.resetName.tip"));
1174         nameResetButton.addActionListener(JAXXUtil.getEventListener(ActionListener.class, "actionPerformed", this, "doActionPerformed__on__nameResetButton"));
1175         nameResetButton.putClientProperty("help", "tutti.editCruise.action.resetName.help");
1176         nameResetButton.putClientProperty("skipAction", true);
1177     }
1178 
1179     protected void createProgramComboBox() {
1180         $objectMap.put("programComboBox", programComboBox = new BeanFilterableComboBox<Program>(this));
1181         
1182         programComboBox.setName("programComboBox");
1183         programComboBox.setProperty("program");
1184         programComboBox.setShowReset(true);
1185         programComboBox.putClientProperty("help", "tutti.editCruise.field.program.help");
1186         programComboBox.putClientProperty("validatorLabel", t("tutti.editCruise.field.program"));
1187     }
1188 
1189     protected void createProgramLabel() {
1190         $objectMap.put("programLabel", programLabel = new JLabel());
1191         
1192         programLabel.setName("programLabel");
1193         programLabel.setText(t("tutti.editCruise.field.program"));
1194         programLabel.setToolTipText(t("tutti.editCruise.field.program.tip"));
1195         programLabel.putClientProperty("help", "tutti.editCruise.field.program.help");
1196     }
1197 
1198     protected void createResetButton() {
1199         $objectMap.put("resetButton", resetButton = new JButton());
1200         
1201         resetButton.setName("resetButton");
1202         resetButton.setText(t("tutti.editCruise.action.resetCruise"));
1203         resetButton.setToolTipText(t("tutti.editCruise.action.resetCruise.tip"));
1204         resetButton.putClientProperty("help", "tutti.editCruise.action.reset.help");
1205         resetButton.putClientProperty("applicationAction", fr.ifremer.tutti.ui.swing.content.cruise.actions.ResetCruiseAction.class);
1206     }
1207 
1208     protected void createReturnLocationComboBox() {
1209         $objectMap.put("returnLocationComboBox", returnLocationComboBox = new BeanFilterableComboBox<TuttiLocation>(this));
1210         
1211         returnLocationComboBox.setName("returnLocationComboBox");
1212         returnLocationComboBox.setProperty("returnLocation");
1213         returnLocationComboBox.setShowReset(true);
1214         returnLocationComboBox.putClientProperty("help", "tutti.editCruise.field.returnLocation.help");
1215         returnLocationComboBox.putClientProperty("validatorLabel", t("tutti.editCruise.field.returnLocation"));
1216     }
1217 
1218     protected void createReturnLocationLabel() {
1219         $objectMap.put("returnLocationLabel", returnLocationLabel = new JLabel());
1220         
1221         returnLocationLabel.setName("returnLocationLabel");
1222         returnLocationLabel.setText(t("tutti.editCruise.field.returnLocation"));
1223         returnLocationLabel.setToolTipText(t("tutti.editCruise.field.returnLocation.tip"));
1224         returnLocationLabel.putClientProperty("help", "tutti.editCruise.field.returnLocation.help");
1225     }
1226 
1227     protected void createSaveButton() {
1228         $objectMap.put("saveButton", saveButton = new JButton());
1229         
1230         saveButton.setName("saveButton");
1231         saveButton.setText(t("tutti.editCruise.action.saveCruise"));
1232         saveButton.setToolTipText(t("tutti.editCruise.action.saveCruise.tip"));
1233         saveButton.putClientProperty("help", "tutti.editCruise.action.save.help");
1234         saveButton.putClientProperty("applicationAction", fr.ifremer.tutti.ui.swing.content.cruise.actions.SaveCruiseAction.class);
1235     }
1236 
1237     protected void createSurveyPartField() {
1238         $objectMap.put("surveyPartField", surveyPartField = new JTextField());
1239         
1240         surveyPartField.setName("surveyPartField");
1241         surveyPartField.setColumns(15);
1242         surveyPartField.addKeyListener(JAXXUtil.getEventListener(KeyListener.class, "keyReleased", this, "doKeyReleased__on__surveyPartField"));
1243         surveyPartField.putClientProperty("help", "tutti.editCruise.field.surveyPart.help");
1244         surveyPartField.putClientProperty("selectOnFocus", true);
1245         surveyPartField.putClientProperty("validatorLabel", t("tutti.editCruise.field.surveyPart"));
1246     }
1247 
1248     protected void createSurveyPartLabel() {
1249         $objectMap.put("surveyPartLabel", surveyPartLabel = new JLabel());
1250         
1251         surveyPartLabel.setName("surveyPartLabel");
1252         surveyPartLabel.setText(t("tutti.editCruise.field.surveyPart"));
1253         surveyPartLabel.setToolTipText(t("tutti.editCruise.field.surveyPart.tip"));
1254         surveyPartLabel.putClientProperty("help", "tutti.editCruise.field.surveyPart.help");
1255     }
1256 
1257     protected void createSurveyPartResetButton() {
1258         $objectMap.put("surveyPartResetButton", surveyPartResetButton = new JButton());
1259         
1260         surveyPartResetButton.setName("surveyPartResetButton");
1261         surveyPartResetButton.setFocusable(false);
1262         surveyPartResetButton.setToolTipText(t("tutti.editCruise.action.resetSurveyPart.tip"));
1263         surveyPartResetButton.addActionListener(JAXXUtil.getEventListener(ActionListener.class, "actionPerformed", this, "doActionPerformed__on__surveyPartResetButton"));
1264         surveyPartResetButton.putClientProperty("help", "tutti.editCruise.action.resetSurveyPart.help");
1265         surveyPartResetButton.putClientProperty("skipAction", true);
1266     }
1267 
1268     protected void createTopToolBar() {
1269         $objectMap.put("topToolBar", topToolBar = new JToolBar());
1270         
1271         topToolBar.setName("topToolBar");
1272         topToolBar.setBorderPainted(false);
1273         topToolBar.setOpaque(false);
1274         topToolBar.setFloatable(false);
1275     }
1276 
1277     protected void createValidator() {
1278         $objectMap.put("validator", validator = SwingValidator.newValidator(EditCruiseUIModel.class, "validate"));
1279     }
1280 
1281     protected void createVesselComboBox() {
1282         $objectMap.put("vesselComboBox", vesselComboBox = new BeanFilterableComboBox<Vessel>(this));
1283         
1284         vesselComboBox.setName("vesselComboBox");
1285         vesselComboBox.setProperty("vessel");
1286         vesselComboBox.setShowReset(true);
1287         vesselComboBox.setToolTipText(t("tutti.editCruise.field.vessel.tip"));
1288         vesselComboBox.putClientProperty("help", "tutti.editCruise.field.vessel.help");
1289         vesselComboBox.putClientProperty("validatorLabel", t("tutti.editCruise.field.vessel"));
1290     }
1291 
1292     protected void createVesselFilterPane() {
1293         $objectMap.put("vesselFilterPane", vesselFilterPane = new JPanel());
1294         
1295         vesselFilterPane.setName("vesselFilterPane");
1296     }
1297 
1298     protected void createVesselLabel() {
1299         $objectMap.put("vesselLabel", vesselLabel = new JLabel());
1300         
1301         vesselLabel.setName("vesselLabel");
1302         vesselLabel.setText(t("tutti.editCruise.field.vessel"));
1303         vesselLabel.setToolTipText(t("tutti.editCruise.field.vessel.tip"));
1304         vesselLabel.putClientProperty("help", "tutti.editCruise.field.vessel.help");
1305     }
1306 
1307     protected void createViewGearCaracteristicsItem() {
1308         $objectMap.put("viewGearCaracteristicsItem", viewGearCaracteristicsItem = new JMenuItem());
1309         
1310         viewGearCaracteristicsItem.setName("viewGearCaracteristicsItem");
1311         viewGearCaracteristicsItem.setText(t("tutti.editCruise.action.viewGearCaracteristics"));
1312         viewGearCaracteristicsItem.setToolTipText(t("tutti.editCruise.action.viewGearCaracteristics.tip"));
1313         viewGearCaracteristicsItem.putClientProperty("help", "tutti.editCruise.action.viewGearCaracteristics.help");
1314         viewGearCaracteristicsItem.putClientProperty("applicationAction", fr.ifremer.tutti.ui.swing.content.cruise.actions.ViewGearCaracteristicsAction.class);
1315     }
1316 
1317     /*-----------------------------------------------------------------------*/
1318     /*------------------------ Internal jaxx methods ------------------------*/
1319     /*-----------------------------------------------------------------------*/
1320 
1321     private void $completeSetup() {
1322         allComponentsCreated = true;
1323         if (log.isDebugEnabled()) {
1324             log.debug(this);
1325         }
1326         addChildrenToEditCruiseTopPanel();
1327         addChildrenToValidator();
1328         addChildrenToTopToolBar();
1329         addChildrenToGearMenuPopup();
1330         // inline complete setup of $JPanel0
1331         $JPanel0.add(cruiseScrollPane, BorderLayout.CENTER);
1332         $JPanel0.add($JPanel6, BorderLayout.SOUTH);
1333         addChildrenToCruiseScrollPane();
1334         // inline complete setup of $Table0
1335         $Table0.add(programLabel, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0, 17, 1, new Insets(3, 3, 3, 3), 0, 0));
1336         $Table0.add(SwingUtil.boxComponentWithJxLayer(programComboBox), new GridBagConstraints(1, 0, 1, 1, 1.0, 0.0, 10, 1, new Insets(3, 3, 3, 3), 0, 0));
1337         $Table0.add(surveyPartLabel, new GridBagConstraints(2, 0, 1, 1, 0.0, 0.0, 10, 1, new Insets(3, 3, 3, 3), 0, 0));
1338         $Table0.add($JPanel1, new GridBagConstraints(3, 0, 1, 1, 0.0, 0.0, 10, 1, new Insets(3, 3, 3, 3), 0, 0));
1339         $Table0.add(departureLocationLabel, new GridBagConstraints(0, 1, 1, 1, 0.0, 0.0, 17, 1, new Insets(3, 3, 3, 3), 0, 0));
1340         $Table0.add(SwingUtil.boxComponentWithJxLayer(departureLocationComboBox), new GridBagConstraints(1, 1, 1, 1, 0.0, 0.0, 10, 1, new Insets(3, 3, 3, 3), 0, 0));
1341         $Table0.add(beginDateLabel, new GridBagConstraints(2, 1, 1, 1, 0.0, 0.0, 10, 1, new Insets(3, 3, 3, 3), 0, 0));
1342         $Table0.add($JPanel2, new GridBagConstraints(3, 1, 1, 1, 0.0, 0.0, 10, 1, new Insets(3, 3, 3, 3), 0, 0));
1343         $Table0.add(returnLocationLabel, new GridBagConstraints(0, 2, 1, 1, 0.0, 0.0, 17, 1, new Insets(3, 3, 3, 3), 0, 0));
1344         $Table0.add(SwingUtil.boxComponentWithJxLayer(returnLocationComboBox), new GridBagConstraints(1, 2, 1, 1, 0.0, 0.0, 10, 1, new Insets(3, 3, 3, 3), 0, 0));
1345         $Table0.add(endDateLabel, new GridBagConstraints(2, 2, 1, 1, 0.0, 0.0, 10, 1, new Insets(3, 3, 3, 3), 0, 0));
1346         $Table0.add($JPanel3, new GridBagConstraints(3, 2, 1, 1, 0.0, 0.0, 10, 1, new Insets(3, 3, 3, 3), 0, 0));
1347         $Table0.add(nameLabel, new GridBagConstraints(0, 3, 1, 1, 0.0, 0.0, 10, 1, new Insets(3, 3, 3, 3), 0, 0));
1348         $Table0.add($JPanel4, new GridBagConstraints(1, 3, 1, 1, 0.0, 0.0, 10, 1, new Insets(3, 3, 3, 3), 0, 0));
1349         $Table0.add(generateNameButton, new GridBagConstraints(2, 3, 2, 1, 0.0, 0.0, 10, 1, new Insets(3, 3, 3, 3), 0, 0));
1350         $Table0.add(multirigNumberLabel, new GridBagConstraints(0, 4, 1, 1, 0.0, 0.0, 10, 1, new Insets(3, 3, 3, 3), 0, 0));
1351         $Table0.add(SwingUtil.boxComponentWithJxLayer(multirigNumberField), new GridBagConstraints(1, 4, 1, 1, 0.0, 0.0, 10, 1, new Insets(3, 3, 3, 3), 0, 0));
1352         $Table0.add($JLabel0, new GridBagConstraints(2, 4, 2, 1, 0.0, 0.0, 10, 1, new Insets(3, 3, 3, 3), 0, 0));
1353         $Table0.add($JSeparator0, new GridBagConstraints(0, 5, 4, 1, 0.0, 0.0, 10, 1, new Insets(3, 3, 3, 3), 0, 0));
1354         $Table0.add(vesselFilterPane, new GridBagConstraints(0, 6, 4, 1, 0.0, 0.0, 10, 1, new Insets(3, 3, 3, 3), 0, 0));
1355         $Table0.add(vesselLabel, new GridBagConstraints(0, 7, 1, 1, 0.0, 0.0, 10, 1, new Insets(3, 3, 3, 3), 0, 0));
1356         $Table0.add(SwingUtil.boxComponentWithJxLayer(vesselComboBox), new GridBagConstraints(1, 7, 3, 1, 0.0, 0.0, 10, 1, new Insets(3, 3, 3, 3), 0, 0));
1357         $Table0.add(SwingUtil.boxComponentWithJxLayer(gearList), new GridBagConstraints(0, 8, 4, 1, 0.0, 0.3, 10, 1, new Insets(3, 3, 3, 3), 0, 0));
1358         $Table0.add($JPanel5, new GridBagConstraints(0, 9, 4, 1, 0.0, 0.3, 10, 1, new Insets(3, 3, 3, 3), 0, 0));
1359         $Table0.add(SwingUtil.boxComponentWithJxLayer(commentPane), new GridBagConstraints(0, 10, 4, 1, 0.0, 0.3, 10, 1, new Insets(3, 3, 3, 3), 0, 0));
1360         // inline complete setup of $JPanel1
1361         $JPanel1.add($JToolBar0, BorderLayout.WEST);
1362         $JPanel1.add(SwingUtil.boxComponentWithJxLayer(surveyPartField), BorderLayout.CENTER);
1363         // inline complete setup of $JToolBar0
1364         $JToolBar0.add(surveyPartResetButton);
1365         // inline complete setup of $JPanel2
1366         $JPanel2.add(SwingUtil.boxComponentWithJxLayer(beginDateField), BorderLayout.CENTER);
1367         $JPanel2.add(beginTimeField, BorderLayout.EAST);
1368         // inline complete setup of $JPanel3
1369         $JPanel3.add(SwingUtil.boxComponentWithJxLayer(endDateField), BorderLayout.CENTER);
1370         $JPanel3.add(endTimeField, BorderLayout.EAST);
1371         // inline complete setup of $JPanel4
1372         $JPanel4.add($JToolBar1, BorderLayout.WEST);
1373         $JPanel4.add(SwingUtil.boxComponentWithJxLayer(nameField));
1374         // inline complete setup of $JToolBar1
1375         $JToolBar1.add(nameResetButton);
1376         addChildrenToVesselFilterPane();
1377         addChildrenToFilterVesselAllButton();
1378         addChildrenToFilterVesselScientificButton();
1379         addChildrenToFilterVesselFishingButton();
1380         // inline complete setup of $JPanel5
1381         $JPanel5.add(SwingUtil.boxComponentWithJxLayer(headOfMissionList));
1382         $JPanel5.add(SwingUtil.boxComponentWithJxLayer(headOfSortRoomList));
1383         addChildrenToCommentPane();
1384         // inline complete setup of $JPanel6
1385         $JPanel6.add(closeButton);
1386         $JPanel6.add(resetButton);
1387         $JPanel6.add(saveButton);
1388         addChildrenToGearCaracteristicsEditorTitledPanel();
1389         
1390         // apply 20 data bindings
1391         JAXXUtil.applyDataBinding(this, $bindings.keySet());
1392         
1393         // apply 54 property setters
1394         programComboBox.setBeanType(Program.class);
1395         departureLocationComboBox.setBeanType(TuttiLocation.class);
1396         returnLocationComboBox.setBeanType(TuttiLocation.class);
1397         vesselComboBox.setBeanType(Vessel.class);
1398         gearList.setBeanType(Gear.class);
1399         headOfMissionList.setBeanType(Person.class);
1400         headOfSortRoomList.setBeanType(Person.class);
1401         editGearCaracteristicsItem.setIcon(SwingUtil.createActionIcon("edit"));
1402         viewGearCaracteristicsItem.setIcon(SwingUtil.createActionIcon("show-frequency"));
1403         programLabel.setLabelFor(programComboBox);
1404         programComboBox.setBean(model);
1405         surveyPartLabel.setLabelFor(surveyPartField);
1406         surveyPartResetButton.setIcon(SwingUtil.createActionIcon("reset"));
1407         departureLocationLabel.setLabelFor(departureLocationComboBox);
1408         departureLocationComboBox.setBean(model);
1409         beginDateLabel.setLabelFor(beginDateField);
1410         beginTimeField.setBean(model);
1411         returnLocationLabel.setLabelFor(returnLocationComboBox);
1412         returnLocationComboBox.setBean(model);
1413         endDateLabel.setLabelFor(endDateField);
1414         endTimeField.setBean(model);
1415         nameLabel.setLabelFor(nameField);
1416         nameResetButton.setIcon(SwingUtil.createActionIcon("reset"));
1417         generateNameButton.setMnemonic(SwingUtil.getFirstCharAt(t("tutti.editCruise.action.generateCampaignName.mnemonic"),'Z'));
1418         generateNameButton.setIcon(SwingUtil.createActionIcon("generate"));
1419         multirigNumberLabel.setLabelFor(multirigNumberField);
1420         multirigNumberField.setAutoPopup(handler.getConfig().isAutoPopupNumberEditor());
1421         multirigNumberField.setNumberType(Integer.class);
1422         multirigNumberField.setShowPopupButton(handler.getConfig().isShowNumberEditorButton());
1423         multirigNumberField.setBean(model);
1424         filterVesselLabel.setIcon(SwingUtil.createActionIcon("filter"));
1425         vesselLabel.setLabelFor(vesselComboBox);
1426         vesselComboBox.setBean(model);
1427         gearList.setBorder(BorderFactory.createTitledBorder(t("tutti.editCruise.field.gear")));
1428         gearList.setBean(model);
1429         headOfMissionList.setBorder(BorderFactory.createTitledBorder(t("tutti.editCruise.field.headOfMission")));
1430         headOfMissionList.setBean(model);
1431         headOfSortRoomList.setBorder(BorderFactory.createTitledBorder(t("tutti.editCruise.field.headOfSortRoom")));
1432         headOfSortRoomList.setBean(model);
1433         commentPane.setBorder(BorderFactory.createTitledBorder(t("tutti.editCruise.field.comment")));
1434         closeButton.setMnemonic(SwingUtil.getFirstCharAt(t("tutti.editCruise.action.closeEditCruise.mnemonic"),'Z'));
1435         closeButton.setIcon(SwingUtil.createActionIcon("cancel"));
1436         resetButton.setMnemonic(SwingUtil.getFirstCharAt(t("tutti.editCruise.action.resetCruise.mnemonic"),'Z'));
1437         resetButton.setIcon(SwingUtil.createActionIcon("reset"));
1438         saveButton.setMnemonic(SwingUtil.getFirstCharAt(t("tutti.editCruise.action.saveCruise.mnemonic"),'Z'));
1439         saveButton.setIcon(SwingUtil.createActionIcon("save"));
1440         // late initializer
1441         // help broker setup
1442         TuttiHelpBroker _broker = getBroker();
1443         registerHelpId(_broker, editCruiseTopPanel, "tutti.editCruise.help");
1444         registerHelpId(_broker, editGearCaracteristicsItem, "tutti.editCruise.action.editGearCaracteristics.help");
1445         registerHelpId(_broker, viewGearCaracteristicsItem, "tutti.editCruise.action.viewGearCaracteristics.help");
1446         registerHelpId(_broker, programLabel, "tutti.editCruise.field.program.help");
1447         registerHelpId(_broker, programComboBox, "tutti.editCruise.field.program.help");
1448         registerHelpId(_broker, surveyPartLabel, "tutti.editCruise.field.surveyPart.help");
1449         registerHelpId(_broker, surveyPartResetButton, "tutti.editCruise.action.resetSurveyPart.help");
1450         registerHelpId(_broker, surveyPartField, "tutti.editCruise.field.surveyPart.help");
1451         registerHelpId(_broker, departureLocationLabel, "tutti.editCruise.field.departureLocation.help");
1452         registerHelpId(_broker, departureLocationComboBox, "tutti.editCruise.field.departureLocation.help");
1453         registerHelpId(_broker, beginDateLabel, "tutti.editCruise.field.beginDate.help");
1454         registerHelpId(_broker, beginDateField, "tutti.editCruise.field.beginDate.help");
1455         registerHelpId(_broker, beginTimeField, "tutti.editCruise.field.beginTime.help");
1456         registerHelpId(_broker, returnLocationLabel, "tutti.editCruise.field.returnLocation.help");
1457         registerHelpId(_broker, returnLocationComboBox, "tutti.editCruise.field.returnLocation.help");
1458         registerHelpId(_broker, endDateLabel, "tutti.editCruise.field.endDate.help");
1459         registerHelpId(_broker, endDateField, "tutti.editCruise.field.endDate.help");
1460         registerHelpId(_broker, endTimeField, "tutti.editCruise.field.endTime.help");
1461         registerHelpId(_broker, nameLabel, "tutti.editCruise.field.name.help");
1462         registerHelpId(_broker, nameResetButton, "tutti.editCruise.action.resetName.help");
1463         registerHelpId(_broker, nameField, "tutti.editCruise.field.name.help");
1464         registerHelpId(_broker, generateNameButton, "tutti.editCruise.action.generateName.help");
1465         registerHelpId(_broker, multirigNumberLabel, "tutti.editCruise.field.multirigNumber.help");
1466         registerHelpId(_broker, multirigNumberField, "tutti.editCruise.field.multirigNumber.help");
1467         registerHelpId(_broker, filterVesselLabel, "tutti.editCruise.filterVessel.help");
1468         registerHelpId(_broker, vesselLabel, "tutti.editCruise.field.vessel.help");
1469         registerHelpId(_broker, vesselComboBox, "tutti.editCruise.field.vessel.help");
1470         registerHelpId(_broker, gearList, "tutti.editCruise.field.gear.help");
1471         registerHelpId(_broker, headOfMissionList, "tutti.editCruise.field.headOfMission.help");
1472         registerHelpId(_broker, headOfSortRoomList, "tutti.editCruise.field.headOfSortRoom.help");
1473         registerHelpId(_broker, commentPane, "tutti.editCruise.field.comment.help");
1474         registerHelpId(_broker, closeButton, "tutti.editCruise.action.close.help");
1475         registerHelpId(_broker, resetButton, "tutti.editCruise.action.reset.help");
1476         registerHelpId(_broker, saveButton, "tutti.editCruise.action.save.help");
1477         _broker.prepareUI(this);
1478         // register 1 validator(s)
1479         validatorIds = SwingValidatorUtil.detectValidators(this);
1480         SwingValidatorUtil.installUI(this);
1481     }
1482 
1483     private void $initialize() {
1484         if (allComponentsCreated) {
1485             return;
1486         }
1487         if (log.isDebugEnabled()) {
1488             log.debug(this);
1489         }
1490         handler.beforeInit(this);
1491         $objectMap.put("editCruiseTopPanel", editCruiseTopPanel);
1492         createModel();
1493         createValidator();
1494         createMainPanelLayout();
1495         createBroker();
1496         createTopToolBar();
1497         createAttachmentsButton();
1498         createGearMenuPopup();
1499         createEditGearCaracteristicsItem();
1500         createViewGearCaracteristicsItem();
1501         // inline creation of $JPanel0
1502         $objectMap.put("$JPanel0", $JPanel0 = new JPanel());
1503         
1504         $JPanel0.setName("$JPanel0");
1505         $JPanel0.setLayout(new BorderLayout());
1506         createCruiseScrollPane();
1507         // inline creation of $Table0
1508         $objectMap.put("$Table0", $Table0 = new Table());
1509         
1510         $Table0.setName("$Table0");
1511         createProgramLabel();
1512         createProgramComboBox();
1513         createSurveyPartLabel();
1514         // inline creation of $JPanel1
1515         $objectMap.put("$JPanel1", $JPanel1 = new JPanel());
1516         
1517         $JPanel1.setName("$JPanel1");
1518         $JPanel1.setLayout(new BorderLayout());
1519         // inline creation of $JToolBar0
1520         $objectMap.put("$JToolBar0", $JToolBar0 = new JToolBar());
1521         
1522         $JToolBar0.setName("$JToolBar0");
1523         $JToolBar0.setBorderPainted(false);
1524         $JToolBar0.setOpaque(false);
1525         $JToolBar0.setFloatable(false);
1526         createSurveyPartResetButton();
1527         createSurveyPartField();
1528         createDepartureLocationLabel();
1529         createDepartureLocationComboBox();
1530         createBeginDateLabel();
1531         // inline creation of $JPanel2
1532         $objectMap.put("$JPanel2", $JPanel2 = new JPanel());
1533         
1534         $JPanel2.setName("$JPanel2");
1535         $JPanel2.setLayout(new BorderLayout());
1536         createBeginDateField();
1537         createBeginTimeField();
1538         createReturnLocationLabel();
1539         createReturnLocationComboBox();
1540         createEndDateLabel();
1541         // inline creation of $JPanel3
1542         $objectMap.put("$JPanel3", $JPanel3 = new JPanel());
1543         
1544         $JPanel3.setName("$JPanel3");
1545         $JPanel3.setLayout(new BorderLayout());
1546         createEndDateField();
1547         createEndTimeField();
1548         createNameLabel();
1549         // inline creation of $JPanel4
1550         $objectMap.put("$JPanel4", $JPanel4 = new JPanel());
1551         
1552         $JPanel4.setName("$JPanel4");
1553         $JPanel4.setLayout(new BorderLayout());
1554         // inline creation of $JToolBar1
1555         $objectMap.put("$JToolBar1", $JToolBar1 = new JToolBar());
1556         
1557         $JToolBar1.setName("$JToolBar1");
1558         $JToolBar1.setBorderPainted(false);
1559         $JToolBar1.setOpaque(false);
1560         $JToolBar1.setFloatable(false);
1561         createNameResetButton();
1562         createNameField();
1563         createGenerateNameButton();
1564         createMultirigNumberLabel();
1565         createMultirigNumberField();
1566         // inline creation of $JLabel0
1567         $objectMap.put("$JLabel0", $JLabel0 = new JLabel());
1568         
1569         $JLabel0.setName("$JLabel0");
1570         // inline creation of $JSeparator0
1571         $objectMap.put("$JSeparator0", $JSeparator0 = new JSeparator(SwingConstants.HORIZONTAL));
1572         
1573         $JSeparator0.setName("$JSeparator0");
1574         createVesselFilterPane();
1575         createFilterVesselLabel();
1576         createFilterVesselAllButton();
1577         createFilterVesselScientificButton();
1578         createFilterVesselFishingButton();
1579         createVesselLabel();
1580         createVesselComboBox();
1581         createGearList();
1582         // inline creation of $JPanel5
1583         $objectMap.put("$JPanel5", $JPanel5 = new JPanel());
1584         
1585         $JPanel5.setName("$JPanel5");
1586         $JPanel5.setLayout(new GridLayout(1, 0));
1587         createHeadOfMissionList();
1588         createHeadOfSortRoomList();
1589         createCommentPane();
1590         createCommentField();
1591         // inline creation of $JPanel6
1592         $objectMap.put("$JPanel6", $JPanel6 = new JPanel());
1593         
1594         $JPanel6.setName("$JPanel6");
1595         $JPanel6.setLayout(new GridLayout(1, 0));
1596         SwingUtil.setComponentHeight($JPanel6,50);
1597         createCloseButton();
1598         createResetButton();
1599         createSaveButton();
1600         createGearCaracteristicsEditorTitledPanel();
1601         createGearCaracteristicsEditor();
1602         createFilterVesselType();
1603         // inline creation of editCruiseTopPanel
1604         setName("editCruiseTopPanel");
1605         setLayout(mainPanelLayout);
1606         editCruiseTopPanel.putClientProperty("help", "tutti.editCruise.help");
1607         
1608         // registers 20 data bindings
1609         $registerDefaultBindings();
1610         $completeSetup();
1611         handler.afterInit(this);
1612     }
1613 
1614     private void $registerDefaultBindings() {
1615         // register 20 data bindings
1616         registerDataBinding(new DefaultJAXXBinding(this, BINDING_ATTACHMENTS_BUTTON_ENABLED, true) {
1617         
1618             @Override
1619             public void applyDataBinding() {
1620                 if (model != null) {
1621                     model.addPropertyChangeListener("id", this);
1622                 }
1623             }
1624         
1625             @Override
1626             public void processDataBinding() {
1627                 if (model != null) {
1628                     attachmentsButton.setEnabled(model.getId() != null);
1629                 }
1630             }
1631         
1632             @Override
1633             public void removeDataBinding() {
1634                 if (model != null) {
1635                     model.removePropertyChangeListener("id", this);
1636                 }
1637             }
1638         });
1639         registerDataBinding(new DefaultJAXXBinding(this, BINDING_EDIT_GEAR_CARACTERISTICS_ITEM_ENABLED, true) {
1640         
1641             @Override
1642             public void applyDataBinding() {
1643                 if (model != null) {
1644                     model.addPropertyChangeListener("canEditGearCatacteristic", this);
1645                 }
1646             }
1647         
1648             @Override
1649             public void processDataBinding() {
1650                 if (model != null) {
1651                     editGearCaracteristicsItem.setEnabled(model.isCanEditGearCatacteristic());
1652                 }
1653             }
1654         
1655             @Override
1656             public void removeDataBinding() {
1657                 if (model != null) {
1658                     model.removePropertyChangeListener("canEditGearCatacteristic", this);
1659                 }
1660             }
1661         });
1662         registerDataBinding(new DefaultJAXXBinding(this, BINDING_VIEW_GEAR_CARACTERISTICS_ITEM_ENABLED, true) {
1663         
1664             @Override
1665             public void applyDataBinding() {
1666                 if (model != null) {
1667                     model.addPropertyChangeListener("canShowGearCatacteristic", this);
1668                 }
1669             }
1670         
1671             @Override
1672             public void processDataBinding() {
1673                 if (model != null) {
1674                     viewGearCaracteristicsItem.setEnabled(model.isCanShowGearCatacteristic());
1675                 }
1676             }
1677         
1678             @Override
1679             public void removeDataBinding() {
1680                 if (model != null) {
1681                     model.removePropertyChangeListener("canShowGearCatacteristic", this);
1682                 }
1683             }
1684         });
1685         registerDataBinding(new DefaultJAXXBinding(this, BINDING_PROGRAM_COMBO_BOX_SELECTED_ITEM, true) {
1686         
1687             @Override
1688             public void applyDataBinding() {
1689                 if (model != null) {
1690                     model.addPropertyChangeListener("program", this);
1691                 }
1692             }
1693         
1694             @Override
1695             public void processDataBinding() {
1696                 if (model != null) {
1697                     programComboBox.setSelectedItem(model.getProgram());
1698                 }
1699             }
1700         
1701             @Override
1702             public void removeDataBinding() {
1703                 if (model != null) {
1704                     model.removePropertyChangeListener("program", this);
1705                 }
1706             }
1707         });
1708         registerDataBinding(new DefaultJAXXBinding(this, BINDING_SURVEY_PART_FIELD_TEXT, true) {
1709         
1710             @Override
1711             public void applyDataBinding() {
1712                 if (model != null) {
1713                     model.addPropertyChangeListener("surveyPart", this);
1714                 }
1715             }
1716         
1717             @Override
1718             public void processDataBinding() {
1719                 if (model != null) {
1720                     SwingUtil.setText(surveyPartField, model.getSurveyPart());
1721                 }
1722             }
1723         
1724             @Override
1725             public void removeDataBinding() {
1726                 if (model != null) {
1727                     model.removePropertyChangeListener("surveyPart", this);
1728                 }
1729             }
1730         });
1731         registerDataBinding(new DefaultJAXXBinding(this, BINDING_DEPARTURE_LOCATION_COMBO_BOX_SELECTED_ITEM, true) {
1732         
1733             @Override
1734             public void applyDataBinding() {
1735                 if (model != null) {
1736                     model.addPropertyChangeListener("departureLocation", this);
1737                 }
1738             }
1739         
1740             @Override
1741             public void processDataBinding() {
1742                 if (model != null) {
1743                     departureLocationComboBox.setSelectedItem(model.getDepartureLocation());
1744                 }
1745             }
1746         
1747             @Override
1748             public void removeDataBinding() {
1749                 if (model != null) {
1750                     model.removePropertyChangeListener("departureLocation", this);
1751                 }
1752             }
1753         });
1754         registerDataBinding(new DefaultJAXXBinding(this, BINDING_BEGIN_DATE_FIELD_DATE, true) {
1755         
1756             @Override
1757             public void applyDataBinding() {
1758                 if (model != null) {
1759                     model.addPropertyChangeListener("beginDate", this);
1760                 }
1761             }
1762         
1763             @Override
1764             public void processDataBinding() {
1765                 if (model != null) {
1766                     beginDateField.setDate(model.getBeginDate());
1767                 }
1768             }
1769         
1770             @Override
1771             public void removeDataBinding() {
1772                 if (model != null) {
1773                     model.removePropertyChangeListener("beginDate", this);
1774                 }
1775             }
1776         });
1777         registerDataBinding(new DefaultJAXXBinding(this, BINDING_RETURN_LOCATION_COMBO_BOX_SELECTED_ITEM, true) {
1778         
1779             @Override
1780             public void applyDataBinding() {
1781                 if (model != null) {
1782                     model.addPropertyChangeListener("returnLocation", this);
1783                 }
1784             }
1785         
1786             @Override
1787             public void processDataBinding() {
1788                 if (model != null) {
1789                     returnLocationComboBox.setSelectedItem(model.getReturnLocation());
1790                 }
1791             }
1792         
1793             @Override
1794             public void removeDataBinding() {
1795                 if (model != null) {
1796                     model.removePropertyChangeListener("returnLocation", this);
1797                 }
1798             }
1799         });
1800         registerDataBinding(new DefaultJAXXBinding(this, BINDING_END_DATE_FIELD_DATE, true) {
1801         
1802             @Override
1803             public void applyDataBinding() {
1804                 if (model != null) {
1805                     model.addPropertyChangeListener("endDate", this);
1806                 }
1807             }
1808         
1809             @Override
1810             public void processDataBinding() {
1811                 if (model != null) {
1812                     endDateField.setDate(model.getEndDate());
1813                 }
1814             }
1815         
1816             @Override
1817             public void removeDataBinding() {
1818                 if (model != null) {
1819                     model.removePropertyChangeListener("endDate", this);
1820                 }
1821             }
1822         });
1823         registerDataBinding(new DefaultJAXXBinding(this, BINDING_NAME_FIELD_TEXT, true) {
1824         
1825             @Override
1826             public void applyDataBinding() {
1827                 if (model != null) {
1828                     model.addPropertyChangeListener("name", this);
1829                 }
1830             }
1831         
1832             @Override
1833             public void processDataBinding() {
1834                 if (model != null) {
1835                     SwingUtil.setText(nameField, model.getName());
1836                 }
1837             }
1838         
1839             @Override
1840             public void removeDataBinding() {
1841                 if (model != null) {
1842                     model.removePropertyChangeListener("name", this);
1843                 }
1844             }
1845         });
1846         registerDataBinding(new DefaultJAXXBinding(this, BINDING_GENERATE_NAME_BUTTON_ENABLED, true) {
1847         
1848             @Override
1849             public void applyDataBinding() {
1850                 if (model != null) {
1851                     model.addPropertyChangeListener("canGenerateName", this);
1852                 }
1853             }
1854         
1855             @Override
1856             public void processDataBinding() {
1857                 if (model != null) {
1858                     generateNameButton.setEnabled(model.isCanGenerateName());
1859                 }
1860             }
1861         
1862             @Override
1863             public void removeDataBinding() {
1864                 if (model != null) {
1865                     model.removePropertyChangeListener("canGenerateName", this);
1866                 }
1867             }
1868         });
1869         registerDataBinding(new SimpleJAXXObjectBinding(this, BINDING_MULTIRIG_NUMBER_FIELD_NUMBER_PATTERN, true ,"INT_1_DIGITS_PATTERN") {
1870         
1871             @Override
1872             public void processDataBinding() {
1873                 multirigNumberField.setNumberPattern(INT_1_DIGITS_PATTERN);
1874             }
1875         });
1876         registerDataBinding(new DefaultJAXXBinding(this, BINDING_MULTIRIG_NUMBER_FIELD_NUMBER_VALUE, true) {
1877         
1878             @Override
1879             public void applyDataBinding() {
1880                 if (model != null) {
1881                     model.addPropertyChangeListener("multirigNumber", this);
1882                 }
1883             }
1884         
1885             @Override
1886             public void processDataBinding() {
1887                 if (model != null) {
1888                     multirigNumberField.setNumberValue(model.getMultirigNumber());
1889                 }
1890             }
1891         
1892             @Override
1893             public void removeDataBinding() {
1894                 if (model != null) {
1895                     model.removePropertyChangeListener("multirigNumber", this);
1896                 }
1897             }
1898         });
1899         registerDataBinding(new DefaultJAXXBinding(this, BINDING_FILTER_VESSEL_ALL_BUTTON_SELECTED, true) {
1900         
1901             @Override
1902             public void applyDataBinding() {
1903                 if (model != null) {
1904                     model.addPropertyChangeListener("vesselTypeAll", this);
1905                 }
1906             }
1907         
1908             @Override
1909             public void processDataBinding() {
1910                 if (model != null) {
1911                     filterVesselAllButton.setSelected(model.isVesselTypeAll());
1912                 }
1913             }
1914         
1915             @Override
1916             public void removeDataBinding() {
1917                 if (model != null) {
1918                     model.removePropertyChangeListener("vesselTypeAll", this);
1919                 }
1920             }
1921         });
1922         registerDataBinding(new DefaultJAXXBinding(this, BINDING_FILTER_VESSEL_SCIENTIFIC_BUTTON_SELECTED, true) {
1923         
1924             @Override
1925             public void applyDataBinding() {
1926                 if (model != null) {
1927                     model.addPropertyChangeListener("vesselTypeScientific", this);
1928                 }
1929             }
1930         
1931             @Override
1932             public void processDataBinding() {
1933                 if (model != null) {
1934                     filterVesselScientificButton.setSelected(model.isVesselTypeScientific());
1935                 }
1936             }
1937         
1938             @Override
1939             public void removeDataBinding() {
1940                 if (model != null) {
1941                     model.removePropertyChangeListener("vesselTypeScientific", this);
1942                 }
1943             }
1944         });
1945         registerDataBinding(new DefaultJAXXBinding(this, BINDING_FILTER_VESSEL_FISHING_BUTTON_SELECTED, true) {
1946         
1947             @Override
1948             public void applyDataBinding() {
1949                 if (model != null) {
1950                     model.addPropertyChangeListener("vesselTypeFishing", this);
1951                 }
1952             }
1953         
1954             @Override
1955             public void processDataBinding() {
1956                 if (model != null) {
1957                     filterVesselFishingButton.setSelected(model.isVesselTypeFishing());
1958                 }
1959             }
1960         
1961             @Override
1962             public void removeDataBinding() {
1963                 if (model != null) {
1964                     model.removePropertyChangeListener("vesselTypeFishing", this);
1965                 }
1966             }
1967         });
1968         registerDataBinding(new DefaultJAXXBinding(this, BINDING_VESSEL_COMBO_BOX_SELECTED_ITEM, true) {
1969         
1970             @Override
1971             public void applyDataBinding() {
1972                 if (model != null) {
1973                     model.addPropertyChangeListener("vessel", this);
1974                 }
1975             }
1976         
1977             @Override
1978             public void processDataBinding() {
1979                 if (model != null) {
1980                     vesselComboBox.setSelectedItem(model.getVessel());
1981                 }
1982             }
1983         
1984             @Override
1985             public void removeDataBinding() {
1986                 if (model != null) {
1987                     model.removePropertyChangeListener("vessel", this);
1988                 }
1989             }
1990         });
1991         registerDataBinding(new DefaultJAXXBinding(this, BINDING_COMMENT_FIELD_TEXT, true) {
1992         
1993             @Override
1994             public void applyDataBinding() {
1995                 if (model != null) {
1996                     model.addPropertyChangeListener("comment", this);
1997                 }
1998             }
1999         
2000             @Override
2001             public void processDataBinding() {
2002                 if (model != null) {
2003                     SwingUtil.setText(commentField, model.getComment());
2004                 }
2005             }
2006         
2007             @Override
2008             public void removeDataBinding() {
2009                 if (model != null) {
2010                     model.removePropertyChangeListener("comment", this);
2011                 }
2012             }
2013         });
2014         registerDataBinding(new DefaultJAXXBinding(this, BINDING_RESET_BUTTON_ENABLED, true, true) {
2015         
2016             @Override
2017             public void applyDataBinding() {
2018                 if (model != null) {
2019                     model.addPropertyChangeListener("modify", this);
2020                 }
2021                 if (model != null) {
2022                     model.addPropertyChangeListener("create", this);
2023                 }
2024             }
2025         
2026             @Override
2027             public void processDataBinding() {
2028                 if (model != null) {
2029                     resetButton.setEnabled(model.isModify() && !model.isCreate());
2030                 }
2031             }
2032         
2033             @Override
2034             public void removeDataBinding() {
2035                 if (model != null) {
2036                     model.removePropertyChangeListener("modify", this);
2037                 }
2038                 if (model != null) {
2039                     model.removePropertyChangeListener("create", this);
2040                 }
2041             }
2042         });
2043         registerDataBinding(new DefaultJAXXBinding(this, BINDING_SAVE_BUTTON_ENABLED, true, true) {
2044         
2045             @Override
2046             public void applyDataBinding() {
2047                 if (model != null) {
2048                     model.addPropertyChangeListener("modify", this);
2049                 }
2050                 if (model != null) {
2051                     model.addPropertyChangeListener("valid", this);
2052                 }
2053             }
2054         
2055             @Override
2056             public void processDataBinding() {
2057                 if (model != null) {
2058                     saveButton.setEnabled(model.isModify() && model.isValid());
2059                 }
2060             }
2061         
2062             @Override
2063             public void removeDataBinding() {
2064                 if (model != null) {
2065                     model.removePropertyChangeListener("modify", this);
2066                 }
2067                 if (model != null) {
2068                     model.removePropertyChangeListener("valid", this);
2069                 }
2070             }
2071         });
2072     }
2073 
2074 }