KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > myfaces > custom > swapimage > HtmlSwapImageTag


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

16 package org.apache.myfaces.custom.swapimage;
17
18 import org.apache.myfaces.taglib.html.HtmlGraphicImageTagBase;
19
20 import javax.faces.component.UIComponent;
21
22 /**
23  * @author Thomas Spiegl
24  * @version $Revision: 1.4 $ $Date: 2005/03/05 22:50:33 $
25  * $Log: HtmlSwapImageTag.java,v $
26  * Revision 1.4 2005/03/05 22:50:33 tomsp
27  * changed swapimage tag
28  *
29  * Revision 1.3 2005/02/18 17:19:30 matzew
30  * added release() to tag clazzes.
31  *
32  * Revision 1.2 2005/01/09 21:56:33 tomsp
33  * added new component swapimage
34  *
35  * Revision 1.1 2005/01/09 12:36:58 tomsp
36  * added new component swapimage
37  *
38  */

39 public class HtmlSwapImageTag
40         extends HtmlGraphicImageTagBase
41 {
42     private static final String JavaDoc RENDERER_TYPE = "org.apache.myfaces.SwapImage";
43
44     private static final String JavaDoc SWAP_IMG_URL_ATTR = "swapImageUrl";
45     private static final String JavaDoc ACTIVE_IMG_URL_ATTR = "activeImageUrl";
46
47     private String JavaDoc _swapImageUrl;
48     private String JavaDoc _activeImageUrl;
49
50     public String JavaDoc getComponentType()
51     {
52         return HtmlSwapImage.COMPONENT_TYPE;
53     }
54
55     public String JavaDoc getRendererType()
56     {
57         return RENDERER_TYPE;
58     }
59
60     public void release() {
61         super.release();
62         _swapImageUrl=null;
63         _activeImageUrl=null;
64     }
65     
66     protected void setProperties(UIComponent component)
67     {
68         super.setProperties(component);
69
70         setStringProperty(component, SWAP_IMG_URL_ATTR, _swapImageUrl);
71         setStringProperty(component, ACTIVE_IMG_URL_ATTR, _activeImageUrl);
72     }
73
74     public void setSwapImageUrl(String JavaDoc swapImageUrl)
75     {
76         _swapImageUrl = swapImageUrl;
77     }
78
79     public void setActiveImageUrl(String JavaDoc activeImageUrl)
80     {
81         _activeImageUrl = activeImageUrl;
82     }
83
84     public void setOnmouseover(String JavaDoc onmouseover)
85     {
86         throw new UnsupportedOperationException JavaDoc(HtmlSwapImageTag.class.getName() + ".setOnmouseover not supported.");
87     }
88
89     public void setOnmousedown(String JavaDoc onmousedown)
90     {
91         throw new UnsupportedOperationException JavaDoc(HtmlSwapImageTag.class.getName() + ".setOnmousedown not supported.");
92     }
93
94     public void setOnmouseup(String JavaDoc onmouseup)
95     {
96         throw new UnsupportedOperationException JavaDoc(HtmlSwapImageTag.class.getName() + ".setOnmouseup not supported.");
97     }
98
99     public void setOnmousemove(String JavaDoc onmousemove)
100     {
101         throw new UnsupportedOperationException JavaDoc(HtmlSwapImageTag.class.getName() + ".setOnmousemove not supported.");
102     }
103
104     public void setOnmouseout(String JavaDoc onmouseout)
105     {
106         throw new UnsupportedOperationException JavaDoc(HtmlSwapImageTag.class.getName() + ".setOnmouseout not supported.");
107     }
108 }
109
Popular Tags