View Javadoc
1   package fr.ifremer.tutti.ui.swing.content.referential;
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.ui.swing.TuttiHelpBroker;
28  import fr.ifremer.tutti.ui.swing.TuttiUIContext;
29  import fr.ifremer.tutti.ui.swing.util.TuttiUI;
30  import fr.ifremer.tutti.ui.swing.util.TuttiUIUtil;
31  import java.awt.BorderLayout;
32  import java.awt.Component;
33  import java.awt.Container;
34  import java.awt.GridBagConstraints;
35  import java.awt.Insets;
36  import java.awt.LayoutManager;
37  import java.util.ArrayList;
38  import java.util.Arrays;
39  import java.util.HashMap;
40  import java.util.List;
41  import java.util.Map;
42  import java.util.TreeMap;
43  import javax.swing.JButton;
44  import javax.swing.JComboBox;
45  import javax.swing.JLabel;
46  import javax.swing.JPanel;
47  import javax.swing.JSeparator;
48  import jaxx.runtime.JAXXBinding;
49  import jaxx.runtime.JAXXContext;
50  import jaxx.runtime.JAXXObject;
51  import jaxx.runtime.JAXXObjectDescriptor;
52  import jaxx.runtime.JAXXUtil;
53  import jaxx.runtime.SwingUtil;
54  import jaxx.runtime.binding.DefaultJAXXBinding;
55  import jaxx.runtime.context.DefaultJAXXContext;
56  import jaxx.runtime.swing.Table;
57  import jaxx.runtime.swing.help.JAXXHelpUI;
58  import org.apache.commons.logging.Log;
59  import org.apache.commons.logging.LogFactory;
60  import static org.nuiton.i18n.I18n.t;
61  
62  public class ManageTemporaryReferentialUI extends JPanel implements JAXXHelpUI<TuttiHelpBroker>, TuttiUI<ManageTemporaryReferentialUIModel, ManageTemporaryReferentialUIHandler>, JAXXObject {
63  
64      /*-----------------------------------------------------------------------*/
65      /*------------------ Constants for all public bindings ------------------*/
66      /*-----------------------------------------------------------------------*/
67  
68      public static final String BINDING_EXPORT_EXISTING_GEAR_BUTTON_ENABLED = "exportExistingGearButton.enabled";
69      public static final String BINDING_EXPORT_EXISTING_PERSON_BUTTON_ENABLED = "exportExistingPersonButton.enabled";
70      public static final String BINDING_EXPORT_EXISTING_SPECIES_BUTTON_ENABLED = "exportExistingSpeciesButton.enabled";
71      public static final String BINDING_EXPORT_EXISTING_VESSEL_BUTTON_ENABLED = "exportExistingVesselButton.enabled";
72      public static final String BINDING_GEAR_LABEL_TEXT = "gearLabel.text";
73      public static final String BINDING_GEAR_LABEL_TOOL_TIP_TEXT = "gearLabel.toolTipText";
74      public static final String BINDING_PERSON_LABEL_TEXT = "personLabel.text";
75      public static final String BINDING_PERSON_LABEL_TOOL_TIP_TEXT = "personLabel.toolTipText";
76      public static final String BINDING_REPLACE_GEAR_BUTTON_ENABLED = "replaceGearButton.enabled";
77      public static final String BINDING_REPLACE_PERSON_BUTTON_ENABLED = "replacePersonButton.enabled";
78      public static final String BINDING_REPLACE_SPECIES_BUTTON_ENABLED = "replaceSpeciesButton.enabled";
79      public static final String BINDING_REPLACE_VESSEL_BUTTON_ENABLED = "replaceVesselButton.enabled";
80      public static final String BINDING_SPECIES_LABEL_TEXT = "speciesLabel.text";
81      public static final String BINDING_SPECIES_LABEL_TOOL_TIP_TEXT = "speciesLabel.toolTipText";
82      public static final String BINDING_VESSEL_LABEL_TEXT = "vesselLabel.text";
83      public static final String BINDING_VESSEL_LABEL_TOOL_TIP_TEXT = "vesselLabel.toolTipText";
84  
85      /*-----------------------------------------------------------------------*/
86      /*------------------------- Other static fields -------------------------*/
87      /*-----------------------------------------------------------------------*/
88  
89      private static final String $jaxxObjectDescriptor = "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";
90      private static final Log log = LogFactory.getLog(ManageTemporaryReferentialUI.class);
91      private static final long serialVersionUID = 1L;
92  
93      /*-----------------------------------------------------------------------*/
94      /*--------------------------- Internal states ---------------------------*/
95      /*-----------------------------------------------------------------------*/
96  
97      protected List<Object> $activeBindings = new ArrayList<Object>();
98      protected Map<String, Object> $bindingSources = new HashMap<String, Object>();
99      protected final Map<String, JAXXBinding> $bindings = new TreeMap<String, JAXXBinding>();
100     protected Map<String, Object> $objectMap = new HashMap<String, Object>();
101     protected Map<?, ?> $previousValues = new HashMap<Object, Object>();
102     private boolean allComponentsCreated;
103     protected final JAXXContext delegateContext = new DefaultJAXXContext();
104 
105     /*-----------------------------------------------------------------------*/
106     /*------------------------ Protected components  ------------------------*/
107     /*-----------------------------------------------------------------------*/
108 
109     protected TuttiHelpBroker broker;
110     protected JButton exportExistingGearButton;
111     protected JButton exportExistingPersonButton;
112     protected JButton exportExistingSpeciesButton;
113     protected JButton exportExistingVesselButton;
114     protected JButton exportGearExampleButton;
115     protected JButton exportPersonExampleButton;
116     protected JButton exportSpeciesExampleButton;
117     protected JButton exportVesselExampleButton;
118     protected JComboBox gearActionComboBox;
119     protected JLabel gearLabel;
120     protected final ManageTemporaryReferentialUIHandler handler = createHandler();
121     protected JButton importGearButton;
122     protected JButton importPersonButton;
123     protected JButton importSpeciesButton;
124     protected JButton importVesselButton;
125     protected ManageTemporaryReferentialUI manageTemporaryReferentialTopPanel = this;
126     protected ManageTemporaryReferentialUIModel model;
127     protected JComboBox personActionComboBox;
128     protected JLabel personLabel;
129     protected JButton replaceGearButton;
130     protected JButton replacePersonButton;
131     protected JButton replaceSpeciesButton;
132     protected JButton replaceVesselButton;
133     protected JComboBox speciesActionComboBox;
134     protected JLabel speciesLabel;
135     protected JComboBox vesselActionComboBox;
136     protected JLabel vesselLabel;
137 
138     /*-----------------------------------------------------------------------*/
139     /*------------------------- Private components  -------------------------*/
140     /*-----------------------------------------------------------------------*/
141 
142     private JSeparator $JSeparator0;
143     private JSeparator $JSeparator1;
144     private JSeparator $JSeparator2;
145     private Table $Table0;
146 
147     /*-----------------------------------------------------------------------*/
148     /*---------------------------- Constructors  ----------------------------*/
149     /*-----------------------------------------------------------------------*/
150 
151     public ManageTemporaryReferentialUI(TuttiUI parentUI) {
152         TuttiUIUtil.setParentUI(this, parentUI);
153             $initialize();
154     }
155 
156     public ManageTemporaryReferentialUI(LayoutManager param0, boolean param1) {
157         super(param0 ,param1);
158         $initialize();
159     }
160 
161     public ManageTemporaryReferentialUI(JAXXContext parentContext, LayoutManager param1, boolean param2) {
162         super(param1 ,param2);
163         JAXXUtil.initContext(this, parentContext);
164         $initialize();
165     }
166 
167     public ManageTemporaryReferentialUI(LayoutManager param0) {
168         super(param0);
169         $initialize();
170     }
171 
172     public ManageTemporaryReferentialUI(JAXXContext parentContext, LayoutManager param1) {
173         super(param1);
174         JAXXUtil.initContext(this, parentContext);
175         $initialize();
176     }
177 
178     public ManageTemporaryReferentialUI() {
179         $initialize();
180     }
181 
182     public ManageTemporaryReferentialUI(JAXXContext parentContext) {
183         JAXXUtil.initContext(this, parentContext);
184         $initialize();
185     }
186 
187     public ManageTemporaryReferentialUI(boolean param0) {
188         super(param0);
189         $initialize();
190     }
191 
192     public ManageTemporaryReferentialUI(JAXXContext parentContext, boolean param1) {
193         super(param1);
194         JAXXUtil.initContext(this, parentContext);
195         $initialize();
196     }
197 
198     /*-----------------------------------------------------------------------*/
199     /*--------------------------- Statics methods ---------------------------*/
200     /*-----------------------------------------------------------------------*/
201 
202     public static JAXXObjectDescriptor $getJAXXObjectDescriptor() {
203         return JAXXUtil.decodeCompressedJAXXObjectDescriptor($jaxxObjectDescriptor);
204     }
205 
206     /*-----------------------------------------------------------------------*/
207     /*---------------------- JAXXObject implementation ----------------------*/
208     /*-----------------------------------------------------------------------*/
209 
210     @Override
211     public void applyDataBinding(String $binding) {
212         if (allComponentsCreated && $bindings.containsKey($binding)) {
213             getDataBinding($binding).applyDataBinding();
214         }
215         processDataBinding($binding);
216     }
217 
218     @Override
219     public void firePropertyChange(String propertyName, Object oldValue, Object newValue) {
220         super.firePropertyChange(propertyName, oldValue, newValue);
221     }
222 
223     @Override
224     public Map<String, Object> get$objectMap() {
225         return $objectMap;
226     }
227 
228     @Override
229     public JAXXBinding getDataBinding(String bindingId) {
230         return $bindings.get(bindingId);
231     }
232 
233     @Override
234     public JAXXBinding[] getDataBindings() {
235         return $bindings.values().toArray(new JAXXBinding[$bindings.size()]);
236     }
237 
238     @Override
239     public Object getObjectById(String id) {
240         return $objectMap.get(id);
241     }
242 
243     @Override
244     public void processDataBinding(String $binding, boolean $force) {
245         if (!$force && $activeBindings.contains($binding)) { 
246             return;
247         }
248         $activeBindings.add($binding);
249         try {
250             if (allComponentsCreated && $bindings.containsKey($binding)) {
251                 getDataBinding($binding).processDataBinding();
252             }
253         } finally {
254             $activeBindings.remove($binding);
255         }
256     }
257 
258     @Override
259     public void processDataBinding(String $binding) {
260         processDataBinding($binding, false);
261     }
262 
263     @Override
264     public void registerDataBinding(JAXXBinding binding) {
265         $bindings.put(binding.getId(), binding);
266     }
267 
268     @Override
269     public void removeDataBinding(String $binding) {
270         if (allComponentsCreated && $bindings.containsKey($binding)) {
271             getDataBinding($binding).removeDataBinding();
272         }
273     }
274 
275     /*-----------------------------------------------------------------------*/
276     /*--------------------- JAXXContext implementation  ---------------------*/
277     /*-----------------------------------------------------------------------*/
278 
279     @Override
280     public <T> T getContextValue(Class<T> clazz) {
281         return delegateContext.getContextValue(clazz, null);
282     }
283 
284     @Override
285     public <T> T getContextValue(Class<T> clazz, String name) {
286         return delegateContext.getContextValue(clazz, name);
287     }
288 
289     @Override
290     public JAXXContext getDelegateContext() {
291         return delegateContext;
292     }
293 
294     @Override
295     public <O extends Container> O getParentContainer(Class<O> clazz) {
296         return SwingUtil.getParentContainer(this, clazz);
297     }
298 
299     @Override
300     public <O extends Container> O getParentContainer(Object source, Class<O> clazz) {
301         return SwingUtil.getParentContainer(source, clazz);
302     }
303 
304     @Override
305     public <T> void removeContextValue(Class<T> clazz) {
306         delegateContext.removeContextValue(clazz, null);
307     }
308 
309     @Override
310     public <T> void removeContextValue(Class<T> clazz, String name) {
311         delegateContext.removeContextValue(clazz, name);
312     }
313 
314     @Override
315     public <T> void setContextValue(T o) {
316         delegateContext.setContextValue(o, null);
317     }
318 
319     @Override
320     public <T> void setContextValue(T o, String name) {
321         delegateContext.setContextValue(o, name);
322     }
323 
324     /*-----------------------------------------------------------------------*/
325     /*----------------------- Public acessor methods  -----------------------*/
326     /*-----------------------------------------------------------------------*/
327 
328     public TuttiHelpBroker getBroker() {
329         return broker;
330     }
331 
332     public JButton getExportExistingGearButton() {
333         return exportExistingGearButton;
334     }
335 
336     public JButton getExportExistingPersonButton() {
337         return exportExistingPersonButton;
338     }
339 
340     public JButton getExportExistingSpeciesButton() {
341         return exportExistingSpeciesButton;
342     }
343 
344     public JButton getExportExistingVesselButton() {
345         return exportExistingVesselButton;
346     }
347 
348     public JButton getExportGearExampleButton() {
349         return exportGearExampleButton;
350     }
351 
352     public JButton getExportPersonExampleButton() {
353         return exportPersonExampleButton;
354     }
355 
356     public JButton getExportSpeciesExampleButton() {
357         return exportSpeciesExampleButton;
358     }
359 
360     public JButton getExportVesselExampleButton() {
361         return exportVesselExampleButton;
362     }
363 
364     public JComboBox getGearActionComboBox() {
365         return gearActionComboBox;
366     }
367 
368     public JLabel getGearLabel() {
369         return gearLabel;
370     }
371 
372     public ManageTemporaryReferentialUIHandler getHandler() {
373         return handler;
374     }
375 
376     public JButton getImportGearButton() {
377         return importGearButton;
378     }
379 
380     public JButton getImportPersonButton() {
381         return importPersonButton;
382     }
383 
384     public JButton getImportSpeciesButton() {
385         return importSpeciesButton;
386     }
387 
388     public JButton getImportVesselButton() {
389         return importVesselButton;
390     }
391 
392     public ManageTemporaryReferentialUIModel getModel() {
393         return model;
394     }
395 
396     public JComboBox getPersonActionComboBox() {
397         return personActionComboBox;
398     }
399 
400     public JLabel getPersonLabel() {
401         return personLabel;
402     }
403 
404     public JButton getReplaceGearButton() {
405         return replaceGearButton;
406     }
407 
408     public JButton getReplacePersonButton() {
409         return replacePersonButton;
410     }
411 
412     public JButton getReplaceSpeciesButton() {
413         return replaceSpeciesButton;
414     }
415 
416     public JButton getReplaceVesselButton() {
417         return replaceVesselButton;
418     }
419 
420     public JComboBox getSpeciesActionComboBox() {
421         return speciesActionComboBox;
422     }
423 
424     public JLabel getSpeciesLabel() {
425         return speciesLabel;
426     }
427 
428     public JComboBox getVesselActionComboBox() {
429         return vesselActionComboBox;
430     }
431 
432     public JLabel getVesselLabel() {
433         return vesselLabel;
434     }
435 
436     /*-----------------------------------------------------------------------*/
437     /*---------------------------- Other methods ----------------------------*/
438     /*-----------------------------------------------------------------------*/
439 
440     @Override
441     public void registerHelpId(TuttiHelpBroker broker, Component component, String helpId) {
442         broker.installUI(component, helpId);
443     }
444 
445     @Override
446     public void showHelp(String helpId) {
447         getBroker().showHelp(this, helpId);
448     }
449 
450     /*-----------------------------------------------------------------------*/
451     /*--------------------- Protected acessors methods  ---------------------*/
452     /*-----------------------------------------------------------------------*/
453 
454     protected JSeparator get$JSeparator0() {
455         return $JSeparator0;
456     }
457 
458     protected JSeparator get$JSeparator1() {
459         return $JSeparator1;
460     }
461 
462     protected JSeparator get$JSeparator2() {
463         return $JSeparator2;
464     }
465 
466     protected Table get$Table0() {
467         return $Table0;
468     }
469 
470     /*-----------------------------------------------------------------------*/
471     /*--------------------- Components creation methods ---------------------*/
472     /*-----------------------------------------------------------------------*/
473 
474     protected void addChildrenToManageTemporaryReferentialTopPanel() {
475         if (!allComponentsCreated) {
476             return;
477         }
478         add(exportSpeciesExampleButton);
479         add(exportExistingSpeciesButton);
480         add(importSpeciesButton);
481         add(replaceSpeciesButton);
482         add(exportVesselExampleButton);
483         add(exportExistingVesselButton);
484         add(importVesselButton);
485         add(replaceVesselButton);
486         add(exportGearExampleButton);
487         add(exportExistingGearButton);
488         add(importGearButton);
489         add(replaceGearButton);
490         add(exportPersonExampleButton);
491         add(exportExistingPersonButton);
492         add(importPersonButton);
493         add(replacePersonButton);
494         add($Table0, BorderLayout.CENTER);
495     }
496 
497     protected void createBroker() {
498         $objectMap.put("broker", broker = new TuttiHelpBroker("tutti.manageTemporaryReferential.help"));
499     }
500 
501     protected void createExportExistingGearButton() {
502         $objectMap.put("exportExistingGearButton", exportExistingGearButton = new JButton());
503         
504         exportExistingGearButton.setName("exportExistingGearButton");
505         exportExistingGearButton.setText(t("tutti.manageTemporaryReferential.action.exportExistingTemporaryGear"));
506         exportExistingGearButton.setToolTipText(t("tutti.manageTemporaryReferential.action.exportExistingTemporaryGear.tip"));
507         exportExistingGearButton.putClientProperty("help", "tutti.manageTemporaryReferential.action.exportExistingTemporaryGear.help");
508         exportExistingGearButton.putClientProperty("applicationAction", fr.ifremer.tutti.ui.swing.content.referential.actions.ExportExistingTemporaryGearAction.class);
509     }
510 
511     protected void createExportExistingPersonButton() {
512         $objectMap.put("exportExistingPersonButton", exportExistingPersonButton = new JButton());
513         
514         exportExistingPersonButton.setName("exportExistingPersonButton");
515         exportExistingPersonButton.setText(t("tutti.manageTemporaryReferential.action.exportExistingTemporaryPerson"));
516         exportExistingPersonButton.setToolTipText(t("tutti.manageTemporaryReferential.action.exportExistingTemporaryPerson.tip"));
517         exportExistingPersonButton.putClientProperty("help", "tutti.manageTemporaryReferential.action.exportExistingTemporaryPerson.help");
518         exportExistingPersonButton.putClientProperty("applicationAction", fr.ifremer.tutti.ui.swing.content.referential.actions.ExportExistingTemporaryPersonAction.class);
519     }
520 
521     protected void createExportExistingSpeciesButton() {
522         $objectMap.put("exportExistingSpeciesButton", exportExistingSpeciesButton = new JButton());
523         
524         exportExistingSpeciesButton.setName("exportExistingSpeciesButton");
525         exportExistingSpeciesButton.setText(t("tutti.manageTemporaryReferential.action.exportExistingTemporarySpecies"));
526         exportExistingSpeciesButton.setToolTipText(t("tutti.manageTemporaryReferential.action.exportExistingTemporarySpecies.tip"));
527         exportExistingSpeciesButton.putClientProperty("help", "tutti.manageTemporaryReferential.action.exportExistingTemporarySpecies.help");
528         exportExistingSpeciesButton.putClientProperty("applicationAction", fr.ifremer.tutti.ui.swing.content.referential.actions.ExportExistingTemporarySpeciesAction.class);
529     }
530 
531     protected void createExportExistingVesselButton() {
532         $objectMap.put("exportExistingVesselButton", exportExistingVesselButton = new JButton());
533         
534         exportExistingVesselButton.setName("exportExistingVesselButton");
535         exportExistingVesselButton.setText(t("tutti.manageTemporaryReferential.action.exportExistingTemporaryVessel"));
536         exportExistingVesselButton.setToolTipText(t("tutti.manageTemporaryReferential.action.exportExistingTemporaryVessel.tip"));
537         exportExistingVesselButton.putClientProperty("help", "tutti.manageTemporaryReferential.action.exportExistingTemporaryVessel.help");
538         exportExistingVesselButton.putClientProperty("applicationAction", fr.ifremer.tutti.ui.swing.content.referential.actions.ExportExistingTemporaryVesselAction.class);
539     }
540 
541     protected void createExportGearExampleButton() {
542         $objectMap.put("exportGearExampleButton", exportGearExampleButton = new JButton());
543         
544         exportGearExampleButton.setName("exportGearExampleButton");
545         exportGearExampleButton.setText(t("tutti.manageTemporaryReferential.action.exportTemporaryGearExample"));
546         exportGearExampleButton.setToolTipText(t("tutti.manageTemporaryReferential.action.exportTemporaryGearExample.tip"));
547         exportGearExampleButton.putClientProperty("help", "tutti.manageTemporaryReferential.action.exportTemporaryGearExample.help");
548         exportGearExampleButton.putClientProperty("applicationAction", fr.ifremer.tutti.ui.swing.content.referential.actions.ExportTemporaryGearExampleAction.class);
549     }
550 
551     protected void createExportPersonExampleButton() {
552         $objectMap.put("exportPersonExampleButton", exportPersonExampleButton = new JButton());
553         
554         exportPersonExampleButton.setName("exportPersonExampleButton");
555         exportPersonExampleButton.setText(t("tutti.manageTemporaryReferential.action.exportTemporaryPersonExample"));
556         exportPersonExampleButton.setToolTipText(t("tutti.manageTemporaryReferential.action.exportTemporaryPersonExample.tip"));
557         exportPersonExampleButton.putClientProperty("help", "tutti.manageTemporaryReferential.action.exportTemporaryPersonExample.help");
558         exportPersonExampleButton.putClientProperty("applicationAction", fr.ifremer.tutti.ui.swing.content.referential.actions.ExportTemporaryPersonExampleAction.class);
559     }
560 
561     protected void createExportSpeciesExampleButton() {
562         $objectMap.put("exportSpeciesExampleButton", exportSpeciesExampleButton = new JButton());
563         
564         exportSpeciesExampleButton.setName("exportSpeciesExampleButton");
565         exportSpeciesExampleButton.setText(t("tutti.manageTemporaryReferential.action.exportTemporarySpeciesExample"));
566         exportSpeciesExampleButton.setToolTipText(t("tutti.manageTemporaryReferential.action.exportTemporarySpeciesExample.tip"));
567         exportSpeciesExampleButton.putClientProperty("help", "tutti.manageTemporaryReferential.action.exportTemporarySpeciesExample.help");
568         exportSpeciesExampleButton.putClientProperty("applicationAction", fr.ifremer.tutti.ui.swing.content.referential.actions.ExportTemporarySpeciesExampleAction.class);
569     }
570 
571     protected void createExportVesselExampleButton() {
572         $objectMap.put("exportVesselExampleButton", exportVesselExampleButton = new JButton());
573         
574         exportVesselExampleButton.setName("exportVesselExampleButton");
575         exportVesselExampleButton.setText(t("tutti.manageTemporaryReferential.action.exportTemporaryVesselExample"));
576         exportVesselExampleButton.setToolTipText(t("tutti.manageTemporaryReferential.action.exportTemporaryVesselExample.tip"));
577         exportVesselExampleButton.putClientProperty("help", "tutti.manageTemporaryReferential.action.exportTemporaryVesselExample.help");
578         exportVesselExampleButton.putClientProperty("applicationAction", fr.ifremer.tutti.ui.swing.content.referential.actions.ExportTemporaryVesselExampleAction.class);
579     }
580 
581     protected void createGearActionComboBox() {
582         $objectMap.put("gearActionComboBox", gearActionComboBox = new JComboBox());
583         
584         gearActionComboBox.setName("gearActionComboBox");
585         gearActionComboBox.putClientProperty("comboboxActions", Arrays.asList(exportGearExampleButton, exportExistingGearButton, importGearButton));
586     }
587 
588     protected void createGearLabel() {
589         $objectMap.put("gearLabel", gearLabel = new JLabel());
590         
591         gearLabel.setName("gearLabel");
592     }
593 
594     protected ManageTemporaryReferentialUIHandler createHandler() {
595         return new ManageTemporaryReferentialUIHandler();
596     }
597 
598     protected void createImportGearButton() {
599         $objectMap.put("importGearButton", importGearButton = new JButton());
600         
601         importGearButton.setName("importGearButton");
602         importGearButton.setText(t("tutti.manageTemporaryReferential.action.importTemporaryGear"));
603         importGearButton.setToolTipText(t("tutti.manageTemporaryReferential.action.importTemporaryGear.tip"));
604         importGearButton.putClientProperty("help", "tutti.manageTemporaryReferential.action.importTemporaryGear.help");
605         importGearButton.putClientProperty("applicationAction", fr.ifremer.tutti.ui.swing.content.referential.actions.ImportTemporaryGearAction.class);
606     }
607 
608     protected void createImportPersonButton() {
609         $objectMap.put("importPersonButton", importPersonButton = new JButton());
610         
611         importPersonButton.setName("importPersonButton");
612         importPersonButton.setText(t("tutti.manageTemporaryReferential.action.importTemporaryPerson"));
613         importPersonButton.setToolTipText(t("tutti.manageTemporaryReferential.action.importTemporaryPerson.tip"));
614         importPersonButton.putClientProperty("help", "tutti.manageTemporaryReferential.action.importTemporaryPerson.help");
615         importPersonButton.putClientProperty("applicationAction", fr.ifremer.tutti.ui.swing.content.referential.actions.ImportTemporaryPersonAction.class);
616     }
617 
618     protected void createImportSpeciesButton() {
619         $objectMap.put("importSpeciesButton", importSpeciesButton = new JButton());
620         
621         importSpeciesButton.setName("importSpeciesButton");
622         importSpeciesButton.setText(t("tutti.manageTemporaryReferential.action.importTemporarySpecies"));
623         importSpeciesButton.setToolTipText(t("tutti.manageTemporaryReferential.action.importTemporarySpecies.tip"));
624         importSpeciesButton.putClientProperty("help", "tutti.manageTemporaryReferential.action.importTemporarySpecies.help");
625         importSpeciesButton.putClientProperty("applicationAction", fr.ifremer.tutti.ui.swing.content.referential.actions.ImportTemporarySpeciesAction.class);
626     }
627 
628     protected void createImportVesselButton() {
629         $objectMap.put("importVesselButton", importVesselButton = new JButton());
630         
631         importVesselButton.setName("importVesselButton");
632         importVesselButton.setText(t("tutti.manageTemporaryReferential.action.importTemporaryVessel"));
633         importVesselButton.setToolTipText(t("tutti.manageTemporaryReferential.action.importTemporaryVessel.tip"));
634         importVesselButton.putClientProperty("help", "tutti.manageTemporaryReferential.action.importTemporaryVessel.help");
635         importVesselButton.putClientProperty("applicationAction", fr.ifremer.tutti.ui.swing.content.referential.actions.ImportTemporaryVesselAction.class);
636     }
637 
638     protected void createModel() {
639         $objectMap.put("model", model = getContextValue(ManageTemporaryReferentialUIModel.class));
640     }
641 
642     protected void createPersonActionComboBox() {
643         $objectMap.put("personActionComboBox", personActionComboBox = new JComboBox());
644         
645         personActionComboBox.setName("personActionComboBox");
646         personActionComboBox.putClientProperty("comboboxActions", Arrays.asList(exportPersonExampleButton, exportExistingPersonButton, importPersonButton));
647     }
648 
649     protected void createPersonLabel() {
650         $objectMap.put("personLabel", personLabel = new JLabel());
651         
652         personLabel.setName("personLabel");
653     }
654 
655     protected void createReplaceGearButton() {
656         $objectMap.put("replaceGearButton", replaceGearButton = new JButton());
657         
658         replaceGearButton.setName("replaceGearButton");
659         replaceGearButton.setText(t("tutti.manageTemporaryReferential.action.replaceTemporaryGear"));
660         replaceGearButton.setToolTipText(t("tutti.manageTemporaryReferential.action.replaceTemporaryGear.tip"));
661         replaceGearButton.putClientProperty("help", "tutti.manageTemporaryReferential.action.replaceTemporaryGear.help");
662         replaceGearButton.putClientProperty("applicationAction", fr.ifremer.tutti.ui.swing.content.referential.actions.OpenReplaceTemporaryGearUIAction.class);
663     }
664 
665     protected void createReplacePersonButton() {
666         $objectMap.put("replacePersonButton", replacePersonButton = new JButton());
667         
668         replacePersonButton.setName("replacePersonButton");
669         replacePersonButton.setText(t("tutti.manageTemporaryReferential.action.replaceTemporaryPerson"));
670         replacePersonButton.setToolTipText(t("tutti.manageTemporaryReferential.action.replaceTemporaryPerson.tip"));
671         replacePersonButton.putClientProperty("help", "tutti.manageTemporaryReferential.action.replaceTemporaryPerson.help");
672         replacePersonButton.putClientProperty("applicationAction", fr.ifremer.tutti.ui.swing.content.referential.actions.OpenReplaceTemporaryPersonUIAction.class);
673     }
674 
675     protected void createReplaceSpeciesButton() {
676         $objectMap.put("replaceSpeciesButton", replaceSpeciesButton = new JButton());
677         
678         replaceSpeciesButton.setName("replaceSpeciesButton");
679         replaceSpeciesButton.setText(t("tutti.manageTemporaryReferential.action.replaceTemporarySpecies"));
680         replaceSpeciesButton.setToolTipText(t("tutti.manageTemporaryReferential.action.replaceTemporarySpecies.tip"));
681         replaceSpeciesButton.putClientProperty("help", "tutti.manageTemporaryReferential.action.replaceTemporarySpecies.help");
682         replaceSpeciesButton.putClientProperty("applicationAction", fr.ifremer.tutti.ui.swing.content.referential.actions.OpenReplaceTemporarySpeciesUIAction.class);
683     }
684 
685     protected void createReplaceVesselButton() {
686         $objectMap.put("replaceVesselButton", replaceVesselButton = new JButton());
687         
688         replaceVesselButton.setName("replaceVesselButton");
689         replaceVesselButton.setText(t("tutti.manageTemporaryReferential.action.replaceTemporaryVessel"));
690         replaceVesselButton.setToolTipText(t("tutti.manageTemporaryReferential.action.replaceTemporaryVessel.tip"));
691         replaceVesselButton.putClientProperty("help", "tutti.manageTemporaryReferential.action.replaceTemporaryVessel.help");
692         replaceVesselButton.putClientProperty("applicationAction", fr.ifremer.tutti.ui.swing.content.referential.actions.OpenReplaceTemporaryVesselUIAction.class);
693     }
694 
695     protected void createSpeciesActionComboBox() {
696         $objectMap.put("speciesActionComboBox", speciesActionComboBox = new JComboBox());
697         
698         speciesActionComboBox.setName("speciesActionComboBox");
699         speciesActionComboBox.putClientProperty("comboboxActions", Arrays.asList(exportSpeciesExampleButton, exportExistingSpeciesButton, importSpeciesButton));
700     }
701 
702     protected void createSpeciesLabel() {
703         $objectMap.put("speciesLabel", speciesLabel = new JLabel());
704         
705         speciesLabel.setName("speciesLabel");
706     }
707 
708     protected void createVesselActionComboBox() {
709         $objectMap.put("vesselActionComboBox", vesselActionComboBox = new JComboBox());
710         
711         vesselActionComboBox.setName("vesselActionComboBox");
712         vesselActionComboBox.putClientProperty("comboboxActions", Arrays.asList(exportVesselExampleButton, exportExistingVesselButton, importVesselButton));
713     }
714 
715     protected void createVesselLabel() {
716         $objectMap.put("vesselLabel", vesselLabel = new JLabel());
717         
718         vesselLabel.setName("vesselLabel");
719     }
720 
721     /*-----------------------------------------------------------------------*/
722     /*------------------------ Internal jaxx methods ------------------------*/
723     /*-----------------------------------------------------------------------*/
724 
725     private void $completeSetup() {
726         allComponentsCreated = true;
727         if (log.isDebugEnabled()) {
728             log.debug(this);
729         }
730         addChildrenToManageTemporaryReferentialTopPanel();
731         // inline complete setup of $Table0
732         $Table0.add(speciesLabel, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0, 10, 0, new Insets(3, 3, 3, 3), 0, 0));
733         $Table0.add(speciesActionComboBox, new GridBagConstraints(1, 0, 1, 1, 0.0, 0.0, 10, 0, new Insets(3, 3, 3, 3), 0, 0));
734         $Table0.add($JSeparator0, new GridBagConstraints(0, 1, 2, 1, 0.0, 0.0, 10, 1, new Insets(3, 3, 3, 3), 0, 0));
735         $Table0.add(vesselLabel, new GridBagConstraints(0, 2, 1, 1, 0.0, 0.0, 10, 0, new Insets(3, 3, 3, 3), 0, 0));
736         $Table0.add(vesselActionComboBox, new GridBagConstraints(1, 2, 1, 1, 0.0, 0.0, 10, 0, new Insets(3, 3, 3, 3), 0, 0));
737         $Table0.add($JSeparator1, new GridBagConstraints(0, 3, 2, 1, 0.0, 0.0, 10, 1, new Insets(3, 3, 3, 3), 0, 0));
738         $Table0.add(gearLabel, new GridBagConstraints(0, 4, 1, 1, 0.0, 0.0, 10, 0, new Insets(3, 3, 3, 3), 0, 0));
739         $Table0.add(gearActionComboBox, new GridBagConstraints(1, 4, 1, 1, 0.0, 0.0, 10, 0, new Insets(3, 3, 3, 3), 0, 0));
740         $Table0.add($JSeparator2, new GridBagConstraints(0, 5, 2, 1, 0.0, 0.0, 10, 1, new Insets(3, 3, 3, 3), 0, 0));
741         $Table0.add(personLabel, new GridBagConstraints(0, 6, 1, 1, 0.0, 0.0, 10, 0, new Insets(3, 3, 3, 3), 0, 0));
742         $Table0.add(personActionComboBox, new GridBagConstraints(1, 6, 1, 1, 0.0, 0.0, 10, 0, new Insets(3, 3, 3, 3), 0, 0));
743         
744         // apply 16 data bindings
745         JAXXUtil.applyDataBinding(this, $bindings.keySet());
746         
747         // apply 21 property setters
748         exportSpeciesExampleButton.setIcon(SwingUtil.createActionIcon("export"));
749         exportExistingSpeciesButton.setIcon(SwingUtil.createActionIcon("export"));
750         importSpeciesButton.setIcon(SwingUtil.createActionIcon("import"));
751         replaceSpeciesButton.setIcon(SwingUtil.createActionIcon("replace"));
752         exportVesselExampleButton.setIcon(SwingUtil.createActionIcon("export"));
753         exportExistingVesselButton.setIcon(SwingUtil.createActionIcon("export"));
754         importVesselButton.setIcon(SwingUtil.createActionIcon("import"));
755         replaceVesselButton.setIcon(SwingUtil.createActionIcon("replace"));
756         exportGearExampleButton.setIcon(SwingUtil.createActionIcon("export"));
757         exportExistingGearButton.setIcon(SwingUtil.createActionIcon("export"));
758         importGearButton.setIcon(SwingUtil.createActionIcon("import"));
759         replaceGearButton.setIcon(SwingUtil.createActionIcon("replace"));
760         exportPersonExampleButton.setIcon(SwingUtil.createActionIcon("export"));
761         exportExistingPersonButton.setIcon(SwingUtil.createActionIcon("export"));
762         importPersonButton.setIcon(SwingUtil.createActionIcon("import"));
763         replacePersonButton.setIcon(SwingUtil.createActionIcon("replace"));
764         speciesLabel.setIcon(SwingUtil.createImageIcon("action-species.gif"));
765         vesselLabel.setIcon(SwingUtil.createActionIcon("vessel"));
766         gearLabel.setIcon(SwingUtil.createActionIcon("gear"));
767         personLabel.setIcon(SwingUtil.createActionIcon("person"));
768         // late initializer
769         // help broker setup
770         TuttiHelpBroker _broker = getBroker();
771         registerHelpId(_broker, manageTemporaryReferentialTopPanel, "tutti.manageTemporaryReferential.help");
772         registerHelpId(_broker, exportSpeciesExampleButton, "tutti.manageTemporaryReferential.action.exportTemporarySpeciesExample.help");
773         registerHelpId(_broker, exportExistingSpeciesButton, "tutti.manageTemporaryReferential.action.exportExistingTemporarySpecies.help");
774         registerHelpId(_broker, importSpeciesButton, "tutti.manageTemporaryReferential.action.importTemporarySpecies.help");
775         registerHelpId(_broker, replaceSpeciesButton, "tutti.manageTemporaryReferential.action.replaceTemporarySpecies.help");
776         registerHelpId(_broker, exportVesselExampleButton, "tutti.manageTemporaryReferential.action.exportTemporaryVesselExample.help");
777         registerHelpId(_broker, exportExistingVesselButton, "tutti.manageTemporaryReferential.action.exportExistingTemporaryVessel.help");
778         registerHelpId(_broker, importVesselButton, "tutti.manageTemporaryReferential.action.importTemporaryVessel.help");
779         registerHelpId(_broker, replaceVesselButton, "tutti.manageTemporaryReferential.action.replaceTemporaryVessel.help");
780         registerHelpId(_broker, exportGearExampleButton, "tutti.manageTemporaryReferential.action.exportTemporaryGearExample.help");
781         registerHelpId(_broker, exportExistingGearButton, "tutti.manageTemporaryReferential.action.exportExistingTemporaryGear.help");
782         registerHelpId(_broker, importGearButton, "tutti.manageTemporaryReferential.action.importTemporaryGear.help");
783         registerHelpId(_broker, replaceGearButton, "tutti.manageTemporaryReferential.action.replaceTemporaryGear.help");
784         registerHelpId(_broker, exportPersonExampleButton, "tutti.manageTemporaryReferential.action.exportTemporaryPersonExample.help");
785         registerHelpId(_broker, exportExistingPersonButton, "tutti.manageTemporaryReferential.action.exportExistingTemporaryPerson.help");
786         registerHelpId(_broker, importPersonButton, "tutti.manageTemporaryReferential.action.importTemporaryPerson.help");
787         registerHelpId(_broker, replacePersonButton, "tutti.manageTemporaryReferential.action.replaceTemporaryPerson.help");
788         _broker.prepareUI(this);
789     }
790 
791     private void $initialize() {
792         if (allComponentsCreated) {
793             return;
794         }
795         if (log.isDebugEnabled()) {
796             log.debug(this);
797         }
798         handler.beforeInit(this);
799         $objectMap.put("manageTemporaryReferentialTopPanel", manageTemporaryReferentialTopPanel);
800         createModel();
801         createBroker();
802         createExportSpeciesExampleButton();
803         createExportExistingSpeciesButton();
804         createImportSpeciesButton();
805         createReplaceSpeciesButton();
806         createExportVesselExampleButton();
807         createExportExistingVesselButton();
808         createImportVesselButton();
809         createReplaceVesselButton();
810         createExportGearExampleButton();
811         createExportExistingGearButton();
812         createImportGearButton();
813         createReplaceGearButton();
814         createExportPersonExampleButton();
815         createExportExistingPersonButton();
816         createImportPersonButton();
817         createReplacePersonButton();
818         // inline creation of $Table0
819         $objectMap.put("$Table0", $Table0 = new Table());
820         
821         $Table0.setName("$Table0");
822         createSpeciesLabel();
823         createSpeciesActionComboBox();
824         // inline creation of $JSeparator0
825         $objectMap.put("$JSeparator0", $JSeparator0 = new JSeparator());
826         
827         $JSeparator0.setName("$JSeparator0");
828         createVesselLabel();
829         createVesselActionComboBox();
830         // inline creation of $JSeparator1
831         $objectMap.put("$JSeparator1", $JSeparator1 = new JSeparator());
832         
833         $JSeparator1.setName("$JSeparator1");
834         createGearLabel();
835         createGearActionComboBox();
836         // inline creation of $JSeparator2
837         $objectMap.put("$JSeparator2", $JSeparator2 = new JSeparator());
838         
839         $JSeparator2.setName("$JSeparator2");
840         createPersonLabel();
841         createPersonActionComboBox();
842         // inline creation of manageTemporaryReferentialTopPanel
843         setName("manageTemporaryReferentialTopPanel");
844         setLayout(new BorderLayout());
845         manageTemporaryReferentialTopPanel.putClientProperty("help", "tutti.manageTemporaryReferential.help");
846         
847         // registers 16 data bindings
848         $registerDefaultBindings();
849         $completeSetup();
850         handler.afterInit(this);
851     }
852 
853     private void $registerDefaultBindings() {
854         // register 16 data bindings
855         registerDataBinding(new DefaultJAXXBinding(this, BINDING_EXPORT_EXISTING_SPECIES_BUTTON_ENABLED, true) {
856         
857             @Override
858             public void applyDataBinding() {
859                 if (model != null) {
860                     model.addPropertyChangeListener("nbTemporarySpecies", this);
861                 }
862             }
863         
864             @Override
865             public void processDataBinding() {
866                 if (model != null) {
867                     exportExistingSpeciesButton.setEnabled( model.getNbTemporarySpecies() > 0 );
868                 }
869             }
870         
871             @Override
872             public void removeDataBinding() {
873                 if (model != null) {
874                     model.removePropertyChangeListener("nbTemporarySpecies", this);
875                 }
876             }
877         });
878         registerDataBinding(new DefaultJAXXBinding(this, BINDING_REPLACE_SPECIES_BUTTON_ENABLED, true) {
879         
880             @Override
881             public void applyDataBinding() {
882                 if (model != null) {
883                     model.addPropertyChangeListener("nbTemporarySpecies", this);
884                 }
885             }
886         
887             @Override
888             public void processDataBinding() {
889                 if (model != null) {
890                     replaceSpeciesButton.setEnabled( model.getNbTemporarySpecies() > 0 );
891                 }
892             }
893         
894             @Override
895             public void removeDataBinding() {
896                 if (model != null) {
897                     model.removePropertyChangeListener("nbTemporarySpecies", this);
898                 }
899             }
900         });
901         registerDataBinding(new DefaultJAXXBinding(this, BINDING_EXPORT_EXISTING_VESSEL_BUTTON_ENABLED, true) {
902         
903             @Override
904             public void applyDataBinding() {
905                 if (model != null) {
906                     model.addPropertyChangeListener("nbTemporaryVessels", this);
907                 }
908             }
909         
910             @Override
911             public void processDataBinding() {
912                 if (model != null) {
913                     exportExistingVesselButton.setEnabled( model.getNbTemporaryVessels() > 0 );
914                 }
915             }
916         
917             @Override
918             public void removeDataBinding() {
919                 if (model != null) {
920                     model.removePropertyChangeListener("nbTemporaryVessels", this);
921                 }
922             }
923         });
924         registerDataBinding(new DefaultJAXXBinding(this, BINDING_REPLACE_VESSEL_BUTTON_ENABLED, true) {
925         
926             @Override
927             public void applyDataBinding() {
928                 if (model != null) {
929                     model.addPropertyChangeListener("nbTemporaryVessels", this);
930                 }
931             }
932         
933             @Override
934             public void processDataBinding() {
935                 if (model != null) {
936                     replaceVesselButton.setEnabled( model.getNbTemporaryVessels() > 0 );
937                 }
938             }
939         
940             @Override
941             public void removeDataBinding() {
942                 if (model != null) {
943                     model.removePropertyChangeListener("nbTemporaryVessels", this);
944                 }
945             }
946         });
947         registerDataBinding(new DefaultJAXXBinding(this, BINDING_EXPORT_EXISTING_GEAR_BUTTON_ENABLED, true) {
948         
949             @Override
950             public void applyDataBinding() {
951                 if (model != null) {
952                     model.addPropertyChangeListener("nbTemporaryGears", this);
953                 }
954             }
955         
956             @Override
957             public void processDataBinding() {
958                 if (model != null) {
959                     exportExistingGearButton.setEnabled( model.getNbTemporaryGears() > 0 );
960                 }
961             }
962         
963             @Override
964             public void removeDataBinding() {
965                 if (model != null) {
966                     model.removePropertyChangeListener("nbTemporaryGears", this);
967                 }
968             }
969         });
970         registerDataBinding(new DefaultJAXXBinding(this, BINDING_REPLACE_GEAR_BUTTON_ENABLED, true) {
971         
972             @Override
973             public void applyDataBinding() {
974                 if (model != null) {
975                     model.addPropertyChangeListener("nbTemporaryGears", this);
976                 }
977             }
978         
979             @Override
980             public void processDataBinding() {
981                 if (model != null) {
982                     replaceGearButton.setEnabled( model.getNbTemporaryGears() > 0 );
983                 }
984             }
985         
986             @Override
987             public void removeDataBinding() {
988                 if (model != null) {
989                     model.removePropertyChangeListener("nbTemporaryGears", this);
990                 }
991             }
992         });
993         registerDataBinding(new DefaultJAXXBinding(this, BINDING_EXPORT_EXISTING_PERSON_BUTTON_ENABLED, true) {
994         
995             @Override
996             public void applyDataBinding() {
997                 if (model != null) {
998                     model.addPropertyChangeListener("nbTemporaryPersons", this);
999                 }
1000             }
1001         
1002             @Override
1003             public void processDataBinding() {
1004                 if (model != null) {
1005                     exportExistingPersonButton.setEnabled( model.getNbTemporaryPersons() > 0 );
1006                 }
1007             }
1008         
1009             @Override
1010             public void removeDataBinding() {
1011                 if (model != null) {
1012                     model.removePropertyChangeListener("nbTemporaryPersons", this);
1013                 }
1014             }
1015         });
1016         registerDataBinding(new DefaultJAXXBinding(this, BINDING_REPLACE_PERSON_BUTTON_ENABLED, true) {
1017         
1018             @Override
1019             public void applyDataBinding() {
1020                 if (model != null) {
1021                     model.addPropertyChangeListener("nbTemporaryPersons", this);
1022                 }
1023             }
1024         
1025             @Override
1026             public void processDataBinding() {
1027                 if (model != null) {
1028                     replacePersonButton.setEnabled( model.getNbTemporaryPersons() > 0 );
1029                 }
1030             }
1031         
1032             @Override
1033             public void removeDataBinding() {
1034                 if (model != null) {
1035                     model.removePropertyChangeListener("nbTemporaryPersons", this);
1036                 }
1037             }
1038         });
1039         registerDataBinding(new DefaultJAXXBinding(this, BINDING_SPECIES_LABEL_TEXT, true) {
1040         
1041             @Override
1042             public void applyDataBinding() {
1043                 if (model != null) {
1044                     model.addPropertyChangeListener("nbTemporarySpecies", this);
1045                 }
1046             }
1047         
1048             @Override
1049             public void processDataBinding() {
1050                 if (model != null) {
1051                     speciesLabel.setText(t( t("tutti.manageTemporaryReferential.field.species", model.getNbTemporarySpecies()) ));
1052                 }
1053             }
1054         
1055             @Override
1056             public void removeDataBinding() {
1057                 if (model != null) {
1058                     model.removePropertyChangeListener("nbTemporarySpecies", this);
1059                 }
1060             }
1061         });
1062         registerDataBinding(new DefaultJAXXBinding(this, BINDING_SPECIES_LABEL_TOOL_TIP_TEXT, true) {
1063         
1064             @Override
1065             public void applyDataBinding() {
1066                 if (model != null) {
1067                     model.addPropertyChangeListener("nbTemporarySpecies", this);
1068                 }
1069             }
1070         
1071             @Override
1072             public void processDataBinding() {
1073                 if (model != null) {
1074                     speciesLabel.setToolTipText(t( t("tutti.manageTemporaryReferential.field.species.tip", model.getNbTemporarySpecies()) ));
1075                 }
1076             }
1077         
1078             @Override
1079             public void removeDataBinding() {
1080                 if (model != null) {
1081                     model.removePropertyChangeListener("nbTemporarySpecies", this);
1082                 }
1083             }
1084         });
1085         registerDataBinding(new DefaultJAXXBinding(this, BINDING_VESSEL_LABEL_TEXT, true) {
1086         
1087             @Override
1088             public void applyDataBinding() {
1089                 if (model != null) {
1090                     model.addPropertyChangeListener("nbTemporaryVessels", this);
1091                 }
1092             }
1093         
1094             @Override
1095             public void processDataBinding() {
1096                 if (model != null) {
1097                     vesselLabel.setText(t( t("tutti.manageTemporaryReferential.field.vessel", model.getNbTemporaryVessels()) ));
1098                 }
1099             }
1100         
1101             @Override
1102             public void removeDataBinding() {
1103                 if (model != null) {
1104                     model.removePropertyChangeListener("nbTemporaryVessels", this);
1105                 }
1106             }
1107         });
1108         registerDataBinding(new DefaultJAXXBinding(this, BINDING_VESSEL_LABEL_TOOL_TIP_TEXT, true) {
1109         
1110             @Override
1111             public void applyDataBinding() {
1112                 if (model != null) {
1113                     model.addPropertyChangeListener("nbTemporaryVessels", this);
1114                 }
1115             }
1116         
1117             @Override
1118             public void processDataBinding() {
1119                 if (model != null) {
1120                     vesselLabel.setToolTipText(t( t("tutti.manageTemporaryReferential.field.vessel.tip", model.getNbTemporaryVessels()) ));
1121                 }
1122             }
1123         
1124             @Override
1125             public void removeDataBinding() {
1126                 if (model != null) {
1127                     model.removePropertyChangeListener("nbTemporaryVessels", this);
1128                 }
1129             }
1130         });
1131         registerDataBinding(new DefaultJAXXBinding(this, BINDING_GEAR_LABEL_TEXT, true) {
1132         
1133             @Override
1134             public void applyDataBinding() {
1135                 if (model != null) {
1136                     model.addPropertyChangeListener("nbTemporaryGears", this);
1137                 }
1138             }
1139         
1140             @Override
1141             public void processDataBinding() {
1142                 if (model != null) {
1143                     gearLabel.setText(t( t("tutti.manageTemporaryReferential.field.gear", model.getNbTemporaryGears()) ));
1144                 }
1145             }
1146         
1147             @Override
1148             public void removeDataBinding() {
1149                 if (model != null) {
1150                     model.removePropertyChangeListener("nbTemporaryGears", this);
1151                 }
1152             }
1153         });
1154         registerDataBinding(new DefaultJAXXBinding(this, BINDING_GEAR_LABEL_TOOL_TIP_TEXT, true) {
1155         
1156             @Override
1157             public void applyDataBinding() {
1158                 if (model != null) {
1159                     model.addPropertyChangeListener("nbTemporaryGears", this);
1160                 }
1161             }
1162         
1163             @Override
1164             public void processDataBinding() {
1165                 if (model != null) {
1166                     gearLabel.setToolTipText(t( t("tutti.manageTemporaryReferential.field.gear.tip", model.getNbTemporaryGears()) ));
1167                 }
1168             }
1169         
1170             @Override
1171             public void removeDataBinding() {
1172                 if (model != null) {
1173                     model.removePropertyChangeListener("nbTemporaryGears", this);
1174                 }
1175             }
1176         });
1177         registerDataBinding(new DefaultJAXXBinding(this, BINDING_PERSON_LABEL_TEXT, true) {
1178         
1179             @Override
1180             public void applyDataBinding() {
1181                 if (model != null) {
1182                     model.addPropertyChangeListener("nbTemporaryPersons", this);
1183                 }
1184             }
1185         
1186             @Override
1187             public void processDataBinding() {
1188                 if (model != null) {
1189                     personLabel.setText(t( t("tutti.manageTemporaryReferential.field.person", model.getNbTemporaryPersons()) ));
1190                 }
1191             }
1192         
1193             @Override
1194             public void removeDataBinding() {
1195                 if (model != null) {
1196                     model.removePropertyChangeListener("nbTemporaryPersons", this);
1197                 }
1198             }
1199         });
1200         registerDataBinding(new DefaultJAXXBinding(this, BINDING_PERSON_LABEL_TOOL_TIP_TEXT, true) {
1201         
1202             @Override
1203             public void applyDataBinding() {
1204                 if (model != null) {
1205                     model.addPropertyChangeListener("nbTemporaryPersons", this);
1206                 }
1207             }
1208         
1209             @Override
1210             public void processDataBinding() {
1211                 if (model != null) {
1212                     personLabel.setToolTipText(t( t("tutti.manageTemporaryReferential.field.person.tip", model.getNbTemporaryPersons()) ));
1213                 }
1214             }
1215         
1216             @Override
1217             public void removeDataBinding() {
1218                 if (model != null) {
1219                     model.removePropertyChangeListener("nbTemporaryPersons", this);
1220                 }
1221             }
1222         });
1223     }
1224 
1225 }