|
ehsbe CommonsTM Version 1.1.0rc3 |
|||||||||
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
javax.swing.text.JTextComponent
javax.swing.JTextField
javax.swing.JFormattedTextField
com.ehsbe.commons.gui.JxTextTimeField
public class JxTextTimeField
A textfield for time values.
For Date values use JxDatePicker.
If the dateformat is NOT explicitly set, the underlying Calendar uses the default timezone of this host for calculations.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class javax.swing.JFormattedTextField |
---|
JFormattedTextField.AbstractFormatter, JFormattedTextField.AbstractFormatterFactory |
Nested classes/interfaces inherited from class javax.swing.JTextField |
---|
JTextField.AccessibleJTextField |
Nested classes/interfaces inherited from class javax.swing.text.JTextComponent |
---|
JTextComponent.AccessibleJTextComponent, JTextComponent.DropLocation, JTextComponent.KeyBinding |
Nested classes/interfaces inherited from class javax.swing.JComponent |
---|
JComponent.AccessibleJComponent |
Nested classes/interfaces inherited from class java.awt.Container |
---|
Container.AccessibleAWTContainer |
Nested classes/interfaces inherited from class java.awt.Component |
---|
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy |
Field Summary |
---|
Fields inherited from class javax.swing.JFormattedTextField |
---|
COMMIT, COMMIT_OR_REVERT, PERSIST, REVERT |
Fields inherited from class javax.swing.JTextField |
---|
notifyAction |
Fields inherited from class javax.swing.text.JTextComponent |
---|
DEFAULT_KEYMAP, FOCUS_ACCELERATOR_KEY |
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 javax.swing.SwingConstants |
---|
BOTTOM, CENTER, EAST, HORIZONTAL, LEADING, LEFT, NEXT, NORTH, NORTH_EAST, NORTH_WEST, PREVIOUS, RIGHT, SOUTH, SOUTH_EAST, SOUTH_WEST, TOP, TRAILING, VERTICAL, WEST |
Fields inherited from interface java.awt.image.ImageObserver |
---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
---|---|
JxTextTimeField()
Construct an text time field without a validator, but with the default locale. |
|
JxTextTimeField(Class<?> entityClass,
String methodName)
Construct an text time field for the given entity with the default locale. |
|
JxTextTimeField(Class<?> entityClass,
String methodName,
Locale locale)
Construct an text time field for the given entity. |
|
JxTextTimeField(Locale locale)
Construct an text time field. |
Method Summary | |
---|---|
Calendar |
getCalendar()
Get the calendar used for time formatting. |
TimeZone |
getTimezone()
Get the associated time zone for this formatter. |
String |
getToolTipText()
If tooltip is set to an empty String, this component tries to obtain the Tooltip from its corresponding label. |
Validator<Date> |
getValidator()
Get the Validator used to check, whether the fields input is valid. |
Date |
getValue()
|
protected void |
processFocusEvent(FocusEvent e)
|
void |
setLocale(Locale l)
|
void |
setTemplate(Class<?> entityClass,
String methodName)
Initialize the field wrt. the given entity and method name. |
void |
setToolTipText(String text)
|
void |
setValidator(Validator<Date> validator)
Set the Validator used to check, whether the fields input is valid. |
void |
setValue(Object value)
Same as JFormattedTextField.setValue(java.lang.Object) , but
normalizes the given time value. |
protected void |
validate(Date num)
If a validator is set, this method validates the input and decorates the component, which used this component in a setLabelFor
method. |
Methods inherited from class javax.swing.JFormattedTextField |
---|
commitEdit, getActions, getFocusLostBehavior, getFormatter, getFormatterFactory, getUIClassID, invalidEdit, isEditValid, processInputMethodEvent, setDocument, setFocusLostBehavior, setFormatter, setFormatterFactory |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public JxTextTimeField(Class<?> entityClass, String methodName, Locale locale)
entityClass
- entity classmethodName
- name of the method, which should be used to
obtain the Column.nullable()
for the fieldlocale
- locale to use for obtaining valid number characterssetTemplate(Class, String)
public JxTextTimeField()
public JxTextTimeField(Locale locale)
locale
- locale to use for obtaining valid number characterspublic JxTextTimeField(Class<?> entityClass, String methodName)
entityClass
- entity classmethodName
- name of the method, which should be used to
obtain the Column.nullable()
for the fieldMethod Detail |
---|
public void setTemplate(Class<?> entityClass, String methodName)
If the given method could not be found, has no @Column annotation
or the annotation contains not nullable=true
, no validator
is setup. Otherwise a "not-null"-validator is installed automatically.
entityClass
- entity classmethodName
- name of the method, which should be used to
obtain the Column.nullable()
for the fieldpublic TimeZone getTimezone()
Per default this is the default timezone for this host.
public void setLocale(Locale l)
setLocale
in class Component
public Date getValue()
getValue
in class JFormattedTextField
public void setValue(Object value)
JFormattedTextField.setValue(java.lang.Object)
, but
normalizes the given time value. I.e. per default, seconds and
milliseconds are set to 0 and the resulting Value represents the time
wrt. to the start of the day for the passed value.
E.g. if you pass in a date of 01.02.2005 14:30:22,123 the value gets
normalized to 01.01.1970 14:30:00,000.
setValue
in class JFormattedTextField
#parse(String)
public Calendar getCalendar()
protected void validate(Date num)
setLabelFor
method.
num
- date to validatepublic String getToolTipText()
getToolTipText
in class JComponent
public void setToolTipText(String text)
setToolTipText
in class JComponent
protected void processFocusEvent(FocusEvent e)
processFocusEvent
in class JFormattedTextField
public Validator<Date> getValidator()
Per default a validator gets automatically installed, if the @Column's
nullable
property is set to false. It accepts
none-null values, only.
null
if not set, the validator otherwise.public void setValidator(Validator<Date> validator)
validator
- null
to disable validation, the validator
otherwise.
|
ehsbe CommonsTM Version 1.1.0rc3 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |