KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > opensubsystems > patterns > scrollabletable > www > ScrollableTableFooterRightTag


1 /*
2  * Copyright (c) 2003 - 2007 OpenSubsystems s.r.o. Slovak Republic. All rights reserved.
3  *
4  * Project: OpenSubsystems
5  *
6  * $Id: ScrollableTableFooterRightTag.java,v 1.6 2007/01/07 06:14:16 bastafidli Exp $
7  *
8  * This program is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation; version 2 of the License.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program; if not, write to the Free Software
19  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20  */

21  
22 package org.opensubsystems.patterns.scrollabletable.www;
23
24 import javax.servlet.jsp.JspException JavaDoc;
25
26 import org.opensubsystems.core.www.BlockElementTag;
27 import org.opensubsystems.core.www.TagUtils;
28
29 /**
30  * Custom tag to generate all HTML code necessary to display right side of footer
31  * of scrollable table. The right side of the footer of the table will be created
32  * from the content of the body of this tag.
33  *
34  * @version $Id: ScrollableTableFooterRightTag.java,v 1.6 2007/01/07 06:14:16 bastafidli Exp $
35  * @author Miro Halas
36  * @code.reviewer Miro Halas
37  * @code.reviewed 1.3 2006/02/18 05:29:32 bastafidli
38  */

39 public class ScrollableTableFooterRightTag extends BlockElementTag
40 {
41    // Attributes ///////////////////////////////////////////////////////////////
42

43    /**
44     * Generated serial version id for this class.
45     */

46    private static final long serialVersionUID = -513133382333515096L;
47
48    // Constructors /////////////////////////////////////////////////////////////
49

50    /**
51     * Constructor for custom tag.
52     */

53    public ScrollableTableFooterRightTag()
54    {
55       super("clsScrollableTable", BlockElementTag.DIV_BLOCK_ELEMENT);
56    }
57    
58    // Business logic ///////////////////////////////////////////////////////////
59

60    /**
61     * {@inheritDoc}
62     */

63    public int doStartTag(
64    ) throws JspException JavaDoc
65    {
66       StringBuffer JavaDoc sbHtml = null;
67       Object JavaDoc objTemp;
68       String JavaDoc strScrollableTableId;
69
70       objTemp = getCachedContent(ScrollableTableTag.ACTIVE_SCROLLABLE_TABLE_ID,
71                                  false).trim();
72       if (objTemp == null)
73       {
74          throw new JspException JavaDoc("Cannot find scrollable table id on the page. Probable" +
75                                 " cause is that the scrollable table open tag is missing.");
76       }
77       strScrollableTableId = (String JavaDoc)objTemp;
78       
79       sbHtml = new StringBuffer JavaDoc();
80
81       /*
82       This is how a start of right side footer of a scrollable table looks like
83       <div id="scrollabletablefooterright" class="clsScrollableTableFooterRight">
84       */

85
86       // Generate the start of the tabbed dialog tab header
87
sbHtml.append("<div id=\"");
88       sbHtml.append(strScrollableTableId);
89       sbHtml.append("footerright\"");
90       if ((m_strCssclass != null) && (m_strCssclass.length() > 0))
91       {
92          sbHtml.append(" class=\"");
93          sbHtml.append(m_strCssclass);
94          sbHtml.append("FooterRight");
95          sbHtml.append("\"");
96       }
97       sbHtml.append(">");
98       
99       TagUtils.write(pageContext, sbHtml.toString());
100       
101       return (EVAL_BODY_INCLUDE);
102    }
103
104    /**
105     * {@inheritDoc}
106     */

107    public int doEndTag(
108    ) throws JspException JavaDoc
109    {
110       // Finish the scrollable table footer
111
TagUtils.write(pageContext, "</div>");
112       
113       return (EVAL_PAGE);
114    }
115 }
116
Popular Tags