All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.nuiton.jaxx.widgets.number.NumberEditor Maven / Gradle / Ivy

There is a newer version: 3.0.0-RC-12
Show newest version
package org.nuiton.jaxx.widgets.number;

/*-
 * #%L
 * JAXX :: Widgets Number
 * %%
 * Copyright (C) 2008 - 2021 Code Lutin, Ultreia.io
 * %%
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as
 * published by the Free Software Foundation, either version 3 of the
 * License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Lesser Public License for more details.
 *
 * You should have received a copy of the GNU General Lesser Public
 * License along with this program.  If not, see
 * .
 * #L%
 */

import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Container;
import java.awt.Dimension;
import java.awt.Font;
import java.awt.GridLayout;
import java.awt.LayoutManager;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.KeyEvent;
import java.awt.event.KeyListener;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.TreeMap;
import javax.swing.BorderFactory;
import javax.swing.JButton;
import javax.swing.JPanel;
import javax.swing.JPopupMenu;
import javax.swing.JTextField;
import javax.swing.JToggleButton;
import javax.swing.JToolBar;
import javax.swing.event.PopupMenuEvent;
import javax.swing.event.PopupMenuListener;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.nuiton.jaxx.runtime.JAXXBinding;
import org.nuiton.jaxx.runtime.JAXXContext;
import org.nuiton.jaxx.runtime.JAXXObject;
import org.nuiton.jaxx.runtime.JAXXObjectDescriptor;
import org.nuiton.jaxx.runtime.JAXXUtil;
import org.nuiton.jaxx.runtime.bean.BeanScopeAware;
import org.nuiton.jaxx.runtime.binding.DefaultJAXXBinding;
import org.nuiton.jaxx.runtime.binding.SimpleJAXXObjectBinding;
import org.nuiton.jaxx.runtime.context.DefaultJAXXContext;
import org.nuiton.jaxx.runtime.css.DataBinding;
import org.nuiton.jaxx.runtime.css.Pseudoclasses;
import org.nuiton.jaxx.runtime.swing.SwingUtil;
import org.nuiton.jaxx.widgets.number.actions.Reset;
import static io.ultreia.java4all.i18n.I18n.t;

public class NumberEditor extends JPanel implements BeanScopeAware, JAXXObject {

    /*-----------------------------------------------------------------------*/
    /*---------------- Constants for all javaBean properties ----------------*/
    /*-----------------------------------------------------------------------*/

    public static final String PROPERTY_AUTO_POPUP = "autoPopup";
    public static final String PROPERTY_POPUP_VISIBLE = "popupVisible";
    public static final String PROPERTY_SHOW_POPUP_BUTTON = "showPopupButton";
    public static final String PROPERTY_SHOW_RESET = "showReset";

    /*-----------------------------------------------------------------------*/
    /*------------------ Constants for all public bindings ------------------*/
    /*-----------------------------------------------------------------------*/

    public static final String BINDING_CLEAR_ALL_BUTTON_ENABLED = "clearAllButton.enabled";
    public static final String BINDING_DOT_BUTTON_ENABLED = "dotButton.enabled";
    public static final String BINDING_LEFT_TOOLBAR_ENABLED = "leftToolbar.enabled";
    public static final String BINDING_LEFT_TOOLBAR_VISIBLE = "leftToolbar.visible";
    public static final String BINDING_RESET_ENABLED = "reset.enabled";
    public static final String BINDING_RIGHT_TOOLBAR_VISIBLE = "rightToolbar.visible";
    public static final String BINDING_SHOW_POP_UP_BUTTON_ENABLED = "showPopUpButton.enabled";
    public static final String BINDING_TEXT_FIELD_ENABLED = "textField.enabled";
    public static final String BINDING_TEXT_FIELD_TEXT = "textField.text";
    public static final String BINDING_TOGGLE_SIGN_BUTTON_ENABLED = "toggleSignButton.enabled";

    /*-----------------------------------------------------------------------*/
    /*------------------------- Other static fields -------------------------*/
    /*-----------------------------------------------------------------------*/

    private static final String $jaxxObjectDescriptor = "H4sIAAAAAAAAAK1YSXMTRxRuyRteWBMgqZCUKhAwFTySjVhcpkjwQgFlYxc2S+FLWpq23KQ1PfT0WHIcOOSQW/5ADrnmkuI/pHJKVS658h9SxU/I6x6NZtHMaLBw2ZLc/fp733v9ttEf/6ERR6ArXDQMy6WSW8YL3G4bwrUkbRLjwZ1nz9ZrL0hdLhOnLqgtuUDeT6GIitto0uyuOxIZ26uAVPaQygqp3EEqL/GmzS1ihYAWVtGEI/cZcXYJkRJNpx6uO055syu50LZd0dGVyDpJ1z8/z74tkOVfiwi1baD/OZj99XsABFYPr6IiNSU6tfoC7+Eyw1YDyAlqNcCgo2ptiWHHeYib5CV6jcZW0aiNBYBJNHMo92g4DdW2JTpy4cEGtgiryF7+LWo2iHRgrVkjwnio31ZMEBC2rSFGJRppcpMwiSrvcXpNHQkgxrEr+Qa3XeBzUllsKC8Yi5wzgq1A7rizy1tabtGVoEctnwzBqO1HxCEytjFlqzNPqENrjMT2RmxP7xmlt204LXC88UArWSOWGwhOaEHtK7isqLRaVGKfdKWPelbf8IhK9FHkQED/M2Bg0gaVsYM3A5FSltx8P7ljdfChuMNYgqDeigFWcyq+llPuej6C6xap5SM4m1PxXE65q/3kxi907qsSyHTvecwDqaQfPyF5o8HIJm1YvZqOcJsIrKqdr8zkMofYsT3MqIklict2iU0ysiO3IINqWEj0cST81PIiFkpyHEwgFoa8MLsZIfwU0pBrQX5J0pZ3KWFmPF22/I0UyClBG7s+G7W2rgV7Evux7efLpzHCyoWBrU9DKgS6mFZ3oc4bQZ0PSm5hG4x0YVmi8+ktRnWJRyDl9Yfz6f1BqdGCP715LX5vvXvrN4UvgVyp36lQ/4MKbQt11ZIqbse9juBKyspr2F7YhgpHGDRP3RwvZTPf7EgCe2DhVVWFZNzDzi6gjYy9/fOvM9/9O4SKd9EE49i8i5X8fbi/XYiAXc7Mtv3Nt5rcVOsIvJ6AvyHImxoXJhEbmFqSQCiM7GAGAYNGuY1fuiRYGN8BWKluyV9rgyMvZTuyy/vN+ru/f/vlqz99ZxbAjAt5TgYOHXmORqnFqEV0j+20z8SeOmk7xDV50BuTuiVS/dLPnk5nqOnXnR5HFYIQBZcdUGfF+2f68qu2q45Y2ib1CXBtO5Y0abDDyq2QIDMO/QHcWpyt6oW664T9DN1qhwvSENy1QP1wjal7mdJysXtLIANUOhXPjhSzD8pp7HylMj9fqRySVrQiflBmQ0LROJyzgoaVRqkIieIlEMxvB4v6k5d5+0ZdECjpK01b7nsb09Urpc7v5VdAs4br3/s0jx4sccaF8fTe/a2VhJiKTCx2jmjd8+YjqDsQrZv+KJUYr9H2kgN8WLUO6BoHelg0YC5ULeMJhrhMURA0m37wxTD30x3uoSlxWrlusonbtOk2N3UgnDmwSKu0DJXDcihIzFWvzFWTeURaVz8qQ8nhFRSCL8KFoHTxYinq6dxh53fpfoQgASYguMDG+3XVVs964wrRU/hMHbO6y1QWJfOelGD2FrW39OWdC581PFRDNW5DwgNGfubxZp/jfjvhE2FvBHNV2MN+iFFnCVuPHb2fEmI9k1l+JsciTIwwgdMxAss8LYeCWS+/4tMRxf5sH9Z/Nqx/qSOQwiD2cDAQDZjgwzQWkmmomO9mtqoDS/AsKze4Q1U4wf7tUiWDKijJR7UQC/wI4Rl/ek5UFB2tDxsTlaygfE4ET7mSzlNJJbeZidpnM6BnB4Oey4CeGwz6agb01cGgqxnQ1cGgr2VAXxsM+noG9PXBoG9kQN8YDPpmBvTNwaDnM6Dnc0NP6pmwRVRnV9OxetTJmuygVDe56xC+p6a2HBPx4Dr6D5I9OkYtLpqYvYeWfEM0KBpleJ+76jZuQWXEpRq1THgwv92jq6BeJ/peASwX1BdmhWYywrk882q3up665T3klbCUgtZcSVKI3ckTdrSuv2NIo7aay7gfMxCeA8L/3s+J1ykXAAA=";
    private static final Logger log = LogManager.getLogger(NumberEditor.class);
    private static final long serialVersionUID = 1L;

    /*-----------------------------------------------------------------------*/
    /*--------------------------- Internal states ---------------------------*/
    /*-----------------------------------------------------------------------*/

    protected List $activeBindings = new ArrayList();
    protected Map $bindingSources = new HashMap();
    protected final Map $bindings = new TreeMap();
    protected Map $objectMap = new HashMap();
    protected Map $previousValues = new HashMap();
    protected final JAXXContext delegateContext = new DefaultJAXXContext();

    /*-----------------------------------------------------------------------*/
    /*------------------------ Protected components  ------------------------*/
    /*-----------------------------------------------------------------------*/

    protected Boolean autoPopup;
    protected JButton clearAllButton;
    protected JButton clearOnebutton;
    protected JButton dotButton;
    protected NumberEditorHandler handler;
    protected JToolBar leftToolbar;
    protected NumberEditorModel model;
    protected JButton number0;
    protected JButton number1Button;
    protected JButton number2Button;
    protected JButton number3Button;
    protected JButton number4Button;
    protected JButton number5Button;
    protected JButton number6Button;
    protected JButton number7Button;
    protected JButton number8Button;
    protected JButton number9Button;
    protected JPopupMenu popup;
    protected JPanel popupPanel;
    protected Boolean popupVisible;
    protected JButton reset;
    protected JToolBar rightToolbar;
    protected JToggleButton showPopUpButton;
    protected Boolean showPopupButton;
    protected Boolean showReset;
    protected JTextField textField;
    protected JButton toggleSignButton;
    protected JButton validateButton;

    /*-----------------------------------------------------------------------*/
    /*------------------------- Private components  -------------------------*/
    /*-----------------------------------------------------------------------*/

    private JButton $JButton0;
    private NumberEditor $JPanel0;

    /*-----------------------------------------------------------------------*/
    /*---------------------- Raw body code from script ----------------------*/
    /*-----------------------------------------------------------------------*/

    @Override
    public Object getBean() { return model.getBean(); }
    
    @Override
    public void setBean(Object bean) { model.setBean(bean); }
    
    // Config delegate methods
    public void setProperty(String property) { model.getConfig().setProperty(property); }
    public void setUseSign(boolean useSign) { model.getConfig().setUseSign(useSign); }
    public void setNumberType(Class numberType) { model.getConfig().setNumberType(numberType); }
    public void setSelectAllTextOnError(boolean selectAllTextOnError) { model.getConfig().setSelectAllTextOnError(selectAllTextOnError); }
    
    // Model delegate methods
    public void setNumberValue(Number numberValue) { model.setNumberValue(numberValue); }
    public void setNumberPattern(String numberPattern) { model.setNumberPattern(numberPattern); }
    
    public void init() { handler.init(this); }
    
    public void reset() { handler.reset(); }
    
    void showPopup() {
       if ( popupVisible || autoPopup ) {
           if (!popupVisible) {
               setPopupVisible(true);
           } else if (!getPopup().isVisible()) {
               handler.setPopupVisible(true);
           }
       }
    }
    
    @Override
    public void setToolTipText(String toolTipText) {
        super.setToolTipText(toolTipText);
        textField.setToolTipText(toolTipText);
    }

    /*-----------------------------------------------------------------------*/
    /*---------------------------- Constructors  ----------------------------*/
    /*-----------------------------------------------------------------------*/

    public NumberEditor(LayoutManager param0) {
        super(param0);
        $initialize();
    }

    public NumberEditor(JAXXContext parentContext, LayoutManager param1) {
        super(param1);
        JAXXUtil.initContext(this, parentContext);
        $initialize();
    }

    public NumberEditor(LayoutManager param0, boolean param1) {
        super(param0 ,param1);
        $initialize();
    }

    public NumberEditor(JAXXContext parentContext, LayoutManager param1, boolean param2) {
        super(param1 ,param2);
        JAXXUtil.initContext(this, parentContext);
        $initialize();
    }

    public NumberEditor() {
        $initialize();
    }

    public NumberEditor(JAXXContext parentContext) {
        JAXXUtil.initContext(this, parentContext);
        $initialize();
    }

    public NumberEditor(boolean param0) {
        super(param0);
        $initialize();
    }

    public NumberEditor(JAXXContext parentContext, boolean param1) {
        super(param1);
        JAXXUtil.initContext(this, parentContext);
        $initialize();
    }

    /*-----------------------------------------------------------------------*/
    /*--------------------------- Statics methods ---------------------------*/
    /*-----------------------------------------------------------------------*/

    public static JAXXObjectDescriptor $getJAXXObjectDescriptor() {
        return JAXXUtil.decodeCompressedJAXXObjectDescriptor($jaxxObjectDescriptor);
    }

    /*-----------------------------------------------------------------------*/
    /*---------------------- JAXXObject implementation ----------------------*/
    /*-----------------------------------------------------------------------*/

    @Override
    public void applyDataBinding(String $binding) {
        if ($bindings.containsKey($binding)) {
            getDataBinding($binding).applyDataBinding();
        }
        processDataBinding($binding);
    }

    @Override
    public void firePropertyChange(String propertyName, Object oldValue, Object newValue) {
        super.firePropertyChange(propertyName, oldValue, newValue);
    }

    @Override
    public Map get$objectMap() {
        return $objectMap;
    }

    @Override
    public JAXXBinding getDataBinding(String bindingId) {
        return $bindings.get(bindingId);
    }

    @Override
    public JAXXBinding[] getDataBindings() {
        return $bindings.values().toArray(new JAXXBinding[$bindings.size()]);
    }

    @Override
    public Object getObjectById(String id) {
        return $objectMap.get(id);
    }

    @Override
    public void processDataBinding(String $binding, boolean $force) {
        if (!$force && $activeBindings.contains($binding)) { 
            return;
        }
        $activeBindings.add($binding);
        try {
            if ($bindings.containsKey($binding)) {
                getDataBinding($binding).processDataBinding();
            }
        } finally {
            $activeBindings.remove($binding);
        }
    }

    @Override
    public void processDataBinding(String $binding) {
        processDataBinding($binding, false);
    }

    @Override
    public void registerDataBinding(JAXXBinding binding) {
        $bindings.put(binding.getId(), binding);
    }

    @Override
    public void removeDataBinding(String $binding) {
        if ($bindings.containsKey($binding)) {
            getDataBinding($binding).removeDataBinding();
        }
    }

    /*-----------------------------------------------------------------------*/
    /*--------------------- JAXXContext implementation  ---------------------*/
    /*-----------------------------------------------------------------------*/

    @Override
    public  T getContextValue(Class clazz) {
        return delegateContext.getContextValue(clazz, null);
    }

    @Override
    public  T getContextValue(Class clazz, String name) {
        return delegateContext.getContextValue(clazz, name);
    }

    @Override
    public JAXXContext getDelegateContext() {
        return delegateContext;
    }

    @Override
    public  O getParentContainer(Class clazz) {
        return SwingUtil.getParentContainer(this, clazz);
    }

    @Override
    public  O getParentContainer(Object source, Class clazz) {
        return SwingUtil.getParentContainer(source, clazz);
    }

    @Override
    public  void removeContextValue(Class clazz) {
        delegateContext.removeContextValue(clazz, null);
    }

    @Override
    public  void removeContextValue(Class clazz, String name) {
        delegateContext.removeContextValue(clazz, name);
    }

    @Override
    public  void setContextValue(T o) {
        delegateContext.setContextValue(o, null);
    }

    @Override
    public  void setContextValue(T o, String name) {
        delegateContext.setContextValue(o, name);
    }

    /*-----------------------------------------------------------------------*/
    /*---------------------------- Event methods ----------------------------*/
    /*-----------------------------------------------------------------------*/

    public void doActionPerformed__on__clearAllButton(ActionEvent event) {
        if (log.isDebugEnabled()) {
            log.debug(event);
        }
        handler.reset();
    }

    public void doActionPerformed__on__clearOnebutton(ActionEvent event) {
        if (log.isDebugEnabled()) {
            log.debug(event);
        }
        handler.removeChar();
    }

    public void doActionPerformed__on__dotButton(ActionEvent event) {
        if (log.isDebugEnabled()) {
            log.debug(event);
        }
        handler.addChar('.');
    }

    public void doActionPerformed__on__number0(ActionEvent event) {
        if (log.isDebugEnabled()) {
            log.debug(event);
        }
        handler.addChar('0');
    }

    public void doActionPerformed__on__number1Button(ActionEvent event) {
        if (log.isDebugEnabled()) {
            log.debug(event);
        }
        handler.addChar('1');
    }

    public void doActionPerformed__on__number2Button(ActionEvent event) {
        if (log.isDebugEnabled()) {
            log.debug(event);
        }
        handler.addChar('2');
    }

    public void doActionPerformed__on__number3Button(ActionEvent event) {
        if (log.isDebugEnabled()) {
            log.debug(event);
        }
        handler.addChar('3');
    }

    public void doActionPerformed__on__number4Button(ActionEvent event) {
        if (log.isDebugEnabled()) {
            log.debug(event);
        }
        handler.addChar('4');
    }

