KickJava   Java API By Example, From Geeks To Geeks.

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


1 /*
2  * Copyright (c) 2003 - 2007 OpenSubsystems s.r.o. Slovak Republic. All rights reserved.
3  *
4  * Project: OpenSubsystems
5  *
6  * $Id: DialogUnknownRowTag.java,v 1.8 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
28 /**
29  * Custom tag to for the controls placed in a not yet known row of not yet known
30  * dialog, * which these controls will use to construct their own IDs. Use this
31  * tag when you generate content of dialog row, which will be inserted into a
32  * real dialog row using tiles:put and tiles:insert and therefore the id of the
33  * dialog row where the controls will be inserted is not known yet. At the time
34  * when the unknown row is placed into a real dialog row, the placeholder id
35  * will be substituted for a real id.
36  *
37  * @version $Id: DialogUnknownRowTag.java,v 1.8 2007/01/07 06:14:28 bastafidli Exp $
38  * @author Julian Legeny
39  * @code.reviewer Miro Halas
40  * @code.reviewed 1.5 2006/02/18 05:29:32 bastafidli
41  */

42 public class DialogUnknownRowTag extends BlockElementTag
43 {
44    // Constants ////////////////////////////////////////////////////////////////
45

46    /**
47     * Name of the prefix if we don't know row ID.
48     */

49    public static final String JavaDoc UNKNOWN_ROW_ID = "unknownrowid";
50
51    // Attributes ///////////////////////////////////////////////////////////////
52

53    /**
54     * Generated serial version id for this class.
55     */

56    private static final long serialVersionUID = -3043259599569059943L;
57
58    // Constructors /////////////////////////////////////////////////////////////
59

60    /**
61     * Constructor for custom tag.
62     */

63    public DialogUnknownRowTag()
64    {
65       super(null, null);
66    }
67    
68    // Business logic ///////////////////////////////////////////////////////////
69

70    /**
71     * {@inheritDoc}
72     */

73    public int doStartTag(
74    ) throws JspException JavaDoc
75    {
76       // Cache unknown row id
77
setStoredId(false);
78       setId(UNKNOWN_ROW_ID);
79       pushCurrentId();
80
81       return (EVAL_BODY_INCLUDE);
82    }
83    
84    /**
85     * {@inheritDoc}
86     */

87    public int doEndTag(
88    ) throws JspException JavaDoc
89    {
90       popCurrentId();
91       return (EVAL_PAGE);
92    }
93 }
94
Popular Tags