public class DateDataField extends TextFieldDataField implements OpenDialog, Freeable, AdvancedDataComponent
calendar. that indicates if a dialog box with the
calendar to set the date.
| Modifier and Type | Class and Description |
|---|---|
class |
DateDataField.CloseAction
Class to define the action performed to close the window.
|
protected class |
DateDataField.KeyListenerSetDate |
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 to a possible advance help menu.
|
protected JButton |
calendarButton
A reference to calendar button
|
protected boolean |
calendarChange
Indicates the form to notify the calendar change event.
|
protected VisualCalendarComponent |
calendarComp
Implements a calendar with selectable year, month and day.
|
protected String |
calendarTitleKey
Indicates to set the title to the calendar, by default "calendar".
|
static boolean |
DEBUG_DATE
Uses only in case of debug mode.
|
protected boolean |
emphasizeInvalidDate
Indicates if the date must be emphasized with a different color when it
is invalid.
|
protected Frame |
frame
A reference to the parent frame used to select a date.
|
protected Locale |
locale
A reference to the default locale.
|
protected GregorianCalendar |
mainCalendar
A reference to the Gregorian Calendar.
|
protected EJDialog |
vCalendar
Especial dialog with the functionality that Esc key throws the event
WINDOW_CLOSING.
|
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, 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_ALIGNMENTADVANCED_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 |
|---|
DateDataField(Hashtable parameters)
The class constructor.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
colorSelection(DocumentEvent e)
Selects the text color in function of field content.
|
protected void |
createPopupMenu()
Creates a Pop-up Menu to advanced search help.
|
void |
deleteData()
Deletes the date of the data field.
|
void |
format()
Creates the correct representation for the date in data field.
|
void |
free()
Releases the frame.
|
Dimension |
getDataFieldPreferredSize()
This method returns the preferred size for data field to contain a date
in correct format.
|
Object |
getDateValue()
Gets the Date value.
|
static Locale |
getSameCountryLocale(Locale loc) |
int |
getSQLDataType()
Gets the SQL data type for specified data types.
|
Object |
getValue()
Gets the Timestamp value.
|
void |
hiddenCalendar()
Hidden the calendar.
|
void |
init(Hashtable parameters)
This method gets the
Hashtable and creates the calendar, the
access button and implements the listeners. |
protected void |
installInnerListener()
Installs a inner listener to get events by program.
|
boolean |
isEmpty()
Checks the presence and validity of data.
|
boolean |
isModified()
Returns true when data component has been modified.
|
void |
setAdvancedQueryMode(boolean enable)
Sets the Component to support the advanced query mode state.
|
void |
setComponentLocale(Locale loc)
Sets the Component Locale, to format date, specified in parameter.
|
protected void |
setCurrentDate()
Fill the DateDataField with the actual date of the system
|
protected void |
setDate()
Check if it has entered a part of the date, and fill the missing data
(month or year)
|
protected void |
setDate(int day)
Fill the field with the the specified day and the actual month and year.
|
protected void |
setDate(int day,
int month)
Fill the field with the the specified day and month and the actual year.
|
void |
setDocument(Document dateDocument) |
void |
setEmphasizeInvalidDate(boolean highlight) |
void |
setEnabled(boolean enabled)
Checks the variable that indicates if user has permission to introduce
values into the datafield.
|
void |
setParentFrame(Frame parentFrame)
Sets the parent Frame.
|
void |
setResourceBundle(ResourceBundle res)
Sets the resource bundle.
|
void |
setValue(Object auxValue)
Sets the field value by program when
auxValue is a instance
of java.sql.timestamp or java.util. |
void |
setValueFromComponent(Object auxValue)
Sets the field value by user when
auxValue is a instance of
java.sql.timestamp or java.util. |
void |
showCalendar(Component c)
Shows the calendar.
|
protected void |
showPopupMenu(Component c,
int x,
int y)
Shows the Pop-up Menu.
|
createDataField, 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, setFontSize, setLabelFontColor, setModifiable, setParentForm, setRequired, setRequiredFieldBackground, setVisible, updateBackgroundColor, updateBackgroundColor, updateFont, updateTip, updateUI, 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, waitgetLabelComponentText, isHidden, isModifiable, isRequired, setModifiable, setRequiredgetConstraints, isEnabled, setVisiblegetTextsToTranslategetAttributeinitPermissions, isRestrictedprotected String calendarTitleKey
protected Frame frame
protected GregorianCalendar mainCalendar
protected boolean calendarChange
protected JButton calendarButton
protected Locale locale
protected boolean emphasizeInvalidDate
protected JMenuItem advancedHelpBMenu
public static boolean DEBUG_DATE
protected EJDialog vCalendar
protected VisualCalendarComponent calendarComp
public DateDataField(Hashtable parameters)
Document Listener.
parameters - a Hashtable with calendar and
calendarchange parameterspublic void setDocument(Document dateDocument)
public void init(Hashtable parameters)
Hashtable and creates the calendar, the
access button and implements the listeners.
init in interface FormComponentinit in class TextFieldDataFieldparameters - the Hashtable with parameters
| attribute | values | default | required | meaning |
| calendar | yes/no | no | Indicates whether a dialog box with a calendar will be showed. | |
| calendarchange | yes/no | no | no | Indicates the form to notify the change event in calendar values. By default, its value is 'no' and so, the changes are only showed when you abandon the calendar. |
| calendaricon | ImageManager.CALENDAR | no | Indicates the path to icon that shows the calendar. | |
| borderbuttons | default/none/raised/lowered or a color defined in
ColorConstants. Moreover, it is also allowed a border
defined in #BorderManager |
no | The border for buttons in Form | |
| highlightbuttons | yes/no | no | no | Sets the highlight in button property when mouse is
entered. See
AbstractButton#setContentAreaFilled(boolean)). This
parameter requires opaque='no'. |
| opaquebuttons | yes/no | no | no | Data field opacity condition for Form buttons |
public void hiddenCalendar()
public void showCalendar(Component c)
c - Component to create graphical representation and user
interactionpublic void setEnabled(boolean enabled)
setEnabled in interface FormComponentsetEnabled in class DataFieldenabled - boolean to change permissionsprotected void colorSelection(DocumentEvent e)
e - public void format()
public void setValueFromComponent(Object auxValue)
auxValue is a instance of
java.sql.timestamp or java.util. During the method execution the inner
Listener is disabled.
auxValue - Date or Timestamp ObjectValueEvent.USER_CHANGEpublic void setValue(Object auxValue)
auxValue is a instance
of java.sql.timestamp or java.util. During the method execution the inner
Listener is disabled.
setValue in interface DataComponentauxValue - Date or Timestamp ObjectValueEvent.PROGRAMMATIC_CHANGEpublic Object getValue()
getValue in interface DataComponentRuntimeException - if any exception occurspublic Object getDateValue()
RuntimeException - if any exception occurspublic Dimension getDataFieldPreferredSize()
public boolean isEmpty()
isEmpty in interface DataComponentisEmpty in class TextFieldDataFieldpublic void setParentFrame(Frame parentFrame)
setParentFrame in interface OpenDialogparentFrame - the framepublic void setComponentLocale(Locale loc)
setComponentLocale in interface InternationalizationsetComponentLocale in class DataFieldpublic int getSQLDataType()
getSQLDataType in interface DataComponentpublic void setAdvancedQueryMode(boolean enable)
setAdvancedQueryMode in interface AdvancedDataComponentenable - the condition to enable this statepublic boolean isModified()
isModified in interface DataComponentisModified in class DataFieldprotected void createPopupMenu()
createPopupMenu in class DataFieldprotected void showPopupMenu(Component c, int x, int y)
showPopupMenu in class DataFieldc - the Component to showx - The x coordinatey - The y coordinatepublic void setResourceBundle(ResourceBundle res)
setResourceBundle in interface InternationalizationsetResourceBundle in class DataFieldres - the resource bundle to changepublic void deleteData()
deleteData in interface DataComponentdeleteData in class TextFieldDataFieldpublic void setEmphasizeInvalidDate(boolean highlight)
highlight - whether or not the emphasizeInvalidDate is enabledprotected void installInnerListener()
installInnerListener in class TextFieldDataFieldprotected void setCurrentDate()
protected void setDate()
protected void setDate(int day)
day - The specific day.protected void setDate(int day,
int month)
day - The specific day.month - The specific month.Copyright © 2016 Imatia Innovation S.L.. All rights reserved.