    public void doActionPerformed__on__number5Button(ActionEvent event) {
        if (log.isDebugEnabled()) {
            log.debug(event);
        }
        handler.addChar('5');
    }

    public void doActionPerformed__on__number6Button(ActionEvent event) {
        if (log.isDebugEnabled()) {
            log.debug(event);
        }
        handler.addChar('6');
    }

    public void doActionPerformed__on__number7Button(ActionEvent event) {
        if (log.isDebugEnabled()) {
            log.debug(event);
        }
        handler.addChar('7');
    }

    public void doActionPerformed__on__number8Button(ActionEvent event) {
        if (log.isDebugEnabled()) {
            log.debug(event);
        }
        handler.addChar('8');
    }

    public void doActionPerformed__on__number9Button(ActionEvent event) {
        if (log.isDebugEnabled()) {
            log.debug(event);
        }
        handler.addChar('9');
    }

    public void doActionPerformed__on__showPopUpButton(ActionEvent event) {
        if (log.isDebugEnabled()) {
            log.debug(event);
        }
        handler.setPopupVisible(!popup.isVisible());
    }

    public void doActionPerformed__on__toggleSignButton(ActionEvent event) {
        if (log.isDebugEnabled()) {
            log.debug(event);
        }
        handler.toggleSign();
    }

    public void doActionPerformed__on__validateButton(ActionEvent event) {
        if (log.isDebugEnabled()) {
            log.debug(event);
        }
        handler.validate();
    }

    public void doKeyReleased__on__textField(KeyEvent event) {
        if (log.isDebugEnabled()) {
            log.debug(event);
        }
        handler.setTextValue(event, textField.getText());
    }

    public void doMouseEntered__on__clearAllButton(MouseEvent event) {
        if (log.isDebugEnabled()) {
            log.debug(event);
        }
        Object value = Pseudoclasses.applyProperty(NumberEditor.this, clearAllButton, "font-weight", "bold", Pseudoclasses.wrap((clearAllButton.getFont().getStyle() & Font.BOLD) != 0 ? "bold" : "normal"), 0);
        if (!(value instanceof DataBinding)) {
            if (clearAllButton.getFont() != null) {
            if (((String) value).equals("bold")) {
                clearAllButton.setFont(clearAllButton.getFont().deriveFont(clearAllButton.getFont().getStyle() | Font.BOLD));
            } else {
                clearAllButton.setFont(clearAllButton.getFont().deriveFont(clearAllButton.getFont().getStyle() & ~Font.BOLD));
            }
        }
        }
    }

    public void doMouseEntered__on__clearOnebutton(MouseEvent event) {
        if (log.isDebugEnabled()) {
            log.debug(event);
        }
        Object value = Pseudoclasses.applyProperty(NumberEditor.this, clearOnebutton, "font-weight", "bold", Pseudoclasses.wrap((clearOnebutton.getFont().getStyle() & Font.BOLD) != 0 ? "bold" : "normal"), 0);
        if (!(value instanceof DataBinding)) {
            if (clearOnebutton.getFont() != null) {
            if (((String) value).equals("bold")) {
                clearOnebutton.setFont(clearOnebutton.getFont().deriveFont(clearOnebutton.getFont().getStyle() | Font.BOLD));
            } else {
                clearOnebutton.setFont(clearOnebutton.getFont().deriveFont(clearOnebutton.getFont().getStyle() & ~Font.BOLD));
            }
        }
        }
    }

    public void doMouseEntered__on__dotButton(MouseEvent event) {
        if (log.isDebugEnabled()) {
            log.debug(event);
        }
        Object value = Pseudoclasses.applyProperty(NumberEditor.this, dotButton, "font-weight", "normal", Pseudoclasses.wrap((dotButton.getFont().getStyle() & Font.BOLD) != 0 ? "bold" : "normal"), 0);
        if (!(value instanceof DataBinding)) {
            if (dotButton.getFont() != null) {
            if (((String) value).equals("bold")) {
                dotButton.setFont(dotButton.getFont().deriveFont(dotButton.getFont().getStyle() | Font.BOLD));
            } else {
                dotButton.setFont(dotButton.getFont().deriveFont(dotButton.getFont().getStyle() & ~Font.BOLD));
            }
        }
        }
    }

    public void doMouseEntered__on__number0(MouseEvent event) {
        if (log.isDebugEnabled()) {
            log.debug(event);
        }
        Object value = Pseudoclasses.applyProperty(NumberEditor.this, number0, "font-weight", "bold", Pseudoclasses.wrap((number0.getFont().getStyle() & Font.BOLD) != 0 ? "bold" : "normal"), 0);
        if (!(value instanceof DataBinding)) {
            if (number0.getFont() != null) {
            if (((String) value).equals("bold")) {
                number0.setFont(number0.getFont().deriveFont(number0.getFont().getStyle() | Font.BOLD));
            } else {
                number0.setFont(number0.getFont().deriveFont(number0.getFont().getStyle() & ~Font.BOLD));
            }
        }
        }
    }

    public void doMouseEntered__on__number1Button(MouseEvent event) {
        if (log.isDebugEnabled()) {
            log.debug(event);
        }
        Object value = Pseudoclasses.applyProperty(NumberEditor.this, number1Button, "font-weight", "bold", Pseudoclasses.wrap((number1Button.getFont().getStyle() & Font.BOLD) != 0 ? "bold" : "normal"), 0);
        if (!(value instanceof DataBinding)) {
            if (number1Button.getFont() != null) {
            if (((String) value).equals("bold")) {
                number1Button.setFont(number1Button.getFont().deriveFont(number1Button.getFont().getStyle() | Font.BOLD));
            } else {
                number1Button.setFont(number1Button.getFont().deriveFont(number1Button.getFont().getStyle() & ~Font.BOLD));
            }
        }
        }
    }

    public void doMouseEntered__on__number2Button(MouseEvent event) {
        if (log.isDebugEnabled()) {
            log.debug(event);
        }
        Object value = Pseudoclasses.applyProperty(NumberEditor.this, number2Button, "font-weight", "bold", Pseudoclasses.wrap((number2Button.getFont().getStyle() & Font.BOLD) != 0 ? "bold" : "normal"), 0);
        if (!(value instanceof DataBinding)) {
            if (number2Button.getFont() != null) {
            if (((String) value).equals("bold")) {
                number2Button.setFont(number2Button.getFont().deriveFont(number2Button.getFont().getStyle() | Font.BOLD));
            } else {
                number2Button.setFont(number2Button.getFont().deriveFont(number2Button.getFont().getStyle() & ~Font.BOLD));
            }
        }
        }
    }

    public void doMouseEntered__on__number3Button(MouseEvent event) {
        if (log.isDebugEnabled()) {
            log.debug(event);
        }
        Object value = Pseudoclasses.applyProperty(NumberEditor.this, number3Button, "font-weight", "bold", Pseudoclasses.wrap((number3Button.getFont().getStyle() & Font.BOLD) != 0 ? "bold" : "normal"), 0);
        if (!(value instanceof DataBinding)) {
            if (number3Button.getFont() != null) {
            if (((String) value).equals("bold")) {
                number3Button.setFont(number3Button.getFont().deriveFont(number3Button.getFont().getStyle() | Font.BOLD));
            } else {
                number3Button.setFont(number3Button.getFont().deriveFont(number3Button.getFont().getStyle() & ~Font.BOLD));
            }
        }
        }
    }

    public void doMouseEntered__on__number4Button(MouseEvent event) {
        if (log.isDebugEnabled()) {
            log.debug(event);
        }
        Object value = Pseudoclasses.applyProperty(NumberEditor.this, number4Button, "font-weight", "bold", Pseudoclasses.wrap((number4Button.getFont().getStyle() & Font.BOLD) != 0 ? "bold" : "normal"), 0);
        if (!(value instanceof DataBinding)) {
            if (number4Button.getFont() != null) {
            if (((String) value).equals("bold")) {
                number4Button.setFont(number4Button.getFont().deriveFont(number4Button.getFont().getStyle() | Font.BOLD));
            } else {
                number4Button.setFont(number4Button.getFont().deriveFont(number4Button.getFont().getStyle() & ~Font.BOLD));
            }
        }
        }
    }

    public void doMouseEntered__on__number5Button(MouseEvent event) {
        if (log.isDebugEnabled()) {
            log.debug(event);
        }
        Object value = Pseudoclasses.applyProperty(NumberEditor.this, number5Button, "font-weight", "bold", Pseudoclasses.wrap((number5Button.getFont().getStyle() & Font.BOLD) != 0 ? "bold" : "normal"), 0);
        if (!(value instanceof DataBinding)) {
            if (number5Button.getFont() != null) {
            if (((String) value).equals("bold")) {
                number5Button.setFont(number5Button.getFont().deriveFont(number5Button.getFont().getStyle() | Font.BOLD));
            } else {
                number5Button.setFont(number5Button.getFont().deriveFont(number5Button.getFont().getStyle() & ~Font.BOLD));
            }
        }
        }
    }

    public void doMouseEntered__on__number6Button(MouseEvent event) {
        if (log.isDebugEnabled()) {
            log.debug(event);
        }
        Object value = Pseudoclasses.applyProperty(NumberEditor.this, number6Button, "font-weight", "bold", Pseudoclasses.wrap((number6Button.getFont().getStyle() & Font.BOLD) != 0 ? "bold" : "normal"), 0);
        if (!(value instanceof DataBinding)) {
            if (number6Button.getFont() != null) {
            if (((String) value).equals("bold")) {
                number6Button.setFont(number6Button.getFont().deriveFont(number6Button.getFont().getStyle() | Font.BOLD));
            } else {
                number6Button.setFont(number6Button.getFont().deriveFont(number6Button.getFont().getStyle() & ~Font.BOLD));
            }
        }
        }
    }

    public void doMouseEntered__on__number7Button(MouseEvent event) {
        if (log.isDebugEnabled()) {
            log.debug(event);
        }
        Object value = Pseudoclasses.applyProperty(NumberEditor.this, number7Button, "font-weight", "bold", Pseudoclasses.wrap((number7Button.getFont().getStyle() & Font.BOLD) != 0 ? "bold" : "normal"), 0);
        if (!(value instanceof DataBinding)) {
            if (number7Button.getFont() != null) {
            if (((String) value).equals("bold")) {
                number7Button.setFont(number7Button.getFont().deriveFont(number7Button.getFont().getStyle() | Font.BOLD));
            } else {
                number7Button.setFont(number7Button.getFont().deriveFont(number7Button.getFont().getStyle() & ~Font.BOLD));
            }
        }
        }
    }

    public void doMouseEntered__on__number8Button(MouseEvent event) {
        if (log.isDebugEnabled()) {
            log.debug(event);
        }
        Object value = Pseudoclasses.applyProperty(NumberEditor.this, number8Button, "font-weight", "bold", Pseudoclasses.wrap((number8Button.getFont().getStyle() & Font.BOLD) != 0 ? "bold" : "normal"), 0);
        if (!(value instanceof DataBinding)) {
            if (number8Button.getFont() != null) {
            if (((String) value).equals("bold")) {
                number8Button.setFont(number8Button.getFont().deriveFont(number8Button.getFont().getStyle() | Font.BOLD));
            } else {
                number8Button.setFont(number8Button.getFont().deriveFont(number8Button.getFont().getStyle() & ~Font.BOLD));
            }
        }
        }
    }

    public void doMouseEntered__on__number9Button(MouseEvent event) {
        if (log.isDebugEnabled()) {
            log.debug(event);
        }
        Object value = Pseudoclasses.applyProperty(NumberEditor.this, number9Button, "font-weight", "bold", Pseudoclasses.wrap((number9Button.getFont().getStyle() & Font.BOLD) != 0 ? "bold" : "normal"), 0);
        if (!(value instanceof DataBinding)) {
            if (number9Button.getFont() != null) {
            if (((String) value).equals("bold")) {
                number9Button.setFont(number9Button.getFont().deriveFont(number9Button.getFont().getStyle() | Font.BOLD));
            } else {
                number9Button.setFont(number9Button.getFont().deriveFont(number9Button.getFont().getStyle() & ~Font.BOLD));
            }
        }
        }
    }

    public void doMouseEntered__on__toggleSignButton(MouseEvent event) {
        if (log.isDebugEnabled()) {
            log.debug(event);
        }
        Object value = Pseudoclasses.applyProperty(NumberEditor.this, toggleSignButton, "font-weight", "normal", Pseudoclasses.wrap((toggleSignButton.getFont().getStyle() & Font.BOLD) != 0 ? "bold" : "normal"), 0);
        if (!(value instanceof DataBinding)) {
            if (toggleSignButton.getFont() != null) {
            if (((String) value).equals("bold")) {
                toggleSignButton.setFont(toggleSignButton.getFont().deriveFont(toggleSignButton.getFont().getStyle() | Font.BOLD));
            } else {
                toggleSignButton.setFont(toggleSignButton.getFont().deriveFont(toggleSignButton.getFont().getStyle() & ~Font.BOLD));
            }
        }
        }
    }

    public void doMouseExited__on__$JPanel0(MouseEvent event) {
        if (log.isDebugEnabled()) {
            log.debug(event);
        }
        setPopupVisible(false);popup.setVisible(false);
    }

    public void doMouseExited__on__clearAllButton(MouseEvent event) {
        if (log.isDebugEnabled()) {
            log.debug(event);
        }
        Object value = Pseudoclasses.removeProperty(NumberEditor.this, clearAllButton, "font-weight", "bold", Pseudoclasses.wrap((clearAllButton.getFont().getStyle() & Font.BOLD) != 0 ? "bold" : "normal"), 0);
        if (!(value instanceof DataBinding)) {
            if (clearAllButton.getFont() != null) {
            if (((String) value).equals("bold")) {
                clearAllButton.setFont(clearAllButton.getFont().deriveFont(clearAllButton.getFont().getStyle() | Font.BOLD));
            } else {
                clearAllButton.setFont(clearAllButton.getFont().deriveFont(clearAllButton.getFont().getStyle() & ~Font.BOLD));
            }
        }
        }
    }

    public void doMouseExited__on__clearOnebutton(MouseEvent event) {
        if (log.isDebugEnabled()) {
            log.debug(event);
        }
        Object value = Pseudoclasses.removeProperty(NumberEditor.this, clearOnebutton, "font-weight", "bold", Pseudoclasses.wrap((clearOnebutton.getFont().getStyle() & Font.BOLD) != 0 ? "bold" : "normal"), 0);
        if (!(value instanceof DataBinding)) {
            if (clearOnebutton.getFont() != null) {
            if (((String) value).equals("bold")) {
                clearOnebutton.setFont(clearOnebutton.getFont().deriveFont(clearOnebutton.getFont().getStyle() | Font.BOLD));
            } else {
                clearOnebutton.setFont(clearOnebutton.getFont().deriveFont(clearOnebutton.getFont().getStyle() & ~Font.BOLD));
            }
        }
        }
    }

    public void doMouseExited__on__dotButton(MouseEvent event) {
        if (log.isDebugEnabled()) {
            log.debug(event);
        }
        Object value = Pseudoclasses.removeProperty(NumberEditor.this, dotButton, "font-weight", "normal", Pseudoclasses.wrap((dotButton.getFont().getStyle() & Font.BOLD) != 0 ? "bold" : "normal"), 0);
        if (!(value instanceof DataBinding)) {
            if (dotButton.getFont() != null) {
            if (((String) value).equals("bold")) {
                dotButton.setFont(dotButton.getFont().deriveFont(dotButton.getFont().getStyle() | Font.BOLD));
            } else {
                dotButton.setFont(dotButton.getFont().deriveFont(dotButton.getFont().getStyle() & ~Font.BOLD));
            }
        }
        }
    }

    public void doMouseExited__on__number0(MouseEvent event) {
        if (log.isDebugEnabled()) {
            log.debug(event);
        }
        Object value = Pseudoclasses.removeProperty(NumberEditor.this, number0, "font-weight", "bold", Pseudoclasses.wrap((number0.getFont().getStyle() & Font.BOLD) != 0 ? "bold" : "normal"), 0);
        if (!(value instanceof DataBinding)) {
            if (number0.getFont() != null) {
            if (((String) value).equals("bold")) {
                number0.setFont(number0.getFont().deriveFont(number0.getFont().getStyle() | Font.BOLD));
            } else {
                number0.setFont(number0.getFont().deriveFont(number0.getFont().getStyle() & ~Font.BOLD));
            }
        }
        }
    }

    public void doMouseExited__on__number1Button(MouseEvent event) {
        if (log.isDebugEnabled()) {
            log.debug(event);
        }
        Object value = Pseudoclasses.removeProperty(NumberEditor.this, number1Button, "font-weight", "bold", Pseudoclasses.wrap((number1Button.getFont().getStyle() & Font.BOLD) != 0 ? "bold" : "normal"), 0);
        if (!(value instanceof DataBinding)) {
            if (number1Button.getFont() != null) {
            if (((String) value).equals("bold")) {
                number1Button.setFont(number1Button.getFont().deriveFont(number1Button.getFont().getStyle() | Font.BOLD));
            } else {
                number1Button.setFont(number1Button.getFont().deriveFont(number1Button.getFont().getStyle() & ~Font.BOLD));
            }
        }
        }
    }

    public void doMouseExited__on__number2Button(MouseEvent event) {
        if (log.isDebugEnabled()) {
            log.debug(event);
        }
        Object value = Pseudoclasses.removeProperty(NumberEditor.this, number2Button, "font-weight", "bold", Pseudoclasses.wrap((number2Button.getFont().getStyle() & Font.BOLD) != 0 ? "bold" : "normal"), 0);
        if (!(value instanceof DataBinding)) {
            if (number2Button.getFont() != null) {
            if (((String) value).equals("bold")) {
                number2Button.setFont(number2Button.getFont().deriveFont(number2Button.getFont().getStyle() | Font.BOLD));
            } else {
                number2Button.setFont(number2Button.getFont().deriveFont(number2Button.getFont().getStyle() & ~Font.BOLD));
            }
        }
        }
    }

    public void doMouseExited__on__number3Button(MouseEvent event) {
        if (log.isDebugEnabled()) {
            log.debug(event);
        }
        Object value = Pseudoclasses.removeProperty(NumberEditor.this, number3Button, "font-weight", "bold", Pseudoclasses.wrap((number3Button.getFont().getStyle() & Font.BOLD) != 0 ? "bold" : "normal"), 0);
        if (!(value instanceof DataBinding)) {
            if (number3Button.getFont() != null) {
            if (((String) value).equals("bold")) {
                number3Button.setFont(number3Button.getFont().deriveFont(number3Button.getFont().getStyle() | Font.BOLD));
            } else {
                number3Button.setFont(number3Button.getFont().deriveFont(number3Button.getFont().getStyle() & ~Font.BOLD));
            }
        }
        }
    }

    public void doMouseExited__on__number4Button(MouseEvent event) {
        if (log.isDebugEnabled()) {
            log.debug(event);
        }
        Object value = Pseudoclasses.removeProperty(NumberEditor.this, number4Button, "font-weight", "bold", Pseudoclasses.wrap((number4Button.getFont().getStyle() & Font.BOLD) != 0 ? "bold" : "normal"), 0);
        if (!(value instanceof DataBinding)) {
            if (number4Button.getFont() != null) {
            if (((String) value).equals("bold")) {
                number4Button.setFont(number4Button.getFont().deriveFont(number4Button.getFont().getStyle() | Font.BOLD));
            } else {
                number4Button.setFont(number4Button.getFont().deriveFont(number4Button.getFont().getStyle() & ~Font.BOLD));
            }
        }
        }
    }

    public void doMouseExited__on__number5Button(MouseEvent event) {
        if (log.isDebugEnabled()) {
            log.debug(event);
        }
        Object value = Pseudoclasses.removeProperty(NumberEditor.this, number5Button, "font-weight", "bold", Pseudoclasses.wrap((number5Button.getFont().getStyle() & Font.BOLD) != 0 ? "bold" : "normal"), 0);
        if (!(value instanceof DataBinding)) {
            if (number5Button.getFont() != null) {
            if (((String) value).equals("bold")) {
                number5Button.setFont(number5Button.getFont().deriveFont(number5Button.getFont().getStyle() | Font.BOLD));
            } else {
                number5Button.setFont(number5Button.getFont().deriveFont(number5Button.getFont().getStyle() & ~Font.BOLD));
            }
        }
        }
    }

    public void doMouseExited__on__number6Button(MouseEvent event) {
        if (log.isDebugEnabled()) {
            log.debug(event);
        }
        Object value = Pseudoclasses.removeProperty(NumberEditor.this, number6Button, "font-weight", "bold", Pseudoclasses.wrap((number6Button.getFont().getStyle() & Font.BOLD) != 0 ? "bold" : "normal"), 0);
        if (!(value instanceof DataBinding)) {
            if (number6Button.getFont() != null) {
            if (((String) value).equals("bold")) {
                number6Button.setFont(number6Button.getFont().deriveFont(number6Button.getFont().getStyle() | Font.BOLD));
            } else {
                number6Button.setFont(number6Button.getFont().deriveFont(number6Button.getFont().getStyle() & ~Font.BOLD));
            }
        }
        }
    }

    public void doMouseExited__on__number7Button(MouseEvent event) {
        if (log.isDebugEnabled()) {
            log.debug(event);
        }
        Object value = Pseudoclasses.removeProperty(NumberEditor.this, number7Button, "font-weight", "bold", Pseudoclasses.wrap((number7Button.getFont().getStyle() & Font.BOLD) != 0 ? "bold" : "normal"), 0);
        if (!(value instanceof DataBinding)) {
            if (number7Button.getFont() != null) {
            if (((String) value).equals("bold")) {
                number7Button.setFont(number7Button.getFont().deriveFont(number7Button.getFont().getStyle() | Font.BOLD));
            } else {
                number7Button.setFont(number7Button.getFont().deriveFont(number7Button.getFont().getStyle() & ~Font.BOLD));
            }
        }
        }
    }

    public void doMouseExited__on__number8Button(MouseEvent event) {
        if (log.isDebugEnabled()) {
            log.debug(event);
        }
        Object value = Pseudoclasses.removeProperty(NumberEditor.this, number8Button, "font-weight", "bold", Pseudoclasses.wrap((number8Button.getFont().getStyle() & Font.BOLD) != 0 ? "bold" : "normal"), 0);
        if (!(value instanceof DataBinding)) {
            if (number8Button.getFont() != null) {
            if (((String) value).equals("bold")) {
                number8Button.setFont(number8Button.getFont().deriveFont(number8Button.getFont().getStyle() | Font.BOLD));
            } else {
                number8Button.setFont(number8Button.getFont().deriveFont(number8Button.getFont().getStyle() & ~Font.BOLD));
            }
        }
        }
    }

    public void doMouseExited__on__number9Button(MouseEvent event) {
        if (log.isDebugEnabled()) {
            log.debug(event);
        }
        Object value = Pseudoclasses.removeProperty(NumberEditor.this, number9Button, "font-weight", "bold", Pseudoclasses.wrap((number9Button.getFont().getStyle() & Font.BOLD) != 0 ? "bold" : "normal"), 0);
        if (!(value instanceof DataBinding)) {
            if (number9Button.getFont() != null) {
            if (((String) value).equals("bold")) {
                number9Button.setFont(number9Button.getFont().deriveFont(number9Button.getFont().getStyle() | Font.BOLD));
            } else {
                number9Button.setFont(number9Button.getFont().deriveFont(number9Button.getFont().getStyle() & ~Font.BOLD));
            }
        }
        }
    }

    public void doMouseExited__on__toggleSignButton(MouseEvent event) {
        if (log.isDebugEnabled()) {
            log.debug(event);
        }
        Object value = Pseudoclasses.removeProperty(NumberEditor.this, toggleSignButton, "font-weight", "normal", Pseudoclasses.wrap((toggleSignButton.getFont().getStyle() & Font.BOLD) != 0 ? "bold" : "normal"), 0);
        if (!(value instanceof DataBinding)) {
            if (toggleSignButton.getFont() != null) {
            if (((String) value).equals("bold")) {
                toggleSignButton.setFont(toggleSignButton.getFont().deriveFont(toggleSignButton.getFont().getStyle() | Font.BOLD));
            } else {
                toggleSignButton.setFont(toggleSignButton.getFont().deriveFont(toggleSignButton.getFont().getStyle() & ~Font.BOLD));
            }
        }
        }
    }

    public void doPopupMenuCanceled__on__popup(PopupMenuEvent event) {
        if (log.isDebugEnabled()) {
            log.debug(event);
        }
        showPopUpButton.setSelected(false);
    }

    public void doPopupMenuWillBecomeInvisible__on__popup(PopupMenuEvent event) {
        if (log.isDebugEnabled()) {
            log.debug(event);
        }
        showPopUpButton.setSelected(false);
    }

    public void doPopupMenuWillBecomeVisible__on__popup(PopupMenuEvent event) {
        if (log.isDebugEnabled()) {
            log.debug(event);
        }
        showPopUpButton.setSelected(true);
    }

    /*-----------------------------------------------------------------------*/
    /*----------------------- Public acessor methods  -----------------------*/
    /*-----------------------------------------------------------------------*/

    public Boolean getAutoPopup() {
        return autoPopup;
    }

    public JButton getClearAllButton() {
        return clearAllButton;
    }

    public JButton getClearOnebutton() {
        return clearOnebutton;
    }

    public JButton getDotButton() {
        return dotButton;
    }

    public NumberEditorHandler getHandler() {
        return handler;
    }

    public JToolBar getLeftToolbar() {
        return leftToolbar;
    }

    public NumberEditorModel getModel() {
        return model;
    }

    public JButton getNumber0() {
        return number0;
    }

    public JButton getNumber1Button() {
        return number1Button;
    }

    public JButton getNumber2Button() {
        return number2Button;
    }

    public JButton getNumber3Button() {
        return number3Button;
    }

    public JButton getNumber4Button() {
        return number4Button;
    }

    public JButton getNumber5Button() {
        return number5Button;
    }

    public JButton getNumber6Button() {
        return number6Button;
    }

    public JButton getNumber7Button() {
        return number7Button;
    }

    public JButton getNumber8Button() {
        return number8Button;
    }

    public JButton getNumber9Button() {
        return number9Button;
    }

    public JPopupMenu getPopup() {
        return popup;
    }

    public JPanel getPopupPanel() {
        return popupPanel;
    }

    public Boolean getPopupVisible() {
        return popupVisible;
    }

    public JButton getReset() {
        return reset;
    }

    public JToolBar getRightToolbar() {
        return rightToolbar;
    }

    public JToggleButton getShowPopUpButton() {
        return showPopUpButton;
    }

