KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jahia > taglibs > button > SiteMapRolloverTag


1 package org.jahia.taglibs.button;
2
3 import javax.servlet.jsp.JspException JavaDoc;
4
5 import org.jahia.data.JahiaData;
6 import org.jahia.exceptions.JahiaException;
7
8
9 /**
10  * Class SiteMapRolloverTag : return the full link ("<a href...>...</a>") allowing to
11  * access the site map, that supports rollover
12  *
13  * @author Jerome Tamiotti
14  */

15 public class SiteMapRolloverTag extends AbstractRolloverTag {
16
17     private String JavaDoc title = "Site&nbsp;map";
18     private String JavaDoc style = "";
19     private String JavaDoc align = "";
20
21     // counter to handle multiple tag occurrences
22
private Integer JavaDoc counter;
23
24     private String JavaDoc imgdir = "images";
25     private String JavaDoc siteOn;
26     private String JavaDoc siteOff;
27     private String JavaDoc width = "";
28     private String JavaDoc height = "";
29
30     public void setImgdir(String JavaDoc imgdir) {
31         this.imgdir = imgdir;
32     }
33
34     public String JavaDoc getImgDir() {
35         return this.imgdir;
36     }
37
38     public void setSiteOn(String JavaDoc siteOn) {
39         this.siteOn = siteOn;
40     }
41
42     public void setSiteOff(String JavaDoc siteOff) {
43         this.siteOff = siteOff;
44     }
45
46     public void setWidth(String JavaDoc width) {
47         this.width = width;
48     }
49
50     public String JavaDoc getWidth() {
51         return this.width;
52     }
53
54     public void setHeight(String JavaDoc height) {
55         this.height = height;
56     }
57
58     public String JavaDoc getHeight() {
59         return this.height;
60     }
61
62     public void setAlign(String JavaDoc align) {
63         this.align = align;
64     }
65
66     public String JavaDoc getAlign() {
67         return this.align;
68     }
69
70     public void setTitle(String JavaDoc title) {
71         this.title = title;
72     }
73
74     public void setStyle(String JavaDoc style) {
75         this.style = style;
76     }
77
78     public String JavaDoc getTitle() {
79         return this.title;
80     }
81
82     public String JavaDoc getStyle() {
83         return this.style;
84     }
85
86
87     // define methods declared in AbstractButtonTag
88
public boolean testRights(JahiaData jData) {
89         // the site map button does not require any condition
90
return true;
91     }
92
93     public String JavaDoc getLauncher (JahiaData jData)
94         throws JahiaException {
95         return jData.gui().html().drawSiteMapLauncher();
96     }
97
98
99     // define methods declared in AbstractRolloverTag
100
public String JavaDoc getMouseOutImage(JahiaData jData)
101         throws JahiaException {
102         return this.siteOff;
103     }
104
105     public String JavaDoc getMouseOverImage(JahiaData jData)
106         throws JahiaException {
107         return this.siteOn;
108     }
109
110     public int doEndTag() throws JspException JavaDoc {
111         // let's reinitialize the tag variables to allow tag object reuse in
112
// pooling.
113
title = "Site&nbsp;map";
114         style = "";
115         align = "";
116
117         imgdir = "images";
118         siteOn = null;
119         siteOff = null;
120         width = "";
121         height = "";
122         return EVAL_PAGE;
123     }
124
125
126 }
127
Popular Tags