public class BMoneyFormField extends AbstractFractionNumberFormField
JTextField.AccessibleJTextFieldJTextComponent.AccessibleJTextComponent, JTextComponent.DropLocation, JTextComponent.KeyBindingJComponent.AccessibleJComponentContainer.AccessibleAWTContainerComponent.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy| Modifier and Type | Field and Description |
|---|---|
static boolean |
defaultAutoComma
application-wide default setting for the auto-comma feature
|
decimalFormaterrorMessage, errorOffset, savedValuenotifyActionDEFAULT_KEYMAP, FOCUS_ACCELERATOR_KEYlistenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOWaccessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENTADJUST_LEFT, ADJUST_NONE, ADJUST_RIGHT, ADJUST_TRIM, CONVERT_LC, CONVERT_NONE, CONVERT_UCBOTTOM, CENTER, EAST, HORIZONTAL, LEADING, LEFT, NEXT, NORTH, NORTH_EAST, NORTH_WEST, PREVIOUS, RIGHT, SOUTH, SOUTH_EAST, SOUTH_WEST, TOP, TRAILING, VERTICAL, WESTABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH| Constructor and Description |
|---|
BMoneyFormField()
Creates an empty BMoneyFormField with the default document model,
a minimum column width for a BMoney.
|
BMoneyFormField(boolean parseDMoney)
Creates an empty BMoneyFormField with the default document model,
and minimum column width.
|
BMoneyFormField(Document doc,
int columns,
boolean parseDMoney)
Creates an empty BMoneyFormField.
Notice: setting doc != null requires a doc derived from FormFieldDocument. |
BMoneyFormField(int columns,
boolean parseDMoney)
Creates an empty BMoneyFormField with the default document model and
given column width.
|
| Modifier and Type | Method and Description |
|---|---|
org.tentackle.common.DMoney |
getDMoney()
Gets the value as a DMoney.
|
org.tentackle.common.BMoney |
getFormValue()
Retrieves the value from this component.
The method is used to update the data model if the view has changed because the user edited it. |
protected org.tentackle.common.BMoney |
getFormValue(boolean parseDMoney)
Parses the money string.
|
org.tentackle.common.BMoney |
getMaxValue()
Gets the maximum value.
|
org.tentackle.common.BMoney |
getMinValue()
Gets the minimum value.
|
boolean |
isAutoComma()
Returns the auto-comma setting.
|
boolean |
isParseDMoney()
Gets the flag whether getFormValue() will return DMoney or BMoney.
|
void |
setAutoComma(boolean autoComma)
Sets the auto-comma feature.
Allows "business" keyboard input, i.e. |
void |
setFormat(String pattern)
Sets the format string.
The format string is used to format the view of the data. |
void |
setFormValue(Object object)
Sets a value in this component.
The method is used to update the view if the data has changed. |
void |
setMaxValue(org.tentackle.common.BMoney maxValue)
Sets the maximum value.
|
void |
setMinValue(org.tentackle.common.BMoney minValue)
Sets the minimum value.
|
void |
setParseDMoney(boolean parseDMoney)
Sets whether getFormValue() returns BMoney or DMoney.
|
getScale, setDecimalFormat, setScaleclearText, doFormat, getDecimalFormat, getFormat, isBlankZero, isUnsigned, restoreSavedValue, setBlankZero, setText, setUnsigned, setValidCharsaddValueListener, clearValueShownModified, createDefaultModel, downRight, fireValueChanged, fireValueEntered, getAdjust, getBinding, getBindingPath, getComponentPath, getConvert, getConverter, getDefaultColumns, getErrorMessage, getErrorOffset, getFiller, getFocusTraversalGroup, getHelpURL, getInvalidChars, getMaxColumns, getParentWindow, getPreferredSize, getPropertyGroup, getText, getToolTipText, getValidChars, getValueShown, getVerticalAlignment, hideErrorPopup, invalidateParentInfo, isAutoNext, isAutoSelect, isAutoUpdate, isBindable, isCaretLeft, isCaretRight, isCellEditorUsage, isChangeable, isEmpty, isEraseFirst, isFireRunning, isFormTraversable, isHonourChangeable, isInhibitAutoSelect, isMandatory, isOverwrite, isSmartValueEntered, isStartEditLeftmost, isTriggerValueChangedEnabled, isValueChanged, isValueShownModified, prepareFocusLost, processFocusEvent, processKeyBinding, removeValueListener, requestFocusLater, saveValue, setAdjust, setAutoNext, setAutoSelect, setAutoUpdate, setBindable, setBinding, setBindingPath, setCaretLeft, setCaretRight, setCellEditorUsage, setChangeable, setColumns, setComponentPath, setConvert, setConverter, setDefaultColumns, setEditable, setEraseFirst, setErrorMessage, setErrorOffset, setFiller, setFireRunning, setFocusTraversalGroup, setFormTraversable, setFormWrapWindow, setHelpURL, setHonourChangeable, setInhibitAutoSelect, setInvalidChars, setMandatory, setMaxColumns, setOverwrite, setPropertyGroup, setSmartValueEntered, setStartEditLeftmost, setTriggerValueChangedEnabled, setVerticalAlignment, showErrorPopup, showErrorPopup, showHelp, transferFocus, transferFocusBackward, triggerValueChanged, updateAllChangeable, upLeft, wasFocusGainedFromTransfer, wasFocusGainedFromTransferBackward, wasTransferFocus, wasTransferFocusBackward, wasTransferFocusByEnteractionPropertyChanged, addActionListener, configurePropertiesFromAction, createActionPropertyChangeListener, fireActionPerformed, getAccessibleContext, getAction, getActionListeners, getActions, getColumns, getColumnWidth, getHorizontalAlignment, getHorizontalVisibility, getScrollOffset, getUIClassID, isValidateRoot, paramString, postActionEvent, removeActionListener, scrollRectToVisible, setAction, setActionCommand, setDocument, setFont, setHorizontalAlignment, setScrollOffsetaddCaretListener, addInputMethodListener, addKeymap, copy, cut, fireCaretUpdate, getCaret, getCaretColor, getCaretListeners, getCaretPosition, getDisabledTextColor, getDocument, getDragEnabled, getDropLocation, getDropMode, getFocusAccelerator, getHighlighter, getInputMethodRequests, getKeymap, getKeymap, getMargin, getNavigationFilter, getPreferredScrollableViewportSize, getPrintable, getScrollableBlockIncrement, getScrollableTracksViewportHeight, getScrollableTracksViewportWidth, getScrollableUnitIncrement, getSelectedText, getSelectedTextColor, getSelectionColor, getSelectionEnd, getSelectionStart, getText, getToolTipText, getUI, isEditable, loadKeymap, modelToView, moveCaretPosition, paste, print, print, print, processInputMethodEvent, read, removeCaretListener, removeKeymap, removeNotify, replaceSelection, restoreComposedText, saveComposedText, select, selectAll, setCaret, setCaretColor, setCaretPosition, setComponentOrientation, setDisabledTextColor, setDragEnabled, setDropMode, setFocusAccelerator, setHighlighter, setKeymap, setMargin, setNavigationFilter, setSelectedTextColor, setSelectionColor, setSelectionEnd, setSelectionStart, setUI, updateUI, viewToModel, writeaddAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, updateadd, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validate, validateTreeaction, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processHierarchyBoundsEvent, processHierarchyEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocusUpCycleclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetCaretPosition, getColumns, getHorizontalAlignment, postActionEvent, setCaretPosition, setHorizontalAlignment, setToolTipTextgetBaseline, hasFocuspublic static boolean defaultAutoComma
public BMoneyFormField(Document doc, int columns, boolean parseDMoney)
doc - the document model, null = defaultcolumns - the number of columns, 0 = minimum widthparseDMoney - true if getFormValue() returns DMoney, false if BMoneypublic BMoneyFormField(int columns,
boolean parseDMoney)
columns - the number of columns, 0 = minimum widthparseDMoney - true if getFormValue() returns DMoney, false if BMoneypublic BMoneyFormField(boolean parseDMoney)
parseDMoney - true if getFormValue() returns DMoney, false if BMoneypublic BMoneyFormField()
public void setMinValue(org.tentackle.common.BMoney minValue)
minValue - the minimum value, null if nonepublic org.tentackle.common.BMoney getMinValue()
public void setMaxValue(org.tentackle.common.BMoney maxValue)
maxValue - the maximum value, null if nonepublic org.tentackle.common.BMoney getMaxValue()
public void setFormValue(Object object)
Overridden to set the scale from the money value
setFormValue in interface FormComponentsetFormValue in class AbstractNumberFormFieldobject - is the object to setprotected org.tentackle.common.BMoney getFormValue(boolean parseDMoney)
parseDMoney - true if returned value is a DMoney, else BMoneypublic org.tentackle.common.BMoney getFormValue()
FormComponentpublic org.tentackle.common.DMoney getDMoney()
public void setParseDMoney(boolean parseDMoney)
parseDMoney - true if parse to DMoney, else BMoneypublic boolean isParseDMoney()
public void setFormat(String pattern)
The format string will be converted to a DecimalFormat.
Overridden cause of comma-char.
setFormat in interface FormFieldComponentsetFormat in class AbstractNumberFormFieldpattern - the format stringAbstractNumberFormField.setDecimalFormat(java.text.DecimalFormat)public void setAutoComma(boolean autoComma)
Example: "1122" -> "11.22" if scale was 2.
autoComma - true if automatically set the comma, false if not (default)defaultAutoCommapublic boolean isAutoComma()
Tentackle - distributed, domain- and model-driven