View Javadoc
1   package fr.ifremer.tutti.ui.swing.content.genericformat;
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.ui.swing.TuttiHelpBroker;
29  import fr.ifremer.tutti.ui.swing.content.genericformat.tree.DataSelectTreeModel;
30  import fr.ifremer.tutti.ui.swing.content.genericformat.tree.ExportDataSelectTreeCellRenderer;
31  import fr.ifremer.tutti.ui.swing.util.TuttiUI;
32  import fr.ifremer.tutti.ui.swing.util.TuttiUIUtil;
33  import java.awt.BorderLayout;
34  import java.awt.Component;
35  import java.awt.Container;
36  import java.awt.GridBagConstraints;
37  import java.awt.GridLayout;
38  import java.awt.Insets;
39  import java.awt.LayoutManager;
40  import java.awt.event.ItemEvent;
41  import java.awt.event.ItemListener;
42  import java.util.ArrayList;
43  import java.util.HashMap;
44  import java.util.List;
45  import java.util.Map;
46  import java.util.TreeMap;
47  import javax.swing.BorderFactory;
48  import javax.swing.JButton;
49  import javax.swing.JCheckBox;
50  import javax.swing.JLabel;
51  import javax.swing.JPanel;
52  import javax.swing.JScrollPane;
53  import javax.swing.JToolBar;
54  import javax.swing.JTree;
55  import javax.swing.tree.DefaultTreeModel;
56  import jaxx.runtime.JAXXBinding;
57  import jaxx.runtime.JAXXContext;
58  import jaxx.runtime.JAXXObject;
59  import jaxx.runtime.JAXXObjectDescriptor;
60  import jaxx.runtime.JAXXUtil;
61  import jaxx.runtime.JAXXValidator;
62  import jaxx.runtime.SwingUtil;
63  import jaxx.runtime.binding.DefaultJAXXBinding;
64  import jaxx.runtime.context.DefaultJAXXContext;
65  import jaxx.runtime.swing.Table;
66  import jaxx.runtime.swing.editor.bean.BeanFilterableComboBox;
67  import jaxx.runtime.swing.help.JAXXHelpUI;
68  import jaxx.runtime.validator.swing.SwingValidator;
69  import jaxx.runtime.validator.swing.SwingValidatorUtil;
70  import jaxx.runtime.validator.swing.meta.Validator;
71  import jaxx.runtime.validator.swing.meta.ValidatorField;
72  import jaxx.runtime.validator.swing.ui.ImageValidationUI;
73  import org.apache.commons.logging.Log;
74  import org.apache.commons.logging.LogFactory;
75  import static jaxx.runtime.SwingUtil.getStringValue;
76  import static org.nuiton.i18n.I18n.t;
77  
78  public class GenericFormatExportUI extends JPanel implements JAXXHelpUI<TuttiHelpBroker>, TuttiUI<GenericFormatExportUIModel, GenericFormatExportUIHandler>, JAXXObject, JAXXValidator {
79  
80      /*-----------------------------------------------------------------------*/
81      /*------------------ Constants for all public bindings ------------------*/
82      /*-----------------------------------------------------------------------*/
83  
84      public static final String BINDING_EXPORT_ACCIDENTAL_CATCH_CHECK_BOX_SELECTED = "exportAccidentalCatchCheckBox.selected";
85      public static final String BINDING_EXPORT_ATTACHMENTS_CHECK_BOX_SELECTED = "exportAttachmentsCheckBox.selected";
86      public static final String BINDING_EXPORT_BENTHOS_CHECK_BOX_SELECTED = "exportBenthosCheckBox.selected";
87      public static final String BINDING_EXPORT_BUTTON_ENABLED = "exportButton.enabled";
88      public static final String BINDING_EXPORT_INDIVIDUAL_OBSERVATION_CHECK_BOX_SELECTED = "exportIndividualObservationCheckBox.selected";
89      public static final String BINDING_EXPORT_MARINE_LITTER_CHECK_BOX_SELECTED = "exportMarineLitterCheckBox.selected";
90      public static final String BINDING_EXPORT_SPECIES_CHECK_BOX_SELECTED = "exportSpeciesCheckBox.selected";
91      public static final String BINDING_FOLD_ALL_BUTTON_ENABLED = "foldAllButton.enabled";
92      public static final String BINDING_PROGRAM_COMBO_BOX_SELECTED_ITEM = "programComboBox.selectedItem";
93      public static final String BINDING_SELECT_ALL_BUTTON_ENABLED = "selectAllButton.enabled";
94      public static final String BINDING_UNFOLD_ALL_BUTTON_ENABLED = "unfoldAllButton.enabled";
95      public static final String BINDING_UNSELECT_ALL_BUTTON_ENABLED = "unselectAllButton.enabled";
96  
97      /*-----------------------------------------------------------------------*/
98      /*------------------------- Other static fields -------------------------*/
99      /*-----------------------------------------------------------------------*/
100 
101     private static final String $jaxxObjectDescriptor = "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";
102     private static final Log log = LogFactory.getLog(GenericFormatExportUI.class);
103     private static final long serialVersionUID = 1L;
104 
105     /*-----------------------------------------------------------------------*/
106     /*--------------------------- Internal states ---------------------------*/
107     /*-----------------------------------------------------------------------*/
108 
109     protected List<Object> $activeBindings = new ArrayList<Object>();
110     protected Map<String, Object> $bindingSources = new HashMap<String, Object>();
111     protected final Map<String, JAXXBinding> $bindings = new TreeMap<String, JAXXBinding>();
112     protected Map<String, Object> $objectMap = new HashMap<String, Object>();
113     protected Map<?, ?> $previousValues = new HashMap<Object, Object>();
114     private boolean allComponentsCreated;
115     protected final JAXXContext delegateContext = new DefaultJAXXContext();
116 
117     /*-----------------------------------------------------------------------*/
118     /*------------------------ Protected components  ------------------------*/
119     /*-----------------------------------------------------------------------*/
120 
121     protected TuttiHelpBroker broker;
122     protected JButton closeButton;
123     protected JScrollPane dataSelectionPane;
124     protected JTree dataSelectionTree;
125     protected JToolBar dataSelectionTreeHeader;
126     protected JCheckBox exportAccidentalCatchCheckBox;
127     protected JCheckBox exportAttachmentsCheckBox;
128     protected JCheckBox exportBenthosCheckBox;
129     protected JButton exportButton;
130     protected JCheckBox exportIndividualObservationCheckBox;
131     protected JCheckBox exportMarineLitterCheckBox;
132     protected JPanel exportOptions;
133     protected JCheckBox exportSpeciesCheckBox;
134     protected JButton foldAllButton;
135     protected GenericFormatExportUI genericFormatImportTopPanel = this;
136     protected final GenericFormatExportUIHandler handler = createHandler();
137     protected GenericFormatExportUIModel model;
138     @ValidatorField( validatorId = "validator",  propertyName = "program",  editorName = "programComboBox")
139     protected BeanFilterableComboBox<Program> programComboBox;
140     protected JLabel programLabel;
141     protected JButton selectAllButton;
142     protected DataSelectTreeModel treeModel;
143     protected JButton unfoldAllButton;
144     protected JButton unselectAllButton;
145     @Validator( validatorId = "validator")
146     protected SwingValidator<GenericFormatExportUIModel> validator;
147     protected List<String> validatorIds = new ArrayList<String>();
148 
149     /*-----------------------------------------------------------------------*/
150     /*------------------------- Private components  -------------------------*/
151     /*-----------------------------------------------------------------------*/
152 
153     private JPanel $JPanel0;
154     private JPanel $JPanel1;
155     private JPanel $JPanel2;
156     private Table $Table0;
157 
158     /*-----------------------------------------------------------------------*/
159     /*---------------------------- Constructors  ----------------------------*/
160     /*-----------------------------------------------------------------------*/
161 
162     public GenericFormatExportUI(TuttiUI parentUI) {
163         TuttiUIUtil.setParentUI(this, parentUI);
164             $initialize();
165     }
166 
167     public GenericFormatExportUI(LayoutManager param0, boolean param1) {
168         super(param0 ,param1);
169         $initialize();
170     }
171 
172     public GenericFormatExportUI(JAXXContext parentContext, LayoutManager param1, boolean param2) {
173         super(param1 ,param2);
174         JAXXUtil.initContext(this, parentContext);
175         $initialize();
176     }
177 
178     public GenericFormatExportUI(LayoutManager param0) {
179         super(param0);
180         $initialize();
181     }
182 
183     public GenericFormatExportUI(JAXXContext parentContext, LayoutManager param1) {
184         super(param1);
185         JAXXUtil.initContext(this, parentContext);
186         $initialize();
187     }
188 
189     public GenericFormatExportUI() {
190         $initialize();
191     }
192 
193     public GenericFormatExportUI(JAXXContext parentContext) {
194         JAXXUtil.initContext(this, parentContext);
195         $initialize();
196     }
197 
198     public GenericFormatExportUI(boolean param0) {
199         super(param0);
200         $initialize();
201     }
202 
203     public GenericFormatExportUI(JAXXContext parentContext, boolean param1) {
204         super(param1);
205         JAXXUtil.initContext(this, parentContext);
206         $initialize();
207     }
208 
209     /*-----------------------------------------------------------------------*/
210     /*--------------------------- Statics methods ---------------------------*/
211     /*-----------------------------------------------------------------------*/
212 
213     public static JAXXObjectDescriptor $getJAXXObjectDescriptor() {
214         return JAXXUtil.decodeCompressedJAXXObjectDescriptor($jaxxObjectDescriptor);
215     }
216 
217     /*-----------------------------------------------------------------------*/
218     /*---------------------- JAXXObject implementation ----------------------*/
219     /*-----------------------------------------------------------------------*/
220 
221     @Override
222     public void applyDataBinding(String $binding) {
223         if (allComponentsCreated && $bindings.containsKey($binding)) {
224             getDataBinding($binding).applyDataBinding();
225         }
226         processDataBinding($binding);
227     }
228 
229     @Override
230     public void firePropertyChange(String propertyName, Object oldValue, Object newValue) {
231         super.firePropertyChange(propertyName, oldValue, newValue);
232     }
233 
234     @Override
235     public Map<String, Object> get$objectMap() {
236         return $objectMap;
237     }
238 
239     @Override
240     public JAXXBinding getDataBinding(String bindingId) {
241         return $bindings.get(bindingId);
242     }
243 
244     @Override
245     public JAXXBinding[] getDataBindings() {
246         return $bindings.values().toArray(new JAXXBinding[$bindings.size()]);
247     }
248 
249     @Override
250     public Object getObjectById(String id) {
251         return $objectMap.get(id);
252     }
253 
254     @Override
255     public void processDataBinding(String $binding, boolean $force) {
256         if (!$force && $activeBindings.contains($binding)) { 
257             return;
258         }
259         $activeBindings.add($binding);
260         try {
261             if (allComponentsCreated && $bindings.containsKey($binding)) {
262                 getDataBinding($binding).processDataBinding();
263             }
264         } finally {
265             $activeBindings.remove($binding);
266         }
267     }
268 
269     @Override
270     public void processDataBinding(String $binding) {
271         processDataBinding($binding, false);
272     }
273 
274     @Override
275     public void registerDataBinding(JAXXBinding binding) {
276         $bindings.put(binding.getId(), binding);
277     }
278 
279     @Override
280     public void removeDataBinding(String $binding) {
281         if (allComponentsCreated && $bindings.containsKey($binding)) {
282             getDataBinding($binding).removeDataBinding();
283         }
284     }
285 
286     /*-----------------------------------------------------------------------*/
287     /*--------------------- JAXXContext implementation  ---------------------*/
288     /*-----------------------------------------------------------------------*/
289 
290     @Override
291     public <T> T getContextValue(Class<T> clazz) {
292         return delegateContext.getContextValue(clazz, null);
293     }
294 
295     @Override
296     public <T> T getContextValue(Class<T> clazz, String name) {
297         return delegateContext.getContextValue(clazz, name);
298     }
299 
300     @Override
301     public JAXXContext getDelegateContext() {
302         return delegateContext;
303     }
304 
305     @Override
306     public <O extends Container> O getParentContainer(Class<O> clazz) {
307         return SwingUtil.getParentContainer(this, clazz);
308     }
309 
310     @Override
311     public <O extends Container> O getParentContainer(Object source, Class<O> clazz) {
312         return SwingUtil.getParentContainer(source, clazz);
313     }
314 
315     @Override
316     public <T> void removeContextValue(Class<T> clazz) {
317         delegateContext.removeContextValue(clazz, null);
318     }
319 
320     @Override
321     public <T> void removeContextValue(Class<T> clazz, String name) {
322         delegateContext.removeContextValue(clazz, name);
323     }
324 
325     @Override
326     public <T> void setContextValue(T o) {
327         delegateContext.setContextValue(o, null);
328     }
329 
330     @Override
331     public <T> void setContextValue(T o, String name) {
332         delegateContext.setContextValue(o, name);
333     }
334 
335     /*-----------------------------------------------------------------------*/
336     /*-------------------- JAXXValidator implementation  --------------------*/
337     /*-----------------------------------------------------------------------*/
338 
339     @Override
340     public SwingValidator<?> getValidator(String validatorId) {
341         return (SwingValidator<?>) (validatorIds.contains(validatorId) ? getObjectById(validatorId) : null);
342     }
343 
344     @Override
345     public List<String> getValidatorIds() {
346         return validatorIds;
347     }
348 
349     @Override
350     public void registerValidatorFields() {
351         SwingValidatorUtil.detectValidatorFields(this);
352     }
353 
354     /*-----------------------------------------------------------------------*/
355     /*---------------------------- Event methods ----------------------------*/
356     /*-----------------------------------------------------------------------*/
357 
358     public void doItemStateChanged__on__exportAccidentalCatchCheckBox(ItemEvent event) {
359         if (log.isDebugEnabled()) {
360             log.debug(event);
361         }
362         handler.setBoolean(event, "exportAccidentalCatch");
363     }
364 
365     public void doItemStateChanged__on__exportAttachmentsCheckBox(ItemEvent event) {
366         if (log.isDebugEnabled()) {
367             log.debug(event);
368         }
369         handler.setBoolean(event, "exportAttachments");
370     }
371 
372     public void doItemStateChanged__on__exportBenthosCheckBox(ItemEvent event) {
373         if (log.isDebugEnabled()) {
374             log.debug(event);
375         }
376         handler.setBoolean(event, "exportBenthos");
377     }
378 
379     public void doItemStateChanged__on__exportIndividualObservationCheckBox(ItemEvent event) {
380         if (log.isDebugEnabled()) {
381             log.debug(event);
382         }
383         handler.setBoolean(event, "exportIndividualObservation");
384     }
385 
386     public void doItemStateChanged__on__exportMarineLitterCheckBox(ItemEvent event) {
387         if (log.isDebugEnabled()) {
388             log.debug(event);
389         }
390         handler.setBoolean(event, "exportMarineLitter");
391     }
392 
393     public void doItemStateChanged__on__exportSpeciesCheckBox(ItemEvent event) {
394         if (log.isDebugEnabled()) {
395             log.debug(event);
396         }
397         handler.setBoolean(event, "exportSpecies");
398     }
399 
400     /*-----------------------------------------------------------------------*/
401     /*----------------------- Public acessor methods  -----------------------*/
402     /*-----------------------------------------------------------------------*/
403 
404     public TuttiHelpBroker getBroker() {
405         return broker;
406     }
407 
408     public JButton getCloseButton() {
409         return closeButton;
410     }
411 
412     public JScrollPane getDataSelectionPane() {
413         return dataSelectionPane;
414     }
415 
416     public JTree getDataSelectionTree() {
417         return dataSelectionTree;
418     }
419 
420     public JToolBar getDataSelectionTreeHeader() {
421         return dataSelectionTreeHeader;
422     }
423 
424     public JCheckBox getExportAccidentalCatchCheckBox() {
425         return exportAccidentalCatchCheckBox;
426     }
427 
428     public JCheckBox getExportAttachmentsCheckBox() {
429         return exportAttachmentsCheckBox;
430     }
431 
432     public JCheckBox getExportBenthosCheckBox() {
433         return exportBenthosCheckBox;
434     }
435 
436     public JButton getExportButton() {
437         return exportButton;
438     }
439 
440     public JCheckBox getExportIndividualObservationCheckBox() {
441         return exportIndividualObservationCheckBox;
442     }
443 
444     public JCheckBox getExportMarineLitterCheckBox() {
445         return exportMarineLitterCheckBox;
446     }
447 
448     public JPanel getExportOptions() {
449         return exportOptions;
450     }
451 
452     public JCheckBox getExportSpeciesCheckBox() {
453         return exportSpeciesCheckBox;
454     }
455 
456     public JButton getFoldAllButton() {
457         return foldAllButton;
458     }
459 
460     public GenericFormatExportUIHandler getHandler() {
461         return handler;
462     }
463 
464     public GenericFormatExportUIModel getModel() {
465         return model;
466     }
467 
468     public BeanFilterableComboBox<Program> getProgramComboBox() {
469         return programComboBox;
470     }
471 
472     public JLabel getProgramLabel() {
473         return programLabel;
474     }
475 
476     public JButton getSelectAllButton() {
477         return selectAllButton;
478     }
479 
480     public DataSelectTreeModel getTreeModel() {
481         return treeModel;
482     }
483 
484     public JButton getUnfoldAllButton() {
485         return unfoldAllButton;
486     }
487 
488     public JButton getUnselectAllButton() {
489         return unselectAllButton;
490     }
491 
492     public SwingValidator<GenericFormatExportUIModel> getValidator() {
493         return validator;
494     }
495 
496     /*-----------------------------------------------------------------------*/
497     /*---------------------------- Other methods ----------------------------*/
498     /*-----------------------------------------------------------------------*/
499 
500     @Override
501     public void registerHelpId(TuttiHelpBroker broker, Component component, String helpId) {
502         broker.installUI(component, helpId);
503     }
504 
505     @Override
506     public void showHelp(String helpId) {
507         getBroker().showHelp(this, helpId);
508     }
509 
510     /*-----------------------------------------------------------------------*/
511     /*--------------------- Protected acessors methods  ---------------------*/
512     /*-----------------------------------------------------------------------*/
513 
514     protected JPanel get$JPanel0() {
515         return $JPanel0;
516     }
517 
518     protected JPanel get$JPanel1() {
519         return $JPanel1;
520     }
521 
522     protected JPanel get$JPanel2() {
523         return $JPanel2;
524     }
525 
526     protected Table get$Table0() {
527         return $Table0;
528     }
529 
530     /*-----------------------------------------------------------------------*/
531     /*--------------------- Components creation methods ---------------------*/
532     /*-----------------------------------------------------------------------*/
533 
534     protected void addChildrenToDataSelectionPane() {
535         if (!allComponentsCreated) {
536             return;
537         }
538         dataSelectionPane.getViewport().add(dataSelectionTree);
539     }
540 
541     protected void addChildrenToDataSelectionTreeHeader() {
542         if (!allComponentsCreated) {
543             return;
544         }
545         dataSelectionTreeHeader.add(unfoldAllButton);
546         dataSelectionTreeHeader.add(foldAllButton);
547         dataSelectionTreeHeader.add(selectAllButton);
548         dataSelectionTreeHeader.add(unselectAllButton);
549     }
550 
551     protected void addChildrenToExportOptions() {
552         if (!allComponentsCreated) {
553             return;
554         }
555         exportOptions.add($JPanel1, BorderLayout.NORTH);
556     }
557 
558     protected void addChildrenToGenericFormatImportTopPanel() {
559         if (!allComponentsCreated) {
560             return;
561         }
562         add($Table0, BorderLayout.NORTH);
563     }
564 
565     protected void addChildrenToValidator() {
566         if (!allComponentsCreated) {
567             return;
568         }
569         validator.setUiClass(ImageValidationUI.class);
570         validator.setBean(model);
571     }
572 
573     protected void createBroker() {
574         $objectMap.put("broker", broker = new TuttiHelpBroker("tutti.genericFormatimport.help"));
575     }
576 
577     protected void createCloseButton() {
578         $objectMap.put("closeButton", closeButton = new JButton());
579         
580         closeButton.setName("closeButton");
581         closeButton.setText(t("tutti.genericFormatExport.action.closeGenericFormatExport"));
582         closeButton.setToolTipText(t("tutti.genericFormatExport.action.closeGenericFormatExport.tip"));
583         closeButton.putClientProperty("help", "tutti.genericFormatExport.action.closeGenericFormatExport.help");
584         closeButton.putClientProperty("applicationAction", fr.ifremer.tutti.ui.swing.content.actions.OpenHomeScreenAction.class);
585     }
586 
587     protected void createDataSelectionPane() {
588         $objectMap.put("dataSelectionPane", dataSelectionPane = new JScrollPane());
589         
590         dataSelectionPane.setName("dataSelectionPane");
591     }
592 
593     protected void createDataSelectionTree() {
594         $objectMap.put("dataSelectionTree", dataSelectionTree = new JTree());
595         
596         dataSelectionTree.setName("dataSelectionTree");
597         dataSelectionTree.setEditable(false);
598         dataSelectionTree.setToggleClickCount(2);
599         dataSelectionTree.setScrollsOnExpand(true);
600         dataSelectionTree.setRootVisible(false);
601     }
602 
603     protected void createDataSelectionTreeHeader() {
604         $objectMap.put("dataSelectionTreeHeader", dataSelectionTreeHeader = new JToolBar());
605         
606         dataSelectionTreeHeader.setName("dataSelectionTreeHeader");
607         dataSelectionTreeHeader.setBorderPainted(false);
608         dataSelectionTreeHeader.setOpaque(true);
609         dataSelectionTreeHeader.setFloatable(false);
610     }
611 
612     protected void createExportAccidentalCatchCheckBox() {
613         $objectMap.put("exportAccidentalCatchCheckBox", exportAccidentalCatchCheckBox = new JCheckBox());
614         
615         exportAccidentalCatchCheckBox.setName("exportAccidentalCatchCheckBox");
616         exportAccidentalCatchCheckBox.setText(t("tutti.genericFormatExport.field.exportAccidentalCatch"));
617         exportAccidentalCatchCheckBox.setToolTipText(t("tutti.genericFormatExport.field.exportAccidentalCatch.tip"));
618         exportAccidentalCatchCheckBox.addItemListener(JAXXUtil.getEventListener(ItemListener.class, "itemStateChanged", this, "doItemStateChanged__on__exportAccidentalCatchCheckBox"));
619         exportAccidentalCatchCheckBox.putClientProperty("help", "tutti.genericFormatExport.field.exportAccidentalCatch.help");
620     }
621 
622     protected void createExportAttachmentsCheckBox() {
623         $objectMap.put("exportAttachmentsCheckBox", exportAttachmentsCheckBox = new JCheckBox());
624         
625         exportAttachmentsCheckBox.setName("exportAttachmentsCheckBox");
626         exportAttachmentsCheckBox.setText(t("tutti.genericFormatExport.field.exportAttachments"));
627         exportAttachmentsCheckBox.setToolTipText(t("tutti.genericFormatExport.field.exportAttachments.tip"));
628         exportAttachmentsCheckBox.addItemListener(JAXXUtil.getEventListener(ItemListener.class, "itemStateChanged", this, "doItemStateChanged__on__exportAttachmentsCheckBox"));
629         exportAttachmentsCheckBox.putClientProperty("help", "tutti.genericFormatExport.field.exportAttachments.help");
630     }
631 
632     protected void createExportBenthosCheckBox() {
633         $objectMap.put("exportBenthosCheckBox", exportBenthosCheckBox = new JCheckBox());
634         
635         exportBenthosCheckBox.setName("exportBenthosCheckBox");
636         exportBenthosCheckBox.setText(t("tutti.genericFormatExport.field.exportBenthos"));
637         exportBenthosCheckBox.setToolTipText(t("tutti.genericFormatExport.field.exportBenthos.tip"));
638         exportBenthosCheckBox.addItemListener(JAXXUtil.getEventListener(ItemListener.class, "itemStateChanged", this, "doItemStateChanged__on__exportBenthosCheckBox"));
639         exportBenthosCheckBox.putClientProperty("help", "tutti.genericFormatExport.field.exportBenthos.help");
640     }
641 
642     protected void createExportButton() {
643         $objectMap.put("exportButton", exportButton = new JButton());
644         
645         exportButton.setName("exportButton");
646         exportButton.setText(t("tutti.genericFormatExport.action.export"));
647         exportButton.setToolTipText(t("tutti.genericFormatExport.action.export.tip"));
648         exportButton.putClientProperty("help", "tutti.genericFormatExport.action.export.help");
649         exportButton.putClientProperty("applicationAction", fr.ifremer.tutti.ui.swing.content.genericformat.actions.GenericFormatExportAction.class);
650     }
651 
652     protected void createExportIndividualObservationCheckBox() {
653         $objectMap.put("exportIndividualObservationCheckBox", exportIndividualObservationCheckBox = new JCheckBox());
654         
655         exportIndividualObservationCheckBox.setName("exportIndividualObservationCheckBox");
656         exportIndividualObservationCheckBox.setText(t("tutti.genericFormatExport.field.exportIndividualObservation"));
657         exportIndividualObservationCheckBox.setToolTipText(t("tutti.genericFormatExport.field.exportIndividualObservation.tip"));
658         exportIndividualObservationCheckBox.addItemListener(JAXXUtil.getEventListener(ItemListener.class, "itemStateChanged", this, "doItemStateChanged__on__exportIndividualObservationCheckBox"));
659         exportIndividualObservationCheckBox.putClientProperty("help", "tutti.genericFormatExport.field.exportIndividualObservation.help");
660     }
661 
662     protected void createExportMarineLitterCheckBox() {
663         $objectMap.put("exportMarineLitterCheckBox", exportMarineLitterCheckBox = new JCheckBox());
664         
665         exportMarineLitterCheckBox.setName("exportMarineLitterCheckBox");
666         exportMarineLitterCheckBox.setText(t("tutti.genericFormatExport.field.exportMarineLitter"));
667         exportMarineLitterCheckBox.setToolTipText(t("tutti.genericFormatExport.field.exportMarineLitter.tip"));
668         exportMarineLitterCheckBox.addItemListener(JAXXUtil.getEventListener(ItemListener.class, "itemStateChanged", this, "doItemStateChanged__on__exportMarineLitterCheckBox"));
669         exportMarineLitterCheckBox.putClientProperty("help", "tutti.genericFormatExport.field.exportMarineLitter.help");
670     }
671 
672     protected void createExportOptions() {
673         $objectMap.put("exportOptions", exportOptions = new JPanel());
674         
675         exportOptions.setName("exportOptions");
676         exportOptions.setLayout(new BorderLayout());
677     }
678 
679     protected void createExportSpeciesCheckBox() {
680         $objectMap.put("exportSpeciesCheckBox", exportSpeciesCheckBox = new JCheckBox());
681         
682         exportSpeciesCheckBox.setName("exportSpeciesCheckBox");
683         exportSpeciesCheckBox.setText(t("tutti.genericFormatExport.field.exportSpecies"));
684         exportSpeciesCheckBox.setToolTipText(t("tutti.genericFormatExport.field.exportSpecies.tip"));
685         exportSpeciesCheckBox.addItemListener(JAXXUtil.getEventListener(ItemListener.class, "itemStateChanged", this, "doItemStateChanged__on__exportSpeciesCheckBox"));
686         exportSpeciesCheckBox.putClientProperty("help", "tutti.genericFormatExport.field.exportSpecies.help");
687     }
688 
689     protected void createFoldAllButton() {
690         $objectMap.put("foldAllButton", foldAllButton = new JButton());
691         
692         foldAllButton.setName("foldAllButton");
693         foldAllButton.setToolTipText(t("tutti.genericFormatExport.action.foldAll.tip"));
694         foldAllButton.putClientProperty("help", "tutti.genericFormatExport.action.foldAll.help");
695         foldAllButton.putClientProperty("simpleAction", fr.ifremer.tutti.ui.swing.content.genericformat.actions.ExportFoldAllDataAction.class);
696     }
697 
698     protected GenericFormatExportUIHandler createHandler() {
699         return new GenericFormatExportUIHandler();
700     }
701 
702     protected void createModel() {
703         $objectMap.put("model", model = getContextValue(GenericFormatExportUIModel.class));
704     }
705 
706     protected void createProgramComboBox() {
707         $objectMap.put("programComboBox", programComboBox = new BeanFilterableComboBox<Program>(this));
708         
709         programComboBox.setName("programComboBox");
710         programComboBox.setProperty("program");
711         programComboBox.setShowReset(true);
712         programComboBox.putClientProperty("help", "tutti.genericFormatExport.field.program.help");
713         programComboBox.putClientProperty("validatorLabel", t("tutti.genericFormatExport.field.program"));
714     }
715 
716     protected void createProgramLabel() {
717         $objectMap.put("programLabel", programLabel = new JLabel());
718         
719         programLabel.setName("programLabel");
720         programLabel.setText(t("tutti.genericFormatExport.field.program"));
721         programLabel.setToolTipText(t("tutti.genericFormatExport.field.program.tip"));
722         programLabel.putClientProperty("help", "tutti.genericFormatExport.field.program.help");
723     }
724 
725     protected void createSelectAllButton() {
726         $objectMap.put("selectAllButton", selectAllButton = new JButton());
727         
728         selectAllButton.setName("selectAllButton");
729         selectAllButton.setToolTipText(t("tutti.genericFormatExport.action.selectAll.tip"));
730         selectAllButton.putClientProperty("help", "tutti.genericFormatExport.action.selectAll.help");
731         selectAllButton.putClientProperty("simpleAction", fr.ifremer.tutti.ui.swing.content.genericformat.actions.ExportSelectAllDataAction.class);
732     }
733 
734     protected void createTreeModel() {
735         $objectMap.put("treeModel", treeModel = new DataSelectTreeModel());
736     }
737 
738     protected void createUnfoldAllButton() {
739         $objectMap.put("unfoldAllButton", unfoldAllButton = new JButton());
740         
741         unfoldAllButton.setName("unfoldAllButton");
742         unfoldAllButton.setToolTipText(t("tutti.genericFormatExport.action.unfoldAll.tip"));
743         unfoldAllButton.putClientProperty("help", "tutti.genericFormatExport.action.unfoldAll.help");
744         unfoldAllButton.putClientProperty("simpleAction", fr.ifremer.tutti.ui.swing.content.genericformat.actions.ExportUnfoldAllDataAction.class);
745     }
746 
747     protected void createUnselectAllButton() {
748         $objectMap.put("unselectAllButton", unselectAllButton = new JButton());
749         
750         unselectAllButton.setName("unselectAllButton");
751         unselectAllButton.setToolTipText(t("tutti.genericFormatExport.action.unselectAll.tip"));
752         unselectAllButton.putClientProperty("help", "tutti.genericFormatExport.action.unselectAll.help");
753         unselectAllButton.putClientProperty("simpleAction", fr.ifremer.tutti.ui.swing.content.genericformat.actions.ExportUnselectAllDataAction.class);
754     }
755 
756     protected void createValidator() {
757         $objectMap.put("validator", validator = SwingValidator.newValidator(GenericFormatExportUIModel.class, "edit"));
758     }
759 
760     /*-----------------------------------------------------------------------*/
761     /*------------------------ Internal jaxx methods ------------------------*/
762     /*-----------------------------------------------------------------------*/
763 
764     private void $completeSetup() {
765         allComponentsCreated = true;
766         if (log.isDebugEnabled()) {
767             log.debug(this);
768         }
769         addChildrenToGenericFormatImportTopPanel();
770         addChildrenToValidator();
771         // inline complete setup of $Table0
772         $Table0.add(programLabel, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0, 10, 1, new Insets(3, 3, 3, 3), 0, 0));
773         $Table0.add(SwingUtil.boxComponentWithJxLayer(programComboBox), new GridBagConstraints(1, 0, 1, 1, 0.0, 0.0, 10, 1, new Insets(3, 3, 3, 3), 0, 0));
774         $Table0.add($JPanel0, new GridBagConstraints(0, 1, 2, 1, 1.0, 1.0, 10, 1, new Insets(3, 3, 3, 3), 0, 0));
775         $Table0.add($JPanel2, new GridBagConstraints(0, 2, 2, 1, 0.0, 0.0, 10, 1, new Insets(3, 3, 3, 3), 0, 0));
776         // inline complete setup of $JPanel0
777         $JPanel0.add(dataSelectionPane, BorderLayout.CENTER);
778         $JPanel0.add(exportOptions, BorderLayout.EAST);
779         $JPanel0.add(dataSelectionTreeHeader, BorderLayout.SOUTH);
780         addChildrenToDataSelectionPane();
781         addChildrenToExportOptions();
782         // inline complete setup of $JPanel1
783         $JPanel1.add(exportAttachmentsCheckBox);
784         $JPanel1.add(exportSpeciesCheckBox);
785         $JPanel1.add(exportBenthosCheckBox);
786         $JPanel1.add(exportMarineLitterCheckBox);
787         $JPanel1.add(exportAccidentalCatchCheckBox);
788         $JPanel1.add(exportIndividualObservationCheckBox);
789         addChildrenToDataSelectionTreeHeader();
790         // inline complete setup of $JPanel2
791         $JPanel2.add(closeButton);
792         $JPanel2.add(exportButton);
793         
794         // apply 12 data bindings
795         JAXXUtil.applyDataBinding(this, $bindings.keySet());
796         
797         // apply 21 property setters
798         programComboBox.setBeanType(Program.class);
799         programLabel.setLabelFor(programComboBox);
800         programComboBox.setBean(model);
801         dataSelectionPane.setBorder(BorderFactory.createTitledBorder(t("tutti.genericFormatExport.selectData.legend")));
802         dataSelectionPane.setColumnHeaderView(dataSelectionTreeHeader);
803         dataSelectionTree.setCellRenderer(new ExportDataSelectTreeCellRenderer());
804         dataSelectionTree.setModel(treeModel);
805         exportOptions.setBorder(BorderFactory.createTitledBorder(t("tutti.genericFormatExport.exportOptions.legend")));
806         unfoldAllButton.setIcon(SwingUtil.createActionIcon("expand"));
807         foldAllButton.setIcon(SwingUtil.createActionIcon("collapse"));
808         selectAllButton.setIcon(SwingUtil.createActionIcon("select"));
809         unselectAllButton.setIcon(SwingUtil.createActionIcon("unselect"));
810         closeButton.setMnemonic(SwingUtil.getFirstCharAt(t("tutti.genericFormatExport.action.closeGenericFormatExport.mnemonic"),'Z'));
811         closeButton.setIcon(SwingUtil.createActionIcon("cancel"));
812         exportButton.setMnemonic(SwingUtil.getFirstCharAt(t("tutti.genericFormatExport.action.export.mnemonic"),'Z'));
813         exportButton.setIcon(SwingUtil.createActionIcon("export"));
814         // late initializer
815         // help broker setup
816         TuttiHelpBroker _broker = getBroker();
817         registerHelpId(_broker, programLabel, "tutti.genericFormatExport.field.program.help");
818         registerHelpId(_broker, programComboBox, "tutti.genericFormatExport.field.program.help");
819         registerHelpId(_broker, exportAttachmentsCheckBox, "tutti.genericFormatExport.field.exportAttachments.help");
820         registerHelpId(_broker, exportSpeciesCheckBox, "tutti.genericFormatExport.field.exportSpecies.help");
821         registerHelpId(_broker, exportBenthosCheckBox, "tutti.genericFormatExport.field.exportBenthos.help");
822         registerHelpId(_broker, exportMarineLitterCheckBox, "tutti.genericFormatExport.field.exportMarineLitter.help");
823         registerHelpId(_broker, exportAccidentalCatchCheckBox, "tutti.genericFormatExport.field.exportAccidentalCatch.help");
824         registerHelpId(_broker, exportIndividualObservationCheckBox, "tutti.genericFormatExport.field.exportIndividualObservation.help");
825         registerHelpId(_broker, unfoldAllButton, "tutti.genericFormatExport.action.unfoldAll.help");
826         registerHelpId(_broker, foldAllButton, "tutti.genericFormatExport.action.foldAll.help");
827         registerHelpId(_broker, selectAllButton, "tutti.genericFormatExport.action.selectAll.help");
828         registerHelpId(_broker, unselectAllButton, "tutti.genericFormatExport.action.unselectAll.help");
829         registerHelpId(_broker, closeButton, "tutti.genericFormatExport.action.closeGenericFormatExport.help");
830         registerHelpId(_broker, exportButton, "tutti.genericFormatExport.action.export.help");
831         _broker.prepareUI(this);
832         // register 1 validator(s)
833         validatorIds = SwingValidatorUtil.detectValidators(this);
834         SwingValidatorUtil.installUI(this);
835     }
836 
837     private void $initialize() {
838         if (allComponentsCreated) {
839             return;
840         }
841         if (log.isDebugEnabled()) {
842             log.debug(this);
843         }
844         handler.beforeInit(this);
845         $objectMap.put("genericFormatImportTopPanel", genericFormatImportTopPanel);
846         createModel();
847         createTreeModel();
848         createBroker();
849         createValidator();
850         // inline creation of $Table0
851         $objectMap.put("$Table0", $Table0 = new Table());
852         
853         $Table0.setName("$Table0");
854         createProgramLabel();
855         createProgramComboBox();
856         // inline creation of $JPanel0
857         $objectMap.put("$JPanel0", $JPanel0 = new JPanel());
858         
859         $JPanel0.setName("$JPanel0");
860         $JPanel0.setLayout(new BorderLayout());
861         createDataSelectionPane();
862         createDataSelectionTree();
863         createExportOptions();
864         // inline creation of $JPanel1
865         $objectMap.put("$JPanel1", $JPanel1 = new JPanel());
866         
867         $JPanel1.setName("$JPanel1");
868         $JPanel1.setLayout(new GridLayout(0, 1));
869         createExportAttachmentsCheckBox();
870         createExportSpeciesCheckBox();
871         createExportBenthosCheckBox();
872         createExportMarineLitterCheckBox();
873         createExportAccidentalCatchCheckBox();
874         createExportIndividualObservationCheckBox();
875         createDataSelectionTreeHeader();
876         createUnfoldAllButton();
877         createFoldAllButton();
878         createSelectAllButton();
879         createUnselectAllButton();
880         // inline creation of $JPanel2
881         $objectMap.put("$JPanel2", $JPanel2 = new JPanel());
882         
883         $JPanel2.setName("$JPanel2");
884         $JPanel2.setLayout(new GridLayout(1, 0));
885         SwingUtil.setComponentHeight($JPanel2,50);
886         createCloseButton();
887         createExportButton();
888         // inline creation of genericFormatImportTopPanel
889         setName("genericFormatImportTopPanel");
890         setLayout(new BorderLayout());
891         
892         // registers 12 data bindings
893         $registerDefaultBindings();
894         $completeSetup();
895         handler.afterInit(this);
896     }
897 
898     private void $registerDefaultBindings() {
899         // register 12 data bindings
900         registerDataBinding(new DefaultJAXXBinding(this, BINDING_PROGRAM_COMBO_BOX_SELECTED_ITEM, true) {
901         
902             @Override
903             public void applyDataBinding() {
904                 if (model != null) {
905                     model.addPropertyChangeListener("program", this);
906                 }
907             }
908         
909             @Override
910             public void processDataBinding() {
911                 if (model != null) {
912                     programComboBox.setSelectedItem(model.getProgram());
913                 }
914             }
915         
916             @Override
917             public void removeDataBinding() {
918                 if (model != null) {
919                     model.removePropertyChangeListener("program", this);
920                 }
921             }
922         });
923         registerDataBinding(new DefaultJAXXBinding(this, BINDING_EXPORT_ATTACHMENTS_CHECK_BOX_SELECTED, true) {
924         
925             @Override
926             public void applyDataBinding() {
927                 if (model != null) {
928                     model.addPropertyChangeListener("exportAttachments", this);
929                 }
930             }
931         
932             @Override
933             public void processDataBinding() {
934                 if (model != null) {
935                     exportAttachmentsCheckBox.setSelected(model.isExportAttachments());
936                 }
937             }
938         
939             @Override
940             public void removeDataBinding() {
941                 if (model != null) {
942                     model.removePropertyChangeListener("exportAttachments", this);
943                 }
944             }
945         });
946         registerDataBinding(new DefaultJAXXBinding(this, BINDING_EXPORT_SPECIES_CHECK_BOX_SELECTED, true) {
947         
948             @Override
949             public void applyDataBinding() {
950                 if (model != null) {
951                     model.addPropertyChangeListener("exportSpecies", this);
952                 }
953             }
954         
955             @Override
956             public void processDataBinding() {
957                 if (model != null) {
958                     exportSpeciesCheckBox.setSelected(model.isExportSpecies());
959                 }
960             }
961         
962             @Override
963             public void removeDataBinding() {
964                 if (model != null) {
965                     model.removePropertyChangeListener("exportSpecies", this);
966                 }
967             }
968         });
969         registerDataBinding(new DefaultJAXXBinding(this, BINDING_EXPORT_BENTHOS_CHECK_BOX_SELECTED, true) {
970         
971             @Override
972             public void applyDataBinding() {
973                 if (model != null) {
974                     model.addPropertyChangeListener("exportBenthos", this);
975                 }
976             }
977         
978             @Override
979             public void processDataBinding() {
980                 if (model != null) {
981                     exportBenthosCheckBox.setSelected(model.isExportBenthos());
982                 }
983             }
984         
985             @Override
986             public void removeDataBinding() {
987                 if (model != null) {
988                     model.removePropertyChangeListener("exportBenthos", this);
989                 }
990             }
991         });
992         registerDataBinding(new DefaultJAXXBinding(this, BINDING_EXPORT_MARINE_LITTER_CHECK_BOX_SELECTED, true) {
993         
994             @Override
995             public void applyDataBinding() {
996                 if (model != null) {
997                     model.addPropertyChangeListener("exportMarineLitter", this);
998                 }
999             }
1000         
1001             @Override
1002             public void processDataBinding() {
1003                 if (model != null) {
1004                     exportMarineLitterCheckBox.setSelected(model.isExportMarineLitter());
1005                 }
1006             }
1007         
1008             @Override
1009             public void removeDataBinding() {
1010                 if (model != null) {
1011                     model.removePropertyChangeListener("exportMarineLitter", this);
1012                 }
1013             }
1014         });
1015         registerDataBinding(new DefaultJAXXBinding(this, BINDING_EXPORT_ACCIDENTAL_CATCH_CHECK_BOX_SELECTED, true) {
1016         
1017             @Override
1018             public void applyDataBinding() {
1019                 if (model != null) {
1020                     model.addPropertyChangeListener("exportAccidentalCatch", this);
1021                 }
1022             }
1023         
1024             @Override
1025             public void processDataBinding() {
1026                 if (model != null) {
1027                     exportAccidentalCatchCheckBox.setSelected(model.isExportAccidentalCatch());
1028                 }
1029             }
1030         
1031             @Override
1032             public void removeDataBinding() {
1033                 if (model != null) {
1034                     model.removePropertyChangeListener("exportAccidentalCatch", this);
1035                 }
1036             }
1037         });
1038         registerDataBinding(new DefaultJAXXBinding(this, BINDING_EXPORT_INDIVIDUAL_OBSERVATION_CHECK_BOX_SELECTED, true) {
1039         
1040             @Override
1041             public void applyDataBinding() {
1042                 if (model != null) {
1043                     model.addPropertyChangeListener("exportIndividualObservation", this);
1044                 }
1045             }
1046         
1047             @Override
1048             public void processDataBinding() {
1049                 if (model != null) {
1050                     exportIndividualObservationCheckBox.setSelected(model.isExportIndividualObservation());
1051                 }
1052             }
1053         
1054             @Override
1055             public void removeDataBinding() {
1056                 if (model != null) {
1057                     model.removePropertyChangeListener("exportIndividualObservation", this);
1058                 }
1059             }
1060         });
1061         registerDataBinding(new DefaultJAXXBinding(this, BINDING_UNFOLD_ALL_BUTTON_ENABLED, true) {
1062         
1063             @Override
1064             public void applyDataBinding() {
1065                 if (model != null) {
1066                     model.addPropertyChangeListener("program", this);
1067                 }
1068             }
1069         
1070             @Override
1071             public void processDataBinding() {
1072                 if (model != null) {
1073                     unfoldAllButton.setEnabled(model.getProgram() != null);
1074                 }
1075             }
1076         
1077             @Override
1078             public void removeDataBinding() {
1079                 if (model != null) {
1080                     model.removePropertyChangeListener("program", this);
1081                 }
1082             }
1083         });
1084         registerDataBinding(new DefaultJAXXBinding(this, BINDING_FOLD_ALL_BUTTON_ENABLED, true) {
1085         
1086             @Override
1087             public void applyDataBinding() {
1088                 if (model != null) {
1089                     model.addPropertyChangeListener("program", this);
1090                 }
1091             }
1092         
1093             @Override
1094             public void processDataBinding() {
1095                 if (model != null) {
1096                     foldAllButton.setEnabled(model.getProgram() != null);
1097                 }
1098             }
1099         
1100             @Override
1101             public void removeDataBinding() {
1102                 if (model != null) {
1103                     model.removePropertyChangeListener("program", this);
1104                 }
1105             }
1106         });
1107         registerDataBinding(new DefaultJAXXBinding(this, BINDING_SELECT_ALL_BUTTON_ENABLED, true) {
1108         
1109             @Override
1110             public void applyDataBinding() {
1111                 if (model != null) {
1112                     model.addPropertyChangeListener("program", this);
1113                 }
1114             }
1115         
1116             @Override
1117             public void processDataBinding() {
1118                 if (model != null) {
1119                     selectAllButton.setEnabled(model.getProgram() != null);
1120                 }
1121             }
1122         
1123             @Override
1124             public void removeDataBinding() {
1125                 if (model != null) {
1126                     model.removePropertyChangeListener("program", this);
1127                 }
1128             }
1129         });
1130         registerDataBinding(new DefaultJAXXBinding(this, BINDING_UNSELECT_ALL_BUTTON_ENABLED, true) {
1131         
1132             @Override
1133             public void applyDataBinding() {
1134                 if (model != null) {
1135                     model.addPropertyChangeListener("program", this);
1136                 }
1137             }
1138         
1139             @Override
1140             public void processDataBinding() {
1141                 if (model != null) {
1142                     unselectAllButton.setEnabled(model.getProgram() != null);
1143                 }
1144             }
1145         
1146             @Override
1147             public void removeDataBinding() {
1148                 if (model != null) {
1149                     model.removePropertyChangeListener("program", this);
1150                 }
1151             }
1152         });
1153         registerDataBinding(new DefaultJAXXBinding(this, BINDING_EXPORT_BUTTON_ENABLED, true) {
1154         
1155             @Override
1156             public void applyDataBinding() {
1157                 if (model != null) {
1158                     model.addPropertyChangeListener("canExport", this);
1159                 }
1160             }
1161         
1162             @Override
1163             public void processDataBinding() {
1164                 if (model != null) {
1165                     exportButton.setEnabled(model.isCanExport());
1166                 }
1167             }
1168         
1169             @Override
1170             public void removeDataBinding() {
1171                 if (model != null) {
1172                     model.removePropertyChangeListener("canExport", this);
1173                 }
1174             }
1175         });
1176     }
1177 
1178 }