View Javadoc
1   package fr.ifremer.dali.ui.swing.content.observation.operation.measurement;
2   
3   import fr.ifremer.dali.dto.data.sampling.SamplingOperationDTO;
4   import fr.ifremer.dali.dto.referential.TaxonDTO;
5   import fr.ifremer.dali.dto.referential.TaxonGroupDTO;
6   import fr.ifremer.dali.ui.swing.DaliHelpBroker;
7   import fr.ifremer.dali.ui.swing.DaliUIContext;
8   import fr.ifremer.dali.ui.swing.content.observation.operation.measurement.grouped.OperationMeasurementsGroupedTableUI;
9   import fr.ifremer.dali.ui.swing.content.observation.operation.measurement.ungrouped.OperationMeasurementsUngroupedTableUI;
10  import fr.ifremer.dali.ui.swing.util.DaliUI;
11  import fr.ifremer.dali.ui.swing.util.image.BackgroundPanel;
12  import fr.ifremer.quadrige3.ui.swing.ApplicationUI;
13  import fr.ifremer.quadrige3.ui.swing.ApplicationUIUtil;
14  import fr.ifremer.quadrige3.ui.swing.component.bean.ExtendedComboBox;
15  import java.awt.BorderLayout;
16  import java.awt.Component;
17  import java.awt.Container;
18  import java.awt.GridBagConstraints;
19  import java.awt.GridLayout;
20  import java.awt.Insets;
21  import java.awt.LayoutManager;
22  import java.awt.event.ActionEvent;
23  import java.awt.event.ActionListener;
24  import java.util.ArrayList;
25  import java.util.HashMap;
26  import java.util.List;
27  import java.util.Map;
28  import java.util.TreeMap;
29  import javax.swing.BorderFactory;
30  import javax.swing.Box;
31  import javax.swing.BoxLayout;
32  import javax.swing.JButton;
33  import javax.swing.JLabel;
34  import javax.swing.JPanel;
35  import javax.swing.SwingConstants;
36  import jaxx.runtime.JAXXBinding;
37  import jaxx.runtime.JAXXContext;
38  import jaxx.runtime.JAXXObject;
39  import jaxx.runtime.JAXXObjectDescriptor;
40  import jaxx.runtime.JAXXUtil;
41  import jaxx.runtime.JAXXValidator;
42  import jaxx.runtime.SwingUtil;
43  import jaxx.runtime.binding.DefaultJAXXBinding;
44  import jaxx.runtime.context.DefaultJAXXContext;
45  import jaxx.runtime.swing.Table;
46  import jaxx.runtime.swing.help.JAXXHelpUI;
47  import jaxx.runtime.validator.swing.SwingValidator;
48  import jaxx.runtime.validator.swing.SwingValidatorUtil;
49  import jaxx.runtime.validator.swing.meta.Validator;
50  import jaxx.runtime.validator.swing.meta.ValidatorField;
51  import jaxx.runtime.validator.swing.ui.ImageValidationUI;
52  import org.apache.commons.logging.Log;
53  import org.apache.commons.logging.LogFactory;
54  import static org.nuiton.i18n.I18n.t;
55  
56  public class OperationMeasurementsTabUI extends JPanel implements JAXXHelpUI<DaliHelpBroker>, DaliUI<OperationMeasurementsTabUIModel, OperationMeasurementsTabUIHandler>, JAXXObject, JAXXValidator {
57  
58      /*-----------------------------------------------------------------------*/
59      /*------------------ Constants for all public bindings ------------------*/
60      /*-----------------------------------------------------------------------*/
61  
62      public static final String BINDING_SELECTION_PRELEVEMENTS_COMBO_SELECTED_ITEM = "selectionPrelevementsCombo.selectedItem";
63  
64      /*-----------------------------------------------------------------------*/
65      /*------------------------- Other static fields -------------------------*/
66      /*-----------------------------------------------------------------------*/
67  
68      private static final String $jaxxObjectDescriptor = "H4sIAAAAAAAAALVWzW8bRRSfuHYSJ2lpGyWkJSnFLZCoaF1UIYRSSpov6sj5UO2gQITC2Dt2Jl3vbmdmk42sIP4EbnCEOxcQt54QB84cekH8Cwhx6LXizYx315usY5eUSt2s37yP3/uY39sf/kIZztAbe9j3DebZgjaIsXJ/a2u9skeqYpHwKqOucBjS//pSKLWNhs1QzgW6sV2U5vmWeX7BabiOTew269kiGuLi0CJ8lxAh0FTcosp5vhQez/quxwKvIagkr9/983fqa/Or71MI+S6guwSpXO9mFWWSLqIUNQW6DJH2cd7Cdh1gMGrXAe95KVuwMOdruEEeoy/RQBH1u5iBM4FyvaesfCh73xVo8ObKBraJdVugz2vMoDVGGoQZJrao4VGDH0B0o+rYApwZToUTto8FdWzDcQnTbw2CuSfNQGM9kK5GQl7Glc2C66qg/QJlGo5JLIEq/2u8VRkkCtpfYc4jwgR6u2PURfj1AGzmlWZkmt2HAxNDDQW6FetmeNDyUJLPTwJh5CEo8rvQW9lGv6WvpVIpG0WDFLxQ/qp8jIWHl+VhiVhwFSBnpSXQRAyT9gwlsNSQTIS2V3lgF5aSK7XNQhjpaoL2BoO3fV3ZIq7IiPEklFCaTXWxhqmsOAJ92NaBxx42Ga2TO+3Nb82uUSHYNpZ8GAWTmMp43vHjgcbCQPOeEJBRvHJR9sNVi2CmlQQajSWgpVLxzVB/hIN6dTc6momfZy1SE4UGrhOB7nQcKU9Qy6BSy5jH1Ud15ni2GUKM+jpwU3Xitvw5GZ+HC54tzVxiKhWB2Eu4NqHP5Au0GQup5yMflSaOx34JeE5F83ESFoZei409ULYRUXbEqX3bKMM8EMM92T7J8g/hSPP7xDF+lw7V6fPx0adP/vx5OSD1UYg9lqjatpOAbF0mcxVUhn5FM7och/wqdme3UVYPrlpYkwnASq1jAAfxLklzPU0PMN8FF5mBP375dfyL38+h1DIashxsLmOpX0BZscugCo5l+u5HcwrRyMEgPC/C/7RAQzVqCSizal5aMA/+nAf9g0VSdZimuUwNWxzkWSl/SLjckS3VtLyVMLFNxeJHPpRuMqF0If5K9rdno6Uf54Ly9UE6VzqqRyXMfIb6qW1Rm6it2Fp4iVtw2OXEM51osSWtOgTL7uJxMmlR9F31nDtRrZTcGw4z5d6415xXb7rMh0aVESxImQqLmPpkWkzn1AUABmvAgIfUlJuZOYK677jy4pcPXajiVFNum82CUVoqLi2UC+trOxv315aKO+VPN5agqBLPiqqWfCuiROp3u8MftCQ5L8ueTjY7k/KRbC/xocuvqwxas3tocNxwoQf18GImQTtlV/QAcURbE7MgSAMYXQ+WAcRaagWfluUbDDDBa4CqdzAqy25gzkGTsDItSOoC4ggmX5XmmiqNVjD0ejDUVjEsvRaHheNYZeqWlfpkR3VB3STk7SvqRaGma9Q2Q6QTCaETMeYSFNt5uQPS2HLsBrUP6G8n/FJqfUF80Awuy4kJ67CohCSs3Ezi3Ti2I/8Tovd7RNQLnpEXRJOh+kPiveYutk0LFin8Atp1PFYl6iNjOscx5ZTk3sntufXcjFTQB8kIos+THsL3W/jQgV6iC3ehIvh6BWYJ8r93wnGffA519SjF38jHt8kexs/s4cqZPVzroS6DctVJvj7Fz40zI3mrByRDMJd1W87f1imepnvC8tMpHm71gCVNq/qL+EwonnRB8S/rAQoYCRAAAA==";
69      private static final Log log = LogFactory.getLog(OperationMeasurementsTabUI.class);
70      private static final long serialVersionUID = 1L;
71  
72      /*-----------------------------------------------------------------------*/
73      /*--------------------------- Internal states ---------------------------*/
74      /*-----------------------------------------------------------------------*/
75  
76      protected List<Object> $activeBindings = new ArrayList<Object>();
77      protected Map<String, Object> $bindingSources = new HashMap<String, Object>();
78      protected final Map<String, JAXXBinding> $bindings = new TreeMap<String, JAXXBinding>();
79      protected Map<String, Object> $objectMap = new HashMap<String, Object>();
80      protected Map<?, ?> $previousValues = new HashMap<Object, Object>();
81      private boolean allComponentsCreated;
82      protected final JAXXContext delegateContext = new DefaultJAXXContext();
83  
84      /*-----------------------------------------------------------------------*/
85      /*------------------------ Protected components  ------------------------*/
86      /*-----------------------------------------------------------------------*/
87  
88      protected DaliHelpBroker broker;
89      protected JButton clearButton;
90      @ValidatorField( validatorId = "validator",  propertyName = "groupedTableUIModel",  editorName = "groupedTable")
91      protected OperationMeasurementsGroupedTableUI groupedTable;
92      protected final OperationMeasurementsTabUIHandler handler = createHandler();
93      protected BackgroundPanel leftImage;
94      protected JPanel menuPanel;
95      protected Table menuSelectionPanel;
96      protected OperationMeasurementsTabUIModel model;
97      protected JButton searchButton;
98      protected JPanel selectionButtonsPanel;
99      protected ExtendedComboBox<SamplingOperationDTO> selectionPrelevementsCombo;
100     protected JLabel selectionPrelevementsLabel;
101     protected JPanel selectionoperationsTableUI;
102     @ValidatorField( validatorId = "validator",  propertyName = "ungroupedTableUIModel",  editorName = "ungroupedTable")
103     protected OperationMeasurementsUngroupedTableUI ungroupedTable;
104     @Validator( validatorId = "validator")
105     protected SwingValidator<OperationMeasurementsTabUIModel> validator;
106     protected List<String> validatorIds = new ArrayList<String>();
107 
108     /*-----------------------------------------------------------------------*/
109     /*------------------------- Private components  -------------------------*/
110     /*-----------------------------------------------------------------------*/
111 
112     private OperationMeasurementsTabUI $JPanel0 = this;
113     private JPanel $JPanel1;
114     private Table $Table0;
115 
116     /*-----------------------------------------------------------------------*/
117     /*---------------------------- Constructors  ----------------------------*/
118     /*-----------------------------------------------------------------------*/
119 
120     public OperationMeasurementsTabUI(ApplicationUI parentUI) {
121         ApplicationUIUtil.setParentUI(this, parentUI);
122             $initialize();
123     }
124 
125     public OperationMeasurementsTabUI() {
126         $initialize();
127     }
128 
129     public OperationMeasurementsTabUI(JAXXContext parentContext) {
130         JAXXUtil.initContext(this, parentContext);
131         $initialize();
132     }
133 
134     public OperationMeasurementsTabUI(boolean param0) {
135         super(param0);
136         $initialize();
137     }
138 
139     public OperationMeasurementsTabUI(JAXXContext parentContext, boolean param1) {
140         super(param1);
141         JAXXUtil.initContext(this, parentContext);
142         $initialize();
143     }
144 
145     public OperationMeasurementsTabUI(LayoutManager param0) {
146         super(param0);
147         $initialize();
148     }
149 
150     public OperationMeasurementsTabUI(JAXXContext parentContext, LayoutManager param1) {
151         super(param1);
152         JAXXUtil.initContext(this, parentContext);
153         $initialize();
154     }
155 
156     public OperationMeasurementsTabUI(LayoutManager param0, boolean param1) {
157         super(param0 ,param1);
158         $initialize();
159     }
160 
161     public OperationMeasurementsTabUI(JAXXContext parentContext, LayoutManager param1, boolean param2) {
162         super(param1 ,param2);
163         JAXXUtil.initContext(this, parentContext);
164         $initialize();
165     }
166 
167     /*-----------------------------------------------------------------------*/
168     /*--------------------------- Statics methods ---------------------------*/
169     /*-----------------------------------------------------------------------*/
170 
171     public static JAXXObjectDescriptor $getJAXXObjectDescriptor() {
172         return JAXXUtil.decodeCompressedJAXXObjectDescriptor($jaxxObjectDescriptor);
173     }
174 
175     /*-----------------------------------------------------------------------*/
176     /*---------------------- JAXXObject implementation ----------------------*/
177     /*-----------------------------------------------------------------------*/
178 
179     @Override
180     public void applyDataBinding(String $binding) {
181         if (allComponentsCreated && $bindings.containsKey($binding)) {
182             getDataBinding($binding).applyDataBinding();
183         }
184         processDataBinding($binding);
185     }
186 
187     @Override
188     public void firePropertyChange(String propertyName, Object oldValue, Object newValue) {
189         super.firePropertyChange(propertyName, oldValue, newValue);
190     }
191 
192     @Override
193     public Map<String, Object> get$objectMap() {
194         return $objectMap;
195     }
196 
197     @Override
198     public JAXXBinding getDataBinding(String bindingId) {
199         return $bindings.get(bindingId);
200     }
201 
202     @Override
203     public JAXXBinding[] getDataBindings() {
204         return $bindings.values().toArray(new JAXXBinding[$bindings.size()]);
205     }
206 
207     @Override
208     public Object getObjectById(String id) {
209         return $objectMap.get(id);
210     }
211 
212     @Override
213     public void processDataBinding(String $binding, boolean $force) {
214         if (!$force && $activeBindings.contains($binding)) { 
215             return;
216         }
217         $activeBindings.add($binding);
218         try {
219             if (allComponentsCreated && $bindings.containsKey($binding)) {
220                 getDataBinding($binding).processDataBinding();
221             }
222         } finally {
223             $activeBindings.remove($binding);
224         }
225     }
226 
227     @Override
228     public void processDataBinding(String $binding) {
229         processDataBinding($binding, false);
230     }
231 
232     @Override
233     public void registerDataBinding(JAXXBinding binding) {
234         $bindings.put(binding.getId(), binding);
235     }
236 
237     @Override
238     public void removeDataBinding(String $binding) {
239         if (allComponentsCreated && $bindings.containsKey($binding)) {
240             getDataBinding($binding).removeDataBinding();
241         }
242     }
243 
244     /*-----------------------------------------------------------------------*/
245     /*--------------------- JAXXContext implementation  ---------------------*/
246     /*-----------------------------------------------------------------------*/
247 
248     @Override
249     public <T> T getContextValue(Class<T> clazz) {
250         return delegateContext.getContextValue(clazz, null);
251     }
252 
253     @Override
254     public <T> T getContextValue(Class<T> clazz, String name) {
255         return delegateContext.getContextValue(clazz, name);
256     }
257 
258     @Override
259     public JAXXContext getDelegateContext() {
260         return delegateContext;
261     }
262 
263     @Override
264     public <O extends Container> O getParentContainer(Class<O> clazz) {
265         return SwingUtil.getParentContainer(this, clazz);
266     }
267 
268     @Override
269     public <O extends Container> O getParentContainer(Object source, Class<O> clazz) {
270         return SwingUtil.getParentContainer(source, clazz);
271     }
272 
273     @Override
274     public <T> void removeContextValue(Class<T> clazz) {
275         delegateContext.removeContextValue(clazz, null);
276     }
277 
278     @Override
279     public <T> void removeContextValue(Class<T> clazz, String name) {
280         delegateContext.removeContextValue(clazz, name);
281     }
282 
283     @Override
284     public <T> void setContextValue(T o) {
285         delegateContext.setContextValue(o, null);
286     }
287 
288     @Override
289     public <T> void setContextValue(T o, String name) {
290         delegateContext.setContextValue(o, name);
291     }
292 
293     /*-----------------------------------------------------------------------*/
294     /*-------------------- JAXXValidator implementation  --------------------*/
295     /*-----------------------------------------------------------------------*/
296 
297     @Override
298     public SwingValidator<?> getValidator(String validatorId) {
299         return (SwingValidator<?>) (validatorIds.contains(validatorId) ? getObjectById(validatorId) : null);
300     }
301 
302     @Override
303     public List<String> getValidatorIds() {
304         return validatorIds;
305     }
306 
307     @Override
308     public void registerValidatorFields() {
309         SwingValidatorUtil.detectValidatorFields(this);
310     }
311 
312     /*-----------------------------------------------------------------------*/
313     /*---------------------------- Event methods ----------------------------*/
314     /*-----------------------------------------------------------------------*/
315 
316     public void doActionPerformed__on__clearButton(ActionEvent event) {
317         if (log.isDebugEnabled()) {
318             log.debug(event);
319         }
320         handler.clearSearch();
321     }
322 
323     public void doActionPerformed__on__searchButton(ActionEvent event) {
324         if (log.isDebugEnabled()) {
325             log.debug(event);
326         }
327         handler.doSearch();
328     }
329 
330     /*-----------------------------------------------------------------------*/
331     /*----------------------- Public acessor methods  -----------------------*/
332     /*-----------------------------------------------------------------------*/
333 
334     public DaliHelpBroker getBroker() {
335         return broker;
336     }
337 
338     public JButton getClearButton() {
339         return clearButton;
340     }
341 
342     public OperationMeasurementsGroupedTableUI getGroupedTable() {
343         return groupedTable;
344     }
345 
346     public OperationMeasurementsTabUIHandler getHandler() {
347         return handler;
348     }
349 
350     public BackgroundPanel getLeftImage() {
351         return leftImage;
352     }
353 
354     public JPanel getMenuPanel() {
355         return menuPanel;
356     }
357 
358     public Table getMenuSelectionPanel() {
359         return menuSelectionPanel;
360     }
361 
362     public OperationMeasurementsTabUIModel getModel() {
363         return model;
364     }
365 
366     public JButton getSearchButton() {
367         return searchButton;
368     }
369 
370     public JPanel getSelectionButtonsPanel() {
371         return selectionButtonsPanel;
372     }
373 
374     public ExtendedComboBox<SamplingOperationDTO> getSelectionPrelevementsCombo() {
375         return selectionPrelevementsCombo;
376     }
377 
378     public JLabel getSelectionPrelevementsLabel() {
379         return selectionPrelevementsLabel;
380     }
381 
382     public JPanel getSelectionoperationsTableUI() {
383         return selectionoperationsTableUI;
384     }
385 
386     public OperationMeasurementsUngroupedTableUI getUngroupedTable() {
387         return ungroupedTable;
388     }
389 
390     public SwingValidator<OperationMeasurementsTabUIModel> getValidator() {
391         return validator;
392     }
393 
394     /*-----------------------------------------------------------------------*/
395     /*---------------------------- Other methods ----------------------------*/
396     /*-----------------------------------------------------------------------*/
397 
398     @Override
399     public void registerHelpId(DaliHelpBroker broker, Component component, String helpId) {
400         broker.installUI(component, helpId);
401     }
402 
403     @Override
404     public void showHelp(String helpId) {
405         getBroker().showHelp(this, helpId);
406     }
407 
408     /*-----------------------------------------------------------------------*/
409     /*--------------------- Protected acessors methods  ---------------------*/
410     /*-----------------------------------------------------------------------*/
411 
412     protected JPanel get$JPanel1() {
413         return $JPanel1;
414     }
415 
416     protected Table get$Table0() {
417         return $Table0;
418     }
419 
420     /*-----------------------------------------------------------------------*/
421     /*--------------------- Components creation methods ---------------------*/
422     /*-----------------------------------------------------------------------*/
423 
424     protected void addChildrenToMenuPanel() {
425         if (!allComponentsCreated) {
426             return;
427         }
428         menuPanel.add(menuSelectionPanel);
429         menuPanel.add(selectionButtonsPanel);
430     }
431 
432     protected void addChildrenToMenuSelectionPanel() {
433         if (!allComponentsCreated) {
434             return;
435         }
436         menuSelectionPanel.add(selectionoperationsTableUI, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0, 10, 1, new Insets(3, 3, 3, 3), 0, 0));
437     }
438 
439     protected void addChildrenToSelectionButtonsPanel() {
440         if (!allComponentsCreated) {
441             return;
442         }
443         selectionButtonsPanel.add(clearButton);
444         selectionButtonsPanel.add(searchButton);
445     }
446 
447     protected void addChildrenToSelectionoperationsTableUI() {
448         if (!allComponentsCreated) {
449             return;
450         }
451         selectionoperationsTableUI.add(selectionPrelevementsLabel, BorderLayout.PAGE_START);
452         selectionoperationsTableUI.add(selectionPrelevementsCombo, BorderLayout.CENTER);
453     }
454 
455     protected void addChildrenToValidator() {
456         if (!allComponentsCreated) {
457             return;
458         }
459         validator.setUiClass(ImageValidationUI.class);
460         validator.setBean(model);
461     }
462 
463     protected void createBroker() {
464         $objectMap.put("broker", broker = new DaliHelpBroker("dali.home.help"));
465     }
466 
467     protected void createClearButton() {
468         $objectMap.put("clearButton", clearButton = new JButton());
469         
470         clearButton.setName("clearButton");
471         clearButton.setText(t("dali.action.search.clear.label"));
472         clearButton.setToolTipText(t("dali.action.search.clear.tip"));
473         clearButton.addActionListener(JAXXUtil.getEventListener(ActionListener.class, "actionPerformed", this, "doActionPerformed__on__clearButton"));
474     }
475 
476     protected void createGroupedTable() {
477         $objectMap.put("groupedTable", groupedTable = new OperationMeasurementsGroupedTableUI(this));
478         
479         groupedTable.setName("groupedTable");
480         groupedTable.putClientProperty("validatorLabel", t("dali.samplingOperation.measurement.grouped.table"));
481     }
482 
483     protected OperationMeasurementsTabUIHandler createHandler() {
484         return new OperationMeasurementsTabUIHandler();
485     }
486 
487     protected void createLeftImage() {
488         $objectMap.put("leftImage", leftImage = new BackgroundPanel());
489         
490         leftImage.setName("leftImage");
491     }
492 
493     protected void createMenuPanel() {
494         $objectMap.put("menuPanel", menuPanel = new JPanel());
495         
496         menuPanel.setName("menuPanel");
497         menuPanel.setLayout(new BoxLayout(menuPanel, BoxLayout.PAGE_AXIS));
498     }
499 
500     protected void createMenuSelectionPanel() {
501         $objectMap.put("menuSelectionPanel", menuSelectionPanel = new Table());
502         
503         menuSelectionPanel.setName("menuSelectionPanel");
504         menuSelectionPanel.putClientProperty("panelType", DaliUI.SELECTION_PANEL_TYPE);
505     }
506 
507     protected void createModel() {
508         $objectMap.put("model", model = getContextValue(OperationMeasurementsTabUIModel.class));
509     }
510 
511     protected void createSearchButton() {
512         $objectMap.put("searchButton", searchButton = new JButton());
513         
514         searchButton.setName("searchButton");
515         searchButton.setText(t("dali.action.search.label"));
516         searchButton.setToolTipText(t("dali.action.search.measurement.tip"));
517         searchButton.addActionListener(JAXXUtil.getEventListener(ActionListener.class, "actionPerformed", this, "doActionPerformed__on__searchButton"));
518     }
519 
520     protected void createSelectionButtonsPanel() {
521         $objectMap.put("selectionButtonsPanel", selectionButtonsPanel = new JPanel());
522         
523         selectionButtonsPanel.setName("selectionButtonsPanel");
524         selectionButtonsPanel.setLayout(new GridLayout(1,0));
525     }
526 
527     protected void createSelectionPrelevementsCombo() {
528         $objectMap.put("selectionPrelevementsCombo", selectionPrelevementsCombo = new ExtendedComboBox<SamplingOperationDTO>(this));
529         
530         selectionPrelevementsCombo.setName("selectionPrelevementsCombo");
531         selectionPrelevementsCombo.setFilterable(true);
532         selectionPrelevementsCombo.setShowDecorator(false);
533         selectionPrelevementsCombo.setProperty("sampling");
534         selectionPrelevementsCombo.setShowReset(true);
535     }
536 
537     protected void createSelectionPrelevementsLabel() {
538         $objectMap.put("selectionPrelevementsLabel", selectionPrelevementsLabel = new JLabel());
539         
540         selectionPrelevementsLabel.setName("selectionPrelevementsLabel");
541         selectionPrelevementsLabel.setText(t("dali.property.samplingOperation"));
542     }
543 
544     protected void createSelectionoperationsTableUI() {
545         $objectMap.put("selectionoperationsTableUI", selectionoperationsTableUI = new JPanel());
546         
547         selectionoperationsTableUI.setName("selectionoperationsTableUI");
548         selectionoperationsTableUI.setLayout(new BorderLayout());
549     }
550 
551     protected void createUngroupedTable() {
552         $objectMap.put("ungroupedTable", ungroupedTable = new OperationMeasurementsUngroupedTableUI(this));
553         
554         ungroupedTable.setName("ungroupedTable");
555         ungroupedTable.putClientProperty("validatorLabel", t("dali.samplingOperation.measurement.ungrouped.table"));
556     }
557 
558     protected void createValidator() {
559         $objectMap.put("validator", validator = SwingValidator.newValidator(OperationMeasurementsTabUIModel.class, null));
560     }
561 
562     /*-----------------------------------------------------------------------*/
563     /*------------------------ Internal jaxx methods ------------------------*/
564     /*-----------------------------------------------------------------------*/
565 
566     private void $completeSetup() {
567         allComponentsCreated = true;
568         if (log.isDebugEnabled()) {
569             log.debug(this);
570         }
571         // inline complete setup of $JPanel0
572         add($JPanel1, BorderLayout.LINE_START);
573         add($Table0);
574         addChildrenToValidator();
575         // inline complete setup of $JPanel1
576         $JPanel1.add(menuPanel, BorderLayout.PAGE_START);
577         $JPanel1.add(leftImage, BorderLayout.PAGE_END);
578         addChildrenToMenuPanel();
579         addChildrenToMenuSelectionPanel();
580         addChildrenToSelectionoperationsTableUI();
581         addChildrenToSelectionButtonsPanel();
582         // inline complete setup of $Table0
583         $Table0.add(SwingUtil.boxComponentWithJxLayer(ungroupedTable), new GridBagConstraints(0, 0, 1, 1, 1.0, 0.3, 10, 1, new Insets(3, 3, 3, 3), 0, 0));
584         $Table0.add(SwingUtil.boxComponentWithJxLayer(groupedTable), new GridBagConstraints(0, 1, 1, 1, 1.0, 0.7, 10, 1, new Insets(3, 3, 3, 3), 0, 0));
585         
586         // apply 1 data bindings
587         JAXXUtil.applyDataBinding(this, $bindings.keySet());
588         
589         // apply 14 property setters
590         selectionPrelevementsCombo.setBeanType(SamplingOperationDTO.class);
591         clearButton.setAlignmentX(Component.CENTER_ALIGNMENT);
592         searchButton.setAlignmentX(Component.CENTER_ALIGNMENT);
593         menuSelectionPanel.setBorder(BorderFactory.createTitledBorder(t("dali.common.selection")));
594         selectionPrelevementsLabel.setLabelFor(selectionPrelevementsCombo);
595         selectionPrelevementsCombo.setBean(model);
596         clearButton.setIcon(SwingUtil.createActionIcon("reset"));
597         searchButton.setIcon(SwingUtil.createActionIcon("find"));
598         leftImage.setImage(handler.getResourceImage("saisie","jpg").getImage());
599         // late initializer
600         // register 1 validator(s)
601         validatorIds = SwingValidatorUtil.detectValidators(this);
602         SwingValidatorUtil.installUI(this);
603     }
604 
605     private void $initialize() {
606         if (allComponentsCreated) {
607             return;
608         }
609         if (log.isDebugEnabled()) {
610             log.debug(this);
611         }
612         handler.beforeInit(this);
613         $objectMap.put("$JPanel0", $JPanel0);
614         createModel();
615         createBroker();
616         createValidator();
617         // inline creation of $JPanel1
618         $objectMap.put("$JPanel1", $JPanel1 = new JPanel());
619         
620         $JPanel1.setName("$JPanel1");
621         $JPanel1.setLayout(new BorderLayout());
622         createMenuPanel();
623         createMenuSelectionPanel();
624         createSelectionoperationsTableUI();
625         createSelectionPrelevementsLabel();
626         createSelectionPrelevementsCombo();
627         createSelectionButtonsPanel();
628         createClearButton();
629         createSearchButton();
630         createLeftImage();
631         // inline creation of $Table0
632         $objectMap.put("$Table0", $Table0 = new Table());
633         
634         $Table0.setName("$Table0");
635         createUngroupedTable();
636         createGroupedTable();
637         // inline creation of $JPanel0
638         setName("$JPanel0");
639         setLayout(new BorderLayout());
640         
641         // registers 1 data bindings
642         $registerDefaultBindings();
643         $completeSetup();
644         handler.afterInit(this);
645     }
646 
647     private void $registerDefaultBindings() {
648         // register 1 data bindings
649         registerDataBinding(new DefaultJAXXBinding(this, BINDING_SELECTION_PRELEVEMENTS_COMBO_SELECTED_ITEM, true) {
650         
651             @Override
652             public void applyDataBinding() {
653                 if (model != null) {
654                     model.addPropertyChangeListener("sampling", this);
655                 }
656             }
657         
658             @Override
659             public void processDataBinding() {
660                 if (model != null) {
661                     selectionPrelevementsCombo.setSelectedItem(model.getSampling());
662                 }
663             }
664         
665             @Override
666             public void removeDataBinding() {
667                 if (model != null) {
668                     model.removePropertyChangeListener("sampling", this);
669                 }
670             }
671         });
672     }
673 
674 }