View Javadoc
1   package fr.ifremer.dali.ui.swing.content.manage.program.pmfms;
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.component.ToggleButton;
9   import fr.ifremer.quadrige3.ui.swing.plaf.WaitBlockingLayerUI;
10  import fr.ifremer.quadrige3.ui.swing.table.SwingTable;
11  import java.awt.BorderLayout;
12  import java.awt.Component;
13  import java.awt.Container;
14  import java.awt.GridBagConstraints;
15  import java.awt.Insets;
16  import java.awt.event.ActionEvent;
17  import java.awt.event.ActionListener;
18  import java.util.ArrayList;
19  import java.util.HashMap;
20  import java.util.List;
21  import java.util.Map;
22  import java.util.TreeMap;
23  import javax.swing.BorderFactory;
24  import javax.swing.Box;
25  import javax.swing.BoxLayout;
26  import javax.swing.JButton;
27  import javax.swing.JPanel;
28  import javax.swing.JScrollPane;
29  import jaxx.runtime.JAXXBinding;
30  import jaxx.runtime.JAXXContext;
31  import jaxx.runtime.JAXXObject;
32  import jaxx.runtime.JAXXObjectDescriptor;
33  import jaxx.runtime.JAXXUtil;
34  import jaxx.runtime.SwingUtil;
35  import jaxx.runtime.binding.DefaultJAXXBinding;
36  import jaxx.runtime.context.DefaultJAXXContext;
37  import jaxx.runtime.swing.Table;
38  import jaxx.runtime.swing.help.JAXXHelpUI;
39  import org.apache.commons.logging.Log;
40  import org.apache.commons.logging.LogFactory;
41  import static org.nuiton.i18n.I18n.t;
42  
43  public class PmfmsTableUI extends Table implements JAXXHelpUI<DaliHelpBroker>, DaliUI<PmfmsTableUIModel, PmfmsTableUIHandler>, JAXXObject {
44  
45      /*-----------------------------------------------------------------------*/
46      /*------------------ Constants for all public bindings ------------------*/
47      /*-----------------------------------------------------------------------*/
48  
49      public static final String BINDING_ADD_PMFMS_BUTTON_ENABLED = "addPmfmsButton.enabled";
50      public static final String BINDING_DOWN_PMFM_BUTTON_ENABLED = "downPmfmButton.enabled";
51      public static final String BINDING_EDIT_BUTTON_ENABLED = "editButton.enabled";
52      public static final String BINDING_PMFMS_TABLE_EDITABLE = "pmfmsTable.editable";
53      public static final String BINDING_REMOVE_PMFMS_BUTTON_ENABLED = "removePmfmsButton.enabled";
54      public static final String BINDING_TABLE_BLOCK_LAYER_BLOCK = "tableBlockLayer.block";
55      public static final String BINDING_UP_PMFM_BUTTON_ENABLED = "upPmfmButton.enabled";
56  
57      /*-----------------------------------------------------------------------*/
58      /*------------------------- Other static fields -------------------------*/
59      /*-----------------------------------------------------------------------*/
60  
61      private static final String $jaxxObjectDescriptor = "H4sIAAAAAAAAAMVWS28cRRBub+y1vU7iJMbGIU5kbyJnzWNMeEnImPiFia1NiGJbWPhC707vepKe6c5Mj3eNFcRP4CfAiUsuSNw4RRw4c+CC+AsIceCKqOrZncfu7MOyED6M1l1VX9f3dVd1Pf+DDHkumXtM63XD9R1l2czYXt3f/6T0mJXVBvPKriWVcEnwN5AhmQMyZobrniI3D4oYvtgIX1wXthQOc2LRS0WS89QxZ94hY0qR68mIsuct7oTmpbr03SZqmFQa6jd//Zn52vzq2wwhdQnZjQOV2V5REZPBIslYpiJXYKcjusipU4U0XMupQr4XcG2dU897QG32lHxJhoskK6kLYIrk+6esMXR8XSqSU7TE2UPqMK7IWsU1rIrLbOYaJuWW4VuGV4P9jbJwFMAZNnVolRnSFVWX2oa0K7ZnPMTvLuLsbUmpsbOKDNnCRNCPzw56H5Ei5GzJFU+Yq8jtjtAb8N89iFnTnlHouKa7xkX5SZEeI8Z7MYynPjVdq8rejoAkpxXjU2opHQMrOizOM4DcKbuCc9RRkZfxqOoNgO3IggGjYVxOhgwVMbpnobcwdvC3DkCIyRBp5Na2PsA34eokttaryV2bvnfw/+v4uRbaLlLT1LKv+UrB2ZCJBFqwir43wpDzvsSIyJRP2i+aouZ09cgxE8TtZL0MkogjFssqxanJ6a0UTlMVn3M4AsacXVGtwtk3uL3TXfFys4KMeBiCviahqq8lqhr6hRH1i6igBw7IkOvDsiLTB+0t5hGYguYy3dJcEFBb/5ma+PXH33/YbHaUSdh7MtU11hCh0qGWJNxuC7ceD9qJryy+eJ/KpQMy6jEO3VR3y5mUxHYaZkgO9ruM4QaGG/eodwgQQ8O/vfhp6vNfzpHMJslxQc1Niv5bZFQduqCC4GZd3l3RGZ2vjcD3EuaGpStcE8tu5WRN/woCjw04IarYrqU4MwNLQRXyuqjjfcFQ6JFfWHhWB9lmUmQLcy+N/vz3xM73K03pBoDK1Y7ukXxDn5Gs5XDLYbodNzptavsdkx7zTRF11LQeSxJNVjYax7v6+36aRiNYEUFbeOlEN1HD8j5qrBWQOYYua0r46y5JNJNeOwyCN4huCWcLGzA5B1WvYJXV4R0Z14rD5beFYzispsiYEoLvWnJX26+2nwh4wanAUzLMHNwfwAph2kW4G8wsLMzOz8/2SaWlC52WziCqF/K5FOcTWJKEXmknhG6tjB70yQhX54LlKlPB5WLmI1HzCgvoaEt13OkIo0Z4Ws5Z2I8pFrK+EmfdtCV5z7TzDhz/B+btTf60AmR8GZJPOVFfGpyWcBhJijCd6toiQOUUAnTi71lfoMfy8uydePCeXOVc1BAzVZjE63rqQsCnN1Ql7bzBnq5LioTauUWZw/9OmQ3Yrrs2LZNFL3WymiO+5GYgz+snepzaw2cteHxWQ/EKed/ZDOeG/MKzKDgQ6OZJ83EKJrMjC5pgW0ziOHLRIAIF2kSLq367Fyjqr4ETNz3mHN8ieaI3OrsiaprAHSanXkJnYPIv4awM42PifoDYBUz+QqkxSa8LLmASeOPkkDomhzEMbse6cCoW+AW/wZ4Yuztchdahvo83NsvpsQA+5OIHJlV0tmQ5mOCHbfAD+J3pAzEHAlcdG6TfR5/v0pHmeiLh8vMuCLfOjDB/ZoTCmRFe7UPRQascTNxn0vLFmbXshtCflt0Q+tOyG0JvLXshGIDwL3X2GbN6EQAA";
62      private static final Log log = LogFactory.getLog(PmfmsTableUI.class);
63      private static final long serialVersionUID = 1L;
64  
65      /*-----------------------------------------------------------------------*/
66      /*--------------------------- Internal states ---------------------------*/
67      /*-----------------------------------------------------------------------*/
68  
69      protected List<Object> $activeBindings = new ArrayList<Object>();
70      protected Map<String, Object> $bindingSources = new HashMap<String, Object>();
71      protected final Map<String, JAXXBinding> $bindings = new TreeMap<String, JAXXBinding>();
72      protected Map<String, Object> $objectMap = new HashMap<String, Object>();
73      protected Map<?, ?> $previousValues = new HashMap<Object, Object>();
74      private boolean allComponentsCreated;
75      protected final JAXXContext delegateContext = new DefaultJAXXContext();
76  
77      /*-----------------------------------------------------------------------*/
78      /*------------------------ Protected components  ------------------------*/
79      /*-----------------------------------------------------------------------*/
80  
81      protected JButton addPmfmsButton;
82      protected DaliHelpBroker broker;
83      protected JButton downPmfmButton;
84      protected JButton editButton;
85      protected ToggleButton fullScreenToggleButton;
86      protected final PmfmsTableUIHandler handler = createHandler();
87      protected PmfmsTableUIModel model;
88      protected SwingTable pmfmsTable;
89      protected JButton removePmfmsButton;
90      protected WaitBlockingLayerUI tableBlockLayer;
91      protected PmfmsTableUI tablePanel = this;
92      protected JScrollPane tableScrollPane;
93      protected JButton upPmfmButton;
94  
95      /*-----------------------------------------------------------------------*/
96      /*------------------------- Private components  -------------------------*/
97      /*-----------------------------------------------------------------------*/
98  
99      private JPanel $JPanel0;
100     private JPanel $JPanel1;
101     private JPanel $JPanel2;
102 
103     /*-----------------------------------------------------------------------*/
104     /*---------------------------- Constructors  ----------------------------*/
105     /*-----------------------------------------------------------------------*/
106 
107     public PmfmsTableUI(ApplicationUI parentUI) {
108         ApplicationUIUtil.setParentUI(this, parentUI);
109             $initialize();
110     }
111 
112     public PmfmsTableUI() {
113         $initialize();
114     }
115 
116     public PmfmsTableUI(JAXXContext parentContext) {
117         JAXXUtil.initContext(this, parentContext);
118         $initialize();
119     }
120 
121     /*-----------------------------------------------------------------------*/
122     /*--------------------------- Statics methods ---------------------------*/
123     /*-----------------------------------------------------------------------*/
124 
125     public static JAXXObjectDescriptor $getJAXXObjectDescriptor() {
126         return JAXXUtil.decodeCompressedJAXXObjectDescriptor($jaxxObjectDescriptor);
127     }
128 
129     /*-----------------------------------------------------------------------*/
130     /*---------------------- JAXXObject implementation ----------------------*/
131     /*-----------------------------------------------------------------------*/
132 
133     @Override
134     public void applyDataBinding(String $binding) {
135         if (allComponentsCreated && $bindings.containsKey($binding)) {
136             getDataBinding($binding).applyDataBinding();
137         }
138         processDataBinding($binding);
139     }
140 
141     @Override
142     public void firePropertyChange(String propertyName, Object oldValue, Object newValue) {
143         super.firePropertyChange(propertyName, oldValue, newValue);
144     }
145 
146     @Override
147     public Map<String, Object> get$objectMap() {
148         return $objectMap;
149     }
150 
151     @Override
152     public JAXXBinding getDataBinding(String bindingId) {
153         return $bindings.get(bindingId);
154     }
155 
156     @Override
157     public JAXXBinding[] getDataBindings() {
158         return $bindings.values().toArray(new JAXXBinding[$bindings.size()]);
159     }
160 
161     @Override
162     public Object getObjectById(String id) {
163         return $objectMap.get(id);
164     }
165 
166     @Override
167     public void processDataBinding(String $binding, boolean $force) {
168         if (!$force && $activeBindings.contains($binding)) { 
169             return;
170         }
171         $activeBindings.add($binding);
172         try {
173             if (allComponentsCreated && $bindings.containsKey($binding)) {
174                 getDataBinding($binding).processDataBinding();
175             }
176         } finally {
177             $activeBindings.remove($binding);
178         }
179     }
180 
181     @Override
182     public void processDataBinding(String $binding) {
183         processDataBinding($binding, false);
184     }
185 
186     @Override
187     public void registerDataBinding(JAXXBinding binding) {
188         $bindings.put(binding.getId(), binding);
189     }
190 
191     @Override
192     public void removeDataBinding(String $binding) {
193         if (allComponentsCreated && $bindings.containsKey($binding)) {
194             getDataBinding($binding).removeDataBinding();
195         }
196     }
197 
198     /*-----------------------------------------------------------------------*/
199     /*--------------------- JAXXContext implementation  ---------------------*/
200     /*-----------------------------------------------------------------------*/
201 
202     @Override
203     public <T> T getContextValue(Class<T> clazz) {
204         return delegateContext.getContextValue(clazz, null);
205     }
206 
207     @Override
208     public <T> T getContextValue(Class<T> clazz, String name) {
209         return delegateContext.getContextValue(clazz, name);
210     }
211 
212     @Override
213     public JAXXContext getDelegateContext() {
214         return delegateContext;
215     }
216 
217     @Override
218     public <O extends Container> O getParentContainer(Class<O> clazz) {
219         return SwingUtil.getParentContainer(this, clazz);
220     }
221 
222     @Override
223     public <O extends Container> O getParentContainer(Object source, Class<O> clazz) {
224         return SwingUtil.getParentContainer(source, clazz);
225     }
226 
227     @Override
228     public <T> void removeContextValue(Class<T> clazz) {
229         delegateContext.removeContextValue(clazz, null);
230     }
231 
232     @Override
233     public <T> void removeContextValue(Class<T> clazz, String name) {
234         delegateContext.removeContextValue(clazz, name);
235     }
236 
237     @Override
238     public <T> void setContextValue(T o) {
239         delegateContext.setContextValue(o, null);
240     }
241 
242     @Override
243     public <T> void setContextValue(T o, String name) {
244         delegateContext.setContextValue(o, name);
245     }
246 
247     /*-----------------------------------------------------------------------*/
248     /*---------------------------- Event methods ----------------------------*/
249     /*-----------------------------------------------------------------------*/
250 
251     public void doActionPerformed__on__addPmfmsButton(ActionEvent event) {
252         if (log.isDebugEnabled()) {
253             log.debug(event);
254         }
255         handler.addPmfms();
256     }
257 
258     public void doActionPerformed__on__downPmfmButton(ActionEvent event) {
259         if (log.isDebugEnabled()) {
260             log.debug(event);
261         }
262         handler.downPmfm();
263     }
264 
265     public void doActionPerformed__on__editButton(ActionEvent event) {
266         if (log.isDebugEnabled()) {
267             log.debug(event);
268         }
269         handler.editPmfm();
270     }
271 
272     public void doActionPerformed__on__fullScreenToggleButton(ActionEvent event) {
273         if (log.isDebugEnabled()) {
274             log.debug(event);
275         }
276         handler.toggleFullScreen(tablePanel, fullScreenToggleButton);
277     }
278 
279     public void doActionPerformed__on__removePmfmsButton(ActionEvent event) {
280         if (log.isDebugEnabled()) {
281             log.debug(event);
282         }
283         handler.removePmfms();
284     }
285 
286     public void doActionPerformed__on__upPmfmButton(ActionEvent event) {
287         if (log.isDebugEnabled()) {
288             log.debug(event);
289         }
290         handler.upPmfm();
291     }
292 
293     /*-----------------------------------------------------------------------*/
294     /*----------------------- Public acessor methods  -----------------------*/
295     /*-----------------------------------------------------------------------*/
296 
297     public JButton getAddPmfmsButton() {
298         return addPmfmsButton;
299     }
300 
301     public DaliHelpBroker getBroker() {
302         return broker;
303     }
304 
305     public JButton getDownPmfmButton() {
306         return downPmfmButton;
307     }
308 
309     public JButton getEditButton() {
310         return editButton;
311     }
312 
313     public ToggleButton getFullScreenToggleButton() {
314         return fullScreenToggleButton;
315     }
316 
317     public PmfmsTableUIHandler getHandler() {
318         return handler;
319     }
320 
321     public PmfmsTableUIModel getModel() {
322         return model;
323     }
324 
325     public SwingTable getPmfmsTable() {
326         return pmfmsTable;
327     }
328 
329     public JButton getRemovePmfmsButton() {
330         return removePmfmsButton;
331     }
332 
333     public WaitBlockingLayerUI getTableBlockLayer() {
334         return tableBlockLayer;
335     }
336 
337     public JScrollPane getTableScrollPane() {
338         return tableScrollPane;
339     }
340 
341     public JButton getUpPmfmButton() {
342         return upPmfmButton;
343     }
344 
345     /*-----------------------------------------------------------------------*/
346     /*---------------------------- Other methods ----------------------------*/
347     /*-----------------------------------------------------------------------*/
348 
349     @Override
350     public void registerHelpId(DaliHelpBroker broker, Component component, String helpId) {
351         broker.installUI(component, helpId);
352     }
353 
354     @Override
355     public void showHelp(String helpId) {
356         getBroker().showHelp(this, helpId);
357     }
358 
359     /*-----------------------------------------------------------------------*/
360     /*--------------------- Protected acessors methods  ---------------------*/
361     /*-----------------------------------------------------------------------*/
362 
363     protected JPanel get$JPanel0() {
364         return $JPanel0;
365     }
366 
367     protected JPanel get$JPanel1() {
368         return $JPanel1;
369     }
370 
371     protected JPanel get$JPanel2() {
372         return $JPanel2;
373     }
374 
375     /*-----------------------------------------------------------------------*/
376     /*--------------------- Components creation methods ---------------------*/
377     /*-----------------------------------------------------------------------*/
378 
379     protected void addChildrenToTablePanel() {
380         if (!allComponentsCreated) {
381             return;
382         }
383         add(SwingUtil.boxComponentWithJxLayer(tableScrollPane), new GridBagConstraints(0, 0, 1, 1, 1.0, 1.0, 10, 1, new Insets(3, 3, 3, 3), 0, 0));
384         add($JPanel0, new GridBagConstraints(0, 1, 1, 1, 1.0, 0.0, 10, 1, new Insets(3, 3, 3, 3), 0, 0));
385     }
386 
387     protected void addChildrenToTableScrollPane() {
388         if (!allComponentsCreated) {
389             return;
390         }
391         tableScrollPane.getViewport().add(pmfmsTable);
392     }
393 
394     protected void createAddPmfmsButton() {
395         $objectMap.put("addPmfmsButton", addPmfmsButton = new JButton());
396         
397         addPmfmsButton.setName("addPmfmsButton");
398         addPmfmsButton.setText(t("dali.common.new"));
399         addPmfmsButton.setToolTipText(t("dali.program.pmfm.new.tip"));
400         addPmfmsButton.addActionListener(JAXXUtil.getEventListener(ActionListener.class, "actionPerformed", this, "doActionPerformed__on__addPmfmsButton"));
401     }
402 
403     protected void createBroker() {
404         $objectMap.put("broker", broker = new DaliHelpBroker("dali.home.help"));
405     }
406 
407     protected void createDownPmfmButton() {
408         $objectMap.put("downPmfmButton", downPmfmButton = new JButton());
409         
410         downPmfmButton.setName("downPmfmButton");
411         downPmfmButton.setText(t("dali.program.pmfm.down.label"));
412         downPmfmButton.setToolTipText(t("dali.program.pmfm.down.tip"));
413         downPmfmButton.addActionListener(JAXXUtil.getEventListener(ActionListener.class, "actionPerformed", this, "doActionPerformed__on__downPmfmButton"));
414     }
415 
416     protected void createEditButton() {
417         $objectMap.put("editButton", editButton = new JButton());
418         
419         editButton.setName("editButton");
420         editButton.setText(t("dali.common.edit"));
421         editButton.setToolTipText(t("dali.program.pmfm.edit.tip"));
422         editButton.addActionListener(JAXXUtil.getEventListener(ActionListener.class, "actionPerformed", this, "doActionPerformed__on__editButton"));
423     }
424 
425     protected void createFullScreenToggleButton() {
426         $objectMap.put("fullScreenToggleButton", fullScreenToggleButton = new ToggleButton());
427         
428         fullScreenToggleButton.setName("fullScreenToggleButton");
429         fullScreenToggleButton.setText(t("dali.table.view.fullScreen"));
430         fullScreenToggleButton.setToolTipText(t("dali.table.view.fullScreen.tip"));
431         fullScreenToggleButton.addActionListener(JAXXUtil.getEventListener(ActionListener.class, "actionPerformed", this, "doActionPerformed__on__fullScreenToggleButton"));
432     }
433 
434     protected PmfmsTableUIHandler createHandler() {
435         return new PmfmsTableUIHandler();
436     }
437 
438     protected void createModel() {
439         $objectMap.put("model", model = getContextValue(PmfmsTableUIModel.class));
440     }
441 
442     protected void createPmfmsTable() {
443         $objectMap.put("pmfmsTable", pmfmsTable = new SwingTable());
444         
445         pmfmsTable.setName("pmfmsTable");
446     }
447 
448     protected void createRemovePmfmsButton() {
449         $objectMap.put("removePmfmsButton", removePmfmsButton = new JButton());
450         
451         removePmfmsButton.setName("removePmfmsButton");
452         removePmfmsButton.setText(t("dali.common.delete"));
453         removePmfmsButton.setToolTipText(t("dali.program.pmfm.delete.tip"));
454         removePmfmsButton.addActionListener(JAXXUtil.getEventListener(ActionListener.class, "actionPerformed", this, "doActionPerformed__on__removePmfmsButton"));
455     }
456 
457     protected void createTableBlockLayer() {
458         $objectMap.put("tableBlockLayer", tableBlockLayer = new WaitBlockingLayerUI());
459     }
460 
461     protected void createTableScrollPane() {
462         $objectMap.put("tableScrollPane", tableScrollPane = new JScrollPane());
463         
464         tableScrollPane.setName("tableScrollPane");
465     }
466 
467     protected void createUpPmfmButton() {
468         $objectMap.put("upPmfmButton", upPmfmButton = new JButton());
469         
470         upPmfmButton.setName("upPmfmButton");
471         upPmfmButton.setText(t("dali.program.pmfm.up.label"));
472         upPmfmButton.setToolTipText(t("dali.program.pmfm.up.tip"));
473         upPmfmButton.addActionListener(JAXXUtil.getEventListener(ActionListener.class, "actionPerformed", this, "doActionPerformed__on__upPmfmButton"));
474     }
475 
476     /*-----------------------------------------------------------------------*/
477     /*------------------------ Internal jaxx methods ------------------------*/
478     /*-----------------------------------------------------------------------*/
479 
480     private void $completeSetup() {
481         allComponentsCreated = true;
482         if (log.isDebugEnabled()) {
483             log.debug(this);
484         }
485         addChildrenToTablePanel();
486         addChildrenToTableScrollPane();
487         // inline complete setup of $JPanel0
488         $JPanel0.add($JPanel1, BorderLayout.LINE_START);
489         $JPanel0.add($JPanel2, BorderLayout.LINE_END);
490         // inline complete setup of $JPanel1
491         $JPanel1.add(addPmfmsButton);
492         $JPanel1.add(upPmfmButton);
493         $JPanel1.add(downPmfmButton);
494         $JPanel1.add(editButton);
495         $JPanel1.add(removePmfmsButton);
496         // inline complete setup of $JPanel2
497         $JPanel2.add(fullScreenToggleButton);
498         
499         // apply 7 data bindings
500         JAXXUtil.applyDataBinding(this, $bindings.keySet());
501         
502         // apply 17 property setters
503         addPmfmsButton.setAlignmentX(Component.CENTER_ALIGNMENT);
504         upPmfmButton.setAlignmentX(Component.CENTER_ALIGNMENT);
505         downPmfmButton.setAlignmentX(Component.CENTER_ALIGNMENT);
506         editButton.setAlignmentX(Component.CENTER_ALIGNMENT);
507         removePmfmsButton.setAlignmentX(Component.CENTER_ALIGNMENT);
508         setBorder(BorderFactory.createTitledBorder(t("dali.program.pmfm.title")));
509         tableBlockLayer.setBlockingColor(handler.getConfig().getColorBlockingLayer());
510         addPmfmsButton.setIcon(SwingUtil.createActionIcon("add"));
511         upPmfmButton.setIcon(SwingUtil.createActionIcon("up"));
512         downPmfmButton.setIcon(SwingUtil.createActionIcon("down"));
513         editButton.setIcon(SwingUtil.createActionIcon("edit"));
514         removePmfmsButton.setIcon(SwingUtil.createActionIcon("delete"));
515         fullScreenToggleButton.setToggledIcon(SwingUtil.createActionIcon("unFullScreen"));
516         fullScreenToggleButton.setToggledText(t("dali.table.view.unFullScreen"));
517         fullScreenToggleButton.setIcon(SwingUtil.createActionIcon("fullScreen"));
518         fullScreenToggleButton.setToggledToolTipText(t("dali.table.view.unFullScreen.tip"));
519     }
520 
521     private void $initialize() {
522         if (allComponentsCreated) {
523             return;
524         }
525         if (log.isDebugEnabled()) {
526             log.debug(this);
527         }
528         handler.beforeInit(this);
529         $objectMap.put("tablePanel", tablePanel);
530         createModel();
531         createBroker();
532         createTableBlockLayer();
533         createTableScrollPane();
534         createPmfmsTable();
535         // inline creation of $JPanel0
536         $objectMap.put("$JPanel0", $JPanel0 = new JPanel());
537         
538         $JPanel0.setName("$JPanel0");
539         $JPanel0.setLayout(new BorderLayout());
540         // inline creation of $JPanel1
541         $objectMap.put("$JPanel1", $JPanel1 = new JPanel());
542         
543         $JPanel1.setName("$JPanel1");
544         createAddPmfmsButton();
545         createUpPmfmButton();
546         createDownPmfmButton();
547         createEditButton();
548         createRemovePmfmsButton();
549         // inline creation of $JPanel2
550         $objectMap.put("$JPanel2", $JPanel2 = new JPanel());
551         
552         $JPanel2.setName("$JPanel2");
553         createFullScreenToggleButton();
554         // inline creation of tablePanel
555         setName("tablePanel");
556         
557         // registers 7 data bindings
558         $registerDefaultBindings();
559         $completeSetup();
560         handler.afterInit(this);
561     }
562 
563     private void $registerDefaultBindings() {
564         // register 7 data bindings
565         registerDataBinding(new DefaultJAXXBinding(this, BINDING_TABLE_BLOCK_LAYER_BLOCK, true) {
566         
567             @Override
568             public void applyDataBinding() {
569                 if (model != null) {
570                     model.addPropertyChangeListener("loading", this);
571                 }
572             }
573         
574             @Override
575             public void processDataBinding() {
576                 if (model != null) {
577                     tableBlockLayer.setBlock(model.isLoading());
578                 }
579             }
580         
581             @Override
582             public void removeDataBinding() {
583                 if (model != null) {
584                     model.removePropertyChangeListener("loading", this);
585                 }
586             }
587         });
588         registerDataBinding(new DefaultJAXXBinding(this, BINDING_PMFMS_TABLE_EDITABLE, true) {
589         
590             @Override
591             public void applyDataBinding() {
592                 if (model != null) {
593                     model.addPropertyChangeListener("editable", this);
594                 }
595             }
596         
597             @Override
598             public void processDataBinding() {
599                 if (model != null) {
600                     pmfmsTable.setEditable(model.isEditable());
601                 }
602             }
603         
604             @Override
605             public void removeDataBinding() {
606                 if (model != null) {
607                     model.removePropertyChangeListener("editable", this);
608                 }
609             }
610         });
611         registerDataBinding(new DefaultJAXXBinding(this, BINDING_ADD_PMFMS_BUTTON_ENABLED, true, true) {
612         
613             @Override
614             public void applyDataBinding() {
615                 if (model != null) {
616                     model.addPropertyChangeListener("loaded", this);
617                 }
618                 if (model != null) {
619                     model.addPropertyChangeListener("editable", this);
620                 }
621             }
622         
623             @Override
624             public void processDataBinding() {
625                 if (model != null) {
626                     addPmfmsButton.setEnabled(model.isLoaded() && model.isEditable());
627                 }
628             }
629         
630             @Override
631             public void removeDataBinding() {
632                 if (model != null) {
633                     model.removePropertyChangeListener("loaded", this);
634                 }
635                 if (model != null) {
636                     model.removePropertyChangeListener("editable", this);
637                 }
638             }
639         });
640         registerDataBinding(new DefaultJAXXBinding(this, BINDING_UP_PMFM_BUTTON_ENABLED, true, true) {
641         
642             @Override
643             public void applyDataBinding() {
644                 if (model != null) {
645                     model.addPropertyChangeListener("loaded", this);
646                 }
647                 if (model != null) {
648                     model.addPropertyChangeListener("editable", this);
649                 }
650                 if (model != null) {
651                     model.addPropertyChangeListener("selectedRows", this);
652                 }
653                 if (model != null) {
654                     model.addPropertyChangeListener("upAllowed", this);
655                 }
656             }
657         
658             @Override
659             public void processDataBinding() {
660                 if (model != null && model.getSelectedRows() != null) {
661                     upPmfmButton.setEnabled(model.isLoaded() && model.isEditable() && model.getSelectedRows().size() == 1 && model.isUpAllowed());
662                 }
663             }
664         
665             @Override
666             public void removeDataBinding() {
667                 if (model != null) {
668                     model.removePropertyChangeListener("loaded", this);
669                 }
670                 if (model != null) {
671                     model.removePropertyChangeListener("editable", this);
672                 }
673                 if (model != null) {
674                     model.removePropertyChangeListener("selectedRows", this);
675                 }
676                 if (model != null) {
677                     model.removePropertyChangeListener("upAllowed", this);
678                 }
679             }
680         });
681         registerDataBinding(new DefaultJAXXBinding(this, BINDING_DOWN_PMFM_BUTTON_ENABLED, true, true) {
682         
683             @Override
684             public void applyDataBinding() {
685                 if (model != null) {
686                     model.addPropertyChangeListener("loaded", this);
687                 }
688                 if (model != null) {
689                     model.addPropertyChangeListener("editable", this);
690                 }
691                 if (model != null) {
692                     model.addPropertyChangeListener("selectedRows", this);
693                 }
694                 if (model != null) {
695                     model.addPropertyChangeListener("downAllowed", this);
696                 }
697             }
698         
699             @Override
700             public void processDataBinding() {
701                 if (model != null && model.getSelectedRows() != null) {
702                     downPmfmButton.setEnabled(model.isLoaded() && model.isEditable() && model.getSelectedRows().size() == 1 && model.isDownAllowed());
703                 }
704             }
705         
706             @Override
707             public void removeDataBinding() {
708                 if (model != null) {
709                     model.removePropertyChangeListener("loaded", this);
710                 }
711                 if (model != null) {
712                     model.removePropertyChangeListener("editable", this);
713                 }
714                 if (model != null) {
715                     model.removePropertyChangeListener("selectedRows", this);
716                 }
717                 if (model != null) {
718                     model.removePropertyChangeListener("downAllowed", this);
719                 }
720             }
721         });
722         registerDataBinding(new DefaultJAXXBinding(this, BINDING_EDIT_BUTTON_ENABLED, true, true) {
723         
724             @Override
725             public void applyDataBinding() {
726                 if (model != null) {
727                     model.addPropertyChangeListener("loaded", this);
728                 }
729                 if (model != null) {
730                     model.addPropertyChangeListener("editable", this);
731                 }
732                 if (model != null) {
733                     model.addPropertyChangeListener("selectedRows", this);
734                 }
735             }
736         
737             @Override
738             public void processDataBinding() {
739                 if (model != null && model.getSelectedRows() != null) {
740                     editButton.setEnabled(model.isLoaded() && model.isEditable() && !model.getSelectedRows().isEmpty());
741                 }
742             }
743         
744             @Override
745             public void removeDataBinding() {
746                 if (model != null) {
747                     model.removePropertyChangeListener("loaded", this);
748                 }
749                 if (model != null) {
750                     model.removePropertyChangeListener("editable", this);
751                 }
752                 if (model != null) {
753                     model.removePropertyChangeListener("selectedRows", this);
754                 }
755             }
756         });
757         registerDataBinding(new DefaultJAXXBinding(this, BINDING_REMOVE_PMFMS_BUTTON_ENABLED, true, true) {
758         
759             @Override
760             public void applyDataBinding() {
761                 if (model != null) {
762                     model.addPropertyChangeListener("loaded", this);
763                 }
764                 if (model != null) {
765                     model.addPropertyChangeListener("editable", this);
766                 }
767                 if (model != null) {
768                     model.addPropertyChangeListener("selectedRows", this);
769                 }
770             }
771         
772             @Override
773             public void processDataBinding() {
774                 if (model != null && model.getSelectedRows() != null) {
775                     removePmfmsButton.setEnabled(model.isLoaded() && model.isEditable() && !model.getSelectedRows().isEmpty());
776                 }
777             }
778         
779             @Override
780             public void removeDataBinding() {
781                 if (model != null) {
782                     model.removePropertyChangeListener("loaded", this);
783                 }
784                 if (model != null) {
785                     model.removePropertyChangeListener("editable", this);
786                 }
787                 if (model != null) {
788                     model.removePropertyChangeListener("selectedRows", this);
789                 }
790             }
791         });
792     }
793 
794 }