Java Doc for ItsNatFormattedTextField.java in  » Ajax » ItsNat » org » itsnat » comp » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Ajax » ItsNat » org.itsnat.comp 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


org.itsnat.comp.ItsNatFormattedTextField

All known Subclasses:   org.itsnat.impl.comp.ItsNatFormatterDefaultImpl,
ItsNatFormattedTextField
public interface ItsNatFormattedTextField extends ItsNatTextField(Code)
Is the base interface of text based components which text is rendered/edited as a single line and following a format.

This component type is inspired in javax.swing.JFormattedTextField. Some documentation is borrowed from Swing.

This component maintains two values, the value returned by ItsNatFormattedTextField.getText() is the value in the visual control rendering the component, and the value returned by ItsNatFormattedTextField.getValue() . The last one is restricted to the scope defined by ItsNatFormattedTextField.getItsNatFormatter() .

When a new value on the visual control is set as the component value calling ItsNatFormattedTextField.commitEdit() first is validated/converted calling ItsNatFormatter.stringToValue(StringItsNatFormattedTextField) .

Any change to the internal value is notified with a "value" property change event and may be vetoed (see ItsNatFormattedTextField.setValue(Object) ).


author:
   Jose Maria Arranz Santamaria

Inner Class :public interface ItsNatFormatter
Inner Class :public interface ItsNatFormatterFactory

Field Summary
final public static  intCOMMIT
     Constant identifying that when focus is lost, commitEdit should be invoked.
final public static  intCOMMIT_OR_REVERT
     Constant identifying that when focus is lost, commitEdit should be invoked.
final public static  intPERSIST
     Constant identifying that when focus is lost, the edited value should be left.
final public static  intREVERT
     Constant identifying that when focus is lost, editing value should be reverted to current value set on the component.


Method Summary
public  voidcommitEdit()
     Forces the current value to be taken from the control and set as the current value converted first using the current ItsNatFormatter .
public  ItsNatFormatterFactorycreateDefaultItsNatFormatterFactory()
     Creates a new default ItsNat formatter factory.
public  ItsNatFormattercreateItsNatFormatter(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  intgetFocusLostBehavior()
     Returns the behavior when focus is lost.
public  ItsNatFormattergetItsNatFormatter()
     This method is called when the component needs to convert an Object value from/to String.
public  ItsNatFormatterFactorygetItsNatFormatterFactory()
     Returns the current ItsNat formatter factory.
public  ObjectgetValue()
     Returns the last valid value.
public  booleanisEditValid()
     Returns true if the current value being edited is valid.
public  booleanisEdited()
     Informs whether visual control content has changed and component value is still not modified.
public  voidsetFocusLostBehavior(int behavior)
     Sets the behavior when focus is lost.
public  voidsetFormat(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  voidsetItsNatFormatter(ItsNatFormatter formatter)
     Sets the default ItsNat formatter.
public  voidsetItsNatFormatterFactory(ItsNatFormatterFactory tf)
     Sets the current ItsNat formatter factory.
Parameters:
  tf - the new formatter factory.
public  voidsetValue(Object value)
     Sets the value that will be formatted to the control by an ItsNatFormatter obtained from the current ItsNatFormatterFactory .

Field Detail
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)



PERSIST
final public static int PERSIST(Code)
Constant identifying that when focus is lost, the edited value should be left.
See Also:   ItsNatFormattedTextField.setFocusLostBehavior(int)



REVERT
final public static int REVERT(Code)
Constant identifying that when focus is lost, editing value should be reverted to current value set on the component.
See Also:   ItsNatFormattedTextField.setFocusLostBehavior(int)





Method Detail
commitEdit
public void commitEdit() throws ParseException, PropertyVetoException(Code)
Forces the current value to be taken from the control and set as the current value converted first using the current ItsNatFormatter .
throws:
  ParseException - if the ItsNatFormatter is not ableto format the current control value
throws:
  PropertyVetoException - if the new value was vetoed.



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.



getFocusLostBehavior
public int getFocusLostBehavior()(Code)
Returns the behavior when focus is lost. This will be one of ItsNatFormattedTextField.COMMIT_OR_REVERT , ItsNatFormattedTextField.COMMIT , ItsNatFormattedTextField.REVERT or ItsNatFormattedTextField.PERSIST Note that some ItsNatFormatter s may push changes to the control value. returns behavior when focus is lost. ItsNatFormattedTextField.COMMIT_OR_REVERT by default
See Also:   ItsNatFormattedTextField.setFocusLostBehavior(int)



getItsNatFormatter
public ItsNatFormatter getItsNatFormatter()(Code)
This method is called when the component needs to convert an Object value from/to String.

If a formatter was defined explicitly with a call to ItsNatFormattedTextField.setItsNatFormatter(ItsNatFormatter) this method returns this formatter, else returns the formatter of the default formatter factory ( ItsNatFormattedTextField.getItsNatFormatterFactory() calling ItsNatFormatterFactory.getItsNatFormatter(ItsNatFormattedTextField) , if no factory is defined or the factory has not an appropriated formatter, then the component tries to build an appropriated formatter to the current value ( ItsNatFormattedTextField.getValue() ).

the selected formatter.



getItsNatFormatterFactory
public ItsNatFormatterFactory getItsNatFormatterFactory()(Code)
Returns the current ItsNat formatter factory.

By default ItsNat provides a default factory created with ItsNatFormattedTextField.createDefaultItsNatFormatterFactory() .

the current factory. May be null.
See Also:   ItsNatFormattedTextField.setItsNatFormatterFactory(ItsNatFormatterFactory)
See Also:   



getValue
public Object getValue()(Code)
Returns the last valid value. Based on the editing policy of the ItsNatFormatter this may not return the current edited value. The currently edited value can be obtained by invoking ItsNatFormattedTextField.commitEdit() followed by ItsNatFormattedTextField.getValue() . last valid value. The default value is null.



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.



setFocusLostBehavior
public void setFocusLostBehavior(int behavior)(Code)
Sets the behavior when focus is lost. This will be one of ItsNatFormattedTextField.COMMIT_OR_REVERT , ItsNatFormattedTextField.COMMIT , ItsNatFormattedTextField.REVERT or ItsNatFormattedTextField.PERSIST
Parameters:
  behavior - identifies behavior when focus is lost
See Also:   ItsNatFormattedTextField.getFocusLostBehavior()



setFormat
public void setFormat(Format format)(Code)
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. The new ItsNat formatter is set calling ItsNatFormattedTextField.setItsNatFormatter(ItsNatFormatter) .


Parameters:
  format - the java.text.Format object to set as the default formatter.



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.



setValue
public void setValue(Object value) throws PropertyVetoException(Code)
Sets the value that will be formatted to the control by an ItsNatFormatter obtained from the current ItsNatFormatterFactory . If no ItsNatFormatterFactory has been specified, this will attempt to create one based on the type of value.

This new value is "voted" before is set firing a java.beans.PropertyChangeEvent event, with name "value", sent to the listeners registered with ItsNatComponent.addVetoableChangeListener(VetoableChangeListener) if some listener does a "veto" (throws a java.beans.PropertyVetoException) the new value is not set. If finally set the PropertyChangeEvent event is sent to the listeners registered with ItsNatComponent.addPropertyChangeListener(java.beans.PropertyChangeListener) or ItsNatComponent.addPropertyChangeListener(Stringjava.beans.PropertyChangeListener) with property name "value".


Parameters:
  value - value to display (and may be edit).
throws:
  PropertyVetoException - if the new value was vetoed.



www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.