Java Doc for AbstractField.java in  » Web-Framework » Millstone » org » millstone » base » ui » 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 » Web Framework » Millstone » org.millstone.base.ui 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.millstone.base.ui.AbstractComponent
      org.millstone.base.ui.AbstractField

All known Subclasses:   org.millstone.base.ui.TextField,  org.millstone.base.ui.Form,  org.millstone.base.ui.Select,  org.millstone.base.ui.DateField,  org.millstone.base.ui.Button,
AbstractField
abstract public class AbstractField extends AbstractComponent implements Field,Property.ReadOnlyStatusChangeNotifier(Code)

Abstract field component for implementing buffered property editors. The field may hold an internal value, or it may be connected to any data source that implements the org.millstone.base.data.Property interface. AbstractField implements that interface itself, too, so accessing the Property value represented by it is straightforward.

AbstractField also provides the org.millstone.base.data.Buffered interface for buffering the data source value. By default the Field is in write through-mode and AbstractField.setWriteThrough(boolean) should be called to enable buffering.

The class also supports org.millstone.base.data.Validator validators to make sure the value contained in the field is valid.


author:
   IT Mill Ltd.
version:
   3.1.1
since:
   3.0

Inner Class :public class ReadOnlyStatusChangeEvent extends Component.Event implements Property.ReadOnlyStatusChangeEvent


Constructor Summary
public  AbstractField()
    

Method Summary
public  voidaddListener(Property.ValueChangeListener listener)
    
public  voidaddListener(Property.ReadOnlyStatusChangeListener listener)
    
public  voidaddValidator(Validator validator)
     Adds a new validator for the field's value.
public  voidattach()
    
public  voidcommit()
    
public static  AbstractFieldconstructField(Class propertyType)
     Create abstract field by the type of the property.
public  voiddiscard()
    
public  voidfinalize()
     Free used resources.
protected  voidfireReadOnlyStatusChange()
     Emit a read-only status change event.
protected  voidfireValueChange()
     Emit a value change event.
public  voidfocus()
     Ask the terminal to place the cursor to this field.
public  ErrorMessagegetErrorMessage()
     Error messages shown by the fields are composites of the error message thrown by the superclasses (that is the component error message), validation errors and buffered source errors.
public  longgetFocusableId()
    
public  PropertygetPropertyDataSource()
     Gets the current data source of the field, if any.
public  intgetTabIndex()
     Get the tab index of this field.
abstract public  ClassgetType()
    
public  CollectiongetValidators()
     Gets the validators of the field.
public  ObjectgetValue()
     Gets the current value of the field.
public  booleanisInvalidAllowed()
     Fields allow invalid values by default.
public  booleanisInvalidCommitted()
    
public  booleanisModified()
    
public  booleanisReadOnly()
     The abstract field is read only also if the data source is in readonly mode.
public  booleanisReadThrough()
    
public  booleanisRequired()
     Is this field required.
public  booleanisValid()
     Tests the current value against all registered validators.
public  booleanisWriteThrough()
    
public  voidpaintContent(PaintTarget target)
    
public  voidremoveListener(Property.ValueChangeListener listener)
    
public  voidremoveListener(Property.ReadOnlyStatusChangeListener listener)
    
public  voidremoveValidator(Validator validator)
     Removes a validator from the field.
protected  voidsetInternalValue(Object newValue)
     Set the internal field value.
public  voidsetInvalidAllowed(boolean invalidAllowed)
     Fields allow invalid values by default.
public  voidsetInvalidCommitted(boolean isCommitted)
    
public  voidsetPropertyDataSource(Property newDataSource)
    

Sets the specified Property as the data source for the field.

public  voidsetReadOnly(boolean readOnly)
     Change the readonly state and throw read-only status change events.
public  voidsetReadThrough(boolean readTrough)
    
public  voidsetRequired(boolean required)
     Set the field required.
public  voidsetTabIndex(int tabIndex)
     Get the tab index of this field.
public  voidsetValue(Object newValue)
     Set the value of the field.
public  voidsetWriteThrough(boolean writeTrough)
    
public  StringtoString()
     Returns the value of the Property in human readable textual format.
public  voidvalidate()
    
public  voidvalueChange(Property.ValueChangeEvent event)
     This method listens to data source value changes and passes the changes forwards.


Constructor Detail
AbstractField
public AbstractField()(Code)




Method Detail
addListener
public void addListener(Property.ValueChangeListener listener)(Code)



addListener
public void addListener(Property.ReadOnlyStatusChangeListener listener)(Code)



addValidator
public void addValidator(Validator validator)(Code)
Adds a new validator for the field's value. All validators added to a field are checked each time the its value changes.
Parameters:
  validator - the new validator to be added



attach
public void attach()(Code)

See Also:   org.millstone.base.ui.Component.attach



commit
public void commit() throws Buffered.SourceException(Code)



constructField
public static AbstractField constructField(Class propertyType)(Code)
Create abstract field by the type of the property.

This returns most suitable field type for editing property of given type


Parameters:
  propertyType - Type of the property, that needs to be edited.



discard
public void discard() throws Buffered.SourceException(Code)



finalize
public void finalize() throws Throwable(Code)
Free used resources.



fireReadOnlyStatusChange
protected void fireReadOnlyStatusChange()(Code)
Emit a read-only status change event. The value contained in the field is validated before the event is created.



fireValueChange
protected void fireValueChange()(Code)
Emit a value change event. The value contained in the field is validated before the event is created.



focus
public void focus()(Code)
Ask the terminal to place the cursor to this field.



getErrorMessage
public ErrorMessage getErrorMessage()(Code)
Error messages shown by the fields are composites of the error message thrown by the superclasses (that is the component error message), validation errors and buffered source errors.
See Also:   org.millstone.base.ui.AbstractComponent.getErrorMessage



getFocusableId
public long getFocusableId()(Code)

See Also:   org.millstone.base.ui.Component.Focusable.getFocusableId



getPropertyDataSource
public Property getPropertyDataSource()(Code)
Gets the current data source of the field, if any. The current data source as a Property, or null ifnone defined.



getTabIndex
public int getTabIndex()(Code)
Get the tab index of this field. The tab index property is used to specify the natural tab ordering of fields. Tab index of this field. Negative value means unspecified.



getType
abstract public Class getType()(Code)



getValidators
public Collection getValidators()(Code)
Gets the validators of the field. Unmodifiable collection that holds all validators for the field.



getValue
public Object getValue()(Code)
Gets the current value of the field. This is the visible, modified and possible invalid value the user have entered to the field. In the read-through mode, the abstract buffer is also updated and validation is performed. the current value of the field



isInvalidAllowed
public boolean isInvalidAllowed()(Code)
Fields allow invalid values by default. In most cases this is wanted, because the field otherwise visually forget the user input immediately.
See Also:   org.millstone.base.data.Validatable.isInvalidAllowed true iff the invalid values are allowed.



isInvalidCommitted
public boolean isInvalidCommitted()(Code)



isModified
public boolean isModified()(Code)



isReadOnly
public boolean isReadOnly()(Code)
The abstract field is read only also if the data source is in readonly mode.



isReadThrough
public boolean isReadThrough()(Code)



isRequired
public boolean isRequired()(Code)
Is this field required. Required fields must filled by the user. true if the



isValid
public boolean isValid()(Code)
Tests the current value against all registered validators. true if all registered validators claim that thecurrent value is valid, false otherwise



isWriteThrough
public boolean isWriteThrough()(Code)



paintContent
public void paintContent(PaintTarget target) throws PaintException(Code)



removeListener
public void removeListener(Property.ValueChangeListener listener)(Code)



removeListener
public void removeListener(Property.ReadOnlyStatusChangeListener listener)(Code)



removeValidator
public void removeValidator(Validator validator)(Code)
Removes a validator from the field.
Parameters:
  validator - the validator to remove



setInternalValue
protected void setInternalValue(Object newValue)(Code)
Set the internal field value. This is purely used by AbstractField to change the internal Field value. It does not trigger any events. It can be overriden by the inheriting classes to update all dependent variables.
Parameters:
  newValue - The new value to be set.



setInvalidAllowed
public void setInvalidAllowed(boolean invalidAllowed) throws UnsupportedOperationException(Code)
Fields allow invalid values by default. In most cases this is wanted, because the field otherwise visually forget the user input immediately. In common setting where the user wants to assure the correctness of the datasource, but allow temporarily invalid contents in the field, the user should add the validators to datasource, that should not allow invalid values. The validators are automatically copied to the field when the datasource is set.
See Also:   org.millstone.base.data.Validatable.setInvalidAllowed(boolean)



setInvalidCommitted
public void setInvalidCommitted(boolean isCommitted)(Code)



setPropertyDataSource
public void setPropertyDataSource(Property newDataSource)(Code)

Sets the specified Property as the data source for the field. All uncommitted changes to the field are discarded and the value is refreshed from the new data source.

If the datasource has any validators, the same validators are added to the field. Because the default behavior of the field is to allow invalid values, but not to allow committing them, this only adds visual error messages to fields and do not allow committing them as long as the value is invalid. After the value is valid, the error message is not shown and the commit can be done normally.


Parameters:
  newDataSource - the new data source Property



setReadOnly
public void setReadOnly(boolean readOnly)(Code)
Change the readonly state and throw read-only status change events.
See Also:   org.millstone.base.ui.Component.setReadOnly(boolean)



setReadThrough
public void setReadThrough(boolean readTrough) throws Buffered.SourceException(Code)



setRequired
public void setRequired(boolean required)(Code)
Set the field required. Required fields must filled by the user.
Parameters:
  required - Is the field required



setTabIndex
public void setTabIndex(int tabIndex)(Code)
Get the tab index of this field. The tab index property is used to specify the natural tab ordering of fields.
Parameters:
  tabIndex - The tab order of this component. Negative value meansunspecified.



setValue
public void setValue(Object newValue) throws Property.ReadOnlyException, Property.ConversionException(Code)
Set the value of the field.
Parameters:
  newValue - New value of the field.



setWriteThrough
public void setWriteThrough(boolean writeTrough) throws Buffered.SourceException(Code)



toString
public String toString()(Code)
Returns the value of the Property in human readable textual format. String representation of the value stored in theProperty



validate
public void validate() throws Validator.InvalidValueException(Code)



valueChange
public void valueChange(Property.ValueChangeEvent event)(Code)
This method listens to data source value changes and passes the changes forwards.
Parameters:
  event - the value change event telling the data source contents havechanged



Methods inherited from org.millstone.base.ui.AbstractComponent
public void addListener(RepaintRequestListener listener)(Code)(Java Doc)
public void addListener(Class eventType, Object object, Method method)(Code)(Java Doc)
public void addListener(Class eventType, Object object, String methodName)(Code)(Java Doc)
public void addListener(Component.Listener listener)(Code)(Java Doc)
public void attach()(Code)(Java Doc)
public void changeVariables(Object source, Map variables)(Code)(Java Doc)
public void childRequestedRepaint(Collection alreadyNotified)(Code)(Java Doc)
public void dependsOn(VariableOwner depended)(Code)(Java Doc)
public void detach()(Code)(Java Doc)
protected void fireComponentErrorEvent()(Code)(Java Doc)
protected void fireComponentEvent()(Code)(Java Doc)
protected void fireEvent(Component.Event event)(Code)(Java Doc)
public Application getApplication()(Code)(Java Doc)
public String getCaption()(Code)(Java Doc)
public ErrorMessage getComponentError()(Code)(Java Doc)
public Object getData()(Code)(Java Doc)
public String getDescription()(Code)(Java Doc)
public Set getDirectDependencies()(Code)(Java Doc)
public ErrorMessage getErrorMessage()(Code)(Java Doc)
public Resource getIcon()(Code)(Java Doc)
public Locale getLocale()(Code)(Java Doc)
public Component getParent()(Code)(Java Doc)
public String getStyle()(Code)(Java Doc)
abstract public String getTag()(Code)(Java Doc)
public Window getWindow()(Code)(Java Doc)
public boolean isEnabled()(Code)(Java Doc)
public boolean isImmediate()(Code)(Java Doc)
public boolean isReadOnly()(Code)(Java Doc)
public boolean isVisible()(Code)(Java Doc)
final public void paint(PaintTarget target) throws PaintException(Code)(Java Doc)
public void paintContent(PaintTarget target) throws PaintException(Code)(Java Doc)
public void removeDirectDependency(VariableOwner depended)(Code)(Java Doc)
public void removeListener(RepaintRequestListener listener)(Code)(Java Doc)
public void removeListener(Class eventType, Object target)(Code)(Java Doc)
public void removeListener(Class eventType, Object target, Method method)(Code)(Java Doc)
public void removeListener(Class eventType, Object target, String methodName)(Code)(Java Doc)
public void removeListener(Component.Listener listener)(Code)(Java Doc)
public void requestRepaint()(Code)(Java Doc)
public void requestRepaintRequests()(Code)(Java Doc)
public void setCaption(String caption)(Code)(Java Doc)
public void setComponentError(ErrorMessage componentError)(Code)(Java Doc)
public void setData(Object data)(Code)(Java Doc)
public void setDescription(String description)(Code)(Java Doc)
public void setEnabled(boolean enabled)(Code)(Java Doc)
public void setIcon(Resource icon)(Code)(Java Doc)
public void setImmediate(boolean immediate)(Code)(Java Doc)
public void setLocale(Locale locale)(Code)(Java Doc)
public void setParent(Component parent)(Code)(Java Doc)
public void setReadOnly(boolean readOnly)(Code)(Java Doc)
public void setStyle(String style)(Code)(Java Doc)
public void setVisible(boolean visible)(Code)(Java Doc)

Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

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