Class VNumber

    • Field Detail

      • AUTO_POPUP

        public static final boolean AUTO_POPUP
        Automatically pop up calculator
        See Also:
        Constant Field Values
      • m_displayType

        protected int m_displayType
    • Constructor Detail

      • VNumber

        public VNumber()
        IDE Bean Constructor
      • VNumber

        public VNumber​(String columnName,
                       boolean mandatory,
                       boolean isReadOnly,
                       boolean isUpdateable,
                       int displayType,
                       String title)
        Create right aligned Number field. no popup, if WindowNo == 0 (for IDs)
        Parameters:
        columnName - column name
        mandatory - mandatory
        isReadOnly - read only
        isUpdateable - updateable
        displayType - display type
        title - title
    • Method Detail

      • dispose

        public void dispose()
        Dispose
        Specified by:
        dispose in interface VEditor
      • setDocument

        protected void setDocument​(Document doc)
        Set Document
        Parameters:
        doc - document
      • selectAll

        public void selectAll()
        Select all the number text.
      • setColumns

        public void setColumns​(int columns,
                               int height)
        Set no of Columns
        Parameters:
        columns - columns
        height - 0 to use default
      • setRange

        public boolean setRange​(Double minValue,
                                Double maxValue)
        Set Range with min & max
        Parameters:
        minValue - min value
        maxValue - max value
        Returns:
        true, if accepted
      • setRange

        public boolean setRange​(String minValue,
                                String maxValue)
        Set Range with min & max = parse US style number w/o Gouping
        Parameters:
        minValue - min value
        maxValue - max value
        Returns:
        true if accepted
      • setDisplayType

        public void setDisplayType​(int displayType)
        Set and check DisplayType
        Parameters:
        displayType - display type
      • setReadWrite

        public void setReadWrite​(boolean value)
        Set ReadWrite
        Specified by:
        setReadWrite in interface CEditor
        Parameters:
        value - value
      • isReadWrite

        public boolean isReadWrite()
        IsReadWrite
        Specified by:
        isReadWrite in interface CEditor
        Returns:
        true if rw
      • setMandatory

        public void setMandatory​(boolean mandatory)
        Set Mandatory (and back bolor)
        Specified by:
        setMandatory in interface CEditor
        Parameters:
        mandatory - mandatory
      • isMandatory

        public boolean isMandatory()
        Is it mandatory
        Specified by:
        isMandatory in interface CEditor
        Returns:
        true if mandatory
      • setBackground

        public void setBackground​(Color color)
        Set Background
        Overrides:
        setBackground in class JComponent
        Parameters:
        color - color
      • setBackground

        public void setBackground​(boolean error)
        Set Background
        Specified by:
        setBackground in interface CEditor
        Parameters:
        error - error
      • setValue

        public void setValue​(Object value)
        Set Editor to value
        Specified by:
        setValue in interface CEditor
        Parameters:
        value - value
      • requestFocusInWindow

        public boolean requestFocusInWindow()
        Request Focus In Window
        Overrides:
        requestFocusInWindow in class JComponent
        Returns:
        focus request
      • getValue

        public Object getValue()
        Return Editor value
        Specified by:
        getValue in interface CEditor
        Returns:
        value value (big decimal or integer)
      • getDisplay

        public String getDisplay()
        Return Display Value
        Specified by:
        getDisplay in interface CEditor
        Returns:
        value
      • getTitle

        public String getTitle()
        Get Title
        Returns:
        title
      • plus

        public Object plus()
        Plus - add one. Also sets Value
        Returns:
        new value
      • minus

        public Object minus​(int minimum)
        Minus - subtract one, but not below minimum. Also sets Value
        Parameters:
        minimum - minimum
        Returns:
        new value
      • keyTyped

        public void keyTyped​(KeyEvent e)
        Key Listener Interface
        Specified by:
        keyTyped in interface KeyListener
        Parameters:
        e - event
      • keyReleased

        public void keyReleased​(KeyEvent e)
        Key Listener. - Escape - Restore old Text - firstChange - signal change
        Specified by:
        keyReleased in interface KeyListener
        Parameters:
        e - event
      • focusLost

        public void focusLost​(FocusEvent e)
        Data Binding to MTable (via GridController.vetoableChange).
        Specified by:
        focusLost in interface FocusListener
        Parameters:
        e - event
      • startCalculator

        public static String startCalculator​(Container jc,
                                             String value,
                                             DecimalFormat format,
                                             int displayType,
                                             String title,
                                             char operator)
        Invalid Entry - Start Calculator
        Parameters:
        jc - parent
        value - value
        format - format
        displayType - display type
        title - title
        operator - optional math operator +-/*
        Returns:
        value
      • setField

        public void setField​(GridField mField)
        Set Field/WindowNo for ValuePreference
        Specified by:
        setField in interface VEditor
        Parameters:
        mField - field
      • getField

        public GridField getField()
        Description copied from interface: VEditor
        Get Field/WindowNo for ValuePreference
        Specified by:
        getField in interface VEditor
        Returns:
        mField
      • setFocusable

        public void setFocusable​(boolean value)
        Overrides:
        setFocusable in class Component
      • removeActionListener

        public void removeActionListener​(ActionListener l)
        Remove Action Listner
        Parameters:
        l - Action Listener
      • fireActionPerformed

        protected void fireActionPerformed()
        Fire Action Event to listeners
      • isDirty

        public boolean isDirty()
        Description copied from interface: VManagedEditor
        Are there any pending changes
        Specified by:
        isDirty in interface VManagedEditor
        Returns:
        boolean