|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.arsdigita.toolbox.ui.NullComponent
Field Summary | |
static String |
versionId
|
Fields inherited from interface com.arsdigita.bebop.Component |
BEBOP_XML_NS, CLASS, ID, ON_CLICK, STYLE |
Constructor Summary | |
NullComponent()
|
Method Summary | |
Iterator |
children()
Returns an iterator over the children of this component. |
void |
generateXML(PageState state,
Element parent)
Adds a DOM subtree representing this component under the given parent node. |
String |
getClassAttr()
Gets the class attribute. |
String |
getIdAttr()
Gets the id attribute. |
String |
getKey()
Retrieves the programmer-supplied key. |
String |
getStyleAttr()
Gets the style attribute. |
boolean |
isLocked()
Return whether an object is locked and thus immutable, or can still be modified. |
boolean |
isVisible(PageState state)
Determines whether the component is visible in the request represented by state . |
void |
lock()
Lock an object. |
void |
register(Form form,
FormModel model)
Registers form parameters with the form model for this form. |
void |
register(Page page)
Registers state parameters for the page with its model. |
void |
respond(PageState state)
Responds to the request. |
void |
setClassAttr(String clacc)
Sets the class attribute. |
void |
setIdAttr(String id)
Sets the id attribute. |
Component |
setKey(String key)
Supplies a key for making parameter names unique. |
void |
setStyleAttr(String style)
Sets the style attribute. |
void |
setVisible(PageState state,
boolean visible)
Changes the visibility of the component. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final String versionId
Constructor Detail |
public NullComponent()
Method Detail |
public void generateXML(PageState state, Element parent)
Component
Adds a DOM subtree representing this component under the given
parent node. Uses the request values stored in state
.
generateXML
in interface Component
state
- represents the current requestparent
- the node under which the DOM subtree should be addedpublic void respond(PageState state) throws javax.servlet.ServletException
Component
Responds to the request. This method is only called if the request
was made from a link or form that the component put on the page in the
PageState.stateAsURL()
previous request.
No output should be generated on the HTTP response. The component
can store intermediate results in the state
by calling
setAttribute
.
This method is called before any output is printed to the HTTP response so that the component can forward to a different page and thereby commit the response.
respond
in interface Component
state
- represents the current request
javax.servlet.ServletException
public Iterator children()
Component
null
) iterator.
children
in interface Component
public void register(Page page)
Component
param
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 form, FormModel model)
Component
form
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 String getClassAttr()
Component
getClassAttr
in interface Component
Component.setClassAttr(String)
,
Standard Attributespublic void setClassAttr(String clacc)
Component
setClassAttr
in interface Component
clacc
- a valid XML nameComponent.getClassAttr()
public String getStyleAttr()
Component
getStyleAttr
in interface Component
Component.setStyleAttr(java.lang.String)
,
Standard Attributespublic void setStyleAttr(String style)
Component
style
should be a valid CSS
style, because 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 Component
style
- a valid CSS style description for use in the
style attribute of an HTML tagpublic String getIdAttr()
Component
getIdAttr
in interface Component
Component.setIdAttr(String id)
public void setIdAttr(String id)
Component
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 Component
id
- a valid XML identifierpublic Component setKey(String key)
Component
setKey
in interface Component
public String getKey()
Component
getKey
in interface Component
public boolean isVisible(PageState state)
Component
state
.
isVisible
in interface Component
state
- represents the current request
true
if the component is visible in the request;
false
otherwise.setVisible
,
Description of Visibility
abovepublic void setVisible(PageState state, boolean visible)
Component
setVisible
in interface Component
state
- represents the current requestvisible
- true
if the component should be visiblepublic void lock()
Lockable
setXXX
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 Lockable
public boolean isLocked()
Lockable
isLocked
in interface Lockable
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |