KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > net > sf > uitags > tag > formGuide > ObserveTag


1 /**
2  * Jan 16, 2005
3  *
4  * Copyright 2004 - 2005 uitags
5  *
6  * Licensed under the Apache License, Version 2.0 (the "License");
7  * you may not use this file except in compliance with the License.
8  * You may obtain a copy of the License at
9  *
10  * http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software
13  * distributed under the License is distributed on an "AS IS" BASIS,
14  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  * See the License for the specific language governing permissions and
16  * limitations under the License.
17  */

18 package net.sf.uitags.tag.formGuide;
19
20 import javax.servlet.jsp.JspException JavaDoc;
21
22 /**
23  * Notifies {@link net.sf.uitags.tag.formGuide.FormGuideTag} of widgets to observe.
24  *
25  * @author jonni
26  * @version $Id$
27  */

28 public class ObserveTag extends ObserveForNullTag {
29   ///////////////////////////////
30
////////// Constants //////////
31
///////////////////////////////
32

33   /**
34    * Serial Version UID.
35    */

36   private static final long serialVersionUID = 100L;
37
38
39
40   ////////////////////////////
41
////////// Fields //////////
42
////////////////////////////
43

44   /**
45    * The "forValue" tag attribute
46    */

47   private String JavaDoc forValue;
48
49
50
51   //////////////////////////////////
52
////////// Constructors //////////
53
//////////////////////////////////
54

55   /**
56    * Default constructor.
57    */

58   public ObserveTag() {
59     super();
60   }
61
62
63
64   ///////////////////////////////////////////
65
////////// Tag attribute setters //////////
66
///////////////////////////////////////////
67

68   /**
69    * Tag attribute setter.
70    *
71    * @param val value of the tag attribute
72    */

73   public void setForValue(String JavaDoc val) {
74     this.forValue = val;
75   }
76
77
78
79   ///////////////////////////////
80
////////// Tag logic //////////
81
///////////////////////////////
82

83   /**
84    * Communicates with the parent tag ({@link FormGuideTag}).
85    *
86    * @return <code>EVAL_PAGE</code>
87    * @throws JspException to communicate error
88    */

89   protected final void doEndTagWithoutRuntimeValidation() {
90     FormGuideTag formGuideTag = (FormGuideTag) findParent(FormGuideTag.class);
91     if (this.elementId != null) {
92       formGuideTag.addObservedElementId(this.elementId, this.forValue);
93     }
94     else if (this.elementName != null) {
95       formGuideTag.addObservedElementName(this.elementName, this.forValue);
96     }
97   }
98 }
99
Popular Tags