    public Boolean getShowPopupButton() {
        return showPopupButton;
    }

    public Boolean getShowReset() {
        return showReset;
    }

    public JTextField getTextField() {
        return textField;
    }

    public JButton getToggleSignButton() {
        return toggleSignButton;
    }

    public JButton getValidateButton() {
        return validateButton;
    }

    public Boolean isAutoPopup() {
        return autoPopup !=null && autoPopup;
    }

    public Boolean isPopupVisible() {
        return popupVisible !=null && popupVisible;
    }

    public Boolean isShowPopupButton() {
        return showPopupButton !=null && showPopupButton;
    }

    public Boolean isShowReset() {
        return showReset !=null && showReset;
    }

    /*-----------------------------------------------------------------------*/
    /*----------------------- Public mutator methods  -----------------------*/
    /*-----------------------------------------------------------------------*/

    public void setAutoPopup(Boolean autoPopup) {
        Boolean oldValue = this.autoPopup;
        this.autoPopup = autoPopup;
        firePropertyChange(PROPERTY_AUTO_POPUP, oldValue, autoPopup);
    }

    public void setPopupVisible(Boolean popupVisible) {
        Boolean oldValue = this.popupVisible;
        this.popupVisible = popupVisible;
        firePropertyChange(PROPERTY_POPUP_VISIBLE, oldValue, popupVisible);
    }

    public void setShowPopupButton(Boolean showPopupButton) {
        Boolean oldValue = this.showPopupButton;
        this.showPopupButton = showPopupButton;
        firePropertyChange(PROPERTY_SHOW_POPUP_BUTTON, oldValue, showPopupButton);
    }

    public void setShowReset(Boolean showReset) {
        Boolean oldValue = this.showReset;
        this.showReset = showReset;
        firePropertyChange(PROPERTY_SHOW_RESET, oldValue, showReset);
    }

    /*-----------------------------------------------------------------------*/
    /*--------------------- Protected acessors methods  ---------------------*/
    /*-----------------------------------------------------------------------*/

    protected JButton get$JButton0() {
        return $JButton0;
    }

    /*-----------------------------------------------------------------------*/
    /*--------------------- Components creation methods ---------------------*/
    /*-----------------------------------------------------------------------*/

    protected void addChildrenToLeftToolbar() {
        leftToolbar.add(reset);
    }

    protected void addChildrenToPopup() {
        popup.add(popupPanel);
    }

    protected void addChildrenToPopupPanel() {
        popupPanel.add(number7Button);
        popupPanel.add(number8Button);
        popupPanel.add(number9Button);
        popupPanel.add(clearAllButton);
        popupPanel.add(number4Button);
        popupPanel.add(number5Button);
        popupPanel.add(number6Button);
        popupPanel.add(clearOnebutton);
        popupPanel.add(number1Button);
        popupPanel.add(number2Button);
        popupPanel.add(number3Button);
        popupPanel.add($JButton0);
        popupPanel.add(number0);
        popupPanel.add(toggleSignButton);
        popupPanel.add(dotButton);
        popupPanel.add(validateButton);
    }

    protected void addChildrenToRightToolbar() {
        rightToolbar.add(showPopUpButton);
    }

    protected void createAutoPopup() {
        $objectMap.put("autoPopup", autoPopup = false);
    }

    protected void createClearAllButton() {
        $objectMap.put("clearAllButton", clearAllButton = new JButton());
        
        clearAllButton.setName("clearAllButton");
        if (clearAllButton.getFont() != null) {
            clearAllButton.setFont(clearAllButton.getFont().deriveFont((float) 14));
        }
        clearAllButton.setFocusable(false);
        clearAllButton.setForeground(new Color(255, 0, 0));
        clearAllButton.setText(t("numbereditor.clearAll"));
        clearAllButton.setFocusPainted(false);
        clearAllButton.addActionListener(JAXXUtil.getEventListener(ActionListener.class, "actionPerformed", this, "doActionPerformed__on__clearAllButton"));
        clearAllButton.addMouseListener(JAXXUtil.getEventListener(MouseListener.class, "mouseEntered", this, "doMouseEntered__on__clearAllButton"));
        clearAllButton.addMouseListener(JAXXUtil.getEventListener(MouseListener.class, "mouseExited", this, "doMouseExited__on__clearAllButton"));
    }

    protected void createClearOnebutton() {
        $objectMap.put("clearOnebutton", clearOnebutton = new JButton());
        
        clearOnebutton.setName("clearOnebutton");
        if (clearOnebutton.getFont() != null) {
            clearOnebutton.setFont(clearOnebutton.getFont().deriveFont((float) 14));
        }
        clearOnebutton.setFocusable(false);
        clearOnebutton.setForeground(new Color(255, 0, 0));
        clearOnebutton.setFocusPainted(false);
        clearOnebutton.addActionListener(JAXXUtil.getEventListener(ActionListener.class, "actionPerformed", this, "doActionPerformed__on__clearOnebutton"));
        clearOnebutton.addMouseListener(JAXXUtil.getEventListener(MouseListener.class, "mouseEntered", this, "doMouseEntered__on__clearOnebutton"));
        clearOnebutton.addMouseListener(JAXXUtil.getEventListener(MouseListener.class, "mouseExited", this, "doMouseExited__on__clearOnebutton"));
    }

    protected void createDotButton() {
        $objectMap.put("dotButton", dotButton = new JButton());
        
        dotButton.setName("dotButton");
        if (dotButton.getFont() != null) {
            dotButton.setFont(dotButton.getFont().deriveFont((float) 14));
        }
        dotButton.setFocusable(false);
        dotButton.setForeground(new Color(0, 153, 0));
        dotButton.setText(t("numbereditor.."));
        dotButton.setFocusPainted(false);
        dotButton.addActionListener(JAXXUtil.getEventListener(ActionListener.class, "actionPerformed", this, "doActionPerformed__on__dotButton"));
        dotButton.addMouseListener(JAXXUtil.getEventListener(MouseListener.class, "mouseEntered", this, "doMouseEntered__on__dotButton"));
        dotButton.addMouseListener(JAXXUtil.getEventListener(MouseListener.class, "mouseExited", this, "doMouseExited__on__dotButton"));
    }

    protected void createLeftToolbar() {
        $objectMap.put("leftToolbar", leftToolbar = new JToolBar());
        
        leftToolbar.setName("leftToolbar");
        leftToolbar.setBorderPainted(false);
        leftToolbar.setOpaque(false);
        leftToolbar.setFloatable(false);
    }

    protected void createModel() {
        $objectMap.put("model", model = getContextValue(NumberEditorModel.class));
    }

    protected void createNumber0() {
        $objectMap.put("number0", number0 = new JButton());
        
        number0.setName("number0");
        if (number0.getFont() != null) {
            number0.setFont(number0.getFont().deriveFont((float) 14));
        }
        number0.setFocusable(false);
        number0.setForeground(new Color(0, 0, 255));
        number0.setFocusPainted(false);
        number0.addActionListener(JAXXUtil.getEventListener(ActionListener.class, "actionPerformed", this, "doActionPerformed__on__number0"));
        number0.addMouseListener(JAXXUtil.getEventListener(MouseListener.class, "mouseEntered", this, "doMouseEntered__on__number0"));
        number0.addMouseListener(JAXXUtil.getEventListener(MouseListener.class, "mouseExited", this, "doMouseExited__on__number0"));
    }

    protected void createNumber1Button() {
        $objectMap.put("number1Button", number1Button = new JButton());
        
        number1Button.setName("number1Button");
        if (number1Button.getFont() != null) {
            number1Button.setFont(number1Button.getFont().deriveFont((float) 14));
        }
        number1Button.setFocusable(false);
        number1Button.setForeground(new Color(0, 0, 255));
        number1Button.setText(t("numbereditor.1"));
        number1Button.setFocusPainted(false);
        number1Button.addActionListener(JAXXUtil.getEventListener(ActionListener.class, "actionPerformed", this, "doActionPerformed__on__number1Button"));
        number1Button.addMouseListener(JAXXUtil.getEventListener(MouseListener.class, "mouseEntered", this, "doMouseEntered__on__number1Button"));
        number1Button.addMouseListener(JAXXUtil.getEventListener(MouseListener.class, "mouseExited", this, "doMouseExited__on__number1Button"));
    }

    protected void createNumber2Button() {
        $objectMap.put("number2Button", number2Button = new JButton());
        
        number2Button.setName("number2Button");
        if (number2Button.getFont() != null) {
            number2Button.setFont(number2Button.getFont().deriveFont((float) 14));
        }
        number2Button.setFocusable(false);
        number2Button.setForeground(new Color(0, 0, 255));
        number2Button.setText(t("numbereditor.2"));
        number2Button.setFocusPainted(false);
        number2Button.addActionListener(JAXXUtil.getEventListener(ActionListener.class, "actionPerformed", this, "doActionPerformed__on__number2Button"));
        number2Button.addMouseListener(JAXXUtil.getEventListener(MouseListener.class, "mouseEntered", this, "doMouseEntered__on__number2Button"));
        number2Button.addMouseListener(JAXXUtil.getEventListener(MouseListener.class, "mouseExited", this, "doMouseExited__on__number2Button"));
    }

