public class CurrencyDataField extends TextFieldDataField implements OpenDialog, SelectCurrencyValues, AdvancedDataComponent
setValue() and
getValue() methods makes operation in that unit. TextFieldDataField.EJTextField, TextFieldDataField.InnerDocumentListenerDataField.AuxPanel, DataField.CopyActionListener, DataField.ELabel, DataField.FieldButton, DataField.FieldFocusListener, DataField.InfoMouseListener, DataField.ToggleButtonJPanel.AccessibleJPanelJComponent.AccessibleJComponentContainer.AccessibleAWTContainerComponent.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy| Modifier and Type | Field and Description |
|---|---|
protected JMenuItem |
advancedHelpBMenu
A reference for advanced help menu.
|
protected Calculator |
calc
A calculator reference.
|
protected JButton |
calcButton
A reference for a calc button.
|
static String |
CURRENCY |
protected JButton |
currencyButton
Deprecated.
|
static boolean |
DEFAULT_EURO_BUTTON_VISIBLE
Deprecated.
|
protected String |
euro
Deprecated.
Symbol is defined in document
|
protected ImageIcon |
euroIcon
Deprecated.
|
protected Frame |
frame
A reference for the frame.
|
protected String |
pst
Deprecated.
Symbol is defined in document
|
protected ImageIcon |
pstIcon
Deprecated.
|
protected boolean |
showEuros
Deprecated.
|
disabledTextColor, innerListeneradvancedQueryMode, ALIGN, ALIGN_CENTER, ALIGN_LEFT, ALIGN_RIGHT, alignment, ASTERISK_REQUIRED_STYLE, ATTR, attribute, backgroundColor, BGCOLOR, bold, BOLD, BORDER, BORDER_REQUIRED_STYLE, borderText, BOTTOM, CENTER, CLIPBOARD_COPY, CLIPBOARD_COPY_es_ES, CLIPBOARD_CUT, CLIPBOARD_CUT_es_ES, CLIPBOARD_PASTE, CLIPBOARD_PASTE_es_ES, conditions, dataField, DEFAULT_BORDER, DEFAULT_BOTTOM_MARGIN, DEFAULT_FIELD_LEFT_MARGIN, DEFAULT_FIELD_RIGHT_MARGIN, DEFAULT_LABEL_LEFT_MARGIN, DEFAULT_LABEL_RIGHT_MARGIN, DEFAULT_PARENT_MARGIN, DEFAULT_PARENT_MARGIN_FOR_SCROLL, DEFAULT_TOP_MARGIN, defaultAsteriskColor, DEFAULTBORDER, defaultDisableBackgroundColor, defaultFieldButtonHigh, defaultPreferenceTextNotRetrievedFromPreferences, DEFINE_HELP_FIELD_PREFERENCE, dim, DIM, disabledbgcolor, DISABLEDBGCOLOR, empty, enabled, ENABLED, EXPAND, FIELD_HELP_TIP, fieldlistenerFocus, fieldSize, fireValueEvents, FOCUS_BACKGROUNDCOLOR, FONT, fontColor, FONTCOLOR, fontSize, FONTSIZE, height, HEIGHT, incrementalFont, initPreferenceHelpText, INSETS, isEnabled, LABELALIGN, labelComponent, LABELFONT, LABELFONTCOLOR, labelPosition, LABELPOSITION, LABELSIZE, labelText, LABELVISIBLE, LEFT, locale, LOWERED, menuCopy, menuCut, menuDefineHelpPreference, menuHelpPreferences, menuPaste, modifiable, NO_STR, NONE, noRequiredBorder, OPAQUE, originalSize, OUTBORDER, panel, parentForm, permissionActivate, permissionVisible, popupMenu, PREF_WIDTH, prefWidth, RAISED, redimensionPanel, redimensJTextField, required, REQUIRED, requiredBorder, REQUIREDBORDER, requiredFieldBackgroundColor, requiredFieldForegroundColor, resources, restricted, RIGHT, show, showLabel, SIZE, TEXT_STR, TEXTALIGN, textAlignment, textHelpPreference, TIP, tipKey, TOP, validData, VALIGN, Valignment, valueListener, valueSave, VISIBLE, VISUALIZE_HELP_FIELD_PREFERENCE, weightDataFieldH, weightPanelH, width, WIDTH, x, X, y, Y, YES_STRaccessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOWBOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENTEURO, PSTADVANCED_QUERYCOMP_FOCUS_YELLOW, GREEN_VERY_LIGHT, LIGHT_GRAY_BLUE, LIGHT_GREYISH_BLUE, VERY_LIGHT_BLUE, VERY_LIGHT_GRAY, VERY_LIGHT_PINK, VERY_LIGHT_RED, VERY_LIGHT_SKYBLUE, VERY_LIGHT_YELLOW, VERY_LIGHT_YELLOW_2DEBUG_LANGUAGEDESACTIVATE_COMPONENT_BY_PERMISSION_TIPABORT, ALLBITS, ERROR, FRAMEBITS, PROPERTIES, SOMEBITS| Constructor and Description |
|---|
CurrencyDataField(Hashtable parameters)
The class constructor.
|
| Modifier and Type | Method and Description |
|---|---|
protected boolean |
colorSelection(DocumentEvent e)
Checks the consistency of currency document value, changing the color to
red with an incorrect value.
|
protected void |
createDataField()
Creates the data field.
|
protected CurrencyDocument |
createDocument(String currencySymbol) |
protected void |
createPopupMenu()
Creates a pop-up menu.
|
Object |
getDoubleValue()
Gets the double value.
|
int |
getSQLDataType()
Returns the
sql data type according to
java.sql.Types
|
Object |
getValue()
Gets the value of a component.
|
void |
init(Hashtable parameters)
Initializes parameters.
|
protected void |
installInnerListener()
Installs an inner listener.
|
protected void |
installValidationDocumentListener()
Installs a listener for validate document.
|
boolean |
isEmpty()
Checks the data existence in component.
|
boolean |
isModified()
This method should be return
true when data have been
modified. |
void |
setAdvancedQueryMode(boolean enable)
This method must establish the advanced query state, to support advanced
query conditions.
|
void |
setComponentLocale(Locale loc) |
void |
setEnabled(boolean enabled)
Enables the field to insert data.
|
void |
setFontSize(int size)
Sets font size to size parameter.
|
void |
setParentFrame(Frame parentFrame)
This method is called from Form for each component that implements this
interface.
|
void |
setResourceBundle(ResourceBundle resource)
Sets the language resource bundle.
|
protected void |
setTip()
Sets the tip for field.
|
void |
setValue(Object value)
Sets the value for component.
|
void |
showCurrencyValue(String currencySymbol) |
protected void |
showPopupMenu(Component c,
int x,
int y)
Shows the pop-up menu.
|
void |
updateUI() |
deleteData, getAttribute, getInnerListenerEnabled, getInnerValue, getLabelComponentText, getText, isInnerValueEqual, isModifiable, isRequired, isSelectedAll, setInnerListenerEnabled, setInnerValueaddFocusListener, addHelpMenuPopup, addValueChangeListener, changeButton, changeOpacity, checkDefineHelpPermission, checkEnabledPermission, checkVisiblePermission, configurePopupMenuHelp, createFocusListener, createInstanceConditionCombo, defineHelpField, finalize, fireValueChanged, getBorder, getConstraints, getDataField, getDisabledbgcolor, getFontColor, getHelpIdString, getHelpPreferenceKey, getLabelComponent, getLabelFontColor, getLabelText, getParentForm, getPreferenceHelpText, getPreferredSize, getTextsToTranslate, getValueChangeListeners, hasHelpInPreferences, initPermissions, initPreferences, installFocusListener, installHelpId, installPopupMenuListener, installPreferenceHelpListener, isAdvancedQueryMode, isEnabled, isHidden, isLabelVisible, isRestricted, parseBoolean, preferenceChanged, removeFocusListener, removeValueChangeListener, requestFocus, seeHelpField, setBold, setDisabledbgcolor, setFont, setFontColor, setLabelFontColor, setModifiable, setParentForm, setRequired, setRequiredFieldBackground, setVisible, updateBackgroundColor, updateBackgroundColor, updateFont, updateTip, validateComponentPositionsgetAccessibleContext, getUI, getUIClassID, paramString, setUIaddAncestorListener, 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, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setFocusTraversalKeys, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, 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, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, 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, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, 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, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycleclone, equals, getClass, hashCode, notify, notifyAll, wait, wait, waitdeleteData, getLabelComponentText, isHidden, isModifiable, isRequired, setModifiable, setRequiredgetConstraints, isEnabled, setVisiblegetTextsToTranslategetAttributeinitPermissions, isRestrictedpublic static final String CURRENCY
@Deprecated public static boolean DEFAULT_EURO_BUTTON_VISIBLE
@Deprecated protected ImageIcon euroIcon
@Deprecated protected ImageIcon pstIcon
@Deprecated protected String euro
@Deprecated protected String pst
@Deprecated protected JButton currencyButton
@Deprecated protected boolean showEuros
protected JMenuItem advancedHelpBMenu
protected Frame frame
protected JButton calcButton
protected Calculator calc
public CurrencyDataField(Hashtable parameters)
parameters - the Hashtable with parameters.public void init(Hashtable parameters)
init in interface FormComponentinit in class TextFieldDataFieldparameters - the Hashtable with parameters.
| attribute | values | default | required | meaning |
| change | yes/no | yes | To support the change in the currency value. | |
| calc | yes/no | no | no | The presence of the calendar. |
| minintegerdigits | no | The minimum number of integer digits. | ||
| maxintegerdigits | no | The maximum number of integer digits. | ||
| mindecimaldigits | no | The minimum number of decimal digits. | ||
| maxdecimaldigits | no | The maximum number of decimal digits. | ||
| grouping | yes/no | no | The condition to put the numbers in groups (1 000 000 -> 1000000) |
protected CurrencyDocument createDocument(String currencySymbol)
protected void createDataField()
TextFieldDataFieldcreateDataField in class TextFieldDataFieldpublic void setEnabled(boolean enabled)
DataFieldsetEnabled in interface FormComponentsetEnabled in class DataFieldenabled - the condition to set enablepublic Object getValue()
DataComponentgetValue in interface DataComponentobject with value.public void setValue(Object value)
DataComponentsetValue in interface DataComponentvalue - the object with value to setpublic int getSQLDataType()
DataComponentsql data type according to
java.sql.Types
getSQLDataType in interface DataComponentInteger typepublic Object getDoubleValue()
protected void setTip()
public void showCurrencyValue(String currencySymbol)
showCurrencyValue in interface SelectCurrencyValuespublic boolean isModified()
DataComponenttrue when data have been
modified. The method setValue() should be change this
condition.
isModified in interface DataComponentisModified in class DataFieldpublic void setFontSize(int size)
DataFieldsetFontSize in class DataFieldsize - the font size parameterpublic void setAdvancedQueryMode(boolean enable)
AdvancedDataComponentsetAdvancedQueryMode in interface AdvancedDataComponentenable - the condition to enable this stateprotected boolean colorSelection(DocumentEvent e)
e - the document eventprotected void createPopupMenu()
DataFieldcreatePopupMenu in class DataFieldpublic void setResourceBundle(ResourceBundle resource)
InternationalizationsetResourceBundle in interface InternationalizationsetResourceBundle in class DataFieldresource - the new language bundle.protected void showPopupMenu(Component c, int x, int y)
DataFieldshowPopupMenu in class DataFieldc - the componentx - the x coordinatey - the y coordinatepublic boolean isEmpty()
DataComponentisEmpty in interface DataComponentisEmpty in class TextFieldDataFieldtrue when component is emptyprotected void installValidationDocumentListener()
public void setParentFrame(Frame parentFrame)
OpenDialogsetParentFrame in interface OpenDialogparentFrame - the frameprotected void installInnerListener()
TextFieldDataFieldinstallInnerListener in class TextFieldDataFieldpublic void setComponentLocale(Locale loc)
setComponentLocale in interface InternationalizationsetComponentLocale in class DataFieldCopyright © 2016 Imatia Innovation S.L.. All rights reserved.