View Javadoc
1   package fr.ifremer.dali.ui.swing.content.extraction.list;
2   
3   import fr.ifremer.dali.ui.swing.DaliHelpBroker;
4   import fr.ifremer.dali.ui.swing.DaliUIContext;
5   import fr.ifremer.dali.ui.swing.util.DaliUI;
6   import fr.ifremer.quadrige3.ui.swing.ApplicationUI;
7   import fr.ifremer.quadrige3.ui.swing.ApplicationUIUtil;
8   import fr.ifremer.quadrige3.ui.swing.table.SwingTable;
9   import java.awt.BorderLayout;
10  import java.awt.Component;
11  import java.awt.Container;
12  import java.awt.LayoutManager;
13  import java.awt.event.ActionEvent;
14  import java.awt.event.ActionListener;
15  import java.util.ArrayList;
16  import java.util.HashMap;
17  import java.util.List;
18  import java.util.Map;
19  import java.util.TreeMap;
20  import javax.swing.BorderFactory;
21  import javax.swing.JButton;
22  import javax.swing.JComboBox;
23  import javax.swing.JLabel;
24  import javax.swing.JPanel;
25  import javax.swing.JScrollPane;
26  import jaxx.runtime.JAXXBinding;
27  import jaxx.runtime.JAXXContext;
28  import jaxx.runtime.JAXXObject;
29  import jaxx.runtime.JAXXObjectDescriptor;
30  import jaxx.runtime.JAXXUtil;
31  import jaxx.runtime.SwingUtil;
32  import jaxx.runtime.binding.DefaultJAXXBinding;
33  import jaxx.runtime.context.DefaultJAXXContext;
34  import jaxx.runtime.swing.help.JAXXHelpUI;
35  import org.apache.commons.logging.Log;
36  import org.apache.commons.logging.LogFactory;
37  import static org.nuiton.i18n.I18n.t;
38  
39  public class ExtractionsTableUI extends JPanel implements JAXXHelpUI<DaliHelpBroker>, DaliUI<ExtractionsTableUIModel, ExtractionsTableUIHandler>, JAXXObject {
40  
41      /*-----------------------------------------------------------------------*/
42      /*------------------ Constants for all public bindings ------------------*/
43      /*-----------------------------------------------------------------------*/
44  
45      public static final String BINDING_DELETE_BUTTON_ENABLED = "deleteButton.enabled";
46      public static final String BINDING_DUPLICATE_BUTTON_ENABLED = "duplicateButton.enabled";
47      public static final String BINDING_EXPORT_BUTTON_ENABLED = "exportButton.enabled";
48      public static final String BINDING_EXTRACT_COMBO_ENABLED = "extractCombo.enabled";
49  
50      /*-----------------------------------------------------------------------*/
51      /*------------------------- Other static fields -------------------------*/
52      /*-----------------------------------------------------------------------*/
53  
54      private static final String $jaxxObjectDescriptor = "H4sIAAAAAAAAALVXz2/cRBSebLL5HVoS0iYkTTZp1OwK5DSKKkChtMkmIalSQN2AInKAWXuymeK1XXu2cVgF8SfwHwB3LkjcOCEOnDlwQVzhhioOXBFvxl57vTtru9k0B2sz773vvffN+Hvj7/5GWcdGC4+x6yp2zWC0SpQHG4eH75cfE5VtEUe1qcVMG3l/PRmUOUIjWrDuMHTzaJ+Hr/jhK0WzapkGMZqi1/fRsMPOdOKcEMIYuhGNUB1npRSY112rZjdQg6JkqN/88yzzlfbltxmEXAuqewVaySVFhZ307aMM1Rgah0xP8YqOjQqUYVOjAvWO8bWijh3nPVwlT9AXaGAf9VvYBjCGFtO3LDBEvGtBLuIyG6uMmoZzgMs6+XCPoeKxrdBjm1SJrWhYp0qNKs4p1KGopsEAVgmjFJ06TNluQ7EskaSfoWzV1IjO0O4loD7kUCF0f9k2PyM2Q8sdsbfgv12I2RSeYejY0oOSapu6/gE2yG2GrnN+XT+oycTdh4Koq610MaQ0pX5Sw5pNK2QtzM+4l1Liv0UABxoP8K434fFs+maNMfgNGxOpR9iipQwueau3+f+v8sdUYBsyyKmHxNBEBMhb5W4zgfcVrWbpVMWMhNb5qMso0E5i7I1iViXFjFI4jDZriV0K7cSNtQP2Pi5Do62kiNU2LMEnvABlk6HJiL9Y3DTdaMiYH9Ix/6TvUGLY0LCtJTryt0/CVug47ztuVCo2qQDvWiJ2e0jnLDaaiYgOyJkSylmoNz1HKGvXYJmhqaN2BXwEJk/7plq0jwMK63/XJn778Y8fdhqCNwe5J6WuTXoNQmTZpgWvLeWpr3hqV2NUX3mIrfUjNOTAYVM9MZ+VFFbyzVAc5HuZhys8XNnFzglAZAd+/+nna5/+2osyO2hYN7G2g7n/HhpiJzawYOqaa927LyoaPR2E51VeG9cT09a4nhTrm+KXF3imqDYBzg8o04nmWfIsvyiUplW0GHdaLBTOXWBuVsJcUH556Jd/J0rf32+w1wPdTHd0DxnMfoz6qaFTg4iB4c8C6YAYsRxS08xQ82VTAEnHgOVr5T3xLLbR1cvQsBexx/Ub9WINZlcfAyQuKZwa1axWgRYQI4ZGmGnqB9Q6EPZZKXXgCPRZbo1nfFcwwn/toWZFS6orC918gi1P0QB6QyRgaKG+1ZC5cK54RkXlbJy3NNSnmtZZ0NGMqNivNhBMReca1NrdtNwXWmNogBicX6DqzboYjAp1PgJ3LV/I3bqV85YqhHnbTrRH5qmTLygO/ZyAx927udVzGT+tGn5RlubqW0Lp01HU742FgKTx5m1v2KLcSF1CUpbqC50ooM521WJn+YKUgMiESuq+r2P3e2JWpezeG2zy7hu2aPfz0nPv+XY6+pH5efF93XafozNvJMs7a9jSdOb5vtCTH7k+JNGTCa+jX9dPYObqcGsDafHIaFwQxC0zH7kXvJ6T3gKC5eg0DpY7TXiJQxShcP4iCQvvSCnelKgoGmK3B55Sh4rrb/YY606oAPKZ6P8vV8tcbEiHlyJ6a7voW3Gjvh3d1dh5kND6a7F9OH4GOQeFdLEdyJDfULsmpXEiXxwpqp/hIqQEsQmkRN+ri5Ky3CCl/Y3uhp47sS3itlxyotaeF6UDZUnfJZdI3mWcrbTkFWNPWVryignnLekLLYk8/vmh4zMTnNFLb2uY4VyZGhp8ub7Tlq6HP4cTEfnyn/zxlxxhOkVNw8BOxagSgx3GIM2lquVZDMJC1wg3u0ZY7hqh0DWCkmJP+qjqffF3sxs9g93uRixCqt2IRUi1G7EIqXYjFmG1a4S1rhHudI3wRtcIbwHC/0PXIEmcFwAA";
55      private static final Log log = LogFactory.getLog(ExtractionsTableUI.class);
56      private static final long serialVersionUID = 1L;
57  
58      /*-----------------------------------------------------------------------*/
59      /*--------------------------- Internal states ---------------------------*/
60      /*-----------------------------------------------------------------------*/
61  
62      protected List<Object> $activeBindings = new ArrayList<Object>();
63      protected Map<String, Object> $bindingSources = new HashMap<String, Object>();
64      protected final Map<String, JAXXBinding> $bindings = new TreeMap<String, JAXXBinding>();
65      protected Map<String, Object> $objectMap = new HashMap<String, Object>();
66      protected Map<?, ?> $previousValues = new HashMap<Object, Object>();
67      private boolean allComponentsCreated;
68      protected final JAXXContext delegateContext = new DefaultJAXXContext();
69  
70      /*-----------------------------------------------------------------------*/
71      /*------------------------ Protected components  ------------------------*/
72      /*-----------------------------------------------------------------------*/
73  
74      protected DaliHelpBroker broker;
75      protected JButton deleteButton;
76      protected JButton duplicateButton;
77      protected JButton exportButton;
78      protected JButton extractAggregatedCompleteButton;
79      protected JButton extractAggregatedStandardButton;
80      protected JButton extractButton;
81      protected JComboBox extractCombo;
82      protected JButton extractCompleteButton;
83      protected JButton extractStandardButton;
84      protected JPanel extractionsPanelButtons;
85      protected SwingTable extractionsTable;
86      protected ExtractionsTableUI extractionsTableUI = this;
87      protected final ExtractionsTableUIHandler handler = createHandler();
88      protected JButton importButton;
89      protected ExtractionsTableUIModel model;
90      protected JButton newButton;
91  
92      /*-----------------------------------------------------------------------*/
93      /*------------------------- Private components  -------------------------*/
94      /*-----------------------------------------------------------------------*/
95  
96      private JLabel $JLabel0;
97      private JPanel $JPanel0;
98      private JPanel $JPanel1;
99      private JScrollPane $JScrollPane0;
100 
101     /*-----------------------------------------------------------------------*/
102     /*---------------------------- Constructors  ----------------------------*/
103     /*-----------------------------------------------------------------------*/
104 
105     public ExtractionsTableUI(ApplicationUI parentUI) {
106         ApplicationUIUtil.setParentUI(this, parentUI);
107             $initialize();
108     }
109 
110     public ExtractionsTableUI() {
111         $initialize();
112     }
113 
114     public ExtractionsTableUI(JAXXContext parentContext) {
115         JAXXUtil.initContext(this, parentContext);
116         $initialize();
117     }
118 
119     public ExtractionsTableUI(boolean param0) {
120         super(param0);
121         $initialize();
122     }
123 
124     public ExtractionsTableUI(JAXXContext parentContext, boolean param1) {
125         super(param1);
126         JAXXUtil.initContext(this, parentContext);
127         $initialize();
128     }
129 
130     public ExtractionsTableUI(LayoutManager param0) {
131         super(param0);
132         $initialize();
133     }
134 
135     public ExtractionsTableUI(JAXXContext parentContext, LayoutManager param1) {
136         super(param1);
137         JAXXUtil.initContext(this, parentContext);
138         $initialize();
139     }
140 
141     public ExtractionsTableUI(LayoutManager param0, boolean param1) {
142         super(param0 ,param1);
143         $initialize();
144     }
145 
146     public ExtractionsTableUI(JAXXContext parentContext, LayoutManager param1, boolean param2) {
147         super(param1 ,param2);
148         JAXXUtil.initContext(this, parentContext);
149         $initialize();
150     }
151 
152     /*-----------------------------------------------------------------------*/
153     /*--------------------------- Statics methods ---------------------------*/
154     /*-----------------------------------------------------------------------*/
155 
156     public static JAXXObjectDescriptor $getJAXXObjectDescriptor() {
157         return JAXXUtil.decodeCompressedJAXXObjectDescriptor($jaxxObjectDescriptor);
158     }
159 
160     /*-----------------------------------------------------------------------*/
161     /*---------------------- JAXXObject implementation ----------------------*/
162     /*-----------------------------------------------------------------------*/
163 
164     @Override
165     public void applyDataBinding(String $binding) {
166         if (allComponentsCreated && $bindings.containsKey($binding)) {
167             getDataBinding($binding).applyDataBinding();
168         }
169         processDataBinding($binding);
170     }
171 
172     @Override
173     public void firePropertyChange(String propertyName, Object oldValue, Object newValue) {
174         super.firePropertyChange(propertyName, oldValue, newValue);
175     }
176 
177     @Override
178     public Map<String, Object> get$objectMap() {
179         return $objectMap;
180     }
181 
182     @Override
183     public JAXXBinding getDataBinding(String bindingId) {
184         return $bindings.get(bindingId);
185     }
186 
187     @Override
188     public JAXXBinding[] getDataBindings() {
189         return $bindings.values().toArray(new JAXXBinding[$bindings.size()]);
190     }
191 
192     @Override
193     public Object getObjectById(String id) {
194         return $objectMap.get(id);
195     }
196 
197     @Override
198     public void processDataBinding(String $binding, boolean $force) {
199         if (!$force && $activeBindings.contains($binding)) { 
200             return;
201         }
202         $activeBindings.add($binding);
203         try {
204             if (allComponentsCreated && $bindings.containsKey($binding)) {
205                 getDataBinding($binding).processDataBinding();
206             }
207         } finally {
208             $activeBindings.remove($binding);
209         }
210     }
211 
212     @Override
213     public void processDataBinding(String $binding) {
214         processDataBinding($binding, false);
215     }
216 
217     @Override
218     public void registerDataBinding(JAXXBinding binding) {
219         $bindings.put(binding.getId(), binding);
220     }
221 
222     @Override
223     public void removeDataBinding(String $binding) {
224         if (allComponentsCreated && $bindings.containsKey($binding)) {
225             getDataBinding($binding).removeDataBinding();
226         }
227     }
228 
229     /*-----------------------------------------------------------------------*/
230     /*--------------------- JAXXContext implementation  ---------------------*/
231     /*-----------------------------------------------------------------------*/
232 
233     @Override
234     public <T> T getContextValue(Class<T> clazz) {
235         return delegateContext.getContextValue(clazz, null);
236     }
237 
238     @Override
239     public <T> T getContextValue(Class<T> clazz, String name) {
240         return delegateContext.getContextValue(clazz, name);
241     }
242 
243     @Override
244     public JAXXContext getDelegateContext() {
245         return delegateContext;
246     }
247 
248     @Override
249     public <O extends Container> O getParentContainer(Class<O> clazz) {
250         return SwingUtil.getParentContainer(this, clazz);
251     }
252 
253     @Override
254     public <O extends Container> O getParentContainer(Object source, Class<O> clazz) {
255         return SwingUtil.getParentContainer(source, clazz);
256     }
257 
258     @Override
259     public <T> void removeContextValue(Class<T> clazz) {
260         delegateContext.removeContextValue(clazz, null);
261     }
262 
263     @Override
264     public <T> void removeContextValue(Class<T> clazz, String name) {
265         delegateContext.removeContextValue(clazz, name);
266     }
267 
268     @Override
269     public <T> void setContextValue(T o) {
270         delegateContext.setContextValue(o, null);
271     }
272 
273     @Override
274     public <T> void setContextValue(T o, String name) {
275         delegateContext.setContextValue(o, name);
276     }
277 
278     /*-----------------------------------------------------------------------*/
279     /*---------------------------- Event methods ----------------------------*/
280     /*-----------------------------------------------------------------------*/
281 
282     public void doActionPerformed__on__newButton(ActionEvent event) {
283         if (log.isDebugEnabled()) {
284             log.debug(event);
285         }
286         model.addNewRow();
287     }
288 
289     /*-----------------------------------------------------------------------*/
290     /*----------------------- Public acessor methods  -----------------------*/
291     /*-----------------------------------------------------------------------*/
292 
293     public DaliHelpBroker getBroker() {
294         return broker;
295     }
296 
297     public JButton getDeleteButton() {
298         return deleteButton;
299     }
300 
301     public JButton getDuplicateButton() {
302         return duplicateButton;
303     }
304 
305     public JButton getExportButton() {
306         return exportButton;
307     }
308 
309     public JButton getExtractAggregatedCompleteButton() {
310         return extractAggregatedCompleteButton;
311     }
312 
313     public JButton getExtractAggregatedStandardButton() {
314         return extractAggregatedStandardButton;
315     }
316 
317     public JButton getExtractButton() {
318         return extractButton;
319     }
320 
321     public JComboBox getExtractCombo() {
322         return extractCombo;
323     }
324 
325     public JButton getExtractCompleteButton() {
326         return extractCompleteButton;
327     }
328 
329     public JButton getExtractStandardButton() {
330         return extractStandardButton;
331     }
332 
333     public JPanel getExtractionsPanelButtons() {
334         return extractionsPanelButtons;
335     }
336 
337     public SwingTable getExtractionsTable() {
338         return extractionsTable;
339     }
340 
341     public ExtractionsTableUIHandler getHandler() {
342         return handler;
343     }
344 
345     public JButton getImportButton() {
346         return importButton;
347     }
348 
349     public ExtractionsTableUIModel getModel() {
350         return model;
351     }
352 
353     public JButton getNewButton() {
354         return newButton;
355     }
356 
357     /*-----------------------------------------------------------------------*/
358     /*---------------------------- Other methods ----------------------------*/
359     /*-----------------------------------------------------------------------*/
360 
361     @Override
362     public void registerHelpId(DaliHelpBroker broker, Component component, String helpId) {
363         broker.installUI(component, helpId);
364     }
365 
366     @Override
367     public void showHelp(String helpId) {
368         getBroker().showHelp(this, helpId);
369     }
370 
371     /*-----------------------------------------------------------------------*/
372     /*--------------------- Protected acessors methods  ---------------------*/
373     /*-----------------------------------------------------------------------*/
374 
375     protected JLabel get$JLabel0() {
376         return $JLabel0;
377     }
378 
379     protected JPanel get$JPanel0() {
380         return $JPanel0;
381     }
382 
383     protected JPanel get$JPanel1() {
384         return $JPanel1;
385     }
386 
387     protected JScrollPane get$JScrollPane0() {
388         return $JScrollPane0;
389     }
390 
391     /*-----------------------------------------------------------------------*/
392     /*--------------------- Components creation methods ---------------------*/
393     /*-----------------------------------------------------------------------*/
394 
395     protected void addChildrenToExtractionsPanelButtons() {
396         if (!allComponentsCreated) {
397             return;
398         }
399         extractionsPanelButtons.add($JPanel0, BorderLayout.LINE_START);
400         extractionsPanelButtons.add($JPanel1, BorderLayout.LINE_END);
401     }
402 
403     protected void addChildrenToExtractionsTableUI() {
404         if (!allComponentsCreated) {
405             return;
406         }
407         add($JScrollPane0);
408         add(extractionsPanelButtons, BorderLayout.PAGE_END);
409     }
410 
411     protected void createBroker() {
412         $objectMap.put("broker", broker = new DaliHelpBroker("dali.home.help"));
413     }
414 
415     protected void createDeleteButton() {
416         $objectMap.put("deleteButton", deleteButton = new JButton());
417         
418         deleteButton.setName("deleteButton");
419         deleteButton.setText(t("dali.common.delete"));
420         deleteButton.setToolTipText(t("dali.common.delete"));
421         deleteButton.putClientProperty("applicationAction", DeleteExtractionAction.class);
422     }
423 
424     protected void createDuplicateButton() {
425         $objectMap.put("duplicateButton", duplicateButton = new JButton());
426         
427         duplicateButton.setName("duplicateButton");
428         duplicateButton.setText(t("dali.action.duplicate.label"));
429         duplicateButton.setToolTipText(t("dali.action.duplicate.tip"));
430         duplicateButton.putClientProperty("applicationAction", DuplicateExtractionAction.class);
431     }
432 
433     protected void createExportButton() {
434         $objectMap.put("exportButton", exportButton = new JButton());
435         
436         exportButton.setName("exportButton");
437         exportButton.setText(t("dali.common.export"));
438         exportButton.setToolTipText(t("dali.extraction.list.export.tip"));
439         exportButton.putClientProperty("applicationAction", ExportExtractionAction.class);
440     }
441 
442     protected void createExtractAggregatedCompleteButton() {
443         $objectMap.put("extractAggregatedCompleteButton", extractAggregatedCompleteButton = new JButton());
444         
445         extractAggregatedCompleteButton.setName("extractAggregatedCompleteButton");
446         extractAggregatedCompleteButton.setVisible(false);
447         extractAggregatedCompleteButton.setText(t("dali.extraction.list.extract.aggregatedComplete.label"));
448         extractAggregatedCompleteButton.setToolTipText(t("dali.extraction.list.extract.aggregatedComplete.tip"));
449         extractAggregatedCompleteButton.putClientProperty("applicationAction", ExtractAggregatedCompleteAction.class);
450     }
451 
452     protected void createExtractAggregatedStandardButton() {
453         $objectMap.put("extractAggregatedStandardButton", extractAggregatedStandardButton = new JButton());
454         
455         extractAggregatedStandardButton.setName("extractAggregatedStandardButton");
456         extractAggregatedStandardButton.setVisible(false);
457         extractAggregatedStandardButton.setText(t("dali.extraction.list.extract.aggregatedStandard.label"));
458         extractAggregatedStandardButton.setToolTipText(t("dali.extraction.list.extract.aggregatedStandard.tip"));
459         extractAggregatedStandardButton.putClientProperty("applicationAction", ExtractAggregatedStandardAction.class);
460     }
461 
462     protected void createExtractButton() {
463         $objectMap.put("extractButton", extractButton = new JButton());
464         
465         extractButton.setName("extractButton");
466         extractButton.setVisible(false);
467         extractButton.setText(t("dali.extraction.list.extract.label"));
468         extractButton.setToolTipText(t("dali.extraction.list.extract.tip"));
469     }
470 
471     protected void createExtractCombo() {
472         $objectMap.put("extractCombo", extractCombo = new JComboBox());
473         
474         extractCombo.setName("extractCombo");
475     }
476 
477     protected void createExtractCompleteButton() {
478         $objectMap.put("extractCompleteButton", extractCompleteButton = new JButton());
479         
480         extractCompleteButton.setName("extractCompleteButton");
481         extractCompleteButton.setVisible(false);
482         extractCompleteButton.setText(t("dali.extraction.list.extract.complete.label"));
483         extractCompleteButton.setToolTipText(t("dali.extraction.list.extract.complete.tip"));
484         extractCompleteButton.putClientProperty("applicationAction", ExtractCompleteAction.class);
485     }
486 
487     protected void createExtractStandardButton() {
488         $objectMap.put("extractStandardButton", extractStandardButton = new JButton());
489         
490         extractStandardButton.setName("extractStandardButton");
491         extractStandardButton.setVisible(false);
492         extractStandardButton.setText(t("dali.extraction.list.extract.standard.label"));
493         extractStandardButton.setToolTipText(t("dali.extraction.list.extract.standard.tip"));
494         extractStandardButton.putClientProperty("applicationAction", ExtractStandardAction.class);
495     }
496 
497     protected void createExtractionsPanelButtons() {
498         $objectMap.put("extractionsPanelButtons", extractionsPanelButtons = new JPanel());
499         
500         extractionsPanelButtons.setName("extractionsPanelButtons");
501         extractionsPanelButtons.setLayout(new BorderLayout());
502     }
503 
504     protected void createExtractionsTable() {
505         $objectMap.put("extractionsTable", extractionsTable = new SwingTable());
506         
507         extractionsTable.setName("extractionsTable");
508     }
509 
510     protected ExtractionsTableUIHandler createHandler() {
511         return new ExtractionsTableUIHandler();
512     }
513 
514     protected void createImportButton() {
515         $objectMap.put("importButton", importButton = new JButton());
516         
517         importButton.setName("importButton");
518         importButton.setText(t("dali.common.import"));
519         importButton.setToolTipText(t("dali.extraction.list.import.tip"));
520         importButton.putClientProperty("applicationAction", ImportExtractionAction.class);
521     }
522 
523     protected void createModel() {
524         $objectMap.put("model", model = getContextValue(ExtractionsTableUIModel.class));
525     }
526 
527     protected void createNewButton() {
528         $objectMap.put("newButton", newButton = new JButton());
529         
530         newButton.setName("newButton");
531         newButton.setText(t("dali.common.new"));
532         newButton.setToolTipText(t("dali.extraction.list.new.tip"));
533         newButton.addActionListener(JAXXUtil.getEventListener(ActionListener.class, "actionPerformed", this, "doActionPerformed__on__newButton"));
534     }
535 
536     /*-----------------------------------------------------------------------*/
537     /*------------------------ Internal jaxx methods ------------------------*/
538     /*-----------------------------------------------------------------------*/
539 
540     private void $completeSetup() {
541         allComponentsCreated = true;
542         if (log.isDebugEnabled()) {
543             log.debug(this);
544         }
545         addChildrenToExtractionsTableUI();
546         // inline complete setup of $JScrollPane0
547         $JScrollPane0.getViewport().add(extractionsTable);
548         addChildrenToExtractionsPanelButtons();
549         // inline complete setup of $JPanel0
550         $JPanel0.add(newButton);
551         $JPanel0.add(duplicateButton);
552         $JPanel0.add(deleteButton);
553         // inline complete setup of $JPanel1
554         $JPanel1.add(importButton);
555         $JPanel1.add(exportButton);
556         $JPanel1.add($JLabel0);
557         $JPanel1.add(extractCombo);
558         $JPanel1.add(extractButton);
559         $JPanel1.add(extractStandardButton);
560         $JPanel1.add(extractCompleteButton);
561         $JPanel1.add(extractAggregatedStandardButton);
562         $JPanel1.add(extractAggregatedCompleteButton);
563         
564         // apply 4 data bindings
565         JAXXUtil.applyDataBinding(this, $bindings.keySet());
566         
567         // apply 20 property setters
568         newButton.setAlignmentX(Component.CENTER_ALIGNMENT);
569         duplicateButton.setAlignmentX(Component.CENTER_ALIGNMENT);
570         deleteButton.setAlignmentX(Component.CENTER_ALIGNMENT);
571         importButton.setAlignmentX(Component.CENTER_ALIGNMENT);
572         exportButton.setAlignmentX(Component.CENTER_ALIGNMENT);
573         extractCombo.setAlignmentX(Component.CENTER_ALIGNMENT);
574         setBorder(BorderFactory.createTitledBorder(t("dali.extraction.list.title")));
575         newButton.setIcon(SwingUtil.createActionIcon("add"));
576         duplicateButton.setIcon(SwingUtil.createActionIcon("copy"));
577         deleteButton.setIcon(SwingUtil.createActionIcon("delete"));
578         importButton.setIcon(SwingUtil.createActionIcon("import"));
579         exportButton.setIcon(SwingUtil.createActionIcon("export"));
580         extractCombo.setModel(handler.newActionComboBoxModel(extractButton, extractStandardButton, extractCompleteButton, extractAggregatedStandardButton, extractAggregatedCompleteButton));
581         extractButton.setIcon(SwingUtil.createActionIcon("next"));
582         extractStandardButton.setIcon(SwingUtil.createActionIcon("next"));
583         extractCompleteButton.setIcon(SwingUtil.createActionIcon("next"));
584         extractAggregatedStandardButton.setIcon(SwingUtil.createActionIcon("next"));
585         extractAggregatedCompleteButton.setIcon(SwingUtil.createActionIcon("next"));
586     }
587 
588     private void $initialize() {
589         if (allComponentsCreated) {
590             return;
591         }
592         if (log.isDebugEnabled()) {
593             log.debug(this);
594         }
595         handler.beforeInit(this);
596         $objectMap.put("extractionsTableUI", extractionsTableUI);
597         createModel();
598         createBroker();
599         // inline creation of $JScrollPane0
600         $objectMap.put("$JScrollPane0", $JScrollPane0 = new JScrollPane());
601         
602         $JScrollPane0.setName("$JScrollPane0");
603         createExtractionsTable();
604         createExtractionsPanelButtons();
605         // inline creation of $JPanel0
606         $objectMap.put("$JPanel0", $JPanel0 = new JPanel());
607         
608         $JPanel0.setName("$JPanel0");
609         createNewButton();
610         createDuplicateButton();
611         createDeleteButton();
612         // inline creation of $JPanel1
613         $objectMap.put("$JPanel1", $JPanel1 = new JPanel());
614         
615         $JPanel1.setName("$JPanel1");
616         createImportButton();
617         createExportButton();
618         // inline creation of $JLabel0
619         $objectMap.put("$JLabel0", $JLabel0 = new JLabel());
620         
621         $JLabel0.setName("$JLabel0");
622         createExtractCombo();
623         createExtractButton();
624         createExtractStandardButton();
625         createExtractCompleteButton();
626         createExtractAggregatedStandardButton();
627         createExtractAggregatedCompleteButton();
628         // inline creation of extractionsTableUI
629         setName("extractionsTableUI");
630         setLayout(new BorderLayout());
631         
632         // registers 4 data bindings
633         $registerDefaultBindings();
634         $completeSetup();
635         handler.afterInit(this);
636     }
637 
638     private void $registerDefaultBindings() {
639         // register 4 data bindings
640         registerDataBinding(new DefaultJAXXBinding(this, BINDING_DUPLICATE_BUTTON_ENABLED, true, true) {
641         
642             @Override
643             public void applyDataBinding() {
644                 if (model != null) {
645                     model.addPropertyChangeListener("valid", this);
646                 }
647                 if (model != null) {
648                     model.addPropertyChangeListener("selectedRows", this);
649                 }
650             }
651         
652             @Override
653             public void processDataBinding() {
654                 if (model != null && model.getSelectedRows() != null) {
655                     duplicateButton.setEnabled(model.isValid() && model.getSelectedRows().size() == 1);
656                 }
657             }
658         
659             @Override
660             public void removeDataBinding() {
661                 if (model != null) {
662                     model.removePropertyChangeListener("valid", this);
663                 }
664                 if (model != null) {
665                     model.removePropertyChangeListener("selectedRows", this);
666                 }
667             }
668         });
669         registerDataBinding(new DefaultJAXXBinding(this, BINDING_DELETE_BUTTON_ENABLED, true) {
670         
671             @Override
672             public void applyDataBinding() {
673                 if (model != null) {
674                     model.addPropertyChangeListener("selectedRows", this);
675                 }
676             }
677         
678             @Override
679             public void processDataBinding() {
680                 if (model != null && model.getSelectedRows() != null) {
681                     deleteButton.setEnabled(!model.getSelectedRows().isEmpty());
682                 }
683             }
684         
685             @Override
686             public void removeDataBinding() {
687                 if (model != null) {
688                     model.removePropertyChangeListener("selectedRows", this);
689                 }
690             }
691         });
692         registerDataBinding(new DefaultJAXXBinding(this, BINDING_EXPORT_BUTTON_ENABLED, true, true) {
693         
694             @Override
695             public void applyDataBinding() {
696                 if (model != null) {
697                     model.addPropertyChangeListener("valid", this);
698                 }
699                 if (model != null) {
700                     model.addPropertyChangeListener("selectedRows", this);
701                 }
702             }
703         
704             @Override
705             public void processDataBinding() {
706                 if (model != null && model.getSelectedRows() != null) {
707                     exportButton.setEnabled(model.isValid() && model.getSelectedRows().size() == 1);
708                 }
709             }
710         
711             @Override
712             public void removeDataBinding() {
713                 if (model != null) {
714                     model.removePropertyChangeListener("valid", this);
715                 }
716                 if (model != null) {
717                     model.removePropertyChangeListener("selectedRows", this);
718                 }
719             }
720         });
721         registerDataBinding(new DefaultJAXXBinding(this, BINDING_EXTRACT_COMBO_ENABLED, true, true) {
722         
723             @Override
724             public void applyDataBinding() {
725                 if (model != null) {
726                     model.addPropertyChangeListener("valid", this);
727                 }
728                 if (model != null) {
729                     model.addPropertyChangeListener("selectedRows", this);
730                 }
731             }
732         
733             @Override
734             public void processDataBinding() {
735                 if (model != null && model.getSelectedRows() != null) {
736                     extractCombo.setEnabled(model.isValid() && model.getSelectedRows().size() == 1);
737                 }
738             }
739         
740             @Override
741             public void removeDataBinding() {
742                 if (model != null) {
743                     model.removePropertyChangeListener("valid", this);
744                 }
745                 if (model != null) {
746                     model.removePropertyChangeListener("selectedRows", this);
747                 }
748             }
749         });
750     }
751 
752 }