| |
|
| org.itsnat.comp.ItsNatFormattedTextField
All known Subclasses: org.itsnat.impl.comp.ItsNatFormatterDefaultImpl,
Inner Class :public interface ItsNatFormatter | |
Inner Class :public interface ItsNatFormatterFactory | |
Field Summary | |
final public static int | COMMIT Constant identifying that when focus is lost,
commitEdit should be invoked. | final public static int | COMMIT_OR_REVERT Constant identifying that when focus is lost,
commitEdit should be invoked. | final public static int | PERSIST Constant identifying that when focus is lost, the edited value
should be left. | final public static int | REVERT Constant identifying that when focus is lost, editing value should
be reverted to current value set on the component. |
Method Summary | |
public void | commitEdit() Forces the current value to be taken from the
control and set as the current value converted first using the current
ItsNatFormatter . | public ItsNatFormatterFactory | createDefaultItsNatFormatterFactory() Creates a new default ItsNat formatter factory. | public ItsNatFormatter | createItsNatFormatter(Format format) Creates an ItsNat formatter wrapping the specified java.text.Format .
Current implementation uses Format.parseObject(String) and
Format.format(Object) to convert string and values.
Parameters: format - the java.text.Format to wrap. | public int | getFocusLostBehavior() Returns the behavior when focus is lost. | public ItsNatFormatter | getItsNatFormatter() This method is called when the component needs to convert an Object value
from/to String. | public ItsNatFormatterFactory | getItsNatFormatterFactory() Returns the current ItsNat formatter factory. | public Object | getValue() Returns the last valid value. | public boolean | isEditValid() Returns true if the current value being edited is valid. | public boolean | isEdited() Informs whether visual control content has changed and component value is
still not modified. | public void | setFocusLostBehavior(int behavior) Sets the behavior when focus is lost. | public void | setFormat(Format format) Defines a default ItsNat formatter based on the specified java.text.Format .
The method
ItsNatFormattedTextField.createItsNatFormatter(java.text.Format) is called to create
an ItsNat formatter wrapping this format. | public void | setItsNatFormatter(ItsNatFormatter formatter) Sets the default ItsNat formatter. | public void | setItsNatFormatterFactory(ItsNatFormatterFactory tf) Sets the current ItsNat formatter factory.
Parameters: tf - the new formatter factory. | public void | setValue(Object value) Sets the value that will be formatted to the control by an
ItsNatFormatter obtained from the current
ItsNatFormatterFactory . |
COMMIT | final public static int COMMIT(Code) | | Constant identifying that when focus is lost,
commitEdit should be invoked. If in committing the
new value a ParseException or
PropertyVetoException is thrown, the invalid
value will remain.
See Also: ItsNatFormattedTextField.setFocusLostBehavior(int) |
COMMIT_OR_REVERT | final public static int COMMIT_OR_REVERT(Code) | | Constant identifying that when focus is lost,
commitEdit should be invoked. If in commiting the new
value a ParseException or
PropertyVetoException is thrown, the value will be
reverted.
See Also: ItsNatFormattedTextField.setFocusLostBehavior(int) |
createDefaultItsNatFormatterFactory | public ItsNatFormatterFactory createDefaultItsNatFormatterFactory()(Code) | | Creates a new default ItsNat formatter factory.
Current implementation is an
ItsNatFormatterFactoryDefault .
a default formatter factory instance. |
createItsNatFormatter | public ItsNatFormatter createItsNatFormatter(Format format)(Code) | | Creates an ItsNat formatter wrapping the specified java.text.Format .
Current implementation uses Format.parseObject(String) and
Format.format(Object) to convert string and values.
Parameters: format - the java.text.Format to wrap. a new ItsNat formatter wrapping the specified format. |
isEditValid | public boolean isEditValid()(Code) | | Returns true if the current value being edited is valid.
true if the current value being edited is valid. |
isEdited | public boolean isEdited()(Code) | | Informs whether visual control content has changed and component value is
still not modified.
if visual value has changed and component value not. |
setItsNatFormatter | public void setItsNatFormatter(ItsNatFormatter formatter)(Code) | | Sets the default ItsNat formatter.
Parameters: formatter - the default formatter. May be null (the factory will be used). |
setItsNatFormatterFactory | public void setItsNatFormatterFactory(ItsNatFormatterFactory tf)(Code) | | Sets the current ItsNat formatter factory.
Parameters: tf - the new formatter factory. May be null. |
|
|
|