View Javadoc
1   package fr.ifremer.tutti.ui.swing.content.validation;
2   
3   /*
4    * #%L
5    * Tutti :: UI
6    * $Id:$
7    * $HeadURL:$
8    * %%
9    * Copyright (C) 2012 - 2017 Ifremer
10   * %%
11   * This program is free software: you can redistribute it and/or modify
12   * it under the terms of the GNU General Public License as
13   * published by the Free Software Foundation, either version 3 of the
14   * License, or (at your option) any later version.
15   * 
16   * This program is distributed in the hope that it will be useful,
17   * but WITHOUT ANY WARRANTY; without even the implied warranty of
18   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19   * GNU General Public License for more details.
20   * 
21   * You should have received a copy of the GNU General Public
22   * License along with this program.  If not, see
23   * <http://www.gnu.org/licenses/gpl-3.0.html>.
24   * #L%
25   */
26  
27  import fr.ifremer.tutti.ui.swing.TuttiHelpBroker;
28  import fr.ifremer.tutti.ui.swing.content.cruise.EditCruiseUI;
29  import fr.ifremer.tutti.ui.swing.content.operation.FishingOperationsUI;
30  import fr.ifremer.tutti.ui.swing.util.TuttiUI;
31  import fr.ifremer.tutti.ui.swing.util.TuttiUIUtil;
32  import java.awt.BorderLayout;
33  import java.awt.Component;
34  import java.awt.Container;
35  import java.awt.event.KeyEvent;
36  import java.awt.event.KeyListener;
37  import java.awt.event.MouseEvent;
38  import java.awt.event.MouseListener;
39  import java.util.ArrayList;
40  import java.util.HashMap;
41  import java.util.List;
42  import java.util.Map;
43  import java.util.TreeMap;
44  import javax.swing.JButton;
45  import javax.swing.JMenuItem;
46  import javax.swing.JPanel;
47  import javax.swing.JPopupMenu;
48  import javax.swing.JScrollPane;
49  import javax.swing.JSplitPane;
50  import javax.swing.JToolBar;
51  import javax.swing.JTree;
52  import jaxx.runtime.JAXXBinding;
53  import jaxx.runtime.JAXXContext;
54  import jaxx.runtime.JAXXObject;
55  import jaxx.runtime.JAXXObjectDescriptor;
56  import jaxx.runtime.JAXXUtil;
57  import jaxx.runtime.SwingUtil;
58  import jaxx.runtime.binding.DefaultJAXXBinding;
59  import jaxx.runtime.context.DefaultJAXXContext;
60  import jaxx.runtime.swing.CardLayout2Ext;
61  import jaxx.runtime.swing.help.JAXXHelpUI;
62  import org.apache.commons.logging.Log;
63  import org.apache.commons.logging.LogFactory;
64  import org.jdesktop.swingx.JXTitledPanel;
65  import static org.nuiton.i18n.I18n.t;
66  
67  public class ValidateCruiseUI extends JSplitPane implements JAXXHelpUI<TuttiHelpBroker>, TuttiUI<ValidateCruiseUIModel, ValidateCruiseUIHandler>, JAXXObject {
68  
69      /*-----------------------------------------------------------------------*/
70      /*------------------ Constants for all public bindings ------------------*/
71      /*-----------------------------------------------------------------------*/
72  
73      public static final String BINDING_EXPORT_OPERATION_MESSAGES_ITEM_ENABLED = "exportOperationMessagesItem.enabled";
74      public static final String BINDING_READY_TO_SYNCH_BUTTON_ENABLED = "readyToSynchButton.enabled";
75  
76      /*-----------------------------------------------------------------------*/
77      /*------------------------- Other static fields -------------------------*/
78      /*-----------------------------------------------------------------------*/
79  
80      private static final String $jaxxObjectDescriptor = "H4sIAAAAAAAAAKVXzVMcRRRvNuyS5SsmMQmRWAKJVUmpTdRKaQkYPgIGCgwVNh8lh9g70+x20js96ekhQ1Gx/BP8E/TuRcsqD54sD549eLH8FyzLg1fL192z07swsAtwWJbX7/3eZ/9e8+1fqBhJNP6UJAmWcaBYg+KVuceP71WfUk/doZEnWaiERPanp4AKm2jAz+SRQlc3V7X5ZGo+uSAaoQho0GI9tYr6I7XDaVSnVCn0eruFF0WTG9nxVBLGsomaBZWH+vU/fxe+8r/8poBQEkJ0r0AqY52sXCa9q6jAfIXOgadtMslJUIMwJAtqEO+Qli1wEkWfkgZ9jr5AfauoFBIJYApNdJ+ywTD2SahQOQo5U+skoArNbEnMtiRtUIlVrBTDMcPRC/CPPREogMPbhDOfKCYC/NB+pQsyZhF9sByGBrWkULEhfMoVmj8R3poGcaClqhTPqFToxsGoFf3nXbCaN7rO+EJAtlnN+KkwxamvE4YIx4Ws4acwPc+UCC1Iglcet+hogHKG0w9qFSH4PIFAXtUdSVLXK6lYK57L9AdpEgqp5iEuSBidb7OwUq15ITMoN2gQr4swhtZcbNM2wjU4dVmNWvR7IZUmtTUaRaRGo2VFG5Bzm7m21HJtOpohnL62YrK8CUPX7q2Zu8vljKthWr1LbSYbnhSc6yNtMO5q5uwUOtteM0mN8rVM+ZykxN+piI2dwKu7Ar1mIBUaqBqR8Z/FRX07wHyV7Ag438Me1tcCkb49f28xUa6G5cxaC662t3tYNEubZny780RnJniJRXU4ydoTPVjWuDcz+AHPjHqKfaszttXHixBy85akiBKNtiUNDIYdgzmK6dlERRmDWKGRzf2kdx+OLN2N7KE7DWhO/7t4/vef/vxhqclxw+D7Qq5qC0UD94RSV0Yx7fqMJbhYMT65RsKpTaAhyoHfDX9fyQlsIz2G4MCfmSKszfFdEtUBotj3x8+/XPz8t1OosIT6uSD+EtH6y6is6hKqILifhLdnTUSDL05rctaxQY+fEN9/RFmtrh4EDKbn0q6hL1yjyomv33iZQFWu5FQlC61a/vXf8xvfzTYr0wORXj5Q3VWn+BkqsYCzgBr+T6k9l+8HwojGvnAUnkfqKAyBPYY4qVL+iKm6jt+czZjPubwqlOomVYUKt24msVZbNBnob59YwH137yC4U5qshfQ1WZd2g5jzl9ByqfHvUE/IlAoGdx2ZgkJRadJV6E07+9tt2wA7DsFGb3+MB5F8mN71Q6IdstGuEwbXDPZvcYvwCEIpiZA8j6kTlLdgshSp8kyWF0fLkujkvBcY7wkJYQV7Ju45z9aG7B5pdRJjFuFFsw9syR5mx821YMGxp0cFCt5vrZY1HirZVQJpPalDzRT6aHeiUyOsPbaWmHCOtekEQA8oSL/CwgpNAPLW0YEUC/Mq27ZOO9W2D/TZux8GawFtiIB5Ck13GUjrDsKNzDy3U5vH69QG2U79V8T9FneH9ahXc4j+Zar6/jGSce2d7rq9bcXIb/AHx4GCFivURwN9m+DOjaSsy6LWchja3T8HOa+ETtMAHFc0jKjQ2zZcvfjnPI/50CICl1WZoIA3cFV/t52I8ty7R9rRZ3D2aJfBvSY6zKF/EsbInijHJI10JLudg725ubGcPSrruPrkj+bUceH2jOc77lFgFzj19z7vrt8YG58ZM+sub2gOe6x3MbwDUgj1kEWs0/JxuXWBWuLpk/ns7p5XdG4O7rF8FOzhaSg9GauywId6fbwPuEd/TnSB2Ms8++/A9/kYlztiaPGPhyC8cWKEtwDhf6fkMPDFEAAA";
81      private static final Log log = LogFactory.getLog(ValidateCruiseUI.class);
82      private static final long serialVersionUID = 1L;
83  
84      /*-----------------------------------------------------------------------*/
85      /*--------------------------- Internal states ---------------------------*/
86      /*-----------------------------------------------------------------------*/
87  
88      protected List<Object> $activeBindings = new ArrayList<Object>();
89      protected Map<String, Object> $bindingSources = new HashMap<String, Object>();
90      protected final Map<String, JAXXBinding> $bindings = new TreeMap<String, JAXXBinding>();
91      protected Map<String, Object> $objectMap = new HashMap<String, Object>();
92      protected Map<?, ?> $previousValues = new HashMap<Object, Object>();
93      private boolean allComponentsCreated;
94      protected final JAXXContext delegateContext = new DefaultJAXXContext();
95  
96      /*-----------------------------------------------------------------------*/
97      /*------------------------ Protected components  ------------------------*/
98      /*-----------------------------------------------------------------------*/
99  
100     protected TuttiHelpBroker broker;
101     protected EditCruiseUI cruisePanel;
102     protected JPanel editPanel;
103     protected CardLayout2Ext editPanelLayout;
104     protected JButton exportButton;
105     protected JMenuItem exportOperationMessagesItem;
106     protected final ValidateCruiseUIHandler handler = createHandler();
107     protected JPopupMenu menuPopup;
108     protected ValidateCruiseUIModel model;
109     protected JTree navigation;
110     protected JScrollPane navigationPanel;
111     protected JXTitledPanel navigationTitledPanel;
112     protected FishingOperationsUI operationPanel;
113     protected JButton readyToSynchButton;
114     protected ValidateCruiseUI splitPane = this;
115     protected JToolBar topToolBar;
116 
117     /*-----------------------------------------------------------------------*/
118     /*------------------------- Private components  -------------------------*/
119     /*-----------------------------------------------------------------------*/
120 
121     private JPanel $JPanel0;
122 
123     /*-----------------------------------------------------------------------*/
124     /*---------------------------- Constructors  ----------------------------*/
125     /*-----------------------------------------------------------------------*/
126 
127     public ValidateCruiseUI(TuttiUI parentUI) {
128         TuttiUIUtil.setParentUI(this, parentUI);
129             $initialize();
130     }
131 
132     public ValidateCruiseUI(int param0, boolean param1, Component param2, Component param3) {
133         super(param0 ,param1 ,param2 ,param3);
134         $initialize();
135     }
136 
137     public ValidateCruiseUI(JAXXContext parentContext, int param1, boolean param2, Component param3, Component param4) {
138         super(param1 ,param2 ,param3 ,param4);
139         JAXXUtil.initContext(this, parentContext);
140         $initialize();
141     }
142 
143     public ValidateCruiseUI(int param0, Component param1, Component param2) {
144         super(param0 ,param1 ,param2);
145         $initialize();
146     }
147 
148     public ValidateCruiseUI(JAXXContext parentContext, int param1, Component param2, Component param3) {
149         super(param1 ,param2 ,param3);
150         JAXXUtil.initContext(this, parentContext);
151         $initialize();
152     }
153 
154     public ValidateCruiseUI() {
155         $initialize();
156     }
157 
158     public ValidateCruiseUI(JAXXContext parentContext) {
159         JAXXUtil.initContext(this, parentContext);
160         $initialize();
161     }
162 
163     public ValidateCruiseUI(int param0) {
164         super(param0);
165         $initialize();
166     }
167 
168     public ValidateCruiseUI(JAXXContext parentContext, int param1) {
169         super(param1);
170         JAXXUtil.initContext(this, parentContext);
171         $initialize();
172     }
173 
174     public ValidateCruiseUI(int param0, boolean param1) {
175         super(param0 ,param1);
176         $initialize();
177     }
178 
179     public ValidateCruiseUI(JAXXContext parentContext, int param1, boolean param2) {
180         super(param1 ,param2);
181         JAXXUtil.initContext(this, parentContext);
182         $initialize();
183     }
184 
185     /*-----------------------------------------------------------------------*/
186     /*--------------------------- Statics methods ---------------------------*/
187     /*-----------------------------------------------------------------------*/
188 
189     public static JAXXObjectDescriptor $getJAXXObjectDescriptor() {
190         return JAXXUtil.decodeCompressedJAXXObjectDescriptor($jaxxObjectDescriptor);
191     }
192 
193     /*-----------------------------------------------------------------------*/
194     /*---------------------- JAXXObject implementation ----------------------*/
195     /*-----------------------------------------------------------------------*/
196 
197     @Override
198     public void applyDataBinding(String $binding) {
199         if (allComponentsCreated && $bindings.containsKey($binding)) {
200             getDataBinding($binding).applyDataBinding();
201         }
202         processDataBinding($binding);
203     }
204 
205     @Override
206     public void firePropertyChange(String propertyName, Object oldValue, Object newValue) {
207         super.firePropertyChange(propertyName, oldValue, newValue);
208     }
209 
210     @Override
211     public Map<String, Object> get$objectMap() {
212         return $objectMap;
213     }
214 
215     @Override
216     public JAXXBinding getDataBinding(String bindingId) {
217         return $bindings.get(bindingId);
218     }
219 
220     @Override
221     public JAXXBinding[] getDataBindings() {
222         return $bindings.values().toArray(new JAXXBinding[$bindings.size()]);
223     }
224 
225     @Override
226     public Object getObjectById(String id) {
227         return $objectMap.get(id);
228     }
229 
230     @Override
231     public void processDataBinding(String $binding, boolean $force) {
232         if (!$force && $activeBindings.contains($binding)) { 
233             return;
234         }
235         $activeBindings.add($binding);
236         try {
237             if (allComponentsCreated && $bindings.containsKey($binding)) {
238                 getDataBinding($binding).processDataBinding();
239             }
240         } finally {
241             $activeBindings.remove($binding);
242         }
243     }
244 
245     @Override
246     public void processDataBinding(String $binding) {
247         processDataBinding($binding, false);
248     }
249 
250     @Override
251     public void registerDataBinding(JAXXBinding binding) {
252         $bindings.put(binding.getId(), binding);
253     }
254 
255     @Override
256     public void removeDataBinding(String $binding) {
257         if (allComponentsCreated && $bindings.containsKey($binding)) {
258             getDataBinding($binding).removeDataBinding();
259         }
260     }
261 
262     /*-----------------------------------------------------------------------*/
263     /*--------------------- JAXXContext implementation  ---------------------*/
264     /*-----------------------------------------------------------------------*/
265 
266     @Override
267     public <T> T getContextValue(Class<T> clazz) {
268         return delegateContext.getContextValue(clazz, null);
269     }
270 
271     @Override
272     public <T> T getContextValue(Class<T> clazz, String name) {
273         return delegateContext.getContextValue(clazz, name);
274     }
275 
276     @Override
277     public JAXXContext getDelegateContext() {
278         return delegateContext;
279     }
280 
281     @Override
282     public <O extends Container> O getParentContainer(Class<O> clazz) {
283         return SwingUtil.getParentContainer(this, clazz);
284     }
285 
286     @Override
287     public <O extends Container> O getParentContainer(Object source, Class<O> clazz) {
288         return SwingUtil.getParentContainer(source, clazz);
289     }
290 
291     @Override
292     public <T> void removeContextValue(Class<T> clazz) {
293         delegateContext.removeContextValue(clazz, null);
294     }
295 
296     @Override
297     public <T> void removeContextValue(Class<T> clazz, String name) {
298         delegateContext.removeContextValue(clazz, name);
299     }
300 
301     @Override
302     public <T> void setContextValue(T o) {
303         delegateContext.setContextValue(o, null);
304     }
305 
306     @Override
307     public <T> void setContextValue(T o, String name) {
308         delegateContext.setContextValue(o, name);
309     }
310 
311     /*-----------------------------------------------------------------------*/
312     /*---------------------------- Event methods ----------------------------*/
313     /*-----------------------------------------------------------------------*/
314 
315     public void doKeyPressed__on__navigation(KeyEvent event) {
316         if (log.isDebugEnabled()) {
317             log.debug(event);
318         }
319         handler.openNodeMenu(event, menuPopup);
320     }
321 
322     public void doMouseClicked__on__navigation(MouseEvent event) {
323         if (log.isDebugEnabled()) {
324             log.debug(event);
325         }
326         handler.autoSelectNode(event, menuPopup);
327     }
328 
329     /*-----------------------------------------------------------------------*/
330     /*----------------------- Public acessor methods  -----------------------*/
331     /*-----------------------------------------------------------------------*/
332 
333     public TuttiHelpBroker getBroker() {
334         return broker;
335     }
336 
337     public EditCruiseUI getCruisePanel() {
338         return cruisePanel;
339     }
340 
341     public JPanel getEditPanel() {
342         return editPanel;
343     }
344 
345     public CardLayout2Ext getEditPanelLayout() {
346         return editPanelLayout;
347     }
348 
349     public JButton getExportButton() {
350         return exportButton;
351     }
352 
353     public JMenuItem getExportOperationMessagesItem() {
354         return exportOperationMessagesItem;
355     }
356 
357     public ValidateCruiseUIHandler getHandler() {
358         return handler;
359     }
360 
361     public JPopupMenu getMenuPopup() {
362         return menuPopup;
363     }
364 
365     public ValidateCruiseUIModel getModel() {
366         return model;
367     }
368 
369     public JTree getNavigation() {
370         return navigation;
371     }
372 
373     public JScrollPane getNavigationPanel() {
374         return navigationPanel;
375     }
376 
377     public JXTitledPanel getNavigationTitledPanel() {
378         return navigationTitledPanel;
379     }
380 
381     public FishingOperationsUI getOperationPanel() {
382         return operationPanel;
383     }
384 
385     public JButton getReadyToSynchButton() {
386         return readyToSynchButton;
387     }
388 
389     public JToolBar getTopToolBar() {
390         return topToolBar;
391     }
392 
393     /*-----------------------------------------------------------------------*/
394     /*---------------------------- Other methods ----------------------------*/
395     /*-----------------------------------------------------------------------*/
396 
397     @Override
398     public void registerHelpId(TuttiHelpBroker broker, Component component, String helpId) {
399         broker.installUI(component, helpId);
400     }
401 
402     @Override
403     public void showHelp(String helpId) {
404         getBroker().showHelp(this, helpId);
405     }
406 
407     /*-----------------------------------------------------------------------*/
408     /*--------------------- Protected acessors methods  ---------------------*/
409     /*-----------------------------------------------------------------------*/
410 
411     protected JPanel get$JPanel0() {
412         return $JPanel0;
413     }
414 
415     /*-----------------------------------------------------------------------*/
416     /*--------------------- Components creation methods ---------------------*/
417     /*-----------------------------------------------------------------------*/
418 
419     protected void addChildrenToEditPanel() {
420         if (!allComponentsCreated) {
421             return;
422         }
423         editPanel.add(operationPanel, "fishingOperation");
424         editPanel.add(cruisePanel, "cruise");
425     }
426 
427     protected void addChildrenToMenuPopup() {
428         if (!allComponentsCreated) {
429             return;
430         }
431         menuPopup.add(exportOperationMessagesItem);
432     }
433 
434     protected void addChildrenToNavigationPanel() {
435         if (!allComponentsCreated) {
436             return;
437         }
438         navigationPanel.getViewport().add(navigation);
439     }
440 
441     protected void addChildrenToNavigationTitledPanel() {
442         if (!allComponentsCreated) {
443             return;
444         }
445         navigationTitledPanel.add(topToolBar);
446         navigationTitledPanel.add($JPanel0);
447     }
448 
449     protected void addChildrenToSplitPane() {
450         if (!allComponentsCreated) {
451             return;
452         }
453         add(navigationTitledPanel, JSplitPane.LEFT);
454         add(editPanel, JSplitPane.RIGHT);
455     }
456 
457     protected void addChildrenToTopToolBar() {
458         if (!allComponentsCreated) {
459             return;
460         }
461         topToolBar.add(exportButton);
462     }
463 
464     protected void createBroker() {
465         $objectMap.put("broker", broker = new TuttiHelpBroker("tutti.validateCruise.help"));
466     }
467 
468     protected void createCruisePanel() {
469         $objectMap.put("cruisePanel", cruisePanel = new EditCruiseUI(this));
470         
471         cruisePanel.setName("cruisePanel");
472     }
473 
474     protected void createEditPanel() {
475         $objectMap.put("editPanel", editPanel = new JPanel());
476         
477         editPanel.setName("editPanel");
478         editPanel.setLayout(editPanelLayout);
479     }
480 
481     protected void createEditPanelLayout() {
482         $objectMap.put("editPanelLayout", editPanelLayout = new CardLayout2Ext(this, "editPanel"));
483     }
484 
485     protected void createExportButton() {
486         $objectMap.put("exportButton", exportButton = new JButton());
487         
488         exportButton.setName("exportButton");
489         exportButton.setToolTipText(t("tutti.validateCruise.navigation.action.export.all.tip"));
490         exportButton.putClientProperty("help", "tutti.validateCruise.navigation.action.export.all.help");
491         exportButton.putClientProperty("applicationAction", fr.ifremer.tutti.ui.swing.content.validation.actions.ExportCruiseValidationMessagesAction.class);
492     }
493 
494     protected void createExportOperationMessagesItem() {
495         $objectMap.put("exportOperationMessagesItem", exportOperationMessagesItem = new JMenuItem());
496         
497         exportOperationMessagesItem.setName("exportOperationMessagesItem");
498         exportOperationMessagesItem.setText(t("tutti.validateCruise.navigation.action.export.operation"));
499         exportOperationMessagesItem.setToolTipText(t("tutti.validateCruise.navigation.action.export.operation.tip"));
500         exportOperationMessagesItem.putClientProperty("help", "tutti.validateCruise.navigation.action.export.operation.help");
501         exportOperationMessagesItem.putClientProperty("applicationAction", fr.ifremer.tutti.ui.swing.content.validation.actions.ExportOperationValidationMessagesAction.class);
502     }
503 
504     protected ValidateCruiseUIHandler createHandler() {
505         return new ValidateCruiseUIHandler();
506     }
507 
508     protected void createMenuPopup() {
509         $objectMap.put("menuPopup", menuPopup = new JPopupMenu());
510         
511         menuPopup.setName("menuPopup");
512         menuPopup.setLabel("tutti.editAccidentalBatch.title.batchActions");
513     }
514 
515     protected void createModel() {
516         $objectMap.put("model", model = getContextValue(ValidateCruiseUIModel.class));
517     }
518 
519     protected void createNavigation() {
520         $objectMap.put("navigation", navigation = new JTree());
521         
522         navigation.setName("navigation");
523         navigation.setRootVisible(false);
524         navigation.addKeyListener(JAXXUtil.getEventListener(KeyListener.class, "keyPressed", this, "doKeyPressed__on__navigation"));
525         navigation.addMouseListener(JAXXUtil.getEventListener(MouseListener.class, "mouseClicked", this, "doMouseClicked__on__navigation"));
526     }
527 
528     protected void createNavigationPanel() {
529         $objectMap.put("navigationPanel", navigationPanel = new JScrollPane());
530         
531         navigationPanel.setName("navigationPanel");
532     }
533 
534     protected void createNavigationTitledPanel() {
535         $objectMap.put("navigationTitledPanel", navigationTitledPanel = new JXTitledPanel());
536         
537         navigationTitledPanel.setName("navigationTitledPanel");
538         navigationTitledPanel.setTitle(t("tutti.validateCruise.navigation.title"));
539     }
540 
541     protected void createOperationPanel() {
542         $objectMap.put("operationPanel", operationPanel = new FishingOperationsUI(this));
543         
544         operationPanel.setName("operationPanel");
545     }
546 
547     protected void createReadyToSynchButton() {
548         $objectMap.put("readyToSynchButton", readyToSynchButton = new JButton());
549         
550         readyToSynchButton.setName("readyToSynchButton");
551         readyToSynchButton.setText(t("tutti.validateCruise.navigation.action.readyToSynch"));
552         readyToSynchButton.setToolTipText(t("tutti.validateCruise.navigation.action.readyToSynch.tip"));
553         SwingUtil.setComponentHeight(readyToSynchButton,50);
554         readyToSynchButton.putClientProperty("help", "tutti.validateCruise.navigation.action.readyToSynch.help");
555         readyToSynchButton.putClientProperty("applicationAction", fr.ifremer.tutti.ui.swing.content.validation.actions.SaveCruiseToReadyToSynchAction.class);
556     }
557 
558     protected void createTopToolBar() {
559         $objectMap.put("topToolBar", topToolBar = new JToolBar());
560         
561         topToolBar.setName("topToolBar");
562         topToolBar.setBorderPainted(false);
563         topToolBar.setOpaque(false);
564         topToolBar.setFloatable(false);
565     }
566 
567     /*-----------------------------------------------------------------------*/
568     /*------------------------ Internal jaxx methods ------------------------*/
569     /*-----------------------------------------------------------------------*/
570 
571     private void $completeSetup() {
572         allComponentsCreated = true;
573         if (log.isDebugEnabled()) {
574             log.debug(this);
575         }
576         addChildrenToSplitPane();
577         addChildrenToNavigationTitledPanel();
578         addChildrenToTopToolBar();
579         addChildrenToMenuPopup();
580         // inline complete setup of $JPanel0
581         $JPanel0.add(navigationPanel, BorderLayout.CENTER);
582         $JPanel0.add(readyToSynchButton, BorderLayout.SOUTH);
583         addChildrenToNavigationPanel();
584         addChildrenToEditPanel();
585         
586         // apply 2 data bindings
587         JAXXUtil.applyDataBinding(this, $bindings.keySet());
588         
589         // apply 9 property setters
590         navigationTitledPanel.setBorder(null);
591         navigationTitledPanel.setRightDecoration(topToolBar);
592         exportButton.setIcon(SwingUtil.createActionIcon("export"));
593         exportOperationMessagesItem.setMnemonic(SwingUtil.getFirstCharAt(t("tutti.validateCruise.navigation.action.export.operation.mnemonic"),'Z'));
594         exportOperationMessagesItem.setIcon(SwingUtil.createActionIcon("export"));
595         readyToSynchButton.setMnemonic(SwingUtil.getFirstCharAt(t("tutti.validateCruise.navigation.action.readyToSynch.mnemonic"),'Z'));
596         readyToSynchButton.setIcon(SwingUtil.createActionIcon("time"));
597         // late initializer
598         // help broker setup
599         TuttiHelpBroker _broker = getBroker();
600         registerHelpId(_broker, exportButton, "tutti.validateCruise.navigation.action.export.all.help");
601         registerHelpId(_broker, exportOperationMessagesItem, "tutti.validateCruise.navigation.action.export.operation.help");
602         registerHelpId(_broker, readyToSynchButton, "tutti.validateCruise.navigation.action.readyToSynch.help");
603         _broker.prepareUI(this);
604     }
605 
606     private void $initialize() {
607         if (allComponentsCreated) {
608             return;
609         }
610         if (log.isDebugEnabled()) {
611             log.debug(this);
612         }
613         handler.beforeInit(this);
614         $objectMap.put("splitPane", splitPane);
615         createModel();
616         createBroker();
617         createNavigationTitledPanel();
618         createTopToolBar();
619         createExportButton();
620         createMenuPopup();
621         createExportOperationMessagesItem();
622         // inline creation of $JPanel0
623         $objectMap.put("$JPanel0", $JPanel0 = new JPanel());
624         
625         $JPanel0.setName("$JPanel0");
626         $JPanel0.setLayout(new BorderLayout());
627         createNavigationPanel();
628         createNavigation();
629         createReadyToSynchButton();
630         createEditPanelLayout();
631         createEditPanel();
632         createOperationPanel();
633         createCruisePanel();
634         // inline creation of splitPane
635         setName("splitPane");
636         
637         // registers 2 data bindings
638         $registerDefaultBindings();
639         $completeSetup();
640         handler.afterInit(this);
641     }
642 
643     private void $registerDefaultBindings() {
644         // register 2 data bindings
645         registerDataBinding(new DefaultJAXXBinding(this, BINDING_EXPORT_OPERATION_MESSAGES_ITEM_ENABLED, true) {
646         
647             @Override
648             public void applyDataBinding() {
649                 if (model != null) {
650                     model.addPropertyChangeListener("selectedFishingOperation", this);
651                 }
652             }
653         
654             @Override
655             public void processDataBinding() {
656                 if (model != null) {
657                     exportOperationMessagesItem.setEnabled(model.getSelectedFishingOperation() != null);
658                 }
659             }
660         
661             @Override
662             public void removeDataBinding() {
663                 if (model != null) {
664                     model.removePropertyChangeListener("selectedFishingOperation", this);
665                 }
666             }
667         });
668         registerDataBinding(new DefaultJAXXBinding(this, BINDING_READY_TO_SYNCH_BUTTON_ENABLED, true) {
669         
670             @Override
671             public void applyDataBinding() {
672                 if (model != null) {
673                     model.addPropertyChangeListener("readyToSynch", this);
674                 }
675             }
676         
677             @Override
678             public void processDataBinding() {
679                 if (model != null) {
680                     readyToSynchButton.setEnabled(model.isReadyToSynch());
681                 }
682             }
683         
684             @Override
685             public void removeDataBinding() {
686                 if (model != null) {
687                     model.removePropertyChangeListener("readyToSynch", this);
688                 }
689             }
690         });
691     }
692 
693 }