|
|||||||||
| 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
test.contrib.tabledatefield.DateTextField
public class DateTextField
Copyright 2008 Computer Science Software (Pty) Ltd. South Africa. Stripped-down for Substance hover issue demo.
| Nested Class Summary |
|---|
| 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 | |
|---|---|
protected javax.swing.JButton |
calendarButton
|
protected java.util.Calendar |
calendarDate
|
protected DateField |
dateField
|
protected javax.swing.JPopupMenu |
popup
|
protected boolean |
popupIsVisible
|
protected java.sql.Timestamp |
timestampValue
|
| 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 | |
|---|---|
DateTextField()
|
|
DateTextField(java.text.SimpleDateFormat dateFormat)
|
|
| Method Summary | |
|---|---|
void |
actionPerformed(java.awt.event.ActionEvent event)
|
void |
addFocusListener(java.awt.event.FocusListener l)
|
javax.accessibility.AccessibleContext |
getAccessibleContext()
Gets the AccessibleContext associated with this
DateTextField. |
java.awt.Color |
getBackground()
|
protected java.util.Calendar |
getCurrentCalendarValue()
|
java.util.Date |
getDate()
|
javax.swing.text.Document |
getDocument()
Fetches the model associated with the editor. |
DateField |
getField()
|
boolean |
getHasChanged()
|
java.awt.im.InputMethodRequests |
getInputMethodRequests()
|
java.lang.String |
getText()
|
java.sql.Timestamp |
getTimestamp()
|
boolean |
isEditable()
Returns the boolean indicating whether this DateTextField
is editable or not. |
void |
removeFocusListener(java.awt.event.FocusListener l)
|
void |
requestFocus()
|
boolean |
requestFocusInWindow()
|
void |
setBackground(java.awt.Color color)
|
void |
setDate(java.util.Date newDate)
|
void |
setDocument(javax.swing.text.Document doc)
Associates the editor with a text document. |
void |
setEditable(boolean b)
Sets the specified boolean to indicate whether or not this DateTextField should be editable. |
void |
setEnabled(boolean flag)
|
protected void |
setFieldValue(java.util.Calendar newCalendarDate)
|
void |
setForeground(java.awt.Color color)
|
void |
setHasChanged(boolean newHasChanged)
|
void |
setHorizontalAlignment(int alignment)
|
void |
setText(java.lang.String text)
Override setText() to throw a RuntimeException, setDate() should be used instead. |
| 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, getUIClassID, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, paramString, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setFocusTraversalKeys, setFont, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update, updateUI |
| 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, 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, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getKeyListeners, getLocale, 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, 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 |
|---|
protected java.sql.Timestamp timestampValue
protected java.util.Calendar calendarDate
protected javax.swing.JPopupMenu popup
protected DateField dateField
protected boolean popupIsVisible
protected javax.swing.JButton calendarButton
| Constructor Detail |
|---|
public DateTextField(java.text.SimpleDateFormat dateFormat)
public DateTextField()
| Method Detail |
|---|
public java.util.Date getDate()
public void setDate(java.util.Date newDate)
public java.sql.Timestamp getTimestamp()
protected void setFieldValue(java.util.Calendar newCalendarDate)
public java.lang.String getText()
public void setText(java.lang.String text)
public DateField getField()
public javax.swing.text.Document getDocument()
public void setDocument(javax.swing.text.Document doc)
doc - the document to display/editgetDocument()public void setEnabled(boolean flag)
setEnabled in class javax.swing.JComponentpublic void setHorizontalAlignment(int alignment)
public void setForeground(java.awt.Color color)
setForeground in class javax.swing.JComponentpublic void setBackground(java.awt.Color color)
setBackground in class javax.swing.JComponentpublic java.awt.Color getBackground()
getBackground in class java.awt.Componentprotected java.util.Calendar getCurrentCalendarValue()
public void actionPerformed(java.awt.event.ActionEvent event)
actionPerformed in interface java.awt.event.ActionListenerpublic boolean getHasChanged()
public void setHasChanged(boolean newHasChanged)
public void requestFocus()
requestFocus in class javax.swing.JComponentpublic boolean requestFocusInWindow()
requestFocusInWindow in class javax.swing.JComponentpublic void addFocusListener(java.awt.event.FocusListener l)
addFocusListener in class java.awt.Componentpublic void removeFocusListener(java.awt.event.FocusListener l)
removeFocusListener in class java.awt.Componentpublic boolean isEditable()
DateTextField
is editable or not.
setEditable(boolean)public void setEditable(boolean b)
DateTextField should be editable. A PropertyChange event
("editable") is fired when the state is changed.
b - the boolean to be setisEditable()public java.awt.im.InputMethodRequests getInputMethodRequests()
getInputMethodRequests in class java.awt.Componentpublic javax.accessibility.AccessibleContext getAccessibleContext()
AccessibleContext associated with this
DateTextField. For text components, the
AccessibleContext takes the form of an
AccessibleJTextComponent. A new
AccessibleJTextComponent instance is created if necessary.
getAccessibleContext in interface javax.accessibility.AccessiblegetAccessibleContext in class javax.swing.JComponentAccessibleJTextComponent that serves as the
AccessibleContext of this
DateTextField
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||