Java Doc for Widget.java in  » Content-Management-System » apache-lenya-2.0 » org » apache » cocoon » forms » formmodel » 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 » Content Management System » apache lenya 2.0 » org.apache.cocoon.forms.formmodel 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


org.apache.cocoon.forms.formmodel.Widget

All known Subclasses:   org.apache.cocoon.forms.formmodel.AbstractWidget,
Widget
public interface Widget extends Locatable(Code)
Interface to be implemented by Widgets. In CForms, a form consists of a number of widgets. Each widget:

When a request is submitted, first the Widget.readFromRequest(FormContext) method of all widgets will be called so that they can read their value(s). Next, the Widget.validate() method will be called. Doing this in two steps allows the validation to compare values between widgets. See also the method Form.process(FormContext) .

A Widget is created by calling the createInstance method on the a WidgetDefinition . A Widget holds all the data that is specific for a certain use of the widget (its value, validationerrors, ...), while the WidgetDefinition holds the data that is static accross all widgets. This keeps the Widgets small and light to create. This mechanism is similar to classes and objects in Java.
version:
   $Id: Widget.java 449149 2006-09-23 03:58:05Z crossley $



Field Summary
 charPATH_SEPARATOR
    


Method Summary
 voidaddValidator(WidgetValidator validator)
    
 voidbroadcastEvent(WidgetEvent event)
     Broadcast an event previously queued by this widget to its event listeners.
 voidgenerateLabel(ContentHandler contentHandler)
     Generates SAX events for the label of this widget.
 voidgenerateSaxFragment(ContentHandler contentHandler, Locale locale)
     Generates an XML representation of this widget.
 ObjectgetAttribute(String name)
     Retrieves an attribute on this widget.
 WidgetStategetCombinedState()
     Get the widget's combined state, which is the strictest of its own state and parent state.
 WidgetDefinitiongetDefinition()
     Get this widget's definition.
 FormgetForm()
     the Form to which this widget belongs.
 StringgetFullName()
    
 StringgetId()
     the id of this widget.
 LocationgetLocation()
    
 StringgetName()
     the name of this widget.
 WidgetgetParent()
     the parent of this widget.
 StringgetRequestParameterName()
    
 WidgetStategetState()
     Get the widget's own state.
 ObjectgetValue()
     Get the value of a widget.
 WidgetgetWidget(String id)
    
 voidinitialize()
     Called after widget's environment has been setup, to allow for any contextual initalization such as looking up case widgets for union widgets.
 booleanisRequired()
     whether this widget is required to be filled in.
 booleanisValid()
     Return the current validation state. This method delivers the same result as the last call to Widget.validate() . The validation process is not started again.
 WidgetlookupWidget(String path)
     Finds a widget relative to this one based on a path-like string (/-delimted) into the widget-tree structure.
 voidreadFromRequest(FormContext formContext)
     Lets this widget read its data from a request.
 voidremoveAttribute(String name)
     Removes the named attribute from this widget.
 booleanremoveValidator(WidgetValidator validator)
    
 voidsetAttribute(String name, Object value)
     Sets an attribute on this widget.
 voidsetParent(Widget widget)
     This method is called on a widget when it is added to a container.
 voidsetState(WidgetState state)
     Set the widget's own state.
 voidsetValue(Object value)
     Sets the value of this widget.
 booleanvalidate()
     Validates this widget and returns the outcome.

Field Detail
PATH_SEPARATOR
char PATH_SEPARATOR(Code)
Widget-Separator used in path-like notations
See Also:   Widget.lookupWidget(String)





Method Detail
addValidator
void addValidator(WidgetValidator validator)(Code)



broadcastEvent
void broadcastEvent(WidgetEvent event)(Code)
Broadcast an event previously queued by this widget to its event listeners.



generateLabel
void generateLabel(ContentHandler contentHandler) throws SAXException(Code)
Generates SAX events for the label of this widget. The label will not be wrapped inside another element.



generateSaxFragment
void generateSaxFragment(ContentHandler contentHandler, Locale locale) throws SAXException(Code)
Generates an XML representation of this widget. The startDocument and endDocument SAX events will not be called. It is assumed that the prefix for the CForms namespace mentioned in Constants.FI_PREFIX is already declared (by the caller or otherwise).



