|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.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 Widget
protected void setLocation(String location)
public String getLocation()
getLocation
in interface Widget
public Widget getParent()
Widget
getParent
in interface Widget
public void setParent(Widget widget)
Widget
setParent
in interface Widget
public Form getForm()
Widget
Form
to which this widget belongs. The form is the top-most ancestor
of the widget.
getForm
in interface Widget
public String getNamespace()
Widget
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.
getNamespace
in interface Widget
public String getFullyQualifiedId()
Widget
getFullyQualifiedId
in interface Widget
public Object getValue()
Widget
getValue
in interface Widget
public void setValue(Object object)
Widget
setValue
in interface Widget
public boolean isRequired()
Widget
Widget.getValue()
, for some
widgets this may not make sense, those should return false here.
isRequired
in interface Widget
public Widget getWidget(String id)
Widget
getWidget
in interface Widget
public void broadcastEvent(WidgetEvent event)
Widget
broadcastEvent
in interface Widget
public void addValidator(WidgetValidator validator)
validator
- public boolean removeValidator(WidgetValidator validator)
validator
-
true
if the validator was found.public boolean validate(FormContext context)
Widget
Widget.generateSaxFragment(ContentHandler, Locale)
method.
validate
in interface Widget
public void generateLabel(ContentHandler contentHandler) throws SAXException
Widget
generateLabel
in interface Widget
SAXException
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 |