View Javadoc
1   package fr.ifremer.quadrige3.ui.swing.component.number;
2   
3   /*-
4    * #%L
5    * JAXX :: Widgets Number
6    * %%
7    * Copyright (C) 2008 - 2017 Code Lutin
8    * %%
9    * This program is free software: you can redistribute it and/or modify
10   * it under the terms of the GNU Affero General Public License as published by
11   * the Free Software Foundation, either version 3 of the License, or
12   * (at your option) any later version.
13   * 
14   * This program is distributed in the hope that it will be useful,
15   * but WITHOUT ANY WARRANTY; without even the implied warranty of
16   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17   * GNU General Public License for more details.
18   * 
19   * You should have received a copy of the GNU Affero General Public License
20   * along with this program.  If not, see <http://www.gnu.org/licenses/>.
21   * #L%
22   */
23  
24  import jaxx.runtime.*;
25  import jaxx.runtime.binding.DefaultJAXXBinding;
26  import jaxx.runtime.binding.SimpleJAXXObjectBinding;
27  import jaxx.runtime.context.DefaultJAXXContext;
28  import jaxx.runtime.css.DataBinding;
29  import jaxx.runtime.css.Pseudoclasses;
30  import org.apache.commons.logging.Log;
31  import org.apache.commons.logging.LogFactory;
32  
33  import javax.swing.*;
34  import javax.swing.event.PopupMenuEvent;
35  import javax.swing.event.PopupMenuListener;
36  import java.awt.*;
37  import java.awt.event.*;
38  import java.io.Serializable;
39  import java.util.List;
40  import java.util.*;
41  
42  import static org.nuiton.i18n.I18n.t;
43  
44  public class NumberEditor extends JPanel implements JAXXObject {
45  
46      /*-----------------------------------------------------------------------*/
47      /*---------------- Constants for all javaBean properties ----------------*/
48      /*-----------------------------------------------------------------------*/
49  
50      public static final String PROPERTY_AUTO_POPUP = "autoPopup";
51      public static final String PROPERTY_POPUP_VISIBLE = "popupVisible";
52      public static final String PROPERTY_SHOW_POPUP_BUTTON = "showPopupButton";
53      public static final String PROPERTY_SHOW_RESET = "showReset";
54  
55      /*-----------------------------------------------------------------------*/
56      /*------------------ Constants for all public bindings ------------------*/
57      /*-----------------------------------------------------------------------*/
58  
59      public static final String BINDING_CLEAR_ALL_BUTTON_ENABLED = "clearAllButton.enabled";
60      public static final String BINDING_DOT_BUTTON_ENABLED = "dotButton.enabled";
61      public static final String BINDING_LEFT_TOOLBAR_ENABLED = "leftToolbar.enabled";
62      public static final String BINDING_LEFT_TOOLBAR_VISIBLE = "leftToolbar.visible";
63      public static final String BINDING_RESET_BUTTON_ENABLED = "resetButton.enabled";
64      public static final String BINDING_RIGHT_TOOLBAR_ENABLED = "rightToolbar.enabled";
65      public static final String BINDING_RIGHT_TOOLBAR_VISIBLE = "rightToolbar.visible";
66      public static final String BINDING_SHOW_POP_UP_BUTTON_ENABLED = "showPopUpButton.enabled";
67      public static final String BINDING_TEXT_FIELD_ENABLED = "textField.enabled";
68      public static final String BINDING_TEXT_FIELD_TEXT = "textField.text";
69      public static final String BINDING_TOGGLE_SIGN_BUTTON_ENABLED = "toggleSignButton.enabled";
70  
71      /*-----------------------------------------------------------------------*/
72      /*------------------------- Other static fields -------------------------*/
73      /*-----------------------------------------------------------------------*/
74  
75      private static final String $jaxxObjectDescriptor = "H4sIAAAAAAAAAK1XS08cRxDuXbNgHn4HbMtY2sSWhRUzLHj9QFiODQYZC2xk8EPmkt6dZmmnd7rd0wNLkK38hPyE5J5LpNxyinLIOYdcovyFKPIh1yjVPTs7O8Ps7OA1ggW6q776uqq6qvqHv1HBlejT17jRsKTnKFon1qP7L18+qbwmVfWAuFVJheIS+V+5PMpvomG7te4qdGlzRatPNdWnFnhdcIc4bdpzK2jIVXuMuNuEKIUuRjWqrju13tqeawhPBqgtUkmo373/J/+t/c33eYQaAthdhKMUu2mFJ+lbQXlqK3QaLO3gKYadGtCQ1KkB32N6bYFh132M6+QNeocGVlC/wBLAFPos+5ENhtFvCIWOXn60hh3CSgp9zmXNcjyquGMZ0rvUrhHlwlq9QqT12PxatEFACmEg+hUq1LlNmEKlQ2ivapUQYhB7iq9x4QGfU/qYlj66Nc85I9gJ5U6423zXyM17Cuzo5VNtMHr7KXGJim2MCK3znLq0wkhsryB8u2PabsNyd8Hb1iNjZJU4Xig4ZASNryBCUWm9qMXOtaSP+ae+5RNV6ExEIaR/ARjYtEZVTPF2KFJMk5vtJne8Cj6U9xlLEDRbMcByRsM3MsrdzEbwiUMq2QhOZzQ8k1Hueje5wcvNeJVCmVacB3yQUmf1k4rXaoys05pz0NJRLojEumwFxmyuMogd38GM2liRuGyL2DAjW2oDblAFS4U+iaSfXp7HUksOwhGIg+Fe2C1Nqa9QDHg1vGWKNNQSJcyOX5qNYKMD8Iikte2Ak1570kEwuOfPRHB9zsf4a4+GDF8IqLMXInUWKrgVVvCwxOY2UUF6sKzQuc2DRf8pbPnl/lys3GtAs/vf2Jk/fv7rp6Wgxl8C26OJom0tCmqvkDqIimrTJ/wC7ynKplaxmNuE2kUY9DfTv8YTiK03t4Ec2POLpFa3HmJ3GyAKA3/+8uvYl78fQfklNMQ4tpewll8G/25DQLc5sxvii3uG0cjuUfg8CT9H4BpUuLSJXMPUUQRiWtjCDOKP+rnAbzwSLgxuAazSgQrWGuCn8QQ/tchWBn/798z6j/cCX+WA+/mO4qG/Cq9QP3UYdYjpiM1ml9gBh4VLPJuHTS2pzSHd6IK0b5b0ivncOuCSXJiP4Jx96i76/0xcfdvwtIpjDqL/AlwhYunbCbZPOxBSedKlX4MD89Nls1D13HaPQpvZ4pLUJPccMN9XYToCI0YuFqEEMkClWapEpAp9VE4Dl0ql2dlS6QNpRUvZR2V2RGoaH+assNN0opSHK+FfFYUm9+fNX/4d27OqkkAtXqwLtedvTJSvFZvfV98CzQqufhXQPLa/wBmX1ouHyxuLCTkVGTVEhmzd8QcbKCuQrevBDJSYr9G+kAG8T1d7KPT7ZsqzYKDTVf45hrzsYCDsD93g8+3cR5vc28a7Ce264Tpu0LpXXzeJMLbvkN3iA6gcjktBYqZ8baaczCPSbbpRgXwbglgC5HJV95vTflsnZlqdNA0xOQGHFRjYoGLDuOliu5rlA1pG21IwhGfNzWgPPiz3sxHuVcyqHtMXLssBxpMOoLvxIfnHO3iGVGhmWoS9Fc5O7VU5yEbqLmDnmWv2O2TjgekrO5PjESZWO4HRGIEHvNN1C+e57IZHI4aD+b3d/tl2+wtNgQ4MYg+AnmjAlN5OYy6ZRvHKlWKrCOiSsQCPVLXGXarTCfbvFkspVMFINqq5WOJHCE8GE3Kioej4/KE5UUpLyldE8g4hab48SpmPmWh9OgV6ujfomRTomd6gr6dAX+8NupwCXe4N+kYK9I3eoG+mQN/sDfpWCvSt3qBvp0Df7g16NgV6NjP0sBkfd4keAvQgrd8/aUMglOo691zCd/SAl2F47t1G95nzgI1+h8s6Zoewkm3eBkP9DO9xT0fjDlRGXKxQx4bX9t0DtnL6c6hrCGA5p1/nOZ6MMJ5ltG1V19N3/PdgESslacVTpAOx+1nSjlZ5GrWVTId7l4LwtGeETUD4Hzq9EbANFwAA";
76      private static final Log log = LogFactory.getLog(NumberEditor.class);
77      private static final long serialVersionUID = 1L;
78  
79      /*-----------------------------------------------------------------------*/
80      /*--------------------------- Internal states ---------------------------*/
81      /*-----------------------------------------------------------------------*/
82  
83      protected List<Object> $activeBindings = new ArrayList<Object>();
84      protected Map<String, Object> $bindingSources = new HashMap<String, Object>();
85      protected final Map<String, JAXXBinding> $bindings = new TreeMap<String, JAXXBinding>();
86      protected Map<String, Object> $objectMap = new HashMap<String, Object>();
87      protected Map<?, ?> $previousValues = new HashMap<Object, Object>();
88      private boolean allComponentsCreated;
89      protected final JAXXContext delegateContext = new DefaultJAXXContext();
90  
91      /*-----------------------------------------------------------------------*/
92      /*------------------------ Protected components  ------------------------*/
93      /*-----------------------------------------------------------------------*/
94  
95      protected Boolean autoPopup;
96      protected JButton clearAllButton;
97      protected JButton clearOnebutton;
98      protected JButton dotButton;
99      protected final NumberEditorHandler handler = createHandler();
100     protected JToolBar leftToolbar;
101     protected NumberEditorModel model;
102     protected JButton number0;
103     protected JButton number1Button;
104     protected JButton number2Button;
105     protected JButton number3Button;
106     protected JButton number4Button;
107     protected JButton number5Button;
108     protected JButton number6Button;
109     protected JButton number7Button;
110     protected JButton number8Button;
111     protected JButton number9Button;
112     protected JPopupMenu popup;
113     protected JPanel popupPanel;
114     protected Boolean popupVisible;
115     protected JButton resetButton;
116     protected JToolBar rightToolbar;
117     protected JToggleButton showPopUpButton;
118     protected Boolean showPopupButton;
119     protected Boolean showReset;
120     protected JTextField textField;
121     protected JButton toggleSignButton;
122     protected JButton validateButton;
123 
124     /*-----------------------------------------------------------------------*/
125     /*------------------------- Private components  -------------------------*/
126     /*-----------------------------------------------------------------------*/
127 
128     private JButton $JButton0;
129     private NumberEditor $JPanel0 = this;
130 
131     /*-----------------------------------------------------------------------*/
132     /*---------------------- Raw body code from script ----------------------*/
133     /*-----------------------------------------------------------------------*/
134 
135     // Config delegate methods
136     public void setProperty(String property) { model.getConfig().setProperty(property); }
137     public void setUseSign(boolean useSign) { model.getConfig().setUseSign(useSign); }
138     public void setNumberType(Class<?> numberType) { model.getConfig().setNumberType(numberType); }
139     public void setSelectAllTextOnError(boolean selectAllTextOnError) { model.getConfig().setSelectAllTextOnError(selectAllTextOnError); }
140     
141     // Model delegate methods
142     public void setBean(Serializable bean) { model.setBean(bean); }
143     public void setNumberValue(Number numberValue) { model.setNumberValue(numberValue); }
144     public void setNumberPattern(String numberPattern) { model.setNumberPattern(numberPattern); }
145     
146     public void init() { handler.init(); }
147     
148     void showPopup() {
149        if ( popupVisible || autoPopup ) {
150            if (!popupVisible) {
151                setPopupVisible(true);
152            } else if (!getPopup().isVisible()) {
153                handler.setPopupVisible(true);
154            }
155        }
156     }
157     
158     @Override
159     public void setToolTipText(String toolTipText) {
160         super.setToolTipText(toolTipText);
161         textField.setToolTipText(toolTipText);
162     }
163 
164     /*-----------------------------------------------------------------------*/
165     /*---------------------------- Constructors  ----------------------------*/
166     /*-----------------------------------------------------------------------*/
167 
168     public NumberEditor(LayoutManager param0, boolean param1) {
169         super(param0 ,param1);
170         $initialize();
171     }
172 
173     public NumberEditor(JAXXContext parentContext, LayoutManager param1, boolean param2) {
174         super(param1 ,param2);
175         JAXXUtil.initContext(this, parentContext);
176         $initialize();
177     }
178 
179     public NumberEditor(LayoutManager param0) {
180         super(param0);
181         $initialize();
182     }
183 
184     public NumberEditor(JAXXContext parentContext, LayoutManager param1) {
185         super(param1);
186         JAXXUtil.initContext(this, parentContext);
187         $initialize();
188     }
189 
190     public NumberEditor() {
191         $initialize();
192     }
193 
194     public NumberEditor(JAXXContext parentContext) {
195         JAXXUtil.initContext(this, parentContext);
196         $initialize();
197     }
198 
199     public NumberEditor(boolean param0) {
200         super(param0);
201         $initialize();
202     }
203 
204     public NumberEditor(JAXXContext parentContext, boolean param1) {
205         super(param1);
206         JAXXUtil.initContext(this, parentContext);
207         $initialize();
208     }
209 
210     /*-----------------------------------------------------------------------*/
211     /*--------------------------- Statics methods ---------------------------*/
212     /*-----------------------------------------------------------------------*/
213 
214     public static JAXXObjectDescriptor $getJAXXObjectDescriptor() {
215         return JAXXUtil.decodeCompressedJAXXObjectDescriptor($jaxxObjectDescriptor);
216     }
217 
218     /*-----------------------------------------------------------------------*/
219     /*---------------------- JAXXObject implementation ----------------------*/
220     /*-----------------------------------------------------------------------*/
221 
222     @Override
223     public void applyDataBinding(String $binding) {
224         if (allComponentsCreated && $bindings.containsKey($binding)) {
225             getDataBinding($binding).applyDataBinding();
226         }
227         processDataBinding($binding);
228     }
229 
230     @Override
231     public void firePropertyChange(String propertyName, Object oldValue, Object newValue) {
232         super.firePropertyChange(propertyName, oldValue, newValue);
233     }
234 
235     @Override
236     public Map<String, Object> get$objectMap() {
237         return $objectMap;
238     }
239 
240     @Override
241     public JAXXBinding getDataBinding(String bindingId) {
242         return $bindings.get(bindingId);
243     }
244 
245     @Override
246     public JAXXBinding[] getDataBindings() {
247         return $bindings.values().toArray(new JAXXBinding[$bindings.size()]);
248     }
249 
250     @Override
251     public Object getObjectById(String id) {
252         return $objectMap.get(id);
253     }
254 
255     @Override
256     public void processDataBinding(String $binding, boolean $force) {
257         if (!$force && $activeBindings.contains($binding)) { 
258             return;
259         }
260         $activeBindings.add($binding);
261         try {
262             if (allComponentsCreated && $bindings.containsKey($binding)) {
263                 getDataBinding($binding).processDataBinding();
264             }
265         } finally {
266             $activeBindings.remove($binding);
267         }
268     }
269 
270     @Override
271     public void processDataBinding(String $binding) {
272         processDataBinding($binding, false);
273     }
274 
275     @Override
276     public void registerDataBinding(JAXXBinding binding) {
277         $bindings.put(binding.getId(), binding);
278     }
279 
280     @Override
281     public void removeDataBinding(String $binding) {
282         if (allComponentsCreated && $bindings.containsKey($binding)) {
283             getDataBinding($binding).removeDataBinding();
284         }
285     }
286 
287     /*-----------------------------------------------------------------------*/
288     /*--------------------- JAXXContext implementation  ---------------------*/
289     /*-----------------------------------------------------------------------*/
290 
291     @Override
292     public <T> T getContextValue(Class<T> clazz) {
293         return delegateContext.getContextValue(clazz, null);
294     }
295 
296     @Override
297     public <T> T getContextValue(Class<T> clazz, String name) {
298         return delegateContext.getContextValue(clazz, name);
299     }
300 
301     @Override
302     public JAXXContext getDelegateContext() {
303         return delegateContext;
304     }
305 
306     @Override
307     public <O extends Container> O getParentContainer(Class<O> clazz) {
308         return SwingUtil.getParentContainer(this, clazz);
309     }
310 
311     @Override
312     public <O extends Container> O getParentContainer(Object source, Class<O> clazz) {
313         return SwingUtil.getParentContainer(source, clazz);
314     }
315 
316     @Override
317     public <T> void removeContextValue(Class<T> clazz) {
318         delegateContext.removeContextValue(clazz, null);
319     }
320 
321     @Override
322     public <T> void removeContextValue(Class<T> clazz, String name) {
323         delegateContext.removeContextValue(clazz, name);
324     }
325 
326     @Override
327     public <T> void setContextValue(T o) {
328         delegateContext.setContextValue(o, null);
329     }
330 
331     @Override
332     public <T> void setContextValue(T o, String name) {
333         delegateContext.setContextValue(o, name);
334     }
335 
336     /*-----------------------------------------------------------------------*/
337     /*---------------------------- Event methods ----------------------------*/
338     /*-----------------------------------------------------------------------*/
339 
340     public void doActionPerformed__on__clearAllButton(ActionEvent event) {
341         if (log.isDebugEnabled()) {
342             log.debug(event);
343         }
344         handler.reset();
345     }
346 
347     public void doActionPerformed__on__clearOnebutton(ActionEvent event) {
348         if (log.isDebugEnabled()) {
349             log.debug(event);
350         }
351         handler.removeChar();
352     }
353 
354     public void doActionPerformed__on__dotButton(ActionEvent event) {
355         if (log.isDebugEnabled()) {
356             log.debug(event);
357         }
358         handler.addChar('.');
359     }
360 
361     public void doActionPerformed__on__number0(ActionEvent event) {
362         if (log.isDebugEnabled()) {
363             log.debug(event);
364         }
365         handler.addChar('0');
366     }
367 
368     public void doActionPerformed__on__number1Button(ActionEvent event) {
369         if (log.isDebugEnabled()) {
370             log.debug(event);
371         }
372         handler.addChar('1');
373     }
374 
375     public void doActionPerformed__on__number2Button(ActionEvent event) {
376         if (log.isDebugEnabled()) {
377             log.debug(event);
378         }
379         handler.addChar('2');
380     }
381 
382     public void doActionPerformed__on__number3Button(ActionEvent event) {
383         if (log.isDebugEnabled()) {
384             log.debug(event);
385         }
386         handler.addChar('3');
387     }
388 
389     public void doActionPerformed__on__number4Button(ActionEvent event) {
390         if (log.isDebugEnabled()) {
391             log.debug(event);
392         }
393         handler.addChar('4');
394     }
395 
396     public void doActionPerformed__on__number5Button(ActionEvent event) {
397         if (log.isDebugEnabled()) {
398             log.debug(event);
399         }
400         handler.addChar('5');
401     }
402 
403     public void doActionPerformed__on__number6Button(ActionEvent event) {
404         if (log.isDebugEnabled()) {
405             log.debug(event);
406         }
407         handler.addChar('6');
408     }
409 
410     public void doActionPerformed__on__number7Button(ActionEvent event) {
411         if (log.isDebugEnabled()) {
412             log.debug(event);
413         }
414         handler.addChar('7');
415     }
416 
417     public void doActionPerformed__on__number8Button(ActionEvent event) {
418         if (log.isDebugEnabled()) {
419             log.debug(event);
420         }
421         handler.addChar('8');
422     }
423 
424     public void doActionPerformed__on__number9Button(ActionEvent event) {
425         if (log.isDebugEnabled()) {
426             log.debug(event);
427         }
428         handler.addChar('9');
429     }
430 
431     public void doActionPerformed__on__resetButton(ActionEvent event) {
432         if (log.isDebugEnabled()) {
433             log.debug(event);
434         }
435         handler.reset();
436     }
437 
438     public void doActionPerformed__on__showPopUpButton(ActionEvent event) {
439         if (log.isDebugEnabled()) {
440             log.debug(event);
441         }
442         handler.setPopupVisible(!popup.isVisible());
443     }
444 
445     public void doActionPerformed__on__toggleSignButton(ActionEvent event) {
446         if (log.isDebugEnabled()) {
447             log.debug(event);
448         }
449         handler.toggleSign();
450     }
451 
452     public void doActionPerformed__on__validateButton(ActionEvent event) {
453         if (log.isDebugEnabled()) {
454             log.debug(event);
455         }
456         handler.validate();
457     }
458 
459     public void doFocusGained__on__$JPanel0(FocusEvent event) {
460         if (log.isDebugEnabled()) {
461             log.debug(event);
462         }
463         textField.requestFocus();
464     }
465 
466     public void doFocusGained__on__textField(FocusEvent event) {
467         if (log.isDebugEnabled()) {
468             log.debug(event);
469         }
470         showPopup();
471     }
472 
473     public void doFocusLost__on__$JPanel0(FocusEvent event) {
474         if (log.isDebugEnabled()) {
475             log.debug(event);
476         }
477         setPopupVisible(false);popup.setVisible(false);
478     }
479 
480     public void doKeyReleased__on__textField(KeyEvent event) {
481         if (log.isDebugEnabled()) {
482             log.debug(event);
483         }
484         handler.setTextValue(textField.getText());
485     }
486 
487     public void doMouseEntered__on__clearAllButton(MouseEvent event) {
488         if (log.isDebugEnabled()) {
489             log.debug(event);
490         }
491         Object value = Pseudoclasses.applyProperty(NumberEditor.this, clearAllButton, "font-weight", "bold", Pseudoclasses.wrap((clearAllButton.getFont().getStyle() & Font.BOLD) != 0 ? "bold" : "normal"), 0);
492         if (!(value instanceof DataBinding)) {
493             if (clearAllButton.getFont() != null) {
494             if (((String) value).equals("bold")) {
495                 clearAllButton.setFont(clearAllButton.getFont().deriveFont(clearAllButton.getFont().getStyle() | Font.BOLD));
496             } else {
497                 clearAllButton.setFont(clearAllButton.getFont().deriveFont(clearAllButton.getFont().getStyle() & ~Font.BOLD));
498             }
499         }
500         }
501     }
502 
503     public void doMouseEntered__on__clearOnebutton(MouseEvent event) {
504         if (log.isDebugEnabled()) {
505             log.debug(event);
506         }
507         Object value = Pseudoclasses.applyProperty(NumberEditor.this, clearOnebutton, "font-weight", "bold", Pseudoclasses.wrap((clearOnebutton.getFont().getStyle() & Font.BOLD) != 0 ? "bold" : "normal"), 0);
508         if (!(value instanceof DataBinding)) {
509             if (clearOnebutton.getFont() != null) {
510             if (((String) value).equals("bold")) {
511                 clearOnebutton.setFont(clearOnebutton.getFont().deriveFont(clearOnebutton.getFont().getStyle() | Font.BOLD));
512             } else {
513                 clearOnebutton.setFont(clearOnebutton.getFont().deriveFont(clearOnebutton.getFont().getStyle() & ~Font.BOLD));
514             }
515         }
516         }
517     }
518 
519     public void doMouseEntered__on__dotButton(MouseEvent event) {
520         if (log.isDebugEnabled()) {
521             log.debug(event);
522         }
523         Object value = Pseudoclasses.applyProperty(NumberEditor.this, dotButton, "font-weight", "normal", Pseudoclasses.wrap((dotButton.getFont().getStyle() & Font.BOLD) != 0 ? "bold" : "normal"), 0);
524         if (!(value instanceof DataBinding)) {
525             if (dotButton.getFont() != null) {
526             if (((String) value).equals("bold")) {
527                 dotButton.setFont(dotButton.getFont().deriveFont(dotButton.getFont().getStyle() | Font.BOLD));
528             } else {
529                 dotButton.setFont(dotButton.getFont().deriveFont(dotButton.getFont().getStyle() & ~Font.BOLD));
530             }
531         }
532         }
533     }
534 
535     public void doMouseEntered__on__number0(MouseEvent event) {
536         if (log.isDebugEnabled()) {
537             log.debug(event);
538         }
539         Object value = Pseudoclasses.applyProperty(NumberEditor.this, number0, "font-weight", "bold", Pseudoclasses.wrap((number0.getFont().getStyle() & Font.BOLD) != 0 ? "bold" : "normal"), 0);
540         if (!(value instanceof DataBinding)) {
541             if (number0.getFont() != null) {
542             if (((String) value).equals("bold")) {
543                 number0.setFont(number0.getFont().deriveFont(number0.getFont().getStyle() | Font.BOLD));
544             } else {
545                 number0.setFont(number0.getFont().deriveFont(number0.getFont().getStyle() & ~Font.BOLD));
546             }
547         }
548         }
549     }
550 
551     public void doMouseEntered__on__number1Button(MouseEvent event) {
552         if (log.isDebugEnabled()) {
553             log.debug(event);
554         }
555         Object value = Pseudoclasses.applyProperty(NumberEditor.this, number1Button, "font-weight", "bold", Pseudoclasses.wrap((number1Button.getFont().getStyle() & Font.BOLD) != 0 ? "bold" : "normal"), 0);
556         if (!(value instanceof DataBinding)) {
557             if (number1Button.getFont() != null) {
558             if (((String) value).equals("bold")) {
559                 number1Button.setFont(number1Button.getFont().deriveFont(number1Button.getFont().getStyle() | Font.BOLD));
560             } else {
561                 number1Button.setFont(number1Button.getFont().deriveFont(number1Button.getFont().getStyle() & ~Font.BOLD));
562             }
563         }
564         }
565     }
566 
567     public void doMouseEntered__on__number2Button(MouseEvent event) {
568         if (log.isDebugEnabled()) {
569             log.debug(event);
570         }
571         Object value = Pseudoclasses.applyProperty(NumberEditor.this, number2Button, "font-weight", "bold", Pseudoclasses.wrap((number2Button.getFont().getStyle() & Font.BOLD) != 0 ? "bold" : "normal"), 0);
572         if (!(value instanceof DataBinding)) {
573             if (number2Button.getFont() != null) {
574             if (((String) value).equals("bold")) {
575                 number2Button.setFont(number2Button.getFont().deriveFont(number2Button.getFont().getStyle() | Font.BOLD));
576             } else {
577                 number2Button.setFont(number2Button.getFont().deriveFont(number2Button.getFont().getStyle() & ~Font.BOLD));
578             }
579         }
580         }
581     }
582 
583     public void doMouseEntered__on__number3Button(MouseEvent event) {
584         if (log.isDebugEnabled()) {
585             log.debug(event);
586         }
587         Object value = Pseudoclasses.applyProperty(NumberEditor.this, number3Button, "font-weight", "bold", Pseudoclasses.wrap((number3Button.getFont().getStyle() & Font.BOLD) != 0 ? "bold" : "normal"), 0);
588         if (!(value instanceof DataBinding)) {
589             if (number3Button.getFont() != null) {
590             if (((String) value).equals("bold")) {
591                 number3Button.setFont(number3Button.getFont().deriveFont(number3Button.getFont().getStyle() | Font.BOLD));
592             } else {
593                 number3Button.setFont(number3Button.getFont().deriveFont(number3Button.getFont().getStyle() & ~Font.BOLD));
594             }
595         }
596         }
597     }
598 
599     public void doMouseEntered__on__number4Button(MouseEvent event) {
600         if (log.isDebugEnabled()) {
601             log.debug(event);
602         }
603         Object value = Pseudoclasses.applyProperty(NumberEditor.this, number4Button, "font-weight", "bold", Pseudoclasses.wrap((number4Button.getFont().getStyle() & Font.BOLD) != 0 ? "bold" : "normal"), 0);
604         if (!(value instanceof DataBinding)) {
605             if (number4Button.getFont() != null) {
606             if (((String) value).equals("bold")) {
607                 number4Button.setFont(number4Button.getFont().deriveFont(number4Button.getFont().getStyle() | Font.BOLD));
608             } else {
609                 number4Button.setFont(number4Button.getFont().deriveFont(number4Button.getFont().getStyle() & ~Font.BOLD));
610             }
611         }
612         }
613     }
614 
615     public void doMouseEntered__on__number5Button(MouseEvent event) {
616         if (log.isDebugEnabled()) {
617             log.debug(event);
618         }
619         Object value = Pseudoclasses.applyProperty(NumberEditor.this, number5Button, "font-weight", "bold", Pseudoclasses.wrap((number5Button.getFont().getStyle() & Font.BOLD) != 0 ? "bold" : "normal"), 0);
620         if (!(value instanceof DataBinding)) {
621             if (number5Button.getFont() != null) {
622             if (((String) value).equals("bold")) {
623                 number5Button.setFont(number5Button.getFont().deriveFont(number5Button.getFont().getStyle() | Font.BOLD));
624             } else {
625                 number5Button.setFont(number5Button.getFont().deriveFont(number5Button.getFont().getStyle() & ~Font.BOLD));
626             }
627         }
628         }
629     }
630 
631     public void doMouseEntered__on__number6Button(MouseEvent event) {
632         if (log.isDebugEnabled()) {
633             log.debug(event);
634         }
635         Object value = Pseudoclasses.applyProperty(NumberEditor.this, number6Button, "font-weight", "bold", Pseudoclasses.wrap((number6Button.getFont().getStyle() & Font.BOLD) != 0 ? "bold" : "normal"), 0);
636         if (!(value instanceof DataBinding)) {
637             if (number6Button.getFont() != null) {
638             if (((String) value).equals("bold")) {
639                 number6Button.setFont(number6Button.getFont().deriveFont(number6Button.getFont().getStyle() | Font.BOLD));
640             } else {
641                 number6Button.setFont(number6Button.getFont().deriveFont(number6Button.getFont().getStyle() & ~Font.BOLD));
642             }
643         }
644         }
645     }
646 
647     public void doMouseEntered__on__number7Button(MouseEvent event) {
648         if (log.isDebugEnabled()) {
649             log.debug(event);
650         }
651         Object value = Pseudoclasses.applyProperty(NumberEditor.this, number7Button, "font-weight", "bold", Pseudoclasses.wrap((number7Button.getFont().getStyle() & Font.BOLD) != 0 ? "bold" : "normal"), 0);
652         if (!(value instanceof DataBinding)) {
653             if (number7Button.getFont() != null) {
654             if (((String) value).equals("bold")) {
655                 number7Button.setFont(number7Button.getFont().deriveFont(number7Button.getFont().getStyle() | Font.BOLD));
656             } else {
657                 number7Button.setFont(number7Button.getFont().deriveFont(number7Button.getFont().getStyle() & ~Font.BOLD));
658             }
659         }
660         }
661     }
662 
663     public void doMouseEntered__on__number8Button(MouseEvent event) {
664         if (log.isDebugEnabled()) {
665             log.debug(event);
666         }
667         Object value = Pseudoclasses.applyProperty(NumberEditor.this, number8Button, "font-weight", "bold", Pseudoclasses.wrap((number8Button.getFont().getStyle() & Font.BOLD) != 0 ? "bold" : "normal"), 0);
668         if (!(value instanceof DataBinding)) {
669             if (number8Button.getFont() != null) {
670             if (((String) value).equals("bold")) {
671                 number8Button.setFont(number8Button.getFont().deriveFont(number8Button.getFont().getStyle() | Font.BOLD));
672             } else {
673                 number8Button.setFont(number8Button.getFont().deriveFont(number8Button.getFont().getStyle() & ~Font.BOLD));
674             }
675         }
676         }
677     }
678 
679     public void doMouseEntered__on__number9Button(MouseEvent event) {
680         if (log.isDebugEnabled()) {
681             log.debug(event);
682         }
683         Object value = Pseudoclasses.applyProperty(NumberEditor.this, number9Button, "font-weight", "bold", Pseudoclasses.wrap((number9Button.getFont().getStyle() & Font.BOLD) != 0 ? "bold" : "normal"), 0);
684         if (!(value instanceof DataBinding)) {
685             if (number9Button.getFont() != null) {
686             if (((String) value).equals("bold")) {
687                 number9Button.setFont(number9Button.getFont().deriveFont(number9Button.getFont().getStyle() | Font.BOLD));
688             } else {
689                 number9Button.setFont(number9Button.getFont().deriveFont(number9Button.getFont().getStyle() & ~Font.BOLD));
690             }
691         }
692         }
693     }
694 
695     public void doMouseEntered__on__toggleSignButton(MouseEvent event) {
696         if (log.isDebugEnabled()) {
697             log.debug(event);
698         }
699         Object value = Pseudoclasses.applyProperty(NumberEditor.this, toggleSignButton, "font-weight", "normal", Pseudoclasses.wrap((toggleSignButton.getFont().getStyle() & Font.BOLD) != 0 ? "bold" : "normal"), 0);
700         if (!(value instanceof DataBinding)) {
701             if (toggleSignButton.getFont() != null) {
702             if (((String) value).equals("bold")) {
703                 toggleSignButton.setFont(toggleSignButton.getFont().deriveFont(toggleSignButton.getFont().getStyle() | Font.BOLD));
704             } else {
705                 toggleSignButton.setFont(toggleSignButton.getFont().deriveFont(toggleSignButton.getFont().getStyle() & ~Font.BOLD));
706             }
707         }
708         }
709     }
710 
711     public void doMouseExited__on__$JPanel0(MouseEvent event) {
712         if (log.isDebugEnabled()) {
713             log.debug(event);
714         }
715         setPopupVisible(false);popup.setVisible(false);
716     }
717 
718     public void doMouseExited__on__clearAllButton(MouseEvent event) {
719         if (log.isDebugEnabled()) {
720             log.debug(event);
721         }
722         Object value = Pseudoclasses.removeProperty(NumberEditor.this, clearAllButton, "font-weight", "bold", Pseudoclasses.wrap((clearAllButton.getFont().getStyle() & Font.BOLD) != 0 ? "bold" : "normal"), 0);
723         if (!(value instanceof DataBinding)) {
724             if (clearAllButton.getFont() != null) {
725             if (((String) value).equals("bold")) {
726                 clearAllButton.setFont(clearAllButton.getFont().deriveFont(clearAllButton.getFont().getStyle() | Font.BOLD));
727             } else {
728                 clearAllButton.setFont(clearAllButton.getFont().deriveFont(clearAllButton.getFont().getStyle() & ~Font.BOLD));
729             }
730         }
731         }
732     }
733 
734     public void doMouseExited__on__clearOnebutton(MouseEvent event) {
735         if (log.isDebugEnabled()) {
736             log.debug(event);
737         }
738         Object value = Pseudoclasses.removeProperty(NumberEditor.this, clearOnebutton, "font-weight", "bold", Pseudoclasses.wrap((clearOnebutton.getFont().getStyle() & Font.BOLD) != 0 ? "bold" : "normal"), 0);
739         if (!(value instanceof DataBinding)) {
740             if (clearOnebutton.getFont() != null) {
741             if (((String) value).equals("bold")) {
742                 clearOnebutton.setFont(clearOnebutton.getFont().deriveFont(clearOnebutton.getFont().getStyle() | Font.BOLD));
743             } else {
744                 clearOnebutton.setFont(clearOnebutton.getFont().deriveFont(clearOnebutton.getFont().getStyle() & ~Font.BOLD));
745             }
746         }
747         }
748     }
749 
750     public void doMouseExited__on__dotButton(MouseEvent event) {
751         if (log.isDebugEnabled()) {
752             log.debug(event);
753         }
754         Object value = Pseudoclasses.removeProperty(NumberEditor.this, dotButton, "font-weight", "normal", Pseudoclasses.wrap((dotButton.getFont().getStyle() & Font.BOLD) != 0 ? "bold" : "normal"), 0);
755         if (!(value instanceof DataBinding)) {
756             if (dotButton.getFont() != null) {
757             if (((String) value).equals("bold")) {
758                 dotButton.setFont(dotButton.getFont().deriveFont(dotButton.getFont().getStyle() | Font.BOLD));
759             } else {
760                 dotButton.setFont(dotButton.getFont().deriveFont(dotButton.getFont().getStyle() & ~Font.BOLD));
761             }
762         }
763         }
764     }
765 
766     public void doMouseExited__on__number0(MouseEvent event) {
767         if (log.isDebugEnabled()) {
768             log.debug(event);
769         }
770         Object value = Pseudoclasses.removeProperty(NumberEditor.this, number0, "font-weight", "bold", Pseudoclasses.wrap((number0.getFont().getStyle() & Font.BOLD) != 0 ? "bold" : "normal"), 0);
771         if (!(value instanceof DataBinding)) {
772             if (number0.getFont() != null) {
773             if (((String) value).equals("bold")) {
774                 number0.setFont(number0.getFont().deriveFont(number0.getFont().getStyle() | Font.BOLD));
775             } else {
776                 number0.setFont(number0.getFont().deriveFont(number0.getFont().getStyle() & ~Font.BOLD));
777             }
778         }
779         }
780     }
781 
782     public void doMouseExited__on__number1Button(MouseEvent event) {
783         if (log.isDebugEnabled()) {
784             log.debug(event);
785         }
786         Object value = Pseudoclasses.removeProperty(NumberEditor.this, number1Button, "font-weight", "bold", Pseudoclasses.wrap((number1Button.getFont().getStyle() & Font.BOLD) != 0 ? "bold" : "normal"), 0);
787         if (!(value instanceof DataBinding)) {
788             if (number1Button.getFont() != null) {
789             if (((String) value).equals("bold")) {
790                 number1Button.setFont(number1Button.getFont().deriveFont(number1Button.getFont().getStyle() | Font.BOLD));
791             } else {
792                 number1Button.setFont(number1Button.getFont().deriveFont(number1Button.getFont().getStyle() & ~Font.BOLD));
793             }
794         }
795         }
796     }
797 
798     public void doMouseExited__on__number2Button(MouseEvent event) {
799         if (log.isDebugEnabled()) {
800             log.debug(event);
801         }
802         Object value = Pseudoclasses.removeProperty(NumberEditor.this, number2Button, "font-weight", "bold", Pseudoclasses.wrap((number2Button.getFont().getStyle() & Font.BOLD) != 0 ? "bold" : "normal"), 0);
803         if (!(value instanceof DataBinding)) {
804             if (number2Button.getFont() != null) {
805             if (((String) value).equals("bold")) {
806                 number2Button.setFont(number2Button.getFont().deriveFont(number2Button.getFont().getStyle() | Font.BOLD));
807             } else {
808                 number2Button.setFont(number2Button.getFont().deriveFont(number2Button.getFont().getStyle() & ~Font.BOLD));
809             }
810         }
811         }
812     }
813 
814     public void doMouseExited__on__number3Button(MouseEvent event) {
815         if (log.isDebugEnabled()) {
816             log.debug(event);
817         }
818         Object value = Pseudoclasses.removeProperty(NumberEditor.this, number3Button, "font-weight", "bold", Pseudoclasses.wrap((number3Button.getFont().getStyle() & Font.BOLD) != 0 ? "bold" : "normal"), 0);
819         if (!(value instanceof DataBinding)) {
820             if (number3Button.getFont() != null) {
821             if (((String) value).equals("bold")) {
822                 number3Button.setFont(number3Button.getFont().deriveFont(number3Button.getFont().getStyle() | Font.BOLD));
823             } else {
824                 number3Button.setFont(number3Button.getFont().deriveFont(number3Button.getFont().getStyle() & ~Font.BOLD));
825             }
826         }
827         }
828     }
829 
830     public void doMouseExited__on__number4Button(MouseEvent event) {
831         if (log.isDebugEnabled()) {
832             log.debug(event);
833         }
834         Object value = Pseudoclasses.removeProperty(NumberEditor.this, number4Button, "font-weight", "bold", Pseudoclasses.wrap((number4Button.getFont().getStyle() & Font.BOLD) != 0 ? "bold" : "normal"), 0);
835         if (!(value instanceof DataBinding)) {
836             if (number4Button.getFont() != null) {
837             if (((String) value).equals("bold")) {
838                 number4Button.setFont(number4Button.getFont().deriveFont(number4Button.getFont().getStyle() | Font.BOLD));
839             } else {
840                 number4Button.setFont(number4Button.getFont().deriveFont(number4Button.getFont().getStyle() & ~Font.BOLD));
841             }
842         }
843         }
844     }
845 
846     public void doMouseExited__on__number5Button(MouseEvent event) {
847         if (log.isDebugEnabled()) {
848             log.debug(event);
849         }
850         Object value = Pseudoclasses.removeProperty(NumberEditor.this, number5Button, "font-weight", "bold", Pseudoclasses.wrap((number5Button.getFont().getStyle() & Font.BOLD) != 0 ? "bold" : "normal"), 0);
851         if (!(value instanceof DataBinding)) {
852             if (number5Button.getFont() != null) {
853             if (((String) value).equals("bold")) {
854                 number5Button.setFont(number5Button.getFont().deriveFont(number5Button.getFont().getStyle() | Font.BOLD));
855             } else {
856                 number5Button.setFont(number5Button.getFont().deriveFont(number5Button.getFont().getStyle() & ~Font.BOLD));
857             }
858         }
859         }
860     }
861 
862     public void doMouseExited__on__number6Button(MouseEvent event) {
863         if (log.isDebugEnabled()) {
864             log.debug(event);
865         }
866         Object value = Pseudoclasses.removeProperty(NumberEditor.this, number6Button, "font-weight", "bold", Pseudoclasses.wrap((number6Button.getFont().getStyle() & Font.BOLD) != 0 ? "bold" : "normal"), 0);
867         if (!(value instanceof DataBinding)) {
868             if (number6Button.getFont() != null) {
869             if (((String) value).equals("bold")) {
870                 number6Button.setFont(number6Button.getFont().deriveFont(number6Button.getFont().getStyle() | Font.BOLD));
871             } else {
872                 number6Button.setFont(number6Button.getFont().deriveFont(number6Button.getFont().getStyle() & ~Font.BOLD));
873             }
874         }
875         }
876     }
877 
878     public void doMouseExited__on__number7Button(MouseEvent event) {
879         if (log.isDebugEnabled()) {
880             log.debug(event);
881         }
882         Object value = Pseudoclasses.removeProperty(NumberEditor.this, number7Button, "font-weight", "bold", Pseudoclasses.wrap((number7Button.getFont().getStyle() & Font.BOLD) != 0 ? "bold" : "normal"), 0);
883         if (!(value instanceof DataBinding)) {
884             if (number7Button.getFont() != null) {
885             if (((String) value).equals("bold")) {
886                 number7Button.setFont(number7Button.getFont().deriveFont(number7Button.getFont().getStyle() | Font.BOLD));
887             } else {
888                 number7Button.setFont(number7Button.getFont().deriveFont(number7Button.getFont().getStyle() & ~Font.BOLD));
889             }
890         }
891         }
892     }
893 
894     public void doMouseExited__on__number8Button(MouseEvent event) {
895         if (log.isDebugEnabled()) {
896             log.debug(event);
897         }
898         Object value = Pseudoclasses.removeProperty(NumberEditor.this, number8Button, "font-weight", "bold", Pseudoclasses.wrap((number8Button.getFont().getStyle() & Font.BOLD) != 0 ? "bold" : "normal"), 0);
899         if (!(value instanceof DataBinding)) {
900             if (number8Button.getFont() != null) {
901             if (((String) value).equals("bold")) {
902                 number8Button.setFont(number8Button.getFont().deriveFont(number8Button.getFont().getStyle() | Font.BOLD));
903             } else {
904                 number8Button.setFont(number8Button.getFont().deriveFont(number8Button.getFont().getStyle() & ~Font.BOLD));
905             }
906         }
907         }
908     }
909 
910     public void doMouseExited__on__number9Button(MouseEvent event) {
911         if (log.isDebugEnabled()) {
912             log.debug(event);
913         }
914         Object value = Pseudoclasses.removeProperty(NumberEditor.this, number9Button, "font-weight", "bold", Pseudoclasses.wrap((number9Button.getFont().getStyle() & Font.BOLD) != 0 ? "bold" : "normal"), 0);
915         if (!(value instanceof DataBinding)) {
916             if (number9Button.getFont() != null) {
917             if (((String) value).equals("bold")) {
918                 number9Button.setFont(number9Button.getFont().deriveFont(number9Button.getFont().getStyle() | Font.BOLD));
919             } else {
920                 number9Button.setFont(number9Button.getFont().deriveFont(number9Button.getFont().getStyle() & ~Font.BOLD));
921             }
922         }
923         }
924     }
925 
926     public void doMouseExited__on__toggleSignButton(MouseEvent event) {
927         if (log.isDebugEnabled()) {
928             log.debug(event);
929         }
930         Object value = Pseudoclasses.removeProperty(NumberEditor.this, toggleSignButton, "font-weight", "normal", Pseudoclasses.wrap((toggleSignButton.getFont().getStyle() & Font.BOLD) != 0 ? "bold" : "normal"), 0);
931         if (!(value instanceof DataBinding)) {
932             if (toggleSignButton.getFont() != null) {
933             if (((String) value).equals("bold")) {
934                 toggleSignButton.setFont(toggleSignButton.getFont().deriveFont(toggleSignButton.getFont().getStyle() | Font.BOLD));
935             } else {
936                 toggleSignButton.setFont(toggleSignButton.getFont().deriveFont(toggleSignButton.getFont().getStyle() & ~Font.BOLD));
937             }
938         }
939         }
940     }
941 
942     public void doPopupMenuCanceled__on__popup(PopupMenuEvent event) {
943         if (log.isDebugEnabled()) {
944             log.debug(event);
945         }
946         showPopUpButton.setSelected(false);
947     }
948 
949     public void doPopupMenuWillBecomeInvisible__on__popup(PopupMenuEvent event) {
950         if (log.isDebugEnabled()) {
951             log.debug(event);
952         }
953         showPopUpButton.setSelected(false);
954     }
955 
956     public void doPopupMenuWillBecomeVisible__on__popup(PopupMenuEvent event) {
957         if (log.isDebugEnabled()) {
958             log.debug(event);
959         }
960         showPopUpButton.setSelected(true);
961     }
962 
963     /*-----------------------------------------------------------------------*/
964     /*----------------------- Public acessor methods  -----------------------*/
965     /*-----------------------------------------------------------------------*/
966 
967     public Boolean getAutoPopup() {
968         return autoPopup;
969     }
970 
971     public JButton getClearAllButton() {
972         return clearAllButton;
973     }
974 
975     public JButton getClearOnebutton() {
976         return clearOnebutton;
977     }
978 
979     public JButton getDotButton() {
980         return dotButton;
981     }
982 
983     public NumberEditorHandler getHandler() {
984         return handler;
985     }
986 
987     public JToolBar getLeftToolbar() {
988         return leftToolbar;
989     }
990 
991     public NumberEditorModel getModel() {
992         return model;
993     }
994 
995     public JButton getNumber0() {
996         return number0;
997     }
998 
999     public JButton getNumber1Button() {
1000         return number1Button;
1001     }
1002 
1003     public JButton getNumber2Button() {
1004         return number2Button;
1005     }
1006 
1007     public JButton getNumber3Button() {
1008         return number3Button;
1009     }
1010 
1011     public JButton getNumber4Button() {
1012         return number4Button;
1013     }
1014 
1015     public JButton getNumber5Button() {
1016         return number5Button;
1017     }
1018 
1019     public JButton getNumber6Button() {
1020         return number6Button;
1021     }
1022 
1023     public JButton getNumber7Button() {
1024         return number7Button;
1025     }
1026 
1027     public JButton getNumber8Button() {
1028         return number8Button;
1029     }
1030 
1031     public JButton getNumber9Button() {
1032         return number9Button;
1033     }
1034 
1035     public JPopupMenu getPopup() {
1036         return popup;
1037     }
1038 
1039     public JPanel getPopupPanel() {
1040         return popupPanel;
1041     }
1042 
1043     public Boolean getPopupVisible() {
1044         return popupVisible;
1045     }
1046 
1047     public JButton getResetButton() {
1048         return resetButton;
1049     }
1050 
1051     public JToolBar getRightToolbar() {
1052         return rightToolbar;
1053     }
1054 
1055     public JToggleButton getShowPopUpButton() {
1056         return showPopUpButton;
1057     }
1058 
1059     public Boolean getShowPopupButton() {
1060         return showPopupButton;
1061     }
1062 
1063     public Boolean getShowReset() {
1064         return showReset;
1065     }
1066 
1067     public JTextField getTextField() {
1068         return textField;
1069     }
1070 
1071     public JButton getToggleSignButton() {
1072         return toggleSignButton;
1073     }
1074 
1075     public JButton getValidateButton() {
1076         return validateButton;
1077     }
1078 
1079     public Boolean isAutoPopup() {
1080         return autoPopup !=null && autoPopup;
1081     }
1082 
1083     public Boolean isPopupVisible() {
1084         return popupVisible !=null && popupVisible;
1085     }
1086 
1087     public Boolean isShowPopupButton() {
1088         return showPopupButton !=null && showPopupButton;
1089     }
1090 
1091     public Boolean isShowReset() {
1092         return showReset !=null && showReset;
1093     }
1094 
1095     /*-----------------------------------------------------------------------*/
1096     /*----------------------- Public mutator methods  -----------------------*/
1097     /*-----------------------------------------------------------------------*/
1098 
1099     public void setAutoPopup(Boolean autoPopup) {
1100         Boolean oldValue = this.autoPopup;
1101         this.autoPopup = autoPopup;
1102         firePropertyChange(PROPERTY_AUTO_POPUP, oldValue, autoPopup);
1103     }
1104 
1105     public void setPopupVisible(Boolean popupVisible) {
1106         Boolean oldValue = this.popupVisible;
1107         this.popupVisible = popupVisible;
1108         firePropertyChange(PROPERTY_POPUP_VISIBLE, oldValue, popupVisible);
1109     }
1110 
1111     public void setShowPopupButton(Boolean showPopupButton) {
1112         Boolean oldValue = this.showPopupButton;
1113         this.showPopupButton = showPopupButton;
1114         firePropertyChange(PROPERTY_SHOW_POPUP_BUTTON, oldValue, showPopupButton);
1115     }
1116 
1117     public void setShowReset(Boolean showReset) {
1118         Boolean oldValue = this.showReset;
1119         this.showReset = showReset;
1120         firePropertyChange(PROPERTY_SHOW_RESET, oldValue, showReset);
1121     }
1122 
1123     /*-----------------------------------------------------------------------*/
1124     /*--------------------- Protected acessors methods  ---------------------*/
1125     /*-----------------------------------------------------------------------*/
1126 
1127     protected JButton get$JButton0() {
1128         return $JButton0;
1129     }
1130 
1131     /*-----------------------------------------------------------------------*/
1132     /*--------------------- Components creation methods ---------------------*/
1133     /*-----------------------------------------------------------------------*/
1134 
1135     protected void addChildrenToLeftToolbar() {
1136         if (!allComponentsCreated) {
1137             return;
1138         }
1139         leftToolbar.add(resetButton);
1140     }
1141 
1142     protected void addChildrenToPopup() {
1143         if (!allComponentsCreated) {
1144             return;
1145         }
1146         popup.add(popupPanel);
1147     }
1148 
1149     protected void addChildrenToPopupPanel() {
1150         if (!allComponentsCreated) {
1151             return;
1152         }
1153         popupPanel.add(number7Button);
1154         popupPanel.add(number8Button);
1155         popupPanel.add(number9Button);
1156         popupPanel.add(clearAllButton);
1157         popupPanel.add(number4Button);
1158         popupPanel.add(number5Button);
1159         popupPanel.add(number6Button);
1160         popupPanel.add(clearOnebutton);
1161         popupPanel.add(number1Button);
1162         popupPanel.add(number2Button);
1163         popupPanel.add(number3Button);
1164         popupPanel.add($JButton0);
1165         popupPanel.add(number0);
1166         popupPanel.add(toggleSignButton);
1167         popupPanel.add(dotButton);
1168         popupPanel.add(validateButton);
1169     }
1170 
1171     protected void addChildrenToRightToolbar() {
1172         if (!allComponentsCreated) {
1173             return;
1174         }
1175         rightToolbar.add(showPopUpButton);
1176     }
1177 
1178     protected void createAutoPopup() {
1179         $objectMap.put("autoPopup", autoPopup = false);
1180     }
1181 
1182     protected void createClearAllButton() {
1183         $objectMap.put("clearAllButton", clearAllButton = new JButton());
1184         
1185         clearAllButton.setName("clearAllButton");
1186         if (clearAllButton.getFont() != null) {
1187             clearAllButton.setFont(clearAllButton.getFont().deriveFont((float) 14));
1188         }
1189         clearAllButton.setFocusable(false);
1190         clearAllButton.setForeground(new Color(255, 0, 0));
1191         clearAllButton.setText(t("numbereditor.clearAll"));
1192         clearAllButton.setFocusPainted(false);
1193         clearAllButton.addActionListener(JAXXUtil.getEventListener(ActionListener.class, "actionPerformed", this, "doActionPerformed__on__clearAllButton"));
1194         clearAllButton.addMouseListener(JAXXUtil.getEventListener(MouseListener.class, "mouseEntered", this, "doMouseEntered__on__clearAllButton"));
1195         clearAllButton.addMouseListener(JAXXUtil.getEventListener(MouseListener.class, "mouseExited", this, "doMouseExited__on__clearAllButton"));
1196     }
1197 
1198     protected void createClearOnebutton() {
1199         $objectMap.put("clearOnebutton", clearOnebutton = new JButton());
1200         
1201         clearOnebutton.setName("clearOnebutton");
1202         if (clearOnebutton.getFont() != null) {
1203             clearOnebutton.setFont(clearOnebutton.getFont().deriveFont((float) 14));
1204         }
1205         clearOnebutton.setFocusable(false);
1206         clearOnebutton.setForeground(new Color(255, 0, 0));
1207         clearOnebutton.setFocusPainted(false);
1208         clearOnebutton.addActionListener(JAXXUtil.getEventListener(ActionListener.class, "actionPerformed", this, "doActionPerformed__on__clearOnebutton"));
1209         clearOnebutton.addMouseListener(JAXXUtil.getEventListener(MouseListener.class, "mouseEntered", this, "doMouseEntered__on__clearOnebutton"));
1210         clearOnebutton.addMouseListener(JAXXUtil.getEventListener(MouseListener.class, "mouseExited", this, "doMouseExited__on__clearOnebutton"));
1211     }
1212 
1213     protected void createDotButton() {
1214         $objectMap.put("dotButton", dotButton = new JButton());
1215         
1216         dotButton.setName("dotButton");
1217         if (dotButton.getFont() != null) {
1218             dotButton.setFont(dotButton.getFont().deriveFont((float) 14));
1219         }
1220         dotButton.setFocusable(false);
1221         dotButton.setForeground(new Color(0, 153, 0));
1222         dotButton.setText(t("numbereditor.."));
1223         dotButton.setFocusPainted(false);
1224         dotButton.addActionListener(JAXXUtil.getEventListener(ActionListener.class, "actionPerformed", this, "doActionPerformed__on__dotButton"));
1225         dotButton.addMouseListener(JAXXUtil.getEventListener(MouseListener.class, "mouseEntered", this, "doMouseEntered__on__dotButton"));
1226         dotButton.addMouseListener(JAXXUtil.getEventListener(MouseListener.class, "mouseExited", this, "doMouseExited__on__dotButton"));
1227     }
1228 
1229     protected NumberEditorHandler createHandler() {
1230         return new NumberEditorHandler();
1231     }
1232 
1233     protected void createLeftToolbar() {
1234         $objectMap.put("leftToolbar", leftToolbar = new JToolBar());
1235         
1236         leftToolbar.setName("leftToolbar");
1237         leftToolbar.setBorderPainted(false);
1238         leftToolbar.setOpaque(false);
1239         leftToolbar.setFloatable(false);
1240     }
1241 
1242     protected void createModel() {
1243         $objectMap.put("model", model = getContextValue(NumberEditorModel.class));
1244     }
1245 
1246     protected void createNumber0() {
1247         $objectMap.put("number0", number0 = new JButton());
1248         
1249         number0.setName("number0");
1250         if (number0.getFont() != null) {
1251             number0.setFont(number0.getFont().deriveFont((float) 14));
1252         }
1253         number0.setFocusable(false);
1254         number0.setForeground(new Color(0, 0, 255));
1255         number0.setFocusPainted(false);
1256         number0.addActionListener(JAXXUtil.getEventListener(ActionListener.class, "actionPerformed", this, "doActionPerformed__on__number0"));
1257         number0.addMouseListener(JAXXUtil.getEventListener(MouseListener.class, "mouseEntered", this, "doMouseEntered__on__number0"));
1258         number0.addMouseListener(JAXXUtil.getEventListener(MouseListener.class, "mouseExited", this, "doMouseExited__on__number0"));
1259     }
1260 
1261     protected void createNumber1Button() {
1262         $objectMap.put("number1Button", number1Button = new JButton());
1263         
1264         number1Button.setName("number1Button");
1265         if (number1Button.getFont() != null) {
1266             number1Button.setFont(number1Button.getFont().deriveFont((float) 14));
1267         }
1268         number1Button.setFocusable(false);
1269         number1Button.setForeground(new Color(0, 0, 255));
1270         number1Button.setText(t("numbereditor.1"));
1271         number1Button.setFocusPainted(false);
1272         number1Button.addActionListener(JAXXUtil.getEventListener(ActionListener.class, "actionPerformed", this, "doActionPerformed__on__number1Button"));
1273         number1Button.addMouseListener(JAXXUtil.getEventListener(MouseListener.class, "mouseEntered", this, "doMouseEntered__on__number1Button"));
1274         number1Button.addMouseListener(JAXXUtil.getEventListener(MouseListener.class, "mouseExited", this, "doMouseExited__on__number1Button"));
1275     }
1276 
1277     protected void createNumber2Button() {
1278         $objectMap.put("number2Button", number2Button = new JButton());
1279         
1280         number2Button.setName("number2Button");
1281         if (number2Button.getFont() != null) {
1282             number2Button.setFont(number2Button.getFont().deriveFont((float) 14));
1283         }
1284         number2Button.setFocusable(false);
1285         number2Button.setForeground(new Color(0, 0, 255));
1286         number2Button.setText(t("numbereditor.2"));
1287         number2Button.setFocusPainted(false);
1288         number2Button.addActionListener(JAXXUtil.getEventListener(ActionListener.class, "actionPerformed", this, "doActionPerformed__on__number2Button"));
1289         number2Button.addMouseListener(JAXXUtil.getEventListener(MouseListener.class, "mouseEntered", this, "doMouseEntered__on__number2Button"));
1290         number2Button.addMouseListener(JAXXUtil.getEventListener(MouseListener.class, "mouseExited", this, "doMouseExited__on__number2Button"));
1291     }
1292 
1293     protected void createNumber3Button() {
1294         $objectMap.put("number3Button", number3Button = new JButton());
1295         
1296         number3Button.setName("number3Button");
1297         if (number3Button.getFont() != null) {
1298             number3Button.setFont(number3Button.getFont().deriveFont((float) 14));
1299         }
1300         number3Button.setFocusable(false);
1301         number3Button.setForeground(new Color(0, 0, 255));
1302         number3Button.setText(t("numbereditor.3"));
1303         number3Button.setFocusPainted(false);
1304         number3Button.addActionListener(JAXXUtil.getEventListener(ActionListener.class, "actionPerformed", this, "doActionPerformed__on__number3Button"));
1305         number3Button.addMouseListener(JAXXUtil.getEventListener(MouseListener.class, "mouseEntered", this, "doMouseEntered__on__number3Button"));
1306         number3Button.addMouseListener(JAXXUtil.getEventListener(MouseListener.class, "mouseExited", this, "doMouseExited__on__number3Button"));
1307     }
1308 
1309     protected void createNumber4Button() {
1310         $objectMap.put("number4Button", number4Button = new JButton());
1311         
1312         number4Button.setName("number4Button");
1313         if (number4Button.getFont() != null) {
1314             number4Button.setFont(number4Button.getFont().deriveFont((float) 14));
1315         }
1316         number4Button.setFocusable(false);
1317         number4Button.setForeground(new Color(0, 0, 255));
1318         number4Button.setText(t("numbereditor.4"));
1319         number4Button.setFocusPainted(false);
1320         number4Button.addActionListener(JAXXUtil.getEventListener(ActionListener.class, "actionPerformed", this, "doActionPerformed__on__number4Button"));
1321         number4Button.addMouseListener(JAXXUtil.getEventListener(MouseListener.class, "mouseEntered", this, "doMouseEntered__on__number4Button"));
1322         number4Button.addMouseListener(JAXXUtil.getEventListener(MouseListener.class, "mouseExited", this, "doMouseExited__on__number4Button"));
1323     }
1324 
1325     protected void createNumber5Button() {
1326         $objectMap.put("number5Button", number5Button = new JButton());
1327         
1328         number5Button.setName("number5Button");
1329         if (number5Button.getFont() != null) {
1330             number5Button.setFont(number5Button.getFont().deriveFont((float) 14));
1331         }
1332         number5Button.setFocusable(false);
1333         number5Button.setForeground(new Color(0, 0, 255));
1334         number5Button.setText(t("numbereditor.5"));
1335         number5Button.setFocusPainted(false);
1336         number5Button.addActionListener(JAXXUtil.getEventListener(ActionListener.class, "actionPerformed", this, "doActionPerformed__on__number5Button"));
1337         number5Button.addMouseListener(JAXXUtil.getEventListener(MouseListener.class, "mouseEntered", this, "doMouseEntered__on__number5Button"));
1338         number5Button.addMouseListener(JAXXUtil.getEventListener(MouseListener.class, "mouseExited", this, "doMouseExited__on__number5Button"));
1339     }
1340 
1341     protected void createNumber6Button() {
1342         $objectMap.put("number6Button", number6Button = new JButton());
1343         
1344         number6Button.setName("number6Button");
1345         if (number6Button.getFont() != null) {
1346             number6Button.setFont(number6Button.getFont().deriveFont((float) 14));
1347         }
1348         number6Button.setFocusable(false);
1349         number6Button.setForeground(new Color(0, 0, 255));
1350         number6Button.setText(t("numbereditor.6"));
1351         number6Button.setFocusPainted(false);
1352         number6Button.addActionListener(JAXXUtil.getEventListener(ActionListener.class, "actionPerformed", this, "doActionPerformed__on__number6Button"));
1353         number6Button.addMouseListener(JAXXUtil.getEventListener(MouseListener.class, "mouseEntered", this, "doMouseEntered__on__number6Button"));
1354         number6Button.addMouseListener(JAXXUtil.getEventListener(MouseListener.class, "mouseExited", this, "doMouseExited__on__number6Button"));
1355     }
1356 
1357     protected void createNumber7Button() {
1358         $objectMap.put("number7Button", number7Button = new JButton());
1359         
1360         number7Button.setName("number7Button");
1361         if (number7Button.getFont() != null) {
1362             number7Button.setFont(number7Button.getFont().deriveFont((float) 14));
1363         }
1364         number7Button.setFocusable(false);
1365         number7Button.setForeground(new Color(0, 0, 255));
1366         number7Button.setText(t("numbereditor.7"));
1367         number7Button.setFocusPainted(false);
1368         number7Button.addActionListener(JAXXUtil.getEventListener(ActionListener.class, "actionPerformed", this, "doActionPerformed__on__number7Button"));
1369         number7Button.addMouseListener(JAXXUtil.getEventListener(MouseListener.class, "mouseEntered", this, "doMouseEntered__on__number7Button"));
1370         number7Button.addMouseListener(JAXXUtil.getEventListener(MouseListener.class, "mouseExited", this, "doMouseExited__on__number7Button"));
1371     }
1372 
1373     protected void createNumber8Button() {
1374         $objectMap.put("number8Button", number8Button = new JButton());
1375         
1376         number8Button.setName("number8Button");
1377         if (number8Button.getFont() != null) {
1378             number8Button.setFont(number8Button.getFont().deriveFont((float) 14));
1379         }
1380         number8Button.setFocusable(false);
1381         number8Button.setForeground(new Color(0, 0, 255));
1382         number8Button.setText(t("numbereditor.8"));
1383         number8Button.setFocusPainted(false);
1384         number8Button.addActionListener(JAXXUtil.getEventListener(ActionListener.class, "actionPerformed", this, "doActionPerformed__on__number8Button"));
1385         number8Button.addMouseListener(JAXXUtil.getEventListener(MouseListener.class, "mouseEntered", this, "doMouseEntered__on__number8Button"));
1386         number8Button.addMouseListener(JAXXUtil.getEventListener(MouseListener.class, "mouseExited", this, "doMouseExited__on__number8Button"));
1387     }
1388 
1389     protected void createNumber9Button() {
1390         $objectMap.put("number9Button", number9Button = new JButton());
1391         
1392         number9Button.setName("number9Button");
1393         if (number9Button.getFont() != null) {
1394             number9Button.setFont(number9Button.getFont().deriveFont((float) 14));
1395         }
1396         number9Button.setFocusable(false);
1397         number9Button.setForeground(new Color(0, 0, 255));
1398         number9Button.setText(t("numbereditor.9"));
1399         number9Button.setFocusPainted(false);
1400         number9Button.addActionListener(JAXXUtil.getEventListener(ActionListener.class, "actionPerformed", this, "doActionPerformed__on__number9Button"));
1401         number9Button.addMouseListener(JAXXUtil.getEventListener(MouseListener.class, "mouseEntered", this, "doMouseEntered__on__number9Button"));
1402         number9Button.addMouseListener(JAXXUtil.getEventListener(MouseListener.class, "mouseExited", this, "doMouseExited__on__number9Button"));
1403     }
1404 
1405     protected void createPopup() {
1406         $objectMap.put("popup", popup = new JPopupMenu());
1407         
1408         popup.setName("popup");
1409         popup.addPopupMenuListener(JAXXUtil.getEventListener(PopupMenuListener.class, "popupMenuCanceled", this, "doPopupMenuCanceled__on__popup"));
1410         popup.addPopupMenuListener(JAXXUtil.getEventListener(PopupMenuListener.class, "popupMenuWillBecomeInvisible", this, "doPopupMenuWillBecomeInvisible__on__popup"));
1411         popup.addPopupMenuListener(JAXXUtil.getEventListener(PopupMenuListener.class, "popupMenuWillBecomeVisible", this, "doPopupMenuWillBecomeVisible__on__popup"));
1412     }
1413 
1414     protected void createPopupPanel() {
1415         $objectMap.put("popupPanel", popupPanel = new JPanel());
1416         
1417         popupPanel.setName("popupPanel");
1418         popupPanel.setLayout(new GridLayout(4,4));
1419     }
1420 
1421     protected void createPopupVisible() {
1422         $objectMap.put("popupVisible", popupVisible = false);
1423     }
1424 
1425     protected void createResetButton() {
1426         $objectMap.put("resetButton", resetButton = new JButton());
1427         
1428         resetButton.setName("resetButton");
1429         resetButton.setFocusable(false);
1430         resetButton.setToolTipText(t("numbereditor.action.reset.tip"));
1431         resetButton.setFocusPainted(false);
1432         resetButton.addActionListener(JAXXUtil.getEventListener(ActionListener.class, "actionPerformed", this, "doActionPerformed__on__resetButton"));
1433     }
1434 
1435     protected void createRightToolbar() {
1436         $objectMap.put("rightToolbar", rightToolbar = new JToolBar());
1437         
1438         rightToolbar.setName("rightToolbar");
1439         rightToolbar.setBorderPainted(false);
1440         rightToolbar.setOpaque(false);
1441         rightToolbar.setFloatable(false);
1442     }
1443 
1444     protected void createShowPopUpButton() {
1445         $objectMap.put("showPopUpButton", showPopUpButton = new JToggleButton());
1446         
1447         showPopUpButton.setName("showPopUpButton");
1448         showPopUpButton.setFocusable(false);
1449         showPopUpButton.setToolTipText(t("numbereditor.action.show.tip"));
1450         showPopUpButton.setFocusPainted(false);
1451         showPopUpButton.addActionListener(JAXXUtil.getEventListener(ActionListener.class, "actionPerformed", this, "doActionPerformed__on__showPopUpButton"));
1452     }
1453 
1454     protected void createShowPopupButton() {
1455         $objectMap.put("showPopupButton", showPopupButton = false);
1456     }
1457 
1458     protected void createShowReset() {
1459         $objectMap.put("showReset", showReset = false);
1460     }
1461 
1462     protected void createTextField() {
1463         $objectMap.put("textField", textField = new JTextField());
1464         
1465         textField.setName("textField");
1466         textField.setColumns(15);
1467         textField.addFocusListener(JAXXUtil.getEventListener(FocusListener.class, "focusGained", this, "doFocusGained__on__textField"));
1468         textField.addKeyListener(JAXXUtil.getEventListener(KeyListener.class, "keyReleased", this, "doKeyReleased__on__textField"));
1469     }
1470 
1471     protected void createToggleSignButton() {
1472         $objectMap.put("toggleSignButton", toggleSignButton = new JButton());
1473         
1474         toggleSignButton.setName("toggleSignButton");
1475         if (toggleSignButton.getFont() != null) {
1476             toggleSignButton.setFont(toggleSignButton.getFont().deriveFont((float) 14));
1477         }
1478         toggleSignButton.setFocusable(false);
1479         toggleSignButton.setForeground(new Color(0, 153, 0));
1480         toggleSignButton.setText(t("numbereditor.toggleSign"));
1481         toggleSignButton.setFocusPainted(false);
1482         toggleSignButton.addActionListener(JAXXUtil.getEventListener(ActionListener.class, "actionPerformed", this, "doActionPerformed__on__toggleSignButton"));
1483         toggleSignButton.addMouseListener(JAXXUtil.getEventListener(MouseListener.class, "mouseEntered", this, "doMouseEntered__on__toggleSignButton"));
1484         toggleSignButton.addMouseListener(JAXXUtil.getEventListener(MouseListener.class, "mouseExited", this, "doMouseExited__on__toggleSignButton"));
1485     }
1486 
1487     protected void createValidateButton() {
1488         $objectMap.put("validateButton", validateButton = new JButton());
1489         
1490         validateButton.setName("validateButton");
1491         validateButton.addActionListener(JAXXUtil.getEventListener(ActionListener.class, "actionPerformed", this, "doActionPerformed__on__validateButton"));
1492     }
1493 
1494     /*-----------------------------------------------------------------------*/
1495     /*------------------------ Internal jaxx methods ------------------------*/
1496     /*-----------------------------------------------------------------------*/
1497 
1498     private void $completeSetup() {
1499         allComponentsCreated = true;
1500         if (log.isDebugEnabled()) {
1501             log.debug(this);
1502         }
1503         // inline complete setup of $JPanel0
1504         add(leftToolbar, BorderLayout.WEST);
1505         add(textField, BorderLayout.CENTER);
1506         add(rightToolbar, BorderLayout.EAST);
1507         addChildrenToPopup();
1508         addChildrenToPopupPanel();
1509         addChildrenToLeftToolbar();
1510         addChildrenToRightToolbar();
1511         
1512         // apply 11 data bindings
1513         JAXXUtil.applyDataBinding(this, $bindings.keySet());
1514         
1515         // apply 8 property setters
1516         popupPanel.setBorder(BorderFactory.createEmptyBorder(4, 4, 4, 4));
1517         popupPanel.setBackground(Color.WHITE);
1518         validateButton.setIcon(SwingUtil.createActionIcon("numbereditor-validate"));
1519         resetButton.setIcon(SwingUtil.createActionIcon("numbereditor-reset"));
1520         rightToolbar.setMaximumSize(new Dimension(24,24));
1521         showPopUpButton.setIcon(SwingUtil.createActionIcon("numbereditor-calculator"));
1522     }
1523 
1524     private void $initialize() {
1525         if (allComponentsCreated) {
1526             return;
1527         }
1528         if (log.isDebugEnabled()) {
1529             log.debug(this);
1530         }
1531         handler.beforeInit(this);
1532         $objectMap.put("$JPanel0", $JPanel0);
1533         createModel();
1534         createAutoPopup();
1535         createShowPopupButton();
1536         createShowReset();
1537         createPopupVisible();
1538         createPopup();
1539         createPopupPanel();
1540         createNumber7Button();
1541         createNumber8Button();
1542         createNumber9Button();
1543         createClearAllButton();
1544         createNumber4Button();
1545         createNumber5Button();
1546         createNumber6Button();
1547         createClearOnebutton();
1548         createNumber1Button();
1549         createNumber2Button();
1550         createNumber3Button();
1551         // inline creation of $JButton0
1552         $objectMap.put("$JButton0", $JButton0 = new JButton());
1553         
1554         $JButton0.setName("$JButton0");
1555         $JButton0.setEnabled(false);
1556         createNumber0();
1557         createToggleSignButton();
1558         createDotButton();
1559         createValidateButton();
1560         createLeftToolbar();
1561         createResetButton();
1562         createTextField();
1563         createRightToolbar();
1564         createShowPopUpButton();
1565         // inline creation of $JPanel0
1566         setName("$JPanel0");
1567         setLayout(new BorderLayout());
1568         $JPanel0.addFocusListener(JAXXUtil.getEventListener(FocusListener.class, "focusGained", this, "doFocusGained__on__$JPanel0"));
1569         $JPanel0.addFocusListener(JAXXUtil.getEventListener(FocusListener.class, "focusLost", this, "doFocusLost__on__$JPanel0"));
1570         $JPanel0.addMouseListener(JAXXUtil.getEventListener(MouseListener.class, "mouseExited", this, "doMouseExited__on__$JPanel0"));
1571         
1572         // registers 11 data bindings
1573         $registerDefaultBindings();
1574         $completeSetup();
1575         handler.afterInit(this);
1576     }
1577 
1578     private void $registerDefaultBindings() {
1579         // register 11 data bindings
1580         registerDataBinding(new DefaultJAXXBinding(this, BINDING_CLEAR_ALL_BUTTON_ENABLED, true) {
1581         
1582             @Override
1583             public void applyDataBinding() {
1584                 if (model != null) {
1585                     model.addPropertyChangeListener("canClearAll", this);
1586                 }
1587             }
1588         
1589             @Override
1590             public void processDataBinding() {
1591                 if (model != null) {
1592                     clearAllButton.setEnabled(model.isCanClearAll());
1593                 }
1594             }
1595         
1596             @Override
1597             public void removeDataBinding() {
1598                 if (model != null) {
1599                     model.removePropertyChangeListener("canClearAll", this);
1600                 }
1601             }
1602         });
1603         registerDataBinding(new DefaultJAXXBinding(this, BINDING_TOGGLE_SIGN_BUTTON_ENABLED, true) {
1604         
1605             @Override
1606             public void applyDataBinding() {
1607                 if (model != null) {
1608                     model.addPropertyChangeListener("canUseSign", this);
1609                 }
1610             }
1611         
1612             @Override
1613             public void processDataBinding() {
1614                 if (model != null) {
1615                     toggleSignButton.setEnabled(model.isCanUseSign());
1616                 }
1617             }
1618         
1619             @Override
1620             public void removeDataBinding() {
1621                 if (model != null) {
1622                     model.removePropertyChangeListener("canUseSign", this);
1623                 }
1624             }
1625         });
1626         registerDataBinding(new DefaultJAXXBinding(this, BINDING_DOT_BUTTON_ENABLED, true) {
1627         
1628             @Override
1629             public void applyDataBinding() {
1630                 if (model != null) {
1631                     model.addPropertyChangeListener("canUseDot", this);
1632                 }
1633             }
1634         
1635             @Override
1636             public void processDataBinding() {
1637                 if (model != null) {
1638                     dotButton.setEnabled(model.isCanUseDot());
1639                 }
1640             }
1641         
1642             @Override
1643             public void removeDataBinding() {
1644                 if (model != null) {
1645                     model.removePropertyChangeListener("canUseDot", this);
1646                 }
1647             }
1648         });
1649         registerDataBinding(new SimpleJAXXObjectBinding(this, BINDING_LEFT_TOOLBAR_VISIBLE, true ,"showReset") {
1650         
1651             @Override
1652             public void processDataBinding() {
1653                 leftToolbar.setVisible(isShowReset());
1654             }
1655         });
1656         registerDataBinding(new SimpleJAXXObjectBinding(this, BINDING_LEFT_TOOLBAR_ENABLED, true ,"enabled") {
1657         
1658             @Override
1659             public void processDataBinding() {
1660                 leftToolbar.setEnabled(isEnabled());
1661             }
1662         });
1663         registerDataBinding(new SimpleJAXXObjectBinding(this, BINDING_RESET_BUTTON_ENABLED, true ,"enabled") {
1664         
1665             @Override
1666             public void processDataBinding() {
1667                 resetButton.setEnabled(isEnabled());
1668             }
1669         });
1670         registerDataBinding(new DefaultJAXXBinding(this, BINDING_TEXT_FIELD_TEXT, true) {
1671         
1672             @Override
1673             public void applyDataBinding() {
1674                 if (model != null) {
1675                     model.addPropertyChangeListener("textValue", this);
1676                 }
1677             }
1678         
1679             @Override
1680             public void processDataBinding() {
1681                 if (model != null) {
1682                     SwingUtil.setText(textField, model.getTextValue());
1683                 }
1684             }
1685         
1686             @Override
1687             public void removeDataBinding() {
1688                 if (model != null) {
1689                     model.removePropertyChangeListener("textValue", this);
1690                 }
1691             }
1692         });
1693         registerDataBinding(new SimpleJAXXObjectBinding(this, BINDING_TEXT_FIELD_ENABLED, true ,"enabled") {
1694         
1695             @Override
1696             public void processDataBinding() {
1697                 textField.setEnabled(isEnabled());
1698             }
1699         });
1700         registerDataBinding(new SimpleJAXXObjectBinding(this, BINDING_RIGHT_TOOLBAR_VISIBLE, true ,"showPopupButton") {
1701         
1702             @Override
1703             public void processDataBinding() {
1704                 rightToolbar.setVisible(isShowPopupButton());
1705             }
1706         });
1707         registerDataBinding(new SimpleJAXXObjectBinding(this, BINDING_RIGHT_TOOLBAR_ENABLED, true ,"enabled") {
1708         
1709             @Override
1710             public void processDataBinding() {
1711                 rightToolbar.setEnabled(isEnabled());
1712             }
1713         });
1714         registerDataBinding(new SimpleJAXXObjectBinding(this, BINDING_SHOW_POP_UP_BUTTON_ENABLED, true ,"enabled") {
1715         
1716             @Override
1717             public void processDataBinding() {
1718                 showPopUpButton.setEnabled(isEnabled());
1719             }
1720         });
1721     }
1722 
1723 }