Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference
11g Release 1 (11.1.1.4.0)

E13403-05

oracle.javatools.ui.calendar
Class CalendarPanel

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by javax.swing.JPanel
                  extended by oracle.javatools.ui.calendar.CalendarPanel
All Implemented Interfaces:
java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, javax.accessibility.Accessible

public final class CalendarPanel
extends javax.swing.JPanel

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.JPanel
javax.swing.JPanel.AccessibleJPanel
 
Nested classes/interfaces inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
 
Nested classes/interfaces inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Nested classes/interfaces inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
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
 
Fields inherited from class javax.swing.JComponent
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, 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
CalendarPanel(java.util.Locale locale)
           
 
Method Summary
 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 timzone.
 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.
 
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
 
Methods inherited from class javax.swing.JComponent
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, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, 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
 
Methods inherited from class java.awt.Container
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, transferFocusBackward, transferFocusDownCycle, validate, validateTree
 
Methods inherited from class java.awt.Component
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, hide, 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, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

DOUBLE_CLICK_COMMAND

public static final java.lang.String DOUBLE_CLICK_COMMAND
The command for the action fired when the user double clicks on the calendar grid

See Also:
Constant Field Values

SELECTION_CHANGED_COMMAND

public static final java.lang.String SELECTION_CHANGED_COMMAND
The command for the action fired when the selection of dates in the calendar changes

See Also:
Constant Field Values
Constructor Detail

CalendarPanel

public CalendarPanel(java.util.Locale locale)
Method Detail

getSelectedDates

public java.util.Date[] getSelectedDates()
returns an array of dates choosen in the calendar.

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

Returns:
an array of selected dates as java Date object.

setSelectedDate

public void setSelectedDate(java.util.Date date)
Change the selected date/time to the given one.

Parameters:
date -

setTimeZone

public void setTimeZone(java.util.TimeZone timeZone)
Change the timzone.

Parameters:
timeZone - the time zone to set

getTimeZone

public java.util.TimeZone getTimeZone()

setMultiSelect

public void setMultiSelect(boolean isMultiSelect)

isMultiSelect

public boolean isMultiSelect()

setSelectedDates

public void setSelectedDates(java.util.Date[] dates)
Change the current selected dates to be the given array. If the calendar is single select then the current selection changes to the first date of the given date array. As the calendar can have many selected dates but only one selected time, the calendar time is adjusted to that of the first date in the given array

Parameters:
dates -

addSelectedDates

public void addSelectedDates(java.util.Date[] dates)
add the given dates to the current selection. If the calendar is single select then the current selection changes to the first date of the given date array. The time portion of the calendar is not changed by this call

Parameters:
dates -

removeSelectedDates

public void removeSelectedDates(java.util.Date[] dates)
remove the given dates from the current selection

Parameters:
dates -

getVisibleDate

public java.util.Date getVisibleDate()
will return a date that is currently visible in the calendar. i.e. one of the days of the currently selected month and year. There's no guarentee of which day in the month will be returned.

Returns:

makeDateVisible

public void makeDateVisible(java.util.Date date)
Will adjust the calendar so that the given date is visible

Parameters:
date -

setMinimumDate

public void setMinimumDate(java.util.Date minimumDate)
Will disable all dates less than the given date

Parameters:
minimumDate -

getMinimumDate

public java.util.Date getMinimumDate()

setMaximumDate

public void setMaximumDate(java.util.Date maximumDate)

getMaximumDate

public java.util.Date getMaximumDate()

setDateProvider

public void setDateProvider(CalendarDateProvider calDateProvider)

getDateProvider

public CalendarDateProvider getDateProvider()

getLocale

public java.util.Locale getLocale()
Overrides:
getLocale in class java.awt.Component

setShowTime

public void setShowTime(boolean showTime)
Show or hide BOTH time and time zone components.

Parameters:
showTime -

isShowingTime

public boolean isShowingTime()

setEditTime

public void setEditTime(boolean editTime)

isEditingTime

public boolean isEditingTime()

setShowTimeZone

public void setShowTimeZone(boolean showTimeZone)

getShowTimeZone

public boolean getShowTimeZone()

setVisibleDate

public void setVisibleDate(boolean visible)
Turn on or off the display of the date component in this CalenderPanel (on by default).

Parameters:
visible - boolean true to make it visible; false to make it invisible.

setVisibleTime

public void setVisibleTime(boolean visible)
Turn on or off the display of the time component in this CalenderPanel. Unlike setShowTimeZone(boolean), this method and setVisibleTimeZone(boolean) may be used to make the time only and time zone components separatly visible.

Parameters:
visible - boolean true to make it visible; false to make it invisible.

setVisibleTimeZone

public void setVisibleTimeZone(boolean visible)
Turn on or off the display of the time zone component in this CalenderPanel. Unlike setShowTimeZone(boolean), this method and setVisibleTime(boolean) may be used to make the time zone and time only components separatly visible.

Parameters:
visible - boolean true to make it visible; false to make it invisible.

getNearestTimeZone

public 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.

Parameters:
timeZone - TimeZone to be checked.
Returns:
The TimeZone from the list that is the nearest match. When there are multiple values in the list with the same value the last one is returned, which typically is the GMT version.

getTimeZoneInList

public java.util.TimeZone getTimeZoneInList(java.util.TimeZone timeZone)
Returns a TimeZone from the time zone list that shares the same long daylight saving name.

Parameters:
timeZone - TimeZone to be located.
Returns:
a TimeZone from the list or null if there is no match.

cleanUp

public void cleanUp()
Cleanup code


addActionListener

public void addActionListener(java.awt.event.ActionListener listener)

removeActionListener

public void removeActionListener(java.awt.event.ActionListener listener)

Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference
11g Release 1 (11.1.1.4.0)

E13403-05

Copyright © 1997, 2011, Oracle. All rights reserved.