|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object
|
+--java.awt.Component
|
+--java.awt.Container
|
+--java.awt.Window
|
+--java.awt.Dialog
|
+--javax.swing.JDialog
|
+--com.ca.commons.cbutil.CBDialog
|
+--com.ca.directory.jxplorer.editor.GeneralizedTimeEditor
The GeneralizedTimeEditor used for editing generalizedTime attributes within the directory. It is initiated when the user clicks on a generalizedTime attribute in the Table Editor of JXplorer.
The GeneralizedTimeEditor displays a date/time dialog with combo boxes for the following:
Milli seconds (possible values: 0-999). Seconds of the minute (possible values: 0-59). Minutes of the hour (possible values: 0-59). Hour of the day (possible values: 0-23). Day of the month (possible values: --, 1-31). Month of the year (possible values: --, January - Decemeber inclusive).
Note: it is possible to enter the following generalizedTime 000000000000, this is why a value of -- (0) is included in day of the month and month of the year combos.
The year is displayed and edited through a restricted (whole number) field. Year can only be of 4 characters. The UTC (or GTM or zulu) is selected via a check box.
This class follows the generalizedTime format of year-month-day-hour-minute (yyyymmddhhmm) as manditory. Optional values in the generalizedTime are second-millisecond-UTC (ss.mmmZ). Milliseconds require seconds to be added. Examples of a correct generalizeTime are
20011231235959.999Z 20011231235959.999 20011231235959.99Z 20011231235959.99 20011231235959.9Z 20011231235959.9 19960229235959 19960229235959Z 199702282359 199702282359Z
The dialog has a 'Now' button for displaying the current date/time of the user's machine.
The dialog enforces date constraints such as leap years. For example if a leap year is entered in the year field and february is selected, the days displayed will be 0-29. The correct days for the month that is selected will be displayed also. For example if April is selected the days will be 0-30.
| Nested Class Summary |
| Nested classes inherited from class javax.swing.JDialog |
javax.swing.JDialog.AccessibleJDialog |
| Nested classes inherited from class java.awt.Dialog |
java.awt.Dialog.AccessibleAWTDialog |
| Nested classes inherited from class java.awt.Window |
java.awt.Window.AccessibleAWTWindow |
| Nested classes inherited from class java.awt.Container |
java.awt.Container.AccessibleAWTContainer |
| Nested classes inherited from class java.awt.Component |
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy |
| Field Summary |
| Fields inherited from class com.ca.commons.cbutil.CBDialog |
buttonPanel, Cancel, display, Help, OK, owner |
| Fields inherited from class javax.swing.JDialog |
accessibleContext, rootPane, rootPaneCheckingEnabled |
| Fields inherited from class java.awt.Component |
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
| Fields inherited from interface javax.swing.WindowConstants |
DISPOSE_ON_CLOSE, DO_NOTHING_ON_CLOSE, EXIT_ON_CLOSE, HIDE_ON_CLOSE |
| Fields inherited from interface java.awt.image.ImageObserver |
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
| Constructor Summary | |
GeneralizedTimeEditor(java.awt.Frame owner,
java.lang.String value,
boolean isTableEditor)
Sets up the dialog components, displaying the supplied attribute value. |
|
| Method Summary | |
protected void |
displayCurrent()
Gets the current date and time from the user's machine and displays it. |
void |
doCancel()
When the user hits 'cancel', the window is shut down. |
void |
doOK()
Sets the changed (or unchanged) attribute value from the attribute editor in the table. |
protected int |
getDaysInMonth(int month)
Returns the days in the month that is supplied. |
protected java.lang.String |
getSelectedDay()
Returns a string representation of the day as entered in the day combo. |
protected java.lang.String |
getSelectedHour()
Returns a string representation of the hour as entered in the hour combo. |
protected java.lang.String |
getSelectedMilliSecond()
Returns a string representation of the milliSecond as entered in the milliSecond combo. |
protected java.lang.String |
getSelectedMinute()
Returns a string representation of the minute as entered in the minute combo. |
protected java.lang.String |
getSelectedMonth()
Returns a string representation of the month as entered in the month combo. |
protected java.lang.String |
getSelectedSecond()
Returns a string representation of the second as entered in the second combo. |
protected java.lang.String |
getSelectedYear()
Returns a string representation of the year as entered in the year field. |
java.lang.String |
getTime()
Returns the time set in the GUI. |
protected int |
getUserYear()
Returns the year from the year field as an integer. |
protected void |
initDateTimeVariables()
Initialises the date and time variables depending on the current attribute value. |
protected void |
initDays(int days)
Initialises the second combo with integers from 0-31, 0-30, 0-29 or 0-28 depending on the number of days supplied. |
protected void |
initHours()
Initialises the hour combo with integers from 0-23. |
protected void |
initMilliSeconds()
Initialises the milli-second combo with integers from 0-999. |
protected void |
initMinutes()
Initialises the minute combo with integers from 0-59. |
protected void |
initMonths()
Initialises the month combo with months of the year. |
protected void |
initSeconds()
Initialises the second combo with integers from 0-59. |
boolean |
isLeapYear(int year)
Determines if given year is a leap year. |
protected void |
setDayComboSelectedIndex(int index)
Displays the value in the day combo at the index supplied. |
protected void |
setSelectedIndexes()
Sets the index of the combo boxes and the year field to the already initiated date an time variables. |
void |
setStringValue(EditableString editString)
Sets the EditableString of this class to the supplied EditableString. |
protected void |
updateDayCombo()
Re-populates the day combo to reflect the number of days of the month that is selected in the month combo. |
| Methods inherited from class com.ca.commons.cbutil.CBDialog |
add, addln, escKeyCheck, getDisplayPanel, makeHeavy, makeLight, makeWide, quit, setHelpLink, wasCancelled |
| Methods inherited from class javax.swing.JDialog |
addImpl, createRootPane, dialogInit, getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getJMenuBar, getLayeredPane, getRootPane, isDefaultLookAndFeelDecorated, isRootPaneCheckingEnabled, paramString, processWindowEvent, remove, setContentPane, setDefaultCloseOperation, setDefaultLookAndFeelDecorated, setGlassPane, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, update |
| Methods inherited from class java.awt.Dialog |
addNotify, dispose, getTitle, hide, isModal, isResizable, isUndecorated, setModal, setResizable, setTitle, setUndecorated, show |
| Methods inherited from class java.awt.Window |
addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, finalize, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getGraphicsConfiguration, getInputContext, getListeners, getLocale, getMostRecentFocusOwner, getOwnedWindows, getOwner, getToolkit, getWarningString, getWindowFocusListeners, getWindowListeners, getWindowStateListeners, isActive, isFocusableWindow, isFocusCycleRoot, isFocused, isShowing, pack, postEvent, processEvent, processWindowFocusEvent, processWindowStateEvent, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, setCursor, setFocusableWindowState, setFocusCycleRoot, setLocationRelativeTo, toBack, toFront |
| Methods inherited from class java.awt.Container |
add, add, add, add, addContainerListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalPolicy, getInsets, getLayout, getMaximumSize, getMinimumSize, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paint, paintComponents, preferredSize, print, printComponents, processContainerEvent, remove, removeAll, removeContainerListener, removeNotify, setFocusTraversalKeys, setFocusTraversalPolicy, setFont, 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, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isOpaque, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, size, toString, transferFocus, transferFocusUpCycle |
| Methods inherited from class java.lang.Object |
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
public GeneralizedTimeEditor(java.awt.Frame owner,
java.lang.String value,
boolean isTableEditor)
owner - the parent frame, usually JXplorer.isTableEditor - this class is normally used by the table editor. If used elsewhere set this to false and get the time value from the getTime() method.| Method Detail |
protected void initDateTimeVariables()
protected int getDaysInMonth(int month)
month - an integer representation of the month for example: 1 = Jan, 2 = Feb...12 = Dec.
0 = an unspecified month which has 0 days.
protected void displayCurrent()
protected void setSelectedIndexes()
protected void initMilliSeconds()
protected void initSeconds()
protected void initMinutes()
protected void initHours()
protected void initDays(int days)
days - the maximum number of days to display. Can be 0, 28, 29, 30 ,31.protected void initMonths()
protected void updateDayCombo()
protected int getUserYear()
protected void setDayComboSelectedIndex(int index)
index - the index of the value to display in the day combo.public boolean isLeapYear(int year)
year - = given year after 1582 (start of the Gregorian calendar).
protected java.lang.String getSelectedYear()
protected java.lang.String getSelectedMonth()
protected java.lang.String getSelectedDay()
protected java.lang.String getSelectedHour()
protected java.lang.String getSelectedMinute()
protected java.lang.String getSelectedSecond()
protected java.lang.String getSelectedMilliSecond()
public void setStringValue(EditableString editString)
setStringValue in interface AbstractStringEditorpublic void doOK()
doOK in class CBDialogpublic void doCancel()
doCancel in class CBDialogpublic java.lang.String getTime()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||