|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectcom.arsdigita.bebop.Completable
com.arsdigita.bebop.SimpleComponent
A simple implementation of the Component interface.
| Field Summary | |
protected Attributes |
m_attr
The Attribute object is protected to make it easier for the Form Builder service to persist the SimpleComponent. |
static String |
versionId
|
| Fields inherited from interface com.arsdigita.bebop.Component |
BEBOP_XML_NS, CLASS, ID, ON_CLICK, STYLE |
| Constructor Summary | |
SimpleComponent()
|
|
| Method Summary | |
Iterator |
children()
Returns an iterator over the children of this component. |
Object |
clone()
Clones a component. |
protected void |
exportAttributes(Element target)
Adds the attributes set with setAttribute to the
element target. |
void |
generateXML(PageState state,
Element p)
Adds [J]DOM nodes for this component. |
protected String |
getAttribute(String name)
Gets the value of an attribute. |
String |
getClassAttr()
Gets the class attribute. |
String |
getIdAttr()
Gets the id attribute. |
String |
getKey()
Retrieves a key for parameter name mangling. |
String |
getMetaDataAttribute(String name)
|
String |
getStyleAttr()
Gets the style attribute. |
protected boolean |
hasAttributes()
Returns true if any attributes have been set. |
boolean |
isLocked()
Return whether an object is locked and thus immutable, or can still be modified. |
boolean |
isVisible(PageState s)
Determines whether the component is visible in the request represented by state. |
void |
lock()
Lock an object. |
void |
register(Form f,
FormModel m)
Registers form parameters with the form model for this form. |
void |
register(Page p)
Registers state parameters for the page with its model. |
void |
respond(PageState state)
Does processing that is special to the component receiving the click. |
protected void |
setAttribute(String name,
String value)
Sets an attribute. |
void |
setClassAttr(String theClass)
Sets the class attribute. |
void |
setIdAttr(String id)
Sets the id attribute. |
Component |
setKey(String key)
Supplies a key for parameter name mangling. |
void |
setMetaDataAttribute(String name,
String value)
|
void |
setStyleAttr(String style)
Sets the style attribute. |
void |
setVisible(PageState s,
boolean v)
Changes the visibility of the component. |
| Methods inherited from class com.arsdigita.bebop.Completable |
addCompletionListener, fireCompletionEvent |
| Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final String versionId
protected Attributes m_attr
| Constructor Detail |
public SimpleComponent()
| Method Detail |
public Object clone()
throws CloneNotSupportedException
CloneNotSupportedExceptionpublic void register(Page p)
Componentparam would do
the following in the body of this method:
p.addComponent(this); p.addComponentStateParam(this, param);You should override this method to set the default visibility of your component:
public void register(Page p) {
super.register(p);
p.setVisibleDefault(childNotInitiallyShown,false);
p.setVisibleDefault(anotherChild, false);
}
Always call super.register when you override
register. Otherwise your component may
malfunction and produce errors like "Widget ... isn't
associated with any Form"
register in interface Component
public void register(Form f,
FormModel m)
Componentform
sections and widgets
(components that have a connection to an HTML form). Other
components can implement it as a no-op.
register in interface Component
public void respond(PageState state)
throws javax.servlet.ServletException
respond in interface Componentstate - the current page state
javax.servlet.ServletExceptionpublic Iterator children()
Componentnull) iterator.
children in interface Component
public void generateXML(PageState state,
Element p)
generateXML in interface Componentstate - represents the current requestp - the node under which the DOM subtree should be addedpublic final boolean isLocked()
Lockable
isLocked in interface Lockablepublic void lock()
LockablesetXXX method
should lead to an exception.
Most lockable Bebop classes throw an IllegalStateException if an attempt is made to modify a
locked instance.
lock in interface Lockablepublic String getClassAttr()
getClassAttr in interface ComponentComponent.setClassAttr(String),
Standard Attributespublic void setClassAttr(String theClass)
setClassAttr in interface ComponenttheClass - a valid XML nameComponent.getClassAttr()public String getStyleAttr()
getStyleAttr in interface ComponentComponent.setStyleAttr(java.lang.String),
Standard Attributespublic void setStyleAttr(String style)
style should be a valid CSS
style, since its value will be copied verbatim to the output and
appear as a style attribute in the top level XML or HTML
output element.
setStyleAttr in interface Componentstyle - a valid CSS style description for use in the
style attribute of an HTML tagpublic String getIdAttr()
getIdAttr in interface ComponentsetIdAttr(String id)public void setIdAttr(String id)
id
should be an XML name
that is unique within the Page in which this component is
contained. The value of id is copied literally to the
output and not used for internal processing.
setIdAttr in interface Componentid - a valid XML identifier
protected final void setAttribute(String name,
String value)
generateXML.
name - attribute name, case insensitivevalue - new attribute valueprotected final String getAttribute(String name)
name - attribute name, case insensitive
setAttribute, or null if none was set.setAttribute(java.lang.String, java.lang.String)protected final void exportAttributes(Element target)
setAttribute to the
element target. The attributes set with
exportAttributes overwrite attributes with identical names
that target might already have.
target - element to which attributes are addedsetAttribute(java.lang.String, java.lang.String)protected final boolean hasAttributes()
true if any attributes have been set.
true if any attributes have been set;
false otherwise.
public final void setMetaDataAttribute(String name,
String value)
public final String getMetaDataAttribute(String name)
public Component setKey(String key)
setKey in interface Componentkey - the key to manglepublic final String getKey()
getKey in interface Componentpublic boolean isVisible(PageState s)
Componentstate.
isVisible in interface Components - represents the current request
true if the component is visible in the request;
false otherwise.setVisible,
Description of Visibility
above
public void setVisible(PageState s,
boolean v)
Component
setVisible in interface Components - represents the current requestv - true if the component should be visible
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||