KickJava   Java API By Example, From Geeks To Geeks.

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


1 package com.lamatek.tags.google;
2
3 import java.io.Serializable JavaDoc;
4 import java.util.Vector JavaDoc;
5
6 import javax.servlet.jsp.tagext.BodyTagSupport JavaDoc;
7 import javax.servlet.jsp.tagext.Tag JavaDoc;
8
9 /**
10  * GoogleMapInfoWindowTabbedTag
11  *
12  * This tag represents a <googlemaps:tabbedInfoWindow> tag. It is like an info window,
13  * but can display multiple panels of information through use of a tabbed interface.
14  *
15  * Developers should not extend this class or override it's methods.
16  *
17  * @author Tom Cole
18  * @version 0.87
19  */

20 public class GoogleMapInfoWindowTabbedTag extends BodyTagSupport JavaDoc implements Serializable JavaDoc, InfoWindow {
21
22     boolean display = false;
23     Vector JavaDoc tabs = null;
24     String JavaDoc style = null;
25     String JavaDoc css_class = null;
26     /**
27      * Overrides doStartTag from BodyTagSupport.
28      */

29     public int doStartTag() {
30         return EVAL_BODY_INCLUDE;
31     }
32     /**
33      * Overrides doEndTag from BodyTagSupport.
34      */

35     public int doEndTag() {
36         Tag JavaDoc tag = this;
37         while (tag.getParent() != null) {
38             if (tag.getParent() instanceof GoogleMapMarkerTag) {
39                 ((GoogleMapMarkerTag) tag.getParent()).setInfoWindow(this);
40                 return EVAL_PAGE;
41             }
42             tag = tag.getParent();
43         }
44         return EVAL_PAGE;
45     }
46     /**
47      * Adds a tab to this tabbed info window.
48      *
49      * @param tab An initialized GoogleMapTabTag
50      */

51     public void addTab(GoogleMapTabTag tab) {
52         if (tabs == null)
53             tabs = new Vector JavaDoc();
54         tabs.addElement(tab);
55     }
56     /**
57      * Returns the number of tabs that have been added to this tabbed info window.
58      *
59      * @return The number of tabs in this info window.
60      */

61     public int getTabCount() {
62         if (tabs == null)
63             return 0;
64         else
65             return tabs.size();
66     }
67     /**
68      * Returns the tab that is stored at the given location.
69      *
70      * @return A GoogleMapTabTag or null of none exists at the specified location.
71      */

72     public GoogleMapTabTag getTab(int i) {
73         if (tabs == null)
74             return null;
75         else
76             return (GoogleMapTabTag) tabs.elementAt(i);
77     }
78     /**
79      * Inherited from the InfoWindow interface. Denotes this as a tabbed info window.
80      *
81      * @return true.
82      */

83     public boolean isTabbed() {
84         return true;
85     }
86     /**
87      * Denotes whether or not this info window should be displayed as soon as the
88      * map is loaded. If set to false, the user will need to click the marker
89      * to display the tabbed info window.
90      *
91      * @return True or false.
92      */

93     public boolean isDisplay() {
94         return display;
95     }
96     /**
97      * Sets whether or not this info window should be displayed as soon as the
98      * map is loaded. If set to false, the user will need to click the marker
99      * to display the tabbed info window.
100      *
101      * @param display True or false.
102      */

103     public void setDisplay(boolean display) {
104         this.display = display;
105     }
106     /**
107      * Gets the css style attribute for this window's content.
108      *
109      * @return The CSS style attribute(s)
110      */

111     public String JavaDoc getStyle() {
112         return style;
113     }
114     /**
115      * Sets the css style attribute for this window's content.
116      *
117      * @param style CSS style attribute(s)
118      */

119     public void setStyle(String JavaDoc style) {
120         this.style = style;
121     }
122     /**
123      * Gets the css class attribute for this window's content.
124      *
125      * @return The CSS class attribute(s)
126      */

127     public String JavaDoc getCss_class() {
128         return css_class;
129     }
130     /**
131      * Sets the css style attribute for this window's content.
132      *
133      * @param style CSS style attribute(s)
134      */

135     public void setCss_class(String JavaDoc css_class) {
136         this.css_class = css_class;
137     }
138 }
139
Popular Tags