    protected void createNumber3Button() {
        $objectMap.put("number3Button", number3Button = new JButton());
        
        number3Button.setName("number3Button");
        if (number3Button.getFont() != null) {
            number3Button.setFont(number3Button.getFont().deriveFont((float) 14));
        }
        number3Button.setFocusable(false);
        number3Button.setForeground(new Color(0, 0, 255));
        number3Button.setText(t("numbereditor.3"));
        number3Button.setFocusPainted(false);
        number3Button.addActionListener(JAXXUtil.getEventListener(ActionListener.class, "actionPerformed", this, "doActionPerformed__on__number3Button"));
        number3Button.addMouseListener(JAXXUtil.getEventListener(MouseListener.class, "mouseEntered", this, "doMouseEntered__on__number3Button"));
        number3Button.addMouseListener(JAXXUtil.getEventListener(MouseListener.class, "mouseExited", this, "doMouseExited__on__number3Button"));
    }

    protected void createNumber4Button() {
        $objectMap.put("number4Button", number4Button = new JButton());
        
        number4Button.setName("number4Button");
        if (number4Button.getFont() != null) {
            number4Button.setFont(number4Button.getFont().deriveFont((float) 14));
        }
        number4Button.setFocusable(false);
        number4Button.setForeground(new Color(0, 0, 255));
        number4Button.setText(t("numbereditor.4"));
        number4Button.setFocusPainted(false);
        number4Button.addActionListener(JAXXUtil.getEventListener(ActionListener.class, "actionPerformed", this, "doActionPerformed__on__number4Button"));
        number4Button.addMouseListener(JAXXUtil.getEventListener(MouseListener.class, "mouseEntered", this, "doMouseEntered__on__number4Button"));
        number4Button.addMouseListener(JAXXUtil.getEventListener(MouseListener.class, "mouseExited", this, "doMouseExited__on__number4Button"));
    }

    protected void createNumber5Button() {
        $objectMap.put("number5Button", number5Button = new JButton());
        
        number5Button.setName("number5Button");
        if (number5Button.getFont() != null) {
            number5Button.setFont(number5Button.getFont().deriveFont((float) 14));
        }
        number5Button.setFocusable(false);
        number5Button.setForeground(new Color(0, 0, 255));
        number5Button.setText(t("numbereditor.5"));
        number5Button.setFocusPainted(false);
        number5Button.addActionListener(JAXXUtil.getEventListener(ActionListener.class, "actionPerformed", this, "doActionPerformed__on__number5Button"));
        number5Button.addMouseListener(JAXXUtil.getEventListener(MouseListener.class, "mouseEntered", this, "doMouseEntered__on__number5Button"));
        number5Button.addMouseListener(JAXXUtil.getEventListener(MouseListener.class, "mouseExited", this, "doMouseExited__on__number5Button"));
    }

    protected void createNumber6Button() {
        $objectMap.put("number6Button", number6Button = new JButton());
        
        number6Button.setName("number6Button");
        if (number6Button.getFont() != null) {
            number6Button.setFont(number6Button.getFont().deriveFont((float) 14));
        }
        number6Button.setFocusable(false);
        number6Button.setForeground(new Color(0, 0, 255));
        number6Button.setText(t("numbereditor.6"));
        number6Button.setFocusPainted(false);
        number6Button.addActionListener(JAXXUtil.getEventListener(ActionListener.class, "actionPerformed", this, "doActionPerformed__on__number6Button"));
        number6Button.addMouseListener(JAXXUtil.getEventListener(MouseListener.class, "mouseEntered", this, "doMouseEntered__on__number6Button"));
        number6Button.addMouseListener(JAXXUtil.getEventListener(MouseListener.class, "mouseExited", this, "doMouseExited__on__number6Button"));
    }

    protected void createNumber7Button() {
        $objectMap.put("number7Button", number7Button = new JButton());
        
        number7Button.setName("number7Button");
        if (number7Button.getFont() != null) {
            number7Button.setFont(number7Button.getFont().deriveFont((float) 14));
        }
        number7Button.setFocusable(false);
        number7Button.setForeground(new Color(0, 0, 255));
        number7Button.setText(t("numbereditor.7"));
        number7Button.setFocusPainted(false);
        number7Button.addActionListener(JAXXUtil.getEventListener(ActionListener.class, "actionPerformed", this, "doActionPerformed__on__number7Button"));
        number7Button.addMouseListener(JAXXUtil.getEventListener(MouseListener.class, "mouseEntered", this, "doMouseEntered__on__number7Button"));
        number7Button.addMouseListener(JAXXUtil.getEventListener(MouseListener.class, "mouseExited", this, "doMouseExited__on__number7Button"));
    }

    protected void createNumber8Button() {
        $objectMap.put("number8Button", number8Button = new JButton());
        
        number8Button.setName("number8Button");
        if (number8Button.getFont() != null) {
            number8Button.setFont(number8Button.getFont().deriveFont((float) 14));
        }
        number8Button.setFocusable(false);
        number8Button.setForeground(new Color(0, 0, 255));
        number8Button.setText(t("numbereditor.8"));
        number8Button.setFocusPainted(false);
        number8Button.addActionListener(JAXXUtil.getEventListener(ActionListener.class, "actionPerformed", this, "doActionPerformed__on__number8Button"));
        number8Button.addMouseListener(JAXXUtil.getEventListener(MouseListener.class, "mouseEntered", this, "doMouseEntered__on__number8Button"));
        number8Button.addMouseListener(JAXXUtil.getEventListener(MouseListener.class, "mouseExited", this, "doMouseExited__on__number8Button"));
    }

    protected void createNumber9Button() {
        $objectMap.put("number9Button", number9Button = new JButton());
        
        number9Button.setName("number9Button");
        if (number9Button.getFont() != null) {
            number9Button.setFont(number9Button.getFont().deriveFont((float) 14));
        }
        number9Button.setFocusable(false);
        number9Button.setForeground(new Color(0, 0, 255));
        number9Button.setText(t("numbereditor.9"));
        number9Button.setFocusPainted(false);
        number9Button.addActionListener(JAXXUtil.getEventListener(ActionListener.class, "actionPerformed", this, "doActionPerformed__on__number9Button"));
        number9Button.addMouseListener(JAXXUtil.getEventListener(MouseListener.class, "mouseEntered", this, "doMouseEntered__on__number9Button"));
        number9Button.addMouseListener(JAXXUtil.getEventListener(MouseListener.class, "mouseExited", this, "doMouseExited__on__number9Button"));
    }

    protected void createPopup() {
        $objectMap.put("popup", popup = new JPopupMenu());
        
        popup.setName("popup");
        popup.addPopupMenuListener(JAXXUtil.getEventListener(PopupMenuListener.class, "popupMenuCanceled", this, "doPopupMenuCanceled__on__popup"));
        popup.addPopupMenuListener(JAXXUtil.getEventListener(PopupMenuListener.class, "popupMenuWillBecomeInvisible", this, "doPopupMenuWillBecomeInvisible__on__popup"));
        popup.addPopupMenuListener(JAXXUtil.getEventListener(PopupMenuListener.class, "popupMenuWillBecomeVisible", this, "doPopupMenuWillBecomeVisible__on__popup"));
    }

    protected void createPopupPanel() {
        $objectMap.put("popupPanel", popupPanel = new JPanel());
        
        popupPanel.setName("popupPanel");
        popupPanel.setLayout(new GridLayout(4,4));
    }

    protected void createPopupVisible() {
        $objectMap.put("popupVisible", popupVisible = false);
    }

    protected void createReset() {
        $objectMap.put("reset", reset = new JButton());
        
        reset.setName("reset");
        reset.setFocusable(false);
        reset.setFocusPainted(false);
    }

    protected void createRightToolbar() {
        $objectMap.put("rightToolbar", rightToolbar = new JToolBar());
        
        rightToolbar.setName("rightToolbar");
        rightToolbar.setBorderPainted(false);
        rightToolbar.setOpaque(false);
        rightToolbar.setFloatable(false);
    }

    protected void createShowPopUpButton() {
        $objectMap.put("showPopUpButton", showPopUpButton = new JToggleButton());
        
        showPopUpButton.setName("showPopUpButton");
        showPopUpButton.setFocusable(false);
        showPopUpButton.setToolTipText(t("numbereditor.action.show.tip"));
        showPopUpButton.setFocusPainted(false);
        showPopUpButton.addActionListener(JAXXUtil.getEventListener(ActionListener.class, "actionPerformed", this, "doActionPerformed__on__showPopUpButton"));
    }

    protected void createShowPopupButton() {
        $objectMap.put("showPopupButton", showPopupButton = false);
    }

    protected void createShowReset() {
        $objectMap.put("showReset", showReset = false);
    }

