|
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.JxFormattedTextField
public class JxFormattedTextField
Same as JFormattedTextField, but allows to set an additional Validator
like in JxTextField
,
JxTextNumberField
and
JxTextTimeField
to reflect problems to other
components.
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 | |
---|---|
JxFormattedTextField(boolean nullable)
See JFormattedTextField |
|
JxFormattedTextField(Format format,
boolean nullable)
See JFormattedTextField |
|
JxFormattedTextField(JFormattedTextField.AbstractFormatter formatter,
boolean nullable)
See JFormattedTextField |
Method Summary | |
---|---|
String |
getDefaultTooltipText()
Get a default tooltip text for this component. |
String |
getToolTipText()
If tooltip is set to an empty String, this component tries to obtain the Tooltip from its corresponding label. |
Validator<Object> |
getValidator()
Get the Validator used to check, whether the fields input is valid. |
Object |
getValue()
|
protected void |
processFocusEvent(FocusEvent e)
|
void |
setDefaultTooltipText(String text)
Set a default tooltip text for this component. |
void |
setNullable(boolean nullable)
Set, whether the field accepts null values. |
void |
setToolTipText(String text)
|
void |
setValidator(Validator<Object> validator)
Set the Validator used to check, whether the fields input is valid. |
void |
setValue(Object value)
|
protected void |
validate(Object val)
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 JxFormattedTextField(boolean nullable)
JFormattedTextField
nullable
- if false
, null
values are not
accepted.public JxFormattedTextField(Format format, boolean nullable)
JFormattedTextField
format
- format to usenullable
- if false
, null
values are not
accepted.public JxFormattedTextField(JFormattedTextField.AbstractFormatter formatter, boolean nullable)
JFormattedTextField
formatter
- nullable
- if false
, null
values are not
accepted.Method Detail |
---|
public void setNullable(boolean nullable)
Removes the installed validator and sets a new null-Validator if
nullable is true
.
nullable
- if false
, null
values are not
accepted.public 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 Object getValue()
getValue
in class JFormattedTextField
public void setValue(Object value)
setValue
in class JFormattedTextField
public Validator<Object> getValidator()
null
if not set, the validator otherwise.public void setValidator(Validator<Object> validator)
validator
- null
to disable validation, the validator
otherwise.public String getDefaultTooltipText()
null
if not set, the default tooltip otherwise.public void setDefaultTooltipText(String text)
text
- text to set. Might be null
.protected void validate(Object val)
setLabelFor
method.
val
- number to validate
|
ehsbe CommonsTM Version 1.1.0rc3 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |