KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > myfaces > custom > popup > HtmlPopupTag


1 /*
2  * Copyright (c) 2004 Your Corporation. All Rights Reserved.
3  */

4 package org.apache.myfaces.custom.popup;
5
6 import org.apache.myfaces.component.UserRoleAware;
7 import org.apache.myfaces.taglib.html.HtmlComponentTagBase;
8
9 import javax.faces.component.UIComponent;
10
11 /**
12  * @author Martin Marinschek (latest modification by $Author: mmarinschek $)
13  * @version $Revision: 1.6 $ $Date: 2005/03/14 20:34:13 $
14  * $Log: HtmlPopupTag.java,v $
15  * Revision 1.6 2005/03/14 20:34:13 mmarinschek
16  * fixed bug myfaces-132, thanks to gerhard hofmann
17  *
18  * Revision 1.5 2005/03/14 13:43:34 svieujot
19  * Close MyFaces-132 thanks to Gerhard Hofmann
20  *
21  * Revision 1.4 2005/02/18 17:19:30 matzew
22  * added release() to tag clazzes.
23  *
24  * Revision 1.3 2004/11/25 08:41:25 matzew
25  * removed unused import-statements
26  *
27  * Revision 1.2 2004/11/23 23:24:04 mmarinschek
28  * Popup tag has now more attributes
29  *
30  * Revision 1.1 2004/11/16 16:25:52 mmarinschek
31  * new popup - component; not yet finished
32  *
33  *
34  */

35 public class HtmlPopupTag
36         extends HtmlComponentTagBase
37 {
38     //private static final Log log = LogFactory.getLog(HtmlDataScrollerTag.class);
39

40     // UIComponent attributes --> already implemented in UIComponentTagBase
41

42     // HTML universal attributes --> already implemented in HtmlComponentTagBase
43

44     // HTML event handler attributes --> already implemented in HtmlComponentTagBase
45

46     // User Role support
47
private String JavaDoc _enabledOnUserRole;
48     private String JavaDoc _visibleOnUserRole;
49     private String JavaDoc _displayAtDistanceX = null;
50     private String JavaDoc _displayAtDistanceY = null;
51     private String JavaDoc _closePopupOnExitingElement = null;
52     private String JavaDoc _closePopupOnExitingPopup = null;
53     
54     public void release() {
55         super.release();
56
57         _enabledOnUserRole = null;
58         _visibleOnUserRole = null;
59         _displayAtDistanceX = null;
60         _displayAtDistanceY = null;
61         _closePopupOnExitingElement = null;
62         _closePopupOnExitingPopup = null;
63
64     }
65
66     public String JavaDoc getComponentType()
67     {
68         return HtmlPopup.COMPONENT_TYPE;
69     }
70
71     public String JavaDoc getRendererType()
72     {
73         return HtmlPopupRenderer.RENDERER_TYPE;
74     }
75
76     protected void setProperties(UIComponent component)
77     {
78         super.setProperties(component);
79
80         setStringProperty(component, UserRoleAware.ENABLED_ON_USER_ROLE_ATTR, _enabledOnUserRole);
81         setStringProperty(component, UserRoleAware.VISIBLE_ON_USER_ROLE_ATTR, _visibleOnUserRole);
82         setIntegerProperty(component,"displayAtDistanceX",_displayAtDistanceX);
83         setIntegerProperty(component,"displayAtDistanceY",_displayAtDistanceY);
84         setBooleanProperty(component,"closePopupOnExitingElement",_closePopupOnExitingElement);
85         setBooleanProperty(component,"closePopupOnExitingPopup",_closePopupOnExitingPopup);
86     }
87
88     // userrole attributes
89
public void setEnabledOnUserRole(String JavaDoc enabledOnUserRole)
90     {
91         _enabledOnUserRole = enabledOnUserRole;
92     }
93
94     public void setVisibleOnUserRole(String JavaDoc visibleOnUserRole)
95     {
96         _visibleOnUserRole = visibleOnUserRole;
97     }
98
99     public void setDisplayAtDistanceX(String JavaDoc displayAtDistanceX)
100     {
101         _displayAtDistanceX = displayAtDistanceX;
102     }
103
104     public void setDisplayAtDistanceY(String JavaDoc displayAtDistanceY)
105     {
106         _displayAtDistanceY = displayAtDistanceY;
107     }
108
109     public void setClosePopupOnExitingElement(String JavaDoc closePopupOnExitingElement)
110     {
111         _closePopupOnExitingElement = closePopupOnExitingElement;
112     }
113
114     public void setClosePopupOnExitingPopup(String JavaDoc closePopupOnExitingPopup)
115     {
116         _closePopupOnExitingPopup = closePopupOnExitingPopup;
117     }
118 }
119
Popular Tags