KickJava   Java API By Example, From Geeks To Geeks.

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


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  * GoogleMapInitializeTag
9  *
10  * This tag represents a <googlemaps:initialize> tag. Developers should not override or subclass
11  * this class.
12  *
13  * @author Tom Cole
14  * @version 0.40
15  */

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

23     public int doEndTag() {
24         if (id != null) {
25             Object JavaDoc o;
26             if (scope.equalsIgnoreCase("site")) {
27                 o = pageContext.getSession().getAttribute(id);
28             }
29             else {
30                 o = pageContext.getAttribute(id);
31             }
32             if (o != null) {
33                 GoogleMapTag map = (GoogleMapTag) o;
34                 map.generateInitializationCode();
35             }
36         }
37         return EVAL_PAGE;
38     }
39     /**
40      * Sets the id of the parent <googlemaps:map> that this tag initializes.
41      *
42      * @param id A valid <googlemaps:map> id value.
43      */

44     public void setId(String JavaDoc id) {
45         this.id = id;
46     }
47     /**
48      * Sets the scope where this <div> should look for it's <googlemaps:map>.
49      * Valid values are "site" for session or "page" for pageContext.
50      *
51      * @param scope A string (site OR page) that denotes session or pageContext.
52      */

53     public void setScope(String JavaDoc scope) {
54         this.scope = scope;
55     }
56 }
57
Popular Tags