|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
org.openswing.swing.client.BaseInputControl
org.openswing.swing.client.DateControl
Title: OpenSwing Framework
Description: Date input control: contains a text input control when digit the date and a button for opening a calendar.
Copyright: Copyright (C) 2006 Mauro Carniel
This file is part of OpenSwing Framework. This library is free software; you can redistribute it and/or modify it under the terms of the (LGPL) Lesser General Public License as published by the Free Software Foundation; GNU LESSER GENERAL PUBLIC LICENSE Version 2.1, February 1999 This library 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 Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. The author may be contacted at: maurocarniel@tin.it
Nested Class Summary |
Nested classes inherited from class javax.swing.JComponent |
javax.swing.JComponent.AccessibleJComponent |
Field Summary |
Fields inherited from class javax.swing.JComponent |
TOOL_TIP_TEXT_KEY, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW |
Fields inherited from class java.awt.Component |
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
Fields inherited from interface java.awt.image.ImageObserver |
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
DateControl()
|
|
DateControl(int dateType,
int dateFormat,
char dateFormatSeparator,
boolean showCenturyInDateFormat,
java.lang.String timeFormat)
Constructor. |
Method Summary | |
void |
addActionListener(java.awt.event.ActionListener listener)
Adds the specified action listener to receive action events from this textfield. |
void |
addDateChangedListener(DateChangedListener listener)
Add a date changed listener. |
void |
addFocusListener(java.awt.event.FocusListener listener)
Adds the specified focus listener to receive focus events from this component when this component gains input focus. |
void |
addKeyListener(java.awt.event.KeyListener listener)
Adds the specified key listener to receive action events from this field. |
void |
finalize()
|
void |
focusGained(java.awt.event.FocusEvent e)
Invoked when a component gains the keyboard focus. |
void |
focusLost(java.awt.event.FocusEvent e)
Invoked when a component loses the keyboard focus. |
javax.swing.JComponent |
getBindingComponent()
|
java.util.Date |
getDate()
|
javax.swing.JTextField |
getDateField()
|
int |
getDateType()
|
java.util.Calendar |
getDefaultDate()
|
int |
getFormat()
|
java.util.Date |
getLowerLimit()
|
char |
getSeparator()
|
java.lang.String |
getTimeFormat()
|
java.util.Date |
getUpperLimit()
|
java.lang.Object |
getValue()
|
boolean |
isEnabled()
|
boolean |
isShowCalendarButton()
|
boolean |
isShowCentury()
|
boolean |
isStrictUsage()
|
void |
keyPressed(java.awt.event.KeyEvent e)
Invoked when a key has been pressed. |
void |
keyReleased(java.awt.event.KeyEvent e)
Invoked when a key has been released. |
void |
keyTyped(java.awt.event.KeyEvent e)
Invoked when a key has been typed. |
void |
processKeyEvent(java.awt.event.KeyEvent e)
|
void |
refresh()
Refresh calendar content. |
void |
removeActionListener(java.awt.event.ActionListener listener)
Removes the specified action listener so that it no longer receives action events from this textfield. |
void |
removeDateChangedListener(DateChangedListener listener)
Remove a date changed listener. |
void |
removeFocusListener(java.awt.event.FocusListener listener)
Removes the specified focus listener so that it no longer receives focus events from this component. |
void |
removeKeyListener(java.awt.event.KeyListener listener)
Removes the specified key listener so that it no longer receives action events from this field. |
void |
requestFocus()
Riceve il fuoco e lo smista al componente wrappato. |
void |
setDate(java.util.Date date)
Set date into the date field. |
void |
setDateType(int dateType)
Set date type: date only, date + time, time only. |
void |
setDefaultDate(java.util.Calendar defaultDate)
Set the default date to set into the calendar, when opening it for the first time. |
void |
setEnabled(boolean enabled)
Set current input control abilitation. |
void |
setFormat(int dateFormat)
Set date format. |
void |
setLowerLimit(java.util.Date lowerLimit)
Set minimum allowed date. |
void |
setSeparator(char separator)
Set separator. |
void |
setShowCalendarButton(boolean showCalendarButton)
Show/hide calendar button; default value: true |
void |
setShowCentury(boolean showCentury)
Used to show century. |
void |
setStrictUsage(boolean strictUsage)
define how the date control must behave when an invalid date has been specified within it: clean up the content (stricy usage) or trying to correct it. |
void |
setTimeFormat(java.lang.String timeFormat)
Set the time format. |
void |
setUpperLimit(java.util.Date upperLimit)
Set maximum allowed date. |
void |
setValue(java.lang.Object value)
Set value to the input control. |
void |
transferFocus()
Riceve la richiesta di trasferimento fuoco e lo smista al componente wrappato. |
Methods inherited from class org.openswing.swing.client.BaseInputControl |
addValueChangedListener, getAttributeName, getFont, getLinkLabel, getTextAlignment, getToolTipText, getValueChangeListeners, isCanCopy, isChanged, isEnabledOnEdit, isEnabledOnInsert, isRequired, removeValueChangedListener, setAttributeName, setCanCopy, setChanged, setEnabledOnEdit, setEnabledOnInsert, setFont, setLinkLabel, setRequired, setTextAlignment, setToolTipText |
Methods inherited from class javax.swing.JPanel |
getAccessibleContext, getUI, getUIClassID, setUI, updateUI |
Methods inherited from class javax.swing.JComponent |
addAncestorListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getGraphics, getHeight, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPreferredSize, getPropertyChangeListeners, getPropertyChangeListeners, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isPreferredSizeSet, isRequestFocusEnabled, isValidateRoot, paint, paintImmediately, paintImmediately, print, printAll, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setForeground, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setTransferHandler, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update |
Methods inherited from class java.awt.Container |
add, add, add, add, add, addContainerListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, remove, remove, removeAll, removeContainerListener, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setLayout, transferFocusBackward, transferFocusDownCycle, validate |
Methods inherited from class java.awt.Component |
action, add, addComponentListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, contains, createImage, createImage, createVolatileImage, createVolatileImage, dispatchEvent, enable, enableInputMethods, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFontMetrics, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, remove, removeComponentListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocusUpCycle |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.openswing.swing.client.InputControl |
addValueChangedListener, getAttributeName, getLinkLabel, getValueChangeListeners, isCanCopy, isChanged, isEnabledOnEdit, isEnabledOnInsert, isRequired, removeValueChangedListener, setAttributeName, setCanCopy, setChanged, setEnabledOnEdit, setEnabledOnInsert, setLinkLabel |
Constructor Detail |
public DateControl()
public DateControl(int dateType, int dateFormat, char dateFormatSeparator, boolean showCenturyInDateFormat, java.lang.String timeFormat)
dateType
- possibile values: Consts.TYPE_DATE, Consts.TYPE_TIME, Consts.TYPE_DATE_TIMEdateFormatSeparator
- yy MM dd separator; for example: '/' or '-'showCenturyInDateFormat
- define if the year is in the format 'yy' or 'yyyy'timeFormat
- possibile values: Resources.HH_MM or Resources.H_MM_AAA or Resources.HH_MM_SS or Resources.H_MM_SS_AAAMethod Detail |
public final void finalize()
public final void setSeparator(char separator)
separator
- separator characterpublic final char getSeparator()
public final void setFormat(int dateFormat)
public final int getFormat()
public final void setDate(java.util.Date date)
date
- datepublic final java.util.Date getDate()
public final void setUpperLimit(java.util.Date upperLimit)
upperLimit
- maximum allowed datepublic final java.util.Date getUpperLimit()
public final void setLowerLimit(java.util.Date lowerLimit)
lowerLimit
- minimum allowed datepublic final java.util.Date getLowerLimit()
public final void refresh()
public void setEnabled(boolean enabled)
InputControl
setEnabled
in interface InputControl
setEnabled
in class BaseInputControl
public final boolean isEnabled()
isEnabled
in interface InputControl
isEnabled
in class BaseInputControl
public final void requestFocus()
requestFocus
in class BaseInputControl
public final void transferFocus()
public final boolean isShowCentury()
public final void setShowCentury(boolean showCentury)
showCentury
- show centurypublic void focusGained(java.awt.event.FocusEvent e)
focusGained
in interface java.awt.event.FocusListener
public void focusLost(java.awt.event.FocusEvent e)
focusLost
in interface java.awt.event.FocusListener
public final void keyTyped(java.awt.event.KeyEvent e)
KeyEvent
for a definition of a key typed event.
keyTyped
in interface java.awt.event.KeyListener
public final void keyPressed(java.awt.event.KeyEvent e)
KeyEvent
for a definition of
a key pressed event.
keyPressed
in interface java.awt.event.KeyListener
public final void keyReleased(java.awt.event.KeyEvent e)
KeyEvent
for a definition of
a key released event.
keyReleased
in interface java.awt.event.KeyListener
public final javax.swing.JTextField getDateField()
public final int getDateType()
public final void setDateType(int dateType)
dateType
- possibile values: Consts.TYPE_DATE, Consts.TYPE_TIME, Consts.TYPE_DATE_TIMEpublic final java.lang.String getTimeFormat()
public final void setTimeFormat(java.lang.String timeFormat)
timeFormat
- possibile values: Resources.HH_MM or Resources.H_MM_AAA or Resources.HH_MM_SS or Resources.H_MM_SS_AAApublic final void addDateChangedListener(DateChangedListener listener)
public final void removeDateChangedListener(DateChangedListener listener)
public javax.swing.JComponent getBindingComponent()
getBindingComponent
in class BaseInputControl
public java.lang.Object getValue()
getValue
in interface InputControl
getValue
in class BaseInputControl
public void setValue(java.lang.Object value)
setValue
in interface InputControl
setValue
in class BaseInputControl
value
- value to set into the input controlpublic final void addFocusListener(java.awt.event.FocusListener listener)
l
is null
,
no exception is thrown and no action is performed.
addFocusListener
in interface InputControl
FocusEvent
,
FocusListener
,
removeFocusListener(java.awt.event.FocusListener)
,
Component.getFocusListeners()
public final void removeFocusListener(java.awt.event.FocusListener listener)
l
is null
,
no exception is thrown and no action is performed.
removeFocusListener
in interface InputControl
FocusEvent
,
FocusListener
,
addFocusListener(java.awt.event.FocusListener)
,
Component.getFocusListeners()
public final void addActionListener(java.awt.event.ActionListener listener)
public final void addKeyListener(java.awt.event.KeyListener listener)
public final void removeKeyListener(java.awt.event.KeyListener listener)
public final void removeActionListener(java.awt.event.ActionListener listener)
public void processKeyEvent(java.awt.event.KeyEvent e)
public final java.util.Calendar getDefaultDate()
public final void setDefaultDate(java.util.Calendar defaultDate)
defaultDate
- default date to set into the calendar, when opening it for the first time; null means todaypublic final boolean isShowCalendarButton()
true
public final void setShowCalendarButton(boolean showCalendarButton)
true
showCalendarButton
- show/hide calendar button;public final boolean isStrictUsage()
public final void setStrictUsage(boolean strictUsage)
ClientSettings.DATE_COMPONENT_STRICT_USAGE
strictUsage
- define how the date control must behave when an invalid date has been specified within it: clean up the content (stricy usage) or trying to correct it
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |