KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > lamatek > tags > google > GoogleMapDivTag


1 package com.lamatek.tags.google;
2
3 import java.io.Serializable JavaDoc;
4
5 import javax.servlet.jsp.tagext.TagSupport JavaDoc;
6
7 /**
8  * GoogleMapDivTag
9  *
10  * This tag generates the <div> component that represents the physical map
11  * in the JSP page. Developers should not override this class.
12  *
13  * @author Tom Cole
14  * @version 0.40
15  */

16 public class GoogleMapDivTag extends TagSupport JavaDoc implements Serializable JavaDoc {
17     
18     String JavaDoc id = null;
19     String JavaDoc style = null;
20     String JavaDoc css_class = null;
21     String JavaDoc scope = "page";
22     
23     /**
24      * Overrides doStartTag() from TagSupport. Developers should not override this method.
25      */

26     public int doEndTag() {
27         if (id != null) {
28             Object JavaDoc o;
29             if (scope.equalsIgnoreCase("site")) {
30                 o = pageContext.getSession().getAttribute(id);
31             }
32             else {
33                 o = pageContext.getAttribute(id);
34             }
35             if (o != null) {
36                 GoogleMapTag map = (GoogleMapTag) o;
37                 map.generateDivTag(this);
38             }
39         }
40         return EVAL_PAGE;
41     }
42     /**
43      * Sets the id of the map that this <div> tag represents.
44      *
45      * @param id The id of a <googlemaps:map> tag.
46      */

47     public void setId(String JavaDoc id) {
48         this.id = id;
49     }
50     /**
51      * This method returns the CSS class used to render this <div>.
52      *
53      * @return The css style currently defined.
54      */

55     public String JavaDoc getCss_class() {
56         return css_class;
57     }
58     /**
59      * Sets the CSS class to be used when rendering this <div> tag.
60      *
61      * @param css_class The CSS classname to use.
62      */

63     public void setCss_class(String JavaDoc css_class) {
64         this.css_class = css_class;
65     }
66     /**
67      * Returns the currently defined CSS style string for this <div> tag.
68      *
69      * @return A CSS style string.
70      */

71     public String JavaDoc getStyle() {
72         return style;
73     }
74     /**
75      * Sets the CSS style string to use when rendering this <div> tag.
76      *
77      * @param style A valid CSS style string.
78      */

79     public void setStyle(String JavaDoc style) {
80         this.style = style;
81     }
82     /**
83      * Returns the id of the <googlemaps:map> tag that this <div> renders.
84      *
85      * @return A <googlemaps:map> tag id.
86      */

87     public String JavaDoc getId() {
88         return id;
89     }
90     /**
91      * Sets the scope where this <div> should look for it's <googlemaps:map>.
92      * Valid values are "site" for session or "page" for pageContext.
93      *
94      * @param scope A string (site OR page) that denotes session or pageContext.
95      */

96     public void setScope(String JavaDoc scope) {
97         this.scope = scope;
98     }
99 }
100
Popular Tags