|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.cocoon.woody.formmodel.AbstractWidget
public abstract class AbstractWidget
Abstract base class for Widget implementations. Provides functionality common to many widgets.
| Field Summary | |
|---|---|
protected AbstractWidgetDefinition |
definition
|
| Constructor Summary | |
|---|---|
AbstractWidget()
|
|
| Method Summary | |
|---|---|
void |
addValidator(WidgetValidator validator)
Add a validator to this widget instance. |
void |
broadcastEvent(WidgetEvent event)
Broadcast an event previously queued by this widget to its event listeners. |
void |
generateItemSaxFragment(ContentHandler contentHandler,
Locale locale)
|
void |
generateLabel(ContentHandler contentHandler)
Generates SAX events for the label of this widget. |
void |
generateSaxFragment(ContentHandler contentHandler,
Locale locale,
String element,
WidgetDefinition definition)
|
Form |
getForm()
Get the Form to which this widget belongs. |
String |
getFullyQualifiedId()
Returns the id prefixed with the namespace, this name should be unique accross all widgets on the form. |
String |
getId()
Gets the id of this widget. |
String |
getLocation()
Gets the source location of this widget. |
String |
getNamespace()
Gets the namespace of this widget. |
Widget |
getParent()
Gets the parent of this widget. |
Object |
getValue()
Returns the value of the widget. |
Widget |
getWidget(String id)
Gets the child widget of this widget with the given id, or null if there isn't such a child. |
boolean |
isRequired()
Returns wether this widget is required to be filled in. |
boolean |
removeValidator(WidgetValidator validator)
Remove a validator from this widget instance |
protected void |
setDefinition(AbstractWidgetDefinition definition)
Sets the definition of this widget. |
protected void |
setLocation(String location)
Sets the source location of this widget. |
void |
setParent(Widget widget)
This method is called on a widget when it is added to a container. |
void |
setValue(Object object)
Sets the value of this widget to the given object. |
boolean |
validate(FormContext context)
Validates this widget and returns the outcome. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.apache.cocoon.woody.formmodel.Widget |
|---|
generateSaxFragment, readFromRequest |
| Field Detail |
|---|
protected AbstractWidgetDefinition definition
| Constructor Detail |
|---|
public AbstractWidget()
| Method Detail |
|---|
protected void setDefinition(AbstractWidgetDefinition definition)
public String getId()
getId in interface Widgetprotected void setLocation(String location)
public String getLocation()
getLocation in interface Widgetpublic Widget getParent()
Widget
getParent in interface Widgetpublic void setParent(Widget widget)
Widget
setParent in interface Widgetpublic Form getForm()
WidgetForm to which this widget belongs. The form is the top-most ancestor
of the widget.
getForm in interface Widgetpublic String getNamespace()
WidgetWidget.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.
getNamespace in interface Widgetpublic String getFullyQualifiedId()
Widget
getFullyQualifiedId in interface Widgetpublic Object getValue()
Widget
getValue in interface Widgetpublic void setValue(Object object)
Widget
setValue in interface Widgetpublic boolean isRequired()
WidgetWidget.getValue(), for some
widgets this may not make sense, those should return false here.
isRequired in interface Widgetpublic Widget getWidget(String id)
Widget
getWidget in interface Widgetpublic void broadcastEvent(WidgetEvent event)
Widget
broadcastEvent in interface Widgetpublic void addValidator(WidgetValidator validator)
validator - public boolean removeValidator(WidgetValidator validator)
validator -
true if the validator was found.public boolean validate(FormContext context)
WidgetWidget.generateSaxFragment(ContentHandler, Locale) method.
validate in interface Widget
public void generateLabel(ContentHandler contentHandler)
throws SAXException
Widget
generateLabel in interface WidgetSAXException
public void generateItemSaxFragment(ContentHandler contentHandler,
Locale locale)
throws SAXException
SAXException
public void generateSaxFragment(ContentHandler contentHandler,
Locale locale,
String element,
WidgetDefinition definition)
throws SAXException
SAXException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||