View Javadoc
1   /*
2    * Licensed to the Apache Software Foundation (ASF) under one
3    * or more contributor license agreements.  See the NOTICE file
4    * distributed with this work for additional information
5    * regarding copyright ownership.  The ASF licenses this file
6    * to you under the Apache License, Version 2.0 (the
7    * "License"); you may not use this file except in compliance
8    * with the License.  You may obtain a copy of the License at
9    *
10   *   http://www.apache.org/licenses/LICENSE-2.0
11   *
12   * Unless required by applicable law or agreed to in writing,
13   * software distributed under the License is distributed on an
14   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15   * KIND, either express or implied.  See the License for the
16   * specific language governing permissions and limitations
17   * under the License.
18   */
19  
20  package org.apache.myfaces.tobago.internal.taglib.extension;
21  
22  import org.apache.myfaces.tobago.apt.annotation.DynamicExpression;
23  import org.apache.myfaces.tobago.apt.annotation.ExtensionTag;
24  import org.apache.myfaces.tobago.apt.annotation.Tag;
25  import org.apache.myfaces.tobago.apt.annotation.TagAttribute;
26  import org.apache.myfaces.tobago.apt.annotation.UIComponentTagAttribute;
27  
28  import javax.el.MethodExpression;
29  import javax.el.ValueExpression;
30  
31  /**
32   * Renders a date input field with a date picker and a label.
33   * <br>
34   * Short syntax of:
35   * <pre>
36   * &lt;tc:panel&gt;
37   *   &lt;f:facet name="layout"&gt;
38   *     &lt;tc:gridLayout columns="auto;*"/&gt;
39   *   &lt;/f:facet&gt;
40   *   &lt;tc:label value="#{label}" for="@auto"/&gt;
41   *   &lt;tc:date value="#{value}"&gt;
42   *     ...
43   *   &lt;/tc:in&gt;
44   * &lt;/tc:panel&gt;
45   * </pre>
46   *
47   * @deprecated since Tobago 3.0. The tx-library is deprecated, please use the tc-library.
48   */
49  @Tag(name = "date")
50  @ExtensionTag(
51      baseClassName = "org.apache.myfaces.tobago.internal.taglib.DateTag",
52      faceletHandler = "org.apache.myfaces.tobago.facelets.extension.DateExtensionHandler")
53  public interface DateExtensionTag {
54  
55    /**
56     * The current value of this component.
57     */
58    @TagAttribute
59    @UIComponentTagAttribute(type = "java.lang.Object")
60    void setValue(final ValueExpression value);
61  
62    /**
63     * MethodBinding representing a value change listener method
64     * that will be notified when a new value has been set for this input component.
65     * The expression must evaluate to a public method that takes a ValueChangeEvent
66     * parameter, with a return type of void.
67     */
68    @TagAttribute
69    @UIComponentTagAttribute(
70        type = {},
71        expression = DynamicExpression.METHOD_EXPRESSION_REQUIRED,
72        methodSignature = "javax.faces.event.ValueChangeEvent")
73    void setValueChangeListener(final MethodExpression valueChangeListener);
74  
75    /**
76     * Text value to display as label.
77     * If text contains an underscore the next character is used as accesskey.
78     */
79    @TagAttribute
80    @UIComponentTagAttribute()
81    void setLabel(final ValueExpression label);
82  
83    /**
84     * Client side script function to add to this component's onchange handler.
85     */
86    @TagAttribute
87    @UIComponentTagAttribute()
88    void setOnchange(final ValueExpression onchange);
89  
90    /**
91     * Flag indicating this component should receive the focus.
92     */
93    @TagAttribute
94    @UIComponentTagAttribute(type = "boolean", defaultValue = "false")
95    void setFocus(final ValueExpression focus);
96  
97    /**
98     * The value binding expression linking this
99     * component to a property in a backing bean.
100    */
101   @TagAttribute
102   @UIComponentTagAttribute(type = "javax.faces.component.UIComponent")
103   void setBinding(final ValueExpression binding);
104 
105   /**
106    * Flag indicating whether or not this component should be rendered
107    * (during Render Response Phase), or processed on any subsequent form submit.
108    */
109   @TagAttribute
110   @UIComponentTagAttribute(type = "boolean", defaultValue = "true")
111   void setRendered(final ValueExpression rendered);
112 
113   /**
114    * An expression that specifies the Converter for this component.
115    * If the value binding expression is a String,
116    * the String is used as an ID to look up a Converter.
117    * If the value binding expression is a Converter,
118    * uses that instance as the converter.
119    * The value can either be a static value (ID case only)
120    * or an EL expression.
121    */
122   @TagAttribute
123   @UIComponentTagAttribute(type = "javax.faces.convert.Converter",
124       expression = DynamicExpression.VALUE_EXPRESSION)
125   void setConverter(final ValueExpression converter);
126 
127   /**
128    * A method binding EL expression,
129    * accepting FacesContext, UIComponent,
130    * and Object parameters, and returning void, that validates
131    * the component's local value.
132    */
133   @TagAttribute
134   @UIComponentTagAttribute(type = {},
135       expression = DynamicExpression.METHOD_EXPRESSION,
136       methodSignature = {"javax.faces.context.FacesContext", "javax.faces.component.UIComponent", "java.lang.Object"})
137   void setValidator(final MethodExpression validator);
138 
139   /**
140    * Flag indicating this component should rendered as an inline element.
141    *
142    * @deprecated This should be handled by e.g. a flow layout manager (since 1.5.0)
143    */
144   @TagAttribute
145   @UIComponentTagAttribute(type = "boolean", defaultValue = "false")
146   @Deprecated
147   void setInline(final ValueExpression inline);
148 
149   /**
150    * Flag indicating that this component will prohibit changes by the user.
151    */
152   @TagAttribute
153   @UIComponentTagAttribute(type = "boolean", defaultValue = "false")
154   void setReadonly(final ValueExpression readonly);
155 
156   /**
157    * Flag indicating that this element is disabled.
158    */
159   @TagAttribute()
160   @UIComponentTagAttribute(type = "boolean", defaultValue = "false")
161   void setDisabled(final ValueExpression disabled);
162 
163   /**
164    * Flag indicating that a value is required.
165    * If the value is an empty string a
166    * ValidationError occurs and a Error Message is rendered.
167    */
168   @TagAttribute
169   @UIComponentTagAttribute(type = "boolean", defaultValue = "false")
170   void setRequired(final ValueExpression required);
171 
172   /**
173    * Text value to display as tooltip.
174    */
175   @TagAttribute
176   @UIComponentTagAttribute()
177   void setTip(final ValueExpression tip);
178 
179   /**
180    * Displays a short text in the input field, that describes the meaning of this field.
181    * This is part of HTML 5, the theme should emulate the behaviour, when the browser doesn't support it.
182    */
183   @TagAttribute
184   @UIComponentTagAttribute()
185   void setPlaceholder(final ValueExpression placeholder);
186 
187   /**
188    * The width for the label component. Default: 'auto'.
189    * This value is used in the gridLayouts columns attribute.
190    * See gridLayout tag for valid values.
191    */
192   @TagAttribute
193   @UIComponentTagAttribute()
194   void setLabelWidth(final ValueExpression labelWidth);
195 
196   /**
197    * Indicate markup of this component.
198    * Possible value is 'none'. But this can be overridden in the theme.
199    */
200   @TagAttribute
201   @UIComponentTagAttribute(type = "java.lang.String[]", defaultValue = "none")
202   void setMarkup(final ValueExpression markup);
203 
204   @TagAttribute
205   @UIComponentTagAttribute(type = "java.lang.Integer")
206   void setTabIndex(final ValueExpression tabIndex);
207 
208   /**
209    * An expression that specifies the validator message
210    */
211   @TagAttribute
212   @UIComponentTagAttribute()
213   void setValidatorMessage(final ValueExpression validatorMessage);
214 
215   /**
216    * An expression that specifies the converter message
217    */
218   @TagAttribute
219   @UIComponentTagAttribute()
220   void setConverterMessage(final ValueExpression converterMessage);
221 
222   /**
223    * An expression that specifies the required message
224    */
225   @TagAttribute
226   @UIComponentTagAttribute()
227   void setRequiredMessage(final ValueExpression requiredMessage);
228 
229   /**
230    * The component identifier for the input field component inside of the container.
231    * This value must be unique within the closest parent component that is a naming container.
232    */
233   @TagAttribute(rtexprvalue = true)
234   @UIComponentTagAttribute
235   void setFieldId(final String fieldId);
236 
237   /**
238    * The component identifier for the automatically created picker component inside of the container.
239    * This value must be unique within the closest parent component that is a naming container.
240    */
241   @TagAttribute(rtexprvalue = true)
242   @UIComponentTagAttribute
243   void setPickerId(final String pickerId);
244 
245   /**
246    * The component identifier for the automatically created form component inside of the container.
247    * This value must be unique within the closest parent component that is a naming container.
248    */
249   @TagAttribute(rtexprvalue = true)
250   @UIComponentTagAttribute
251   void setFormId(final String formId);
252 
253   /**
254    * The component identifier for this component.
255    * This value must be unique within the closest parent component that is a naming container.
256    * For tx components the id will be set to the container (e. g. the panel).
257    * To set the id of the input field, you have to use the attribute "fieldId".
258    */
259   @TagAttribute(rtexprvalue = true)
260   @UIComponentTagAttribute
261   void setId(final String id);
262 }