getAttribute
Object getAttribute(String name)(Code)
Retrieves an attribute on this widget.
Parameters:
  name - of the attribute to lookup the found attribute or null if none was found with that name.



getCombinedState
WidgetState getCombinedState()(Code)
Get the widget's combined state, which is the strictest of its own state and parent state. This combined state is the one that will be used by the widget to know if request parameters should be considered and if some output must be produced.
See Also:   WidgetState.strictest(WidgetStateWidgetState) the combined state



getDefinition
WidgetDefinition getDefinition()(Code)
Get this widget's definition. the widget's definition



getForm
Form getForm()(Code)
the Form to which this widget belongs. The form is the top-most ancestorof the widget.



getFullName
String getFullName()(Code)
the name prefixed with the namespace, this name should be uniqueaccross all widgets on the form.



getId
String getId()(Code)
the id of this widget. This should never be nullTop-level container widgets (like 'form') should return ""



getLocation
Location getLocation()(Code)
the source location of this widget.



getName
String getName()(Code)
the name of this widget. This should never be nullTop-level container widgets (like 'form') should return ""



getParent
Widget getParent()(Code)
the parent of this widget. If this widget is the root widget,this method returns null.



getRequestParameterName
String getRequestParameterName()(Code)
the id prefixed with the namespace, this name should be uniqueaccross all widgets on the form.



getState
WidgetState getState()(Code)
Get the widget's own state. Note that this state is not the one actually considered for handling requests and producing output. For these matters, the combined state is used.
See Also:   Widget.getCombinedState() the widget's own state



getValue
Object getValue() throws UnsupportedOperationException(Code)
Get the value of a widget.

Not all widgets do have a value (notably ContainerWidget s, but this method is provided here as a convenience to ease writing and avoiding casts. the value of the widget.
throws:
  UnsupportedOperationException - if this widget doesn't have a value.




getWidget
Widget getWidget(String id)(Code)

throws:
  UnsupportedOperationException - indicating this method has beendeprecated from the API, and will be removed from future releases.



initialize
void initialize()(Code)
Called after widget's environment has been setup, to allow for any contextual initalization such as looking up case widgets for union widgets.



isRequired
boolean isRequired()(Code)
whether this widget is required to be filled in. As with Widget.getValue(),for some widgets this may not make sense, those should return false here.



isValid
boolean isValid()(Code)
Return the current validation state. This method delivers the same result as the last call to Widget.validate() . The validation process is not started again. If the value of this widget has changed since the latest call to Widget.validate() , the result of this method is out of date. The result of the last call to Widget.validate().



lookupWidget
Widget lookupWidget(String path)(Code)
Finds a widget relative to this one based on a path-like string (/-delimted) into the widget-tree structure. This supports '../' and '/' to point to the found widget or null if allong the traversalof the path an invalid section was encountered.



readFromRequest
void readFromRequest(FormContext formContext)(Code)
Lets this widget read its data from a request. At this point the Widget may try to convert the request parameter to its native datatype (if it is not a string), but it should not yet generate any validation errors.



removeAttribute
void removeAttribute(String name)(Code)
Removes the named attribute from this widget.
Parameters:
  name - of the attribute



removeValidator
boolean removeValidator(WidgetValidator validator)(Code)



setAttribute
void setAttribute(String name, Object value)(Code)
Sets an attribute on this widget. This can be used to store custom data with each widget.



setParent
void setParent(Widget widget)(Code)
This method is called on a widget when it is added to a container. You shouldn't call this method unless youre implementing a widget yourself (in which case it should be called when a widget is added as child of your widget).



setState
void setState(WidgetState state)(Code)
Set the widget's own state. This may change its combined state, and those of its children, if any.
Parameters:
  state - the new wiget state



setValue
void setValue(Object value) throws UnsupportedOperationException(Code)
Sets the value of this widget.

Not all widgets do have a value (notably ContainerWidget s, but this method is provided here as a convenience to ease writing and avoiding casts.
Parameters:
  value - the new widget's value.
throws:
  UnsupportedOperationException - if this widget doesn't have a value.




validate
boolean validate()(Code)
Validates this widget and returns the outcome. Possible error messages are remembered by the widget itself and will be part of the XML produced by this widget in its Widget.generateSaxFragment(ContentHandler,Locale) method. true to indicate all validations were ok,false otherwise



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