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


org.apache.cocoon.woody.formmodel.Widget

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

Because widgets can have children, the widgets form a widget tree, with its root being the Form widget.

A widget can have only a value, or only child widgets, or can have both a value and child widgets, or can have neither. This all depends on the widget implementation.

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(FormContext) 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:
   CVS $Id: Widget.java 433543 2006-08-22 06:22:54Z crossley $





Method Summary
public  voidbroadcastEvent(WidgetEvent event)
     Broadcast an event previously queued by this widget to its event listeners.
public  voidgenerateLabel(ContentHandler contentHandler)
     Generates SAX events for the label of this widget.
public  voidgenerateSaxFragment(ContentHandler contentHandler, Locale locale)
     Generates an XML representation of this widget.
public  FormgetForm()
     Get the Form to which this widget belongs.
public  StringgetFullyQualifiedId()
     Returns the id prefixed with the namespace, this name should be unique accross all widgets on the form.
public  StringgetId()
     Returns the id of this widget.
public  StringgetLocation()
     Gets the source location of this widget.
public  StringgetNamespace()
     Gets the namespace of this widget.
public  WidgetgetParent()
     Gets the parent of this widget.
public  ObjectgetValue()
     Returns the value of the widget.
public  WidgetgetWidget(String id)
     Gets the child widget of this widget with the given id, or null if there isn't such a child.
public  booleanisRequired()
     Returns wether this widget is required to be filled in.
public  voidreadFromRequest(FormContext formContext)
     Lets this widget read its data from a request.
public  voidsetParent(Widget widget)
     This method is called on a widget when it is added to a container.
public  voidsetValue(Object object)
     Sets the value of this widget to the given object.
public  booleanvalidate(FormContext formContext)
     Validates this widget and returns the outcome.



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



generateLabel
public 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
public 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 Woody namespace mentioned in Constants.WI_PREFIX is already declared (by the caller or otherwise).



getForm
public Form getForm()(Code)
Get the Form to which this widget belongs. The form is the top-most ancestor of the widget.



getFullyQualifiedId
public String getFullyQualifiedId()(Code)
Returns the id prefixed with the namespace, this name should be unique accross all widgets on the form.



getId
public String getId()(Code)
Returns the id of this widget.



getLocation
public String getLocation()(Code)
Gets the source location of this widget.



getNamespace
public String getNamespace()(Code)
Gets the namespace of this widget. The combination of a widget's namespace with its id (see Widget.getId() gives the widget a form-wide unique name. In practice, the namespace consists of the id's of the widget's parent widgets, separated by dots.



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



getValue
public Object getValue()(Code)
Returns the value of the widget. For some widgets (notably ContainerWidgets) this may not make sense, those should then simply return null here.



getWidget
public Widget getWidget(String id)(Code)
Gets the child widget of this widget with the given id, or null if there isn't such a child.



isRequired
public boolean isRequired()(Code)
Returns wether 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.



readFromRequest
public 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.



setParent
public 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).



setValue
public void setValue(Object object)(Code)
Sets the value of this widget to the given object. Some widgets may not support this method, those should throw an runtime exception if you try to set their value anyway.



validate
public boolean validate(FormContext formContext)(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.



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