KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > opensubsystems > patterns > dialoglayout > www > TextControlTag


1 /*
2  * Copyright (c) 2003 - 2007 OpenSubsystems s.r.o. Slovak Republic. All rights reserved.
3  *
4  * Project: OpenSubsystems
5  *
6  * $Id: TextControlTag.java,v 1.10 2007/01/07 06:14:28 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.dialoglayout.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 control containing
31  * read only text displayed in the dialog row.
32  *
33  * @version $Id: TextControlTag.java,v 1.10 2007/01/07 06:14:28 bastafidli Exp $
34  * @author Miro Halas
35  * @code.reviewer Miro Halas
36  * @code.reviewed 1.7 2006/02/18 05:29:32 bastafidli
37  */

38 public class TextControlTag extends BlockElementTag
39 {
40    // Attributes ///////////////////////////////////////////////////////////////
41

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

45    private static final long serialVersionUID = 4985963317950052336L;
46
47    // Constructors /////////////////////////////////////////////////////////////
48

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

52    public TextControlTag()
53    {
54       super("clsTextStrechControl", BlockElementTag.DIV_BLOCK_ELEMENT);
55    }
56    
57    // Business logic ///////////////////////////////////////////////////////////
58

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

62    public int doStartTag(
63    ) throws JspException JavaDoc
64    {
65       StringBuffer JavaDoc sbHtml = null;
66       
67       sbHtml = new StringBuffer JavaDoc();
68
69       /*
70       <div id="sessionlogincontrol" class="clsStrechLabel">
71       */

72
73       // Generate the start of the tabbed dialog
74
sbHtml.append("<");
75       sbHtml.append(m_strType);
76       sbHtml.append(" id=\"");
77       sbHtml.append(getCurrentId());
78       sbHtml.append(m_strId);
79       sbHtml.append("control\"");
80       if ((m_strCssclass != null) && (m_strCssclass.length() > 0))
81       {
82          sbHtml.append(" class=\"");
83          sbHtml.append(m_strCssclass);
84          sbHtml.append("\"");
85       }
86       if ((m_strStyle != null) && (m_strStyle.length() > 0))
87       {
88          sbHtml.append(" style=\"");
89          sbHtml.append(m_strStyle);
90          sbHtml.append("\"");
91       }
92       sbHtml.append(">");
93       
94       TagUtils.write(pageContext, sbHtml.toString());
95       
96       return (EVAL_BODY_INCLUDE);
97    }
98
99    /**
100     * {@inheritDoc}
101     */

102    public int doEndTag(
103    ) throws JspException JavaDoc
104    {
105       // Finish the label
106
StringBuffer JavaDoc sbHtml = new StringBuffer JavaDoc();
107
108       sbHtml.append("</");
109       sbHtml.append(m_strType);
110       sbHtml.append(">");
111       
112       TagUtils.write(pageContext, sbHtml.toString());
113       
114       return (EVAL_PAGE);
115    }
116 }
117
Popular Tags