public final class CalendarPanel
extends javax.swing.JPanel
javax.swing.JPanel.AccessibleJPanel
javax.swing.JComponent.AccessibleJComponent
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
DOUBLE_CLICK_COMMAND
The command for the action fired when the user double clicks on the calendar grid
|
static java.lang.String |
SELECTION_CHANGED_COMMAND
The command for the action fired when the selection of dates in the calendar changes
|
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
Constructor and Description |
---|
CalendarPanel(java.util.Locale locale) |
Modifier and Type | Method and Description |
---|---|
void |
addActionListener(java.awt.event.ActionListener listener) |
void |
addSelectedDates(java.util.Date[] dates)
add the given dates to the current selection.
|
void |
cleanUp()
Cleanup code
|
CalendarDateProvider |
getDateProvider() |
java.util.Locale |
getLocale() |
java.util.Date |
getMaximumDate() |
java.util.Date |
getMinimumDate() |
java.util.TimeZone |
getNearestTimeZone(java.util.TimeZone timeZone)
Finds the nearest TimeZone from the time zone list to the raw offset of
the supplied timeZone.
|
java.util.Date[] |
getSelectedDates()
returns an array of dates choosen in the calendar.
|
boolean |
getShowTimeZone() |
java.util.TimeZone |
getTimeZone() |
java.util.TimeZone |
getTimeZoneInList(java.util.TimeZone timeZone)
Returns a TimeZone from the time zone list that shares the same
long daylight saving name.
|
java.util.Date |
getVisibleDate()
will return a date that is currently visible in the calendar.
|
boolean |
isEditingTime() |
boolean |
isMultiSelect() |
boolean |
isShowingTime() |
void |
makeDateVisible(java.util.Date date)
Will adjust the calendar so that the given date is visible
|
void |
removeActionListener(java.awt.event.ActionListener listener) |
void |
removeSelectedDates(java.util.Date[] dates)
remove the given dates from the current selection
|
void |
setDateProvider(CalendarDateProvider calDateProvider) |
void |
setEditTime(boolean editTime) |
void |
setMaximumDate(java.util.Date maximumDate) |
void |
setMinimumDate(java.util.Date minimumDate)
Will disable all dates less than the given date
|
void |
setMultiSelect(boolean isMultiSelect) |
void |
setSelectedDate(java.util.Date date)
Change the selected date/time to the given one.
|
void |
setSelectedDates(java.util.Date[] dates)
Change the current selected dates to be the given array.
|
void |
setShowTime(boolean showTime)
Show or hide BOTH time and time zone components.
|
void |
setShowTimeZone(boolean showTimeZone) |
void |
setTimeZone(java.util.TimeZone timeZone)
Change the timezone.
|
void |
setVisibleDate(boolean visible)
Turn on or off the display of the date component in this
CalenderPanel (on by default).
|
void |
setVisibleTime(boolean visible)
Turn on or off the display of the time component in this
CalenderPanel.
|
void |
setVisibleTimeZone(boolean visible)
Turn on or off the display of the time zone component in this
CalenderPanel.
|
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
addAncestorListener, 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, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, 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, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
add, 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, validateTree
action, add, addComponentListener, addFocusListener, 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, 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, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, 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, transferFocusUpCycle
public static final java.lang.String DOUBLE_CLICK_COMMAND
public static final java.lang.String SELECTION_CHANGED_COMMAND
public java.util.Date[] getSelectedDates()
If the calendar is displaying the time section (in either edit or display mode) then the time portion (hours/minutes/seconds) for all returned dates will match the displayed time. Note: This means that any date set using setSelectedDate() or setSelectedDates() may not exactly match the return values for the same day. Calendar time
public void setSelectedDate(java.util.Date date)
date
- public void setTimeZone(java.util.TimeZone timeZone)
timeZone
- the time zone to setpublic java.util.TimeZone getTimeZone()
public void setMultiSelect(boolean isMultiSelect)
public boolean isMultiSelect()
public void setSelectedDates(java.util.Date[] dates)
dates
- public void addSelectedDates(java.util.Date[] dates)
dates
- public void removeSelectedDates(java.util.Date[] dates)
dates
- public java.util.Date getVisibleDate()
public void makeDateVisible(java.util.Date date)
date
- public void setMinimumDate(java.util.Date minimumDate)
minimumDate
- public java.util.Date getMinimumDate()
public void setMaximumDate(java.util.Date maximumDate)
public java.util.Date getMaximumDate()
public void setDateProvider(CalendarDateProvider calDateProvider)
public CalendarDateProvider getDateProvider()
public java.util.Locale getLocale()
getLocale
in class java.awt.Component
public void setShowTime(boolean showTime)
showTime
- public boolean isShowingTime()
public void setEditTime(boolean editTime)
public boolean isEditingTime()
public void setShowTimeZone(boolean showTimeZone)
public boolean getShowTimeZone()
public void setVisibleDate(boolean visible)
visible
- boolean true to make it visible;
false to make it invisible.public void setVisibleTime(boolean visible)
setShowTimeZone(boolean)
, this
method and setVisibleTimeZone(boolean)
may be used to make the
time only and time zone components separatly visible.visible
- boolean true to make it visible;
false to make it invisible.public void setVisibleTimeZone(boolean visible)
setShowTimeZone(boolean)
, this
method and setVisibleTime(boolean)
may be used to make the time
zone and time only components separatly visible.visible
- boolean true to make it visible;
false to make it invisible.public java.util.TimeZone getNearestTimeZone(java.util.TimeZone timeZone)
timeZone
- TimeZone to be checked.public java.util.TimeZone getTimeZoneInList(java.util.TimeZone timeZone)
timeZone
- TimeZone to be located.public void cleanUp()
public void addActionListener(java.awt.event.ActionListener listener)
public void removeActionListener(java.awt.event.ActionListener listener)