|
||||||||||
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
com.michaelbaranov.microba.calendar.CalendarPane
com.michaelbaranov.microba.calendar.DatePicker
A concrete implementation of JComponent. Capable of displaying and selecting dates, much like an editable combo-box with a calendar dropdown.
Nested Class Summary |
Nested classes inherited from class javax.swing.JComponent |
javax.swing.JComponent.AccessibleJComponent |
Field Summary | |
static int |
PICKER_STYLE_BUTTON
A constant for the "pickerStyle" property. |
static int |
PICKER_STYLE_FIELD_AND_BUTTON
A constant for the "pickerStyle" property. |
static java.lang.String |
PROPERTY_NAME_DATE_FORMAT
The name of a "dateFormat" property. |
static java.lang.String |
PROPERTY_NAME_FIELD_EDITABLE
The name of a "fieldEditable" property. |
static java.lang.String |
PROPERTY_NAME_KEEP_TIME
The name of a "keepTime" property. |
static java.lang.String |
PROPERTY_NAME_PICKER_STYLE
The name of a "pickerStyle" property. |
Fields inherited from class com.michaelbaranov.microba.calendar.CalendarPane |
PROPERTY_NAME_DATE, PROPERTY_NAME_FOCUS_LOST_BEHAVIOR, PROPERTY_NAME_HOLIDAY_POLICY, PROPERTY_NAME_LOCALE, PROPERTY_NAME_RESOURCES, PROPERTY_NAME_SHOW_NONE_BTN, PROPERTY_NAME_SHOW_NUMBER_WEEK, PROPERTY_NAME_SHOW_TODAY_BTN, PROPERTY_NAME_STRIP_TIME, PROPERTY_NAME_STYLE, PROPERTY_NAME_VETO_POLICY, PROPERTY_NAME_ZONE, STYLE_CLASSIC, STYLE_MODERN |
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 | |
DatePicker()
Constructor. |
|
DatePicker(java.util.Date initialDate)
Constructor. |
|
DatePicker(java.util.Date initialDate,
java.text.DateFormat dateFormat)
Constructor. |
|
DatePicker(java.util.Date initialDate,
java.text.DateFormat dateFormat,
java.util.Locale locale)
Constructor. |
|
DatePicker(java.util.Date initialDate,
java.text.DateFormat dateFormat,
java.util.Locale locale,
java.util.TimeZone zone)
Constructor. |
|
DatePicker(java.util.Date initialDate,
int dateStyle)
Constructor. |
|
DatePicker(java.util.Date initialDate,
int dateStyle,
java.util.Locale locale)
Constructor. |
|
DatePicker(java.util.Date initialDate,
int dateStyle,
java.util.Locale locale,
java.util.TimeZone zone)
Constructor. |
Method Summary | |
boolean |
commitEdit()
Forces the control to commit current user's edit. |
java.text.DateFormat |
getDateFormat()
Returns the date format. |
int |
getPickerStyle()
Returns current visual style of the picker control. |
java.lang.String |
getUIClassID()
|
void |
hidePopup()
Hides the calendar dropdown without selecting a date. |
boolean |
isFieldEditable()
Is the edit field of the control editable by the user? |
boolean |
isKeepTime()
Does UI try to preserve time components entered in the edit field? |
void |
revertEdit()
Forces the control to revert current user's edit to reflect current control's date. |
void |
setDateFormat(java.text.DateFormat dateFormat)
Sets the date format constant defined by DateFormat and updates
the control to reflect new date style.
|
void |
setFieldEditable(boolean fieldEditable)
Enables or disables editing of the edit field by the user. |
void |
setKeepTime(boolean keepTime)
Determines if the UI should try to preserve time components entered in the edit field. |
void |
setPickerStyle(int pickerStyle)
Sets the current visual style of the picker control. |
void |
showButtonOnly(boolean buttonOnly)
A shortucut method to switch picker style between PICKER_STYLE_FIELD_AND_BUTTON and PICKER_STYLE_BUTTON |
void |
showPopup()
Displays the calendar dropdown. |
Methods inherited from class com.michaelbaranov.microba.calendar.CalendarPane |
addActionListener, addCommitListener, commitOrRevert, getDate, getFocusLostBehavior, getHolidayPolicy, getLocale, getResources, getStyle, getUI, getVetoPolicy, getZone, isShowNoneButton, isShowNumberOfWeek, isShowTodayButton, isStripTime, removeActionListener, removeCommitListener, setDate, setFocusLostBehavior, setHolidayPolicy, setLocale, setResources, setShowNoneButton, setShowNumberOfWeek, setShowTodayButton, setStripTime, setStyle, setVetoPolicy, setZone, stripTime, 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, getAccessibleContext, 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, 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, requestFocus, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFont, setForeground, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, 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, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, contains, createImage, createImage, createVolatileImage, createVolatileImage, dispatchEvent, enable, enableInputMethods, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, 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, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final java.lang.String PROPERTY_NAME_DATE_FORMAT
public static final java.lang.String PROPERTY_NAME_FIELD_EDITABLE
public static final java.lang.String PROPERTY_NAME_KEEP_TIME
public static final java.lang.String PROPERTY_NAME_PICKER_STYLE
public static final int PICKER_STYLE_FIELD_AND_BUTTON
public static final int PICKER_STYLE_BUTTON
Constructor Detail |
public DatePicker()
public DatePicker(java.util.Date initialDate)
public DatePicker(java.util.Date initialDate, int dateStyle)
public DatePicker(java.util.Date initialDate, java.text.DateFormat dateFormat)
public DatePicker(java.util.Date initialDate, int dateStyle, java.util.Locale locale)
public DatePicker(java.util.Date initialDate, java.text.DateFormat dateFormat, java.util.Locale locale)
public DatePicker(java.util.Date initialDate, int dateStyle, java.util.Locale locale, java.util.TimeZone zone)
public DatePicker(java.util.Date initialDate, java.text.DateFormat dateFormat, java.util.Locale locale, java.util.TimeZone zone)
Method Detail |
public java.lang.String getUIClassID()
getUIClassID
in class CalendarPane
public java.text.DateFormat getDateFormat()
setDateFormat(DateFormat)
public void setDateFormat(java.text.DateFormat dateFormat)
DateFormat
and updates
the control to reflect new date style.
dateFormat
- the date format constant to setgetDateFormat()
,
DateFormat
public boolean isFieldEditable()
If not editable, the user can not type in the date and can only use calendar drop-down to select dates.
true
if the edit field is editable,
false
otherwisesetFieldEditable(boolean)
public void setFieldEditable(boolean fieldEditable)
If not editable, the user can not type in the date and can only use calendar drop-down to select dates.
fieldEditable
- the editable value to setisFieldEditable()
public boolean isKeepTime()
If true
and if the date format has some time fields
(hours, minutes, seconds, fraction of second), the UI tries to respect
the time fields' values entered by user as much as possible.
Note: to be able to receive time portion of the date, make sure
CalendarPane.isStripTime()
is false
(the dafualt).
true
if the UI respects time fields,
false
otherwisesetKeepTime(boolean)
,
CalendarPane.setStripTime(boolean)
,
CalendarPane.isStripTime()
public void setKeepTime(boolean keepTime)
If true
and if the date format has some time fields
(hours, minutes, seconds, fraction of second), the UI tries to respect
the time fields' values entered by user as much as possible.
Note: to be able to receive time portion of the date, make sure
CalendarPane.isStripTime()
is false
(the dafualt).
keepTime
- true
to make the UI respects time fields,
false
otherwiseisKeepTime()
,
CalendarPane.setStripTime(boolean)
,
CalendarPane.isStripTime()
public int getPickerStyle()
NOTE: do not confuse with CalendarPane.getStyle()
.
public void setPickerStyle(int pickerStyle)
The control is then updated to reflect the new style.
NOTE: do not confuse with CalendarPane.getStyle()
.
PICKER_STYLE_BUTTON
,
PICKER_STYLE_FIELD_AND_BUTTON
public void showButtonOnly(boolean buttonOnly)
PICKER_STYLE_FIELD_AND_BUTTON
and PICKER_STYLE_BUTTON
public void showPopup()
public void hidePopup()
public boolean commitEdit()
CalendarPane
CommitEvent
is fired.
commitEdit
in class CalendarPane
true
if successful, false
otherwiseCalendarPane.revertEdit()
,
CalendarPane.getFocusLostBehavior()
,
CalendarPane.setFocusLostBehavior(int)
public void revertEdit()
CalendarPane
CommitEvent
is fired.
revertEdit
in class CalendarPane
CalendarPane.revertEdit()
,
CalendarPane.getFocusLostBehavior()
,
CalendarPane.setFocusLostBehavior(int)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |