|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.tonbeller.wcf.component.ComponentSupport
com.tonbeller.wcf.form.XmlComponent
Implementation of a Comonent with support for NodeHandlers. The DOM Document is kept in memory.
The DOM may contain Elements with a handler attribute that contain the class names of NodeHandlers. Example
<myelem> <my-other-elem handler="my.pkg.ClassName"/> </myelem>XmlComponent will create an instance of my.pkg.ClassName and call its initialize() method with the my-other-elem Element as parameter. The NodeHandler may then choose to register itself as FormListener or RequestListener with the Environment.
Field Summary |
Fields inherited from interface com.tonbeller.wcf.bookmarks.Bookmarkable |
EXTENSIONAL, INTENSIONAL |
Constructor Summary | |
XmlComponent(java.lang.String id,
Component parent,
org.w3c.dom.Document document)
creates a Component |
Method Summary | |
void |
destroy(javax.servlet.http.HttpSession session)
called on session timeout or when the component is not used any more |
java.util.List |
getChildren(NodeHandler handler)
|
org.w3c.dom.Document |
getDocument()
returns the current DOM |
org.w3c.dom.Element |
getElement(NodeHandler handler)
return the Element that NodeHandler associated with, or null if there is no such element |
org.w3c.dom.Element |
getElement(java.lang.String id)
|
NodeHandler |
getHandler(org.w3c.dom.Element element)
return the NodeHandler associated with element or null, if there is no such handler |
NodeHandler |
getHandler(java.lang.String id)
return the NodeHandler whose element contains an Attribute "id" |
NodeHandler |
getParent(NodeHandler handler)
returns NodeHandler of the parent DOM Element |
void |
initialize(RequestContext context)
called once when the component is created. |
org.w3c.dom.Document |
render(RequestContext context)
renders the component |
Methods inherited from class com.tonbeller.wcf.component.ComponentSupport |
addFormListener, getBookmarkState, getDispatcher, getForm, getId, getLocale, getNextView, getParent, getRoleExpr, isAutoValidate, isListeningTo, isVisible, removeFormListener, request, revert, setAutoValidate, setBookmarkState, setId, setNextView, setParent, setRoleExpr, setVisible, validate, valueBound, valueUnbound |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public XmlComponent(java.lang.String id, Component parent, org.w3c.dom.Document document)
document
- the document to use.Method Detail |
public void initialize(RequestContext context) throws java.lang.Exception
ComponentSupport
initialize
in interface LifeCycle
initialize
in class ComponentSupport
java.lang.Exception
ComponentSupport.destroy(javax.servlet.http.HttpSession)
,
ComponentSupport.valueBound(javax.servlet.http.HttpSessionBindingEvent)
,
ComponentTag.doEndTag()
public void destroy(javax.servlet.http.HttpSession session) throws java.lang.Exception
ComponentSupport
destroy
in interface LifeCycle
destroy
in class ComponentSupport
java.lang.Exception
ComponentSupport.initialize(com.tonbeller.wcf.controller.RequestContext)
,
ComponentSupport.valueUnbound(javax.servlet.http.HttpSessionBindingEvent)
public org.w3c.dom.Document render(RequestContext context) throws java.lang.Exception
Renderable
java.lang.Exception
Renderable.render(RequestContext)
public NodeHandler getParent(NodeHandler handler)
public java.util.List getChildren(NodeHandler handler)
public org.w3c.dom.Document getDocument()
public NodeHandler getHandler(org.w3c.dom.Element element)
element
-
public NodeHandler getHandler(java.lang.String id)
id
- value of the id attribute
public org.w3c.dom.Element getElement(NodeHandler handler)
public org.w3c.dom.Element getElement(java.lang.String id)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |