View Javadoc
1   package fr.ifremer.tutti.ui.swing.content.operation.catches.species;
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.content.operation.catches.EditCatchesUI;
29  import fr.ifremer.tutti.ui.swing.content.operation.catches.species.create.CreateSpeciesBatchUI;
30  import fr.ifremer.tutti.ui.swing.content.operation.catches.species.edit.SpeciesBatchUI;
31  import fr.ifremer.tutti.ui.swing.content.operation.catches.species.frequency.SpeciesFrequencyUI;
32  import fr.ifremer.tutti.ui.swing.content.operation.catches.species.split.SplitSpeciesBatchUI;
33  import fr.ifremer.tutti.ui.swing.util.TuttiUI;
34  import fr.ifremer.tutti.ui.swing.util.TuttiUIUtil;
35  import java.awt.Component;
36  import java.awt.Container;
37  import java.awt.LayoutManager;
38  import java.util.ArrayList;
39  import java.util.HashMap;
40  import java.util.List;
41  import java.util.Map;
42  import java.util.TreeMap;
43  import javax.swing.JPanel;
44  import jaxx.runtime.JAXXBinding;
45  import jaxx.runtime.JAXXContext;
46  import jaxx.runtime.JAXXObject;
47  import jaxx.runtime.JAXXObjectDescriptor;
48  import jaxx.runtime.JAXXUtil;
49  import jaxx.runtime.SwingUtil;
50  import jaxx.runtime.binding.DefaultJAXXBinding;
51  import jaxx.runtime.context.DefaultJAXXContext;
52  import jaxx.runtime.swing.CardLayout2Ext;
53  import jaxx.runtime.swing.help.JAXXHelpUI;
54  import org.apache.commons.logging.Log;
55  import org.apache.commons.logging.LogFactory;
56  import org.jdesktop.swingx.JXTitledPanel;
57  import static org.nuiton.i18n.I18n.t;
58  
59  public class EditSpeciesBatchPanelUI extends JPanel implements JAXXHelpUI<TuttiHelpBroker>, TuttiUI<EditSpeciesBatchPanelUIModel, EditSpeciesBatchPanelUIHandler>, JAXXObject {
60  
61      /*-----------------------------------------------------------------------*/
62      /*------------------ Constants for all public bindings ------------------*/
63      /*-----------------------------------------------------------------------*/
64  
65      public static final String BINDING_EDIT_BATCHES_UIPANEL_RIGHT_DECORATION = "editBatchesUIPanel.rightDecoration";
66      public static final String BINDING_EDIT_FREQUENCIES_UIPANEL_RIGHT_DECORATION = "editFrequenciesUIPanel.rightDecoration";
67  
68      /*-----------------------------------------------------------------------*/
69      /*------------------------- Other static fields -------------------------*/
70      /*-----------------------------------------------------------------------*/
71  
72      private static final String $jaxxObjectDescriptor = "H4sIAAAAAAAAALVVQW8bVRCeGOw2TdM2rZoWpUhtClIjpGdEhThEiBK3UVO5FOFYifChfd59sV+63vf6dpauZQXxE/gJcOeCxI0T4sCZAxfEX0CIA1fEvLfrXTtet4gIH3bXOzPffDM775tvfodqZODGIU8SZuIQ5UCwBx/u7z/qHgoP74rIM1KjMpD+FipQ6cCSn7+PEG52mja8noXXG2qgVSjCiejNJpyJcBiIqC8EIrw+HeFFUb2VmzcTHZsxak6qDPWrP/+ofOl/8XUFINHE7hyVcv1lUUUlrzahIn2Ei5TpM14PeNgjGkaGPeK7bN81Ah5FH/GBeAafw6km1DQ3BIaw/u9LdhguPtEIp1Hpj3koAoTWgWHywIiBMAxjRMliyaLnlJ55KkRCY0oLw1GqkHkcvb6IWKSFJ+l+z5fYSp+3rMlhtne0dqlqCNWB8m2W/f8hy0MLXaQ6N66pyYeKUhwbpzRZgxs/tb9zL8EiuNY16qkwCBvzie7av/cp5ZbzLYIvCiK4lZJu72R9vaFMjx3SiD4lXilCwh7s70oMhO98bPRiDrI8BYLw6CQds1hssmXtHZvmckHZM4KjyGw5nSvHOE15IeydhFOKxRruNsttLc+6Eukga8V8amcnnRDaJ2HmoKhdwfSYpbyu5ynXuO+3+EDTYaIKesoMi2ksYbha7m6tb9jLm4Wn/VzbRjyLRWizz696ZcbzhEfrIMMajqdlDD5Mq9/QJGZrUweJZJIVMlno2EIHqiam1whXO7PK+gmZUk29ekxTLaCz/r166Zfvf/tueyykdidcLnWd2AMkcNrYAlHa1OdTFY1RBvWHXG92YDESAS0RtySulRBrZWYiR/lWbDiz4ew+j/oEUT316w8/rj75+RWobMOZQHF/m1v/HVjEvqEuqMBP9Ad3HKOzz0/T9YLlRor0mEZgT8heH9uhJEW6MnJyyHoCi9e3No4S6sq1kq7k1LqLP/11qfXtnXFnFojpa3Pdi+5UP4WaDAMZCrdksv1RulSWdCRiXxV7omxzgNa0PZYD3hXBnsS+5e9st931vbIu1PquVITKu28nsXXbdBXYp/dTwKUuza0K3dS/EK5CcEEm7xdG04J/RNvmcZ/kmRb7aD09Cfa4NOzIu6PHrHX9aJbExELUmay/oKDzxtZzV3gqPVQIb42mxNt+30kh2eXdXaWCLW7ct57NXrJA/hOP26MZfZjgkh/tl/KZI0jE6R9K4YCKqgkAAA==";
73      private static final Log log = LogFactory.getLog(EditSpeciesBatchPanelUI.class);
74      private static final long serialVersionUID = 1L;
75  
76      /*-----------------------------------------------------------------------*/
77      /*--------------------------- Internal states ---------------------------*/
78      /*-----------------------------------------------------------------------*/
79  
80      protected List<Object> $activeBindings = new ArrayList<Object>();
81      protected Map<String, Object> $bindingSources = new HashMap<String, Object>();
82      protected final Map<String, JAXXBinding> $bindings = new TreeMap<String, JAXXBinding>();
83      protected Map<String, Object> $objectMap = new HashMap<String, Object>();
84      protected Map<?, ?> $previousValues = new HashMap<Object, Object>();
85      private boolean allComponentsCreated;
86      protected final JAXXContext delegateContext = new DefaultJAXXContext();
87  
88      /*-----------------------------------------------------------------------*/
89      /*------------------------ Protected components  ------------------------*/
90      /*-----------------------------------------------------------------------*/
91  
92      protected SplitSpeciesBatchUI addSampleCategoryBatch;
93      protected JXTitledPanel addSampleCategoryBatchPanel;
94      protected TuttiHelpBroker broker;
95      protected CreateSpeciesBatchUI createBatchUI;
96      protected JXTitledPanel createBatchUIPanel;
97      protected SpeciesBatchUI editBatchesUI;
98      protected JXTitledPanel editBatchesUIPanel;
99      protected SpeciesFrequencyUI editFrequenciesUI;
100     protected JXTitledPanel editFrequenciesUIPanel;
101     protected final EditSpeciesBatchPanelUIHandler handler = createHandler();
102     protected EditSpeciesBatchPanelUIModel model;
103     protected SplitSpeciesBatchUI splitBatchUI;
104     protected JXTitledPanel splitBatchUIPanel;
105     protected EditSpeciesBatchPanelUI topPanel = this;
106     protected CardLayout2Ext topPanelLayout;
107 
108     /*-----------------------------------------------------------------------*/
109     /*---------------------- Raw body code from script ----------------------*/
110     /*-----------------------------------------------------------------------*/
111 
112     public static final String EDIT_BATCH_CARD = "editBatch";
113     public static final String CREATE_BATCH_CARD = "createBatch";
114     public static final String SPLIT_BATCH_CARD = "splitBatch";
115     public static final String ADD_SAMPLE_CATEGORY_BATCH_CARD = "addSampleCategoryBatch";
116     public static final String EDIT_FREQUENCY_CARD = "editFrequency";
117     // Pour savoir sur quel modèle on est (espèce ou benthos)
118     private String speciesOrBenthosContext;
119     
120     
121     public String getSpeciesOrBenthosContext() { return speciesOrBenthosContext; }
122     public void switchToEditBatch() { handler.setSpeciesSelectedCard(EDIT_BATCH_CARD); }
123     public void switchToEditFrequency() { handler.setSpeciesSelectedCard(EDIT_FREQUENCY_CARD); }
124     public void switchToSplitBatch() { handler.setSpeciesSelectedCard(SPLIT_BATCH_CARD); }
125     public void switchToCreateBatch() { handler.setSpeciesSelectedCard(CREATE_BATCH_CARD); }
126     public void switchToAddSampleCategory() { handler.setSpeciesSelectedCard(ADD_SAMPLE_CATEGORY_BATCH_CARD); }
127 
128     /*-----------------------------------------------------------------------*/
129     /*---------------------------- Constructors  ----------------------------*/
130     /*-----------------------------------------------------------------------*/
131 
132     public EditSpeciesBatchPanelUI(EditCatchesUI parentUI, String speciesOrBenthosContext) {
133         TuttiUIUtil.setParentUI(this, parentUI);
134             this.speciesOrBenthosContext = speciesOrBenthosContext;
135             $initialize();
136     }
137 
138     public EditSpeciesBatchPanelUI(LayoutManager param0, boolean param1) {
139         super(param0 ,param1);
140         $initialize();
141     }
142 
143     public EditSpeciesBatchPanelUI(JAXXContext parentContext, LayoutManager param1, boolean param2) {
144         super(param1 ,param2);
145         JAXXUtil.initContext(this, parentContext);
146         $initialize();
147     }
148 
149     public EditSpeciesBatchPanelUI(LayoutManager param0) {
150         super(param0);
151         $initialize();
152     }
153 
154     public EditSpeciesBatchPanelUI(JAXXContext parentContext, LayoutManager param1) {
155         super(param1);
156         JAXXUtil.initContext(this, parentContext);
157         $initialize();
158     }
159 
160     public EditSpeciesBatchPanelUI() {
161         $initialize();
162     }
163 
164     public EditSpeciesBatchPanelUI(JAXXContext parentContext) {
165         JAXXUtil.initContext(this, parentContext);
166         $initialize();
167     }
168 
169     public EditSpeciesBatchPanelUI(boolean param0) {
170         super(param0);
171         $initialize();
172     }
173 
174     public EditSpeciesBatchPanelUI(JAXXContext parentContext, boolean param1) {
175         super(param1);
176         JAXXUtil.initContext(this, parentContext);
177         $initialize();
178     }
179 
180     /*-----------------------------------------------------------------------*/
181     /*--------------------------- Statics methods ---------------------------*/
182     /*-----------------------------------------------------------------------*/
183 
184     public static JAXXObjectDescriptor $getJAXXObjectDescriptor() {
185         return JAXXUtil.decodeCompressedJAXXObjectDescriptor($jaxxObjectDescriptor);
186     }
187 
188     /*-----------------------------------------------------------------------*/
189     /*---------------------- JAXXObject implementation ----------------------*/
190     /*-----------------------------------------------------------------------*/
191 
192     @Override
193     public void applyDataBinding(String $binding) {
194         if (allComponentsCreated && $bindings.containsKey($binding)) {
195             getDataBinding($binding).applyDataBinding();
196         }
197         processDataBinding($binding);
198     }
199 
200     @Override
201     public void firePropertyChange(String propertyName, Object oldValue, Object newValue) {
202         super.firePropertyChange(propertyName, oldValue, newValue);
203     }
204 
205     @Override
206     public Map<String, Object> get$objectMap() {
207         return $objectMap;
208     }
209 
210     @Override
211     public JAXXBinding getDataBinding(String bindingId) {
212         return $bindings.get(bindingId);
213     }
214 
215     @Override
216     public JAXXBinding[] getDataBindings() {
217         return $bindings.values().toArray(new JAXXBinding[$bindings.size()]);
218     }
219 
220     @Override
221     public Object getObjectById(String id) {
222         return $objectMap.get(id);
223     }
224 
225     @Override
226     public void processDataBinding(String $binding, boolean $force) {
227         if (!$force && $activeBindings.contains($binding)) { 
228             return;
229         }
230         $activeBindings.add($binding);
231         try {
232             if (allComponentsCreated && $bindings.containsKey($binding)) {
233                 getDataBinding($binding).processDataBinding();
234             }
235         } finally {
236             $activeBindings.remove($binding);
237         }
238     }
239 
240     @Override
241     public void processDataBinding(String $binding) {
242         processDataBinding($binding, false);
243     }
244 
245     @Override
246     public void registerDataBinding(JAXXBinding binding) {
247         $bindings.put(binding.getId(), binding);
248     }
249 
250     @Override
251     public void removeDataBinding(String $binding) {
252         if (allComponentsCreated && $bindings.containsKey($binding)) {
253             getDataBinding($binding).removeDataBinding();
254         }
255     }
256 
257     /*-----------------------------------------------------------------------*/
258     /*--------------------- JAXXContext implementation  ---------------------*/
259     /*-----------------------------------------------------------------------*/
260 
261     @Override
262     public <T> T getContextValue(Class<T> clazz) {
263         return delegateContext.getContextValue(clazz, null);
264     }
265 
266     @Override
267     public <T> T getContextValue(Class<T> clazz, String name) {
268         return delegateContext.getContextValue(clazz, name);
269     }
270 
271     @Override
272     public JAXXContext getDelegateContext() {
273         return delegateContext;
274     }
275 
276     @Override
277     public <O extends Container> O getParentContainer(Class<O> clazz) {
278         return SwingUtil.getParentContainer(this, clazz);
279     }
280 
281     @Override
282     public <O extends Container> O getParentContainer(Object source, Class<O> clazz) {
283         return SwingUtil.getParentContainer(source, clazz);
284     }
285 
286     @Override
287     public <T> void removeContextValue(Class<T> clazz) {
288         delegateContext.removeContextValue(clazz, null);
289     }
290 
291     @Override
292     public <T> void removeContextValue(Class<T> clazz, String name) {
293         delegateContext.removeContextValue(clazz, name);
294     }
295 
296     @Override
297     public <T> void setContextValue(T o) {
298         delegateContext.setContextValue(o, null);
299     }
300 
301     @Override
302     public <T> void setContextValue(T o, String name) {
303         delegateContext.setContextValue(o, name);
304     }
305 
306     /*-----------------------------------------------------------------------*/
307     /*----------------------- Public acessor methods  -----------------------*/
308     /*-----------------------------------------------------------------------*/
309 
310     public SplitSpeciesBatchUI getAddSampleCategoryBatch() {
311         return addSampleCategoryBatch;
312     }
313 
314     public JXTitledPanel getAddSampleCategoryBatchPanel() {
315         return addSampleCategoryBatchPanel;
316     }
317 
318     public TuttiHelpBroker getBroker() {
319         return broker;
320     }
321 
322     public CreateSpeciesBatchUI getCreateBatchUI() {
323         return createBatchUI;
324     }
325 
326     public JXTitledPanel getCreateBatchUIPanel() {
327         return createBatchUIPanel;
328     }
329 
330     public SpeciesBatchUI getEditBatchesUI() {
331         return editBatchesUI;
332     }
333 
334     public JXTitledPanel getEditBatchesUIPanel() {
335         return editBatchesUIPanel;
336     }
337 
338     public SpeciesFrequencyUI getEditFrequenciesUI() {
339         return editFrequenciesUI;
340     }
341 
342     public JXTitledPanel getEditFrequenciesUIPanel() {
343         return editFrequenciesUIPanel;
344     }
345 
346     public EditSpeciesBatchPanelUIHandler getHandler() {
347         return handler;
348     }
349 
350     public EditSpeciesBatchPanelUIModel getModel() {
351         return model;
352     }
353 
354     public SplitSpeciesBatchUI getSplitBatchUI() {
355         return splitBatchUI;
356     }
357 
358     public JXTitledPanel getSplitBatchUIPanel() {
359         return splitBatchUIPanel;
360     }
361 
362     public CardLayout2Ext getTopPanelLayout() {
363         return topPanelLayout;
364     }
365 
366     /*-----------------------------------------------------------------------*/
367     /*---------------------------- Other methods ----------------------------*/
368     /*-----------------------------------------------------------------------*/
369 
370     @Override
371     public void registerHelpId(TuttiHelpBroker broker, Component component, String helpId) {
372         broker.installUI(component, helpId);
373     }
374 
375     @Override
376     public void showHelp(String helpId) {
377         getBroker().showHelp(this, helpId);
378     }
379 
380     /*-----------------------------------------------------------------------*/
381     /*--------------------- Components creation methods ---------------------*/
382     /*-----------------------------------------------------------------------*/
383 
384     protected void addChildrenToAddSampleCategoryBatchPanel() {
385         if (!allComponentsCreated) {
386             return;
387         }
388         addSampleCategoryBatchPanel.add(addSampleCategoryBatch);
389     }
390 
391     protected void addChildrenToCreateBatchUIPanel() {
392         if (!allComponentsCreated) {
393             return;
394         }
395         createBatchUIPanel.add(createBatchUI);
396     }
397 
398     protected void addChildrenToEditBatchesUIPanel() {
399         if (!allComponentsCreated) {
400             return;
401         }
402         editBatchesUIPanel.add(editBatchesUI);
403     }
404 
405     protected void addChildrenToEditFrequenciesUIPanel() {
406         if (!allComponentsCreated) {
407             return;
408         }
409         editFrequenciesUIPanel.add(editFrequenciesUI);
410     }
411 
412     protected void addChildrenToSplitBatchUIPanel() {
413         if (!allComponentsCreated) {
414             return;
415         }
416         splitBatchUIPanel.add(splitBatchUI);
417     }
418 
419     protected void addChildrenToTopPanel() {
420         if (!allComponentsCreated) {
421             return;
422         }
423         add(editBatchesUIPanel, EDIT_BATCH_CARD);
424         add(createBatchUIPanel, CREATE_BATCH_CARD);
425         add(splitBatchUIPanel, SPLIT_BATCH_CARD);
426         add(addSampleCategoryBatchPanel, ADD_SAMPLE_CATEGORY_BATCH_CARD);
427         add(editFrequenciesUIPanel, EDIT_FREQUENCY_CARD);
428     }
429 
430     protected void createAddSampleCategoryBatch() {
431         $objectMap.put("addSampleCategoryBatch", addSampleCategoryBatch = new SplitSpeciesBatchUI(this, getSpeciesOrBenthosContext()));
432         
433         addSampleCategoryBatch.setName("addSampleCategoryBatch");
434     }
435 
436     protected void createAddSampleCategoryBatchPanel() {
437         $objectMap.put("addSampleCategoryBatchPanel", addSampleCategoryBatchPanel = new JXTitledPanel());
438         
439         addSampleCategoryBatchPanel.setName("addSampleCategoryBatchPanel");
440     }
441 
442     protected void createBroker() {
443         $objectMap.put("broker", broker = new TuttiHelpBroker("tutti.editCatchBatch.help"));
444     }
445 
446     protected void createCreateBatchUI() {
447         $objectMap.put("createBatchUI", createBatchUI = new CreateSpeciesBatchUI(this, getSpeciesOrBenthosContext()));
448         
449         createBatchUI.setName("createBatchUI");
450     }
451 
452     protected void createCreateBatchUIPanel() {
453         $objectMap.put("createBatchUIPanel", createBatchUIPanel = new JXTitledPanel());
454         
455         createBatchUIPanel.setName("createBatchUIPanel");
456     }
457 
458     protected void createEditBatchesUI() {
459         $objectMap.put("editBatchesUI", editBatchesUI = new SpeciesBatchUI(this, getSpeciesOrBenthosContext()));
460         
461         editBatchesUI.setName("editBatchesUI");
462     }
463 
464     protected void createEditBatchesUIPanel() {
465         $objectMap.put("editBatchesUIPanel", editBatchesUIPanel = new JXTitledPanel());
466         
467         editBatchesUIPanel.setName("editBatchesUIPanel");
468     }
469 
470     protected void createEditFrequenciesUI() {
471         $objectMap.put("editFrequenciesUI", editFrequenciesUI = new SpeciesFrequencyUI(editBatchesUI, getSpeciesOrBenthosContext()));
472         
473         editFrequenciesUI.setName("editFrequenciesUI");
474     }
475 
476     protected void createEditFrequenciesUIPanel() {
477         $objectMap.put("editFrequenciesUIPanel", editFrequenciesUIPanel = new JXTitledPanel());
478         
479         editFrequenciesUIPanel.setName("editFrequenciesUIPanel");
480     }
481 
482     protected EditSpeciesBatchPanelUIHandler createHandler() {
483         return new EditSpeciesBatchPanelUIHandler();
484     }
485 
486     protected void createModel() {
487         $objectMap.put("model", model = getContextValue(EditSpeciesBatchPanelUIModel.class));
488     }
489 
490     protected void createSplitBatchUI() {
491         $objectMap.put("splitBatchUI", splitBatchUI = new SplitSpeciesBatchUI(this, getSpeciesOrBenthosContext()));
492         
493         splitBatchUI.setName("splitBatchUI");
494     }
495 
496     protected void createSplitBatchUIPanel() {
497         $objectMap.put("splitBatchUIPanel", splitBatchUIPanel = new JXTitledPanel());
498         
499         splitBatchUIPanel.setName("splitBatchUIPanel");
500     }
501 
502     protected void createTopPanelLayout() {
503         $objectMap.put("topPanelLayout", topPanelLayout = new CardLayout2Ext(this, "topPanel"));
504     }
505 
506     /*-----------------------------------------------------------------------*/
507     /*------------------------ Internal jaxx methods ------------------------*/
508     /*-----------------------------------------------------------------------*/
509 
510     private void $completeSetup() {
511         allComponentsCreated = true;
512         if (log.isDebugEnabled()) {
513             log.debug(this);
514         }
515         addChildrenToTopPanel();
516         addChildrenToEditBatchesUIPanel();
517         addChildrenToCreateBatchUIPanel();
518         addChildrenToSplitBatchUIPanel();
519         addChildrenToAddSampleCategoryBatchPanel();
520         addChildrenToEditFrequenciesUIPanel();
521         
522         // apply 2 data bindings
523         JAXXUtil.applyDataBinding(this, $bindings.keySet());
524         
525         // late initializer
526         // help broker setup
527         TuttiHelpBroker _broker = getBroker();
528         registerHelpId(_broker, topPanel, "tutti.editCatchBatch.help");
529         _broker.prepareUI(this);
530     }
531 
532     private void $initialize() {
533         if (allComponentsCreated) {
534             return;
535         }
536         if (log.isDebugEnabled()) {
537             log.debug(this);
538         }
539         handler.beforeInit(this);
540         $objectMap.put("topPanel", topPanel);
541         createModel();
542         createTopPanelLayout();
543         createBroker();
544         createEditBatchesUIPanel();
545         createEditBatchesUI();
546         createCreateBatchUIPanel();
547         createCreateBatchUI();
548         createSplitBatchUIPanel();
549         createSplitBatchUI();
550         createAddSampleCategoryBatchPanel();
551         createAddSampleCategoryBatch();
552         createEditFrequenciesUIPanel();
553         createEditFrequenciesUI();
554         // inline creation of topPanel
555         setName("topPanel");
556         setLayout(topPanelLayout);
557         topPanel.putClientProperty("help", "tutti.editCatchBatch.help");
558         
559         // registers 2 data bindings
560         $registerDefaultBindings();
561         $completeSetup();
562         handler.afterInit(this);
563     }
564 
565     private void $registerDefaultBindings() {
566         // register 2 data bindings
567         registerDataBinding(new DefaultJAXXBinding(this, BINDING_EDIT_BATCHES_UIPANEL_RIGHT_DECORATION, true) {
568         
569             @Override
570             public void applyDataBinding() {
571                 if (editBatchesUI != null) {
572                     editBatchesUI.addPropertyChangeListener("speciesBatchTabToolBar", this);
573                 }
574             }
575         
576             @Override
577             public void processDataBinding() {
578                 if (editBatchesUI != null) {
579                     editBatchesUIPanel.setRightDecoration(editBatchesUI.getSpeciesBatchTabToolBar());
580                 }
581             }
582         
583             @Override
584             public void removeDataBinding() {
585                 if (editBatchesUI != null) {
586                     editBatchesUI.removePropertyChangeListener("speciesBatchTabToolBar", this);
587                 }
588             }
589         });
590         registerDataBinding(new DefaultJAXXBinding(this, BINDING_EDIT_FREQUENCIES_UIPANEL_RIGHT_DECORATION, true) {
591         
592             @Override
593             public void applyDataBinding() {
594                 if (editFrequenciesUI != null) {
595                     editFrequenciesUI.addPropertyChangeListener("speciesFrequencyTabToolBar", this);
596                 }
597             }
598         
599             @Override
600             public void processDataBinding() {
601                 if (editFrequenciesUI != null) {
602                     editFrequenciesUIPanel.setRightDecoration(editFrequenciesUI.getSpeciesFrequencyTabToolBar());
603                 }
604             }
605         
606             @Override
607             public void removeDataBinding() {
608                 if (editFrequenciesUI != null) {
609                     editFrequenciesUI.removePropertyChangeListener("speciesFrequencyTabToolBar", this);
610                 }
611             }
612         });
613     }
614 
615 }