KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > fr > improve > struts > taglib > layout > event > EndLayoutEvent


1 package fr.improve.struts.taglib.layout.event;
2
3 import javax.servlet.jsp.JspException JavaDoc;
4 import javax.servlet.jsp.PageContext JavaDoc;
5
6 import fr.improve.struts.taglib.layout.LayoutTag;
7 import fr.improve.struts.taglib.layout.util.ParentFinder;
8 import fr.improve.struts.taglib.layout.util.TagUtils;
9
10 /**
11  * @author jnribette
12  *
13  * To change this generated comment edit the template variable "typecomment":
14  * Window>Preferences>Java>Templates.
15  * To enable and disable the creation of type comments go to
16  * Window>Preferences>Java>Code Generation.
17  */

18 public class EndLayoutEvent extends AbstractLayoutEvent {
19     public EndLayoutEvent(LayoutTag in_tag, Object JavaDoc in_value) {
20         super(in_tag, in_value);
21     }
22     /**
23      * @see fr.improve.struts.taglib.layout.event.AbstractLayoutEvent#send()
24      */

25     public Object JavaDoc send() throws JspException JavaDoc {
26         LayoutEventListener lc_listener = (LayoutEventListener) ParentFinder.findLayoutTag(source, LayoutEventListener.class);
27                 if (lc_listener!=null) {
28                     return lc_listener.processEndLayoutEvent(this);
29                 } else {
30                     return Boolean.FALSE;
31                 }
32     }
33     public Object JavaDoc sendToParent(LayoutTag in_tag) throws JspException JavaDoc {
34         LayoutEventListener lc_listener = (LayoutEventListener) ParentFinder.findLayoutTag(in_tag, LayoutEventListener.class);
35                 if (lc_listener!=null) {
36                     return lc_listener.processEndLayoutEvent(this);
37                 } else {
38                     return Boolean.FALSE;
39                 }
40     }
41     public Boolean JavaDoc consume(PageContext JavaDoc in_context, String JavaDoc in_end) throws JspException JavaDoc {
42       // Do write with the source tag pageContext : in the case of an include,
43
// writing with the target tag pageContext mess the HTML.
44
if (value!=null) {
45             TagUtils.write(source.getPageContext(), value.toString());
46         }
47         if (in_end!=null) {
48             TagUtils.write(source.getPageContext(), in_end + "\n");
49         }
50         return Boolean.TRUE;
51     }
52
53 }
54
Popular Tags