KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > myfaces > custom > date > HtmlInputDateTag


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.date;
17
18 import javax.faces.component.UIComponent;
19
20 import org.apache.myfaces.component.UserRoleAware;
21 import org.apache.myfaces.taglib.html.HtmlInputTextTagBase;
22
23 /**
24  * @author Sylvain Vieujot (latest modification by $Author: matzew $)
25  * @version $Revision: 1.8 $ $Date: 2005/02/18 17:19:31 $ $Log:
26  * HtmlInputCalendarTag.java,v $
27  *
28  */

29 public class HtmlInputDateTag extends HtmlInputTextTagBase {
30     public String JavaDoc getComponentType() {
31         return HtmlInputDate.COMPONENT_TYPE;
32     }
33
34     public String JavaDoc getRendererType() {
35         return "org.apache.myfaces.Date";
36     }
37     
38     // HtmlInputDate attributes
39
private String JavaDoc type;
40     private String JavaDoc popupCalendar;
41
42     // UIComponent attributes --> already implemented in UIComponentTagBase
43
// HTML universal attributes --> already implemented in HtmlComponentTagBase
44
// HTML event handler attributes --> already implemented in MyFacesTag
45

46     // UIOutput attributes
47
// value and converterId --> already implemented in UIComponentTagBase
48

49     // UIInput attributes --> already implemented in HtmlInputTagBase
50
// UIHTML Input attributes --> already implemented in HtmlInputTextTagBase
51

52     // User Role support
53
private String JavaDoc enabledOnUserRole;
54     private String JavaDoc visibleOnUserRole;
55     
56     public void release() {
57         super.release();
58         enabledOnUserRole=null;
59         visibleOnUserRole=null;
60         type=null;
61         popupCalendar=null;
62     }
63
64     protected void setProperties(UIComponent component) {
65         super.setProperties(component);
66
67         setStringProperty(component, "type", type);
68         setBooleanProperty(component, "popupCalendar", popupCalendar);
69         
70         setStringProperty(component, UserRoleAware.ENABLED_ON_USER_ROLE_ATTR, enabledOnUserRole);
71         setStringProperty(component, UserRoleAware.VISIBLE_ON_USER_ROLE_ATTR, visibleOnUserRole);
72     }
73     
74     public void setType(String JavaDoc type){
75         this.type = type;
76     }
77     
78     public void setPopupCalendar(String JavaDoc popupCalendar){
79         this.popupCalendar = popupCalendar;
80     }
81     
82     public void setEnabledOnUserRole(String JavaDoc enabledOnUserRole){
83         this.enabledOnUserRole = enabledOnUserRole;
84     }
85
86     public void setVisibleOnUserRole(String JavaDoc visibleOnUserRole){
87         this.visibleOnUserRole = visibleOnUserRole;
88     }
89 }
Popular Tags