    protected void createTextField() {
        $objectMap.put("textField", textField = new JTextField());
        
        textField.setName("textField");
        textField.setColumns(15);
        textField.addKeyListener(JAXXUtil.getEventListener(KeyListener.class, "keyReleased", this, "doKeyReleased__on__textField"));
    }

    protected void createToggleSignButton() {
        $objectMap.put("toggleSignButton", toggleSignButton = new JButton());
        
        toggleSignButton.setName("toggleSignButton");
        if (toggleSignButton.getFont() != null) {
            toggleSignButton.setFont(toggleSignButton.getFont().deriveFont((float) 14));
        }
        toggleSignButton.setFocusable(false);
        toggleSignButton.setForeground(new Color(0, 153, 0));
        toggleSignButton.setText(t("numbereditor.toggleSign"));
        toggleSignButton.setFocusPainted(false);
        toggleSignButton.addActionListener(JAXXUtil.getEventListener(ActionListener.class, "actionPerformed", this, "doActionPerformed__on__toggleSignButton"));
        toggleSignButton.addMouseListener(JAXXUtil.getEventListener(MouseListener.class, "mouseEntered", this, "doMouseEntered__on__toggleSignButton"));
        toggleSignButton.addMouseListener(JAXXUtil.getEventListener(MouseListener.class, "mouseExited", this, "doMouseExited__on__toggleSignButton"));
    }

    protected void createValidateButton() {
        $objectMap.put("validateButton", validateButton = new JButton());
        
        validateButton.setName("validateButton");
        validateButton.addActionListener(JAXXUtil.getEventListener(ActionListener.class, "actionPerformed", this, "doActionPerformed__on__validateButton"));
    }

    /*-----------------------------------------------------------------------*/
    /*------------------------ Internal jaxx methods ------------------------*/
    /*-----------------------------------------------------------------------*/

    protected void $initialize() {
        if (log.isDebugEnabled()) {
            log.debug(this);
        }
        $JPanel0 = this;
        handler = new NumberEditorHandler();
        handler.beforeInit(this);
        $initialize_01_createComponents();
        $initialize_02_registerDataBindings();
        $initialize_03_finalizeCreateComponents();
        $initialize_04_applyDataBindings();
        $initialize_05_setProperties();
        $initialize_06_finalizeInitialize();
        handler.afterInit(this);
    }

    protected void $initialize_01_createComponents() {
        if (log.isDebugEnabled()) {
            log.debug(this);
        }
        $objectMap.put("$JPanel0", $JPanel0);
        createModel();
        createAutoPopup();
        createShowPopupButton();
        createShowReset();
        createPopupVisible();
        createPopup();
        createPopupPanel();
        createNumber7Button();
        createNumber8Button();
        createNumber9Button();
        createClearAllButton();
        createNumber4Button();
        createNumber5Button();
        createNumber6Button();
        createClearOnebutton();
        createNumber1Button();
        createNumber2Button();
        createNumber3Button();
        // inline creation of $JButton0
        $objectMap.put("$JButton0", $JButton0 = new JButton());
        
        $JButton0.setName("$JButton0");
        $JButton0.setEnabled(false);
        createNumber0();
        createToggleSignButton();
        createDotButton();
        createValidateButton();
        createLeftToolbar();
        createReset();
        createTextField();
        createRightToolbar();
        createShowPopUpButton();
        // inline creation of $JPanel0
        setName("$JPanel0");
        setLayout(new BorderLayout());
        $JPanel0.addMouseListener(JAXXUtil.getEventListener(MouseListener.class, "mouseExited", this, "doMouseExited__on__$JPanel0"));
    }

    protected void $initialize_02_registerDataBindings() {
        if (log.isDebugEnabled()) {
            log.debug(this);
        }
        // register 10 data bindings
        registerDataBinding(new DefaultJAXXBinding(this, BINDING_CLEAR_ALL_BUTTON_ENABLED, true) {
        
            @Override
            public void applyDataBinding() {
                if (model != null) {
                    model.addPropertyChangeListener("canClearAll", this);
                }
            }
        
            @Override
            public void processDataBinding() {
                if (model != null) {
                    clearAllButton.setEnabled(model.isCanClearAll());
                }
            }
        
            @Override
            public void removeDataBinding() {
                if (model != null) {
                    model.removePropertyChangeListener("canClearAll", this);
                }
            }
        });
        registerDataBinding(new DefaultJAXXBinding(this, BINDING_TOGGLE_SIGN_BUTTON_ENABLED, true) {
        
            @Override
            public void applyDataBinding() {
                if (model != null) {
                    model.addPropertyChangeListener("canUseSign", this);
                }
            }
        
            @Override
            public void processDataBinding() {
                if (model != null) {
                    toggleSignButton.setEnabled(model.isCanUseSign());
                }
            }
        
            @Override
            public void removeDataBinding() {
                if (model != null) {
                    model.removePropertyChangeListener("canUseSign", this);
                }
            }
        });
        registerDataBinding(new DefaultJAXXBinding(this, BINDING_DOT_BUTTON_ENABLED, true) {
        
            @Override
            public void applyDataBinding() {
                if (model != null) {
                    model.addPropertyChangeListener("canUseDot", this);
                }
            }
        
            @Override
            public void processDataBinding() {
                if (model != null) {
                    dotButton.setEnabled(model.isCanUseDot());
                }
            }
        
            @Override
            public void removeDataBinding() {
                if (model != null) {
                    model.removePropertyChangeListener("canUseDot", this);
                }
            }
        });
        registerDataBinding(new SimpleJAXXObjectBinding(this, BINDING_LEFT_TOOLBAR_VISIBLE, true ,"showReset") {
        
            @Override
            public void processDataBinding() {
                leftToolbar.setVisible(isShowReset());
            }
        });
        registerDataBinding(new SimpleJAXXObjectBinding(this, BINDING_LEFT_TOOLBAR_ENABLED, true ,"enabled") {
        
            @Override
            public void processDataBinding() {
                leftToolbar.setEnabled(isEnabled());
            }
        });
        registerDataBinding(new SimpleJAXXObjectBinding(this, BINDING_RESET_ENABLED, true ,"enabled" ,"showReset") {
        
            @Override
            public void processDataBinding() {
                reset.setEnabled(isEnabled() && isShowReset());
            }
        });
        registerDataBinding(new DefaultJAXXBinding(this, BINDING_TEXT_FIELD_TEXT, true) {
        
            @Override
            public void applyDataBinding() {
                if (model != null) {
                    model.addPropertyChangeListener("textValue", this);
                }
            }
        
            @Override
            public void processDataBinding() {
                if (model != null) {
                    textField.setText(model.getTextValue());
                }
            }
        
            @Override
            public void removeDataBinding() {
                if (model != null) {
                    model.removePropertyChangeListener("textValue", this);
                }
            }
        });
        registerDataBinding(new SimpleJAXXObjectBinding(this, BINDING_TEXT_FIELD_ENABLED, true ,"enabled") {
        
            @Override
            public void processDataBinding() {
                textField.setEnabled(isEnabled());
            }
        });
        registerDataBinding(new SimpleJAXXObjectBinding(this, BINDING_RIGHT_TOOLBAR_VISIBLE, true ,"showPopupButton") {
        
            @Override
            public void processDataBinding() {
                rightToolbar.setVisible(isShowPopupButton());
            }
        });
        registerDataBinding(new SimpleJAXXObjectBinding(this, BINDING_SHOW_POP_UP_BUTTON_ENABLED, true ,"enabled") {
        
            @Override
            public void processDataBinding() {
                showPopUpButton.setEnabled(isEnabled());
            }
        });
    }

    protected void $initialize_03_finalizeCreateComponents() {
        if (log.isDebugEnabled()) {
            log.debug(this);
        }
        // inline complete setup of $JPanel0
        add(leftToolbar, BorderLayout.WEST);
        add(textField, BorderLayout.CENTER);
        add(rightToolbar, BorderLayout.EAST);
        addChildrenToPopup();
        addChildrenToPopupPanel();
        addChildrenToLeftToolbar();
        addChildrenToRightToolbar();
    }

    protected void $initialize_04_applyDataBindings() {
        if (log.isDebugEnabled()) {
            log.debug(this);
        }
        
        // apply 10 data bindings
        JAXXUtil.applyDataBinding(this, $bindings.keySet());
    }

    protected void $initialize_05_setProperties() {
        if (log.isDebugEnabled()) {
            log.debug(this);
        }
        
        // apply 7 property setters
        popupPanel.setBorder(BorderFactory.createEmptyBorder(4, 4, 4, 4));
        popupPanel.setBackground(Color.WHITE);
        validateButton.setIcon(SwingUtil.getUIManagerActionIcon("numbereditor-validate"));
        rightToolbar.setMaximumSize(new Dimension(24,24));
        showPopUpButton.setIcon(SwingUtil.getUIManagerActionIcon("numbereditor-calculator"));// late initializer
        
        Reset.init(this, reset, Reset.class);
    }

    protected void $initialize_06_finalizeInitialize() {
        if (log.isDebugEnabled()) {
            log.debug(this);
        }
    }

}