|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.cocoon.forms.formmodel.AbstractWidgetDefinition
public abstract class AbstractWidgetDefinition
Provides functionality that is common across many WidgetDefinition implementations.
Field Summary | |
---|---|
protected CreateListener |
createListener
|
protected Library |
enclosingLibrary
|
protected WidgetDefinition |
parent
|
Constructor Summary | |
---|---|
AbstractWidgetDefinition()
|
Method Summary | |
---|---|
void |
addCreateListener(CreateListener listener)
|
void |
addValidator(WidgetValidator validator)
|
void |
checkCompleteness()
Checks if this definition is complete or not. |
protected void |
checkMutable()
Check that this definition is mutable, i.e. is in setup phase. |
void |
fireCreateEvent(CreateEvent event)
|
void |
generateDisplayData(ContentHandler contentHandler)
Generates SAX events for display data. |
void |
generateDisplayData(String name,
ContentHandler contentHandler)
Generates SAX events for named display data. |
void |
generateLabel(ContentHandler contentHandler)
Generates SAX events for the label of this widget. |
Object |
getAttribute(String name)
Gets an attribute that has been defined on the widget's definition. |
Library |
getEnclosingLibrary()
Gets the Library object containing this definition |
FormDefinition |
getFormDefinition()
Gets the FormDefinition . |
String |
getId()
Gets id of this widget definition. |
Location |
getLocation()
Gets source location of this widget definition. |
WidgetDefinition |
getParent()
Gets the parent of this definition. |
WidgetState |
getState()
|
void |
initializeFrom(WidgetDefinition definition)
initialize this definition with the other, sort of like a copy constructor |
void |
makeImmutable()
Locks this definition so that it becomes immutable. |
void |
setAttributes(Map attributes)
|
void |
setDisplayData(Map displayData)
Sets the various display data for this widget. |
void |
setEnclosingLibrary(Library library)
Sets the Library object containing this definition (should only be used by Library itself!) |
void |
setId(String id)
|
void |
setLocation(Location location)
|
void |
setParent(WidgetDefinition definition)
Sets the parent of this definition |
void |
setState(WidgetState state)
|
boolean |
validate(Widget widget)
Validate a widget using the validators that were defined in its definition. |
void |
widgetCreated(Widget widget)
|
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.forms.formmodel.WidgetDefinition |
---|
createInstance |
Field Detail |
---|
protected WidgetDefinition parent
protected Library enclosingLibrary
protected CreateListener createListener
Constructor Detail |
---|
public AbstractWidgetDefinition()
Method Detail |
---|
public FormDefinition getFormDefinition()
WidgetDefinition
FormDefinition
.
getFormDefinition
in interface WidgetDefinition
public Library getEnclosingLibrary()
WidgetDefinition
getEnclosingLibrary
in interface WidgetDefinition
public void setEnclosingLibrary(Library library)
WidgetDefinition
setEnclosingLibrary
in interface WidgetDefinition
public void initializeFrom(WidgetDefinition definition) throws Exception
initializeFrom
in interface WidgetDefinition
Exception
public void checkCompleteness() throws IncompletenessException
checkCompleteness
in interface WidgetDefinition
IncompletenessException
public void makeImmutable()
protected void checkMutable()
public void setParent(WidgetDefinition definition)
setParent
in interface WidgetDefinition
public WidgetDefinition getParent()
public WidgetState getState()
public void setState(WidgetState state)
public void setLocation(Location location)
public Location getLocation()
WidgetDefinition
getLocation
in interface WidgetDefinition
getLocation
in interface Locatable
public String getId()
WidgetDefinition
getId
in interface WidgetDefinition
public void setId(String id)
public void setAttributes(Map attributes)
public Object getAttribute(String name)
WidgetDefinition
getAttribute
in interface WidgetDefinition
name
- the attribute name
public void addCreateListener(CreateListener listener)
public void widgetCreated(Widget widget)
public void fireCreateEvent(CreateEvent event)
public void generateLabel(ContentHandler contentHandler) throws SAXException
WidgetDefinition
generateLabel
in interface WidgetDefinition
SAXException
public void setDisplayData(Map displayData)
displayData
- an association of {name, sax fragment}public void addValidator(WidgetValidator validator)
public void generateDisplayData(String name, ContentHandler contentHandler) throws SAXException
WidgetDefinition
generateDisplayData
in interface WidgetDefinition
SAXException
public void generateDisplayData(ContentHandler contentHandler) throws SAXException
WidgetDefinition
generateDisplayData
in interface WidgetDefinition
SAXException
public boolean validate(Widget widget)
WidgetDefinition
validate
in interface WidgetDefinition
widget
- the widget
true
if validation was successful.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |