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 text input field with 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:in 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  @Deprecated
50  @Tag(name = "in")
51  @ExtensionTag(
52      baseClassName = "org.apache.myfaces.tobago.internal.taglib.InTag",
53      faceletHandler = "org.apache.myfaces.tobago.facelets.extension.InExtensionHandler")
54  public interface InExtensionTag {
55  
56    /**
57     * Indicate markup of this component.
58     * Possible value is 'none'. But this can be overridden in the theme.
59     */
60    @TagAttribute
61    @UIComponentTagAttribute(defaultValue = "none", type = "java.lang.String[]")
62    void setMarkup(final ValueExpression markup);
63  
64    /**
65     * The current value of this component.
66     */
67    @TagAttribute
68    @UIComponentTagAttribute(type = "java.lang.Object")
69    void setValue(final ValueExpression value);
70  
71    /**
72     * MethodExpression representing a value change listener method
73     * that will be notified when a new value has been set for this input component.
74     * The expression must evaluate to a public method that takes a ValueChangeEvent
75     * parameter, with a return type of void.
76     */
77    @TagAttribute
78    @UIComponentTagAttribute(
79        type = {},
80        expression = DynamicExpression.METHOD_EXPRESSION_REQUIRED,
81        methodSignature = "javax.faces.event.ValueChangeEvent")
82    void setValueChangeListener(final MethodExpression valueChangeListener);
83  
84    /**
85     * Text value to display as label.
86     * If text contains an underscore the next character is used as accesskey.
87     */
88    @TagAttribute
89    @UIComponentTagAttribute()
90    void setLabel(final ValueExpression label);
91  
92    /**
93     * Flag indicating this component should receive the focus.
94     */
95    @TagAttribute
96    @UIComponentTagAttribute(type = "boolean", defaultValue = "false")
97    void setFocus(final ValueExpression focus);
98  
99    /**
100    * The value binding expression linking this
101    * component to a property in a backing bean.
102    */
103   @TagAttribute
104   @UIComponentTagAttribute(type = "javax.faces.component.UIComponent")
105   void setBinding(final ValueExpression binding);
106 
107   /**
108    * Flag indicating whether or not this component should be rendered
109    * (during Render Response Phase), or processed on any subsequent form submit.
110    */
111   @TagAttribute
112   @UIComponentTagAttribute(type = "boolean", defaultValue = "true")
113   void setRendered(final ValueExpression rendered);
114 
115   /**
116    * An expression that specifies the Converter for this component.
117    * If the value binding expression is a String,
118    * the String is used as an ID to look up a Converter.
119    * If the value binding expression is a Converter,
120    * uses that instance as the converter.
121    * The value can either be a static value (ID case only)
122    * or an EL expression.
123    */
124   @TagAttribute
125   @UIComponentTagAttribute(type = "javax.faces.convert.Converter",
126       expression = DynamicExpression.VALUE_EXPRESSION)
127   void setConverter(final ValueExpression converter);
128 
129   /**
130    * Clientside script function to add to this component's onchange handler.
131    */
132   @TagAttribute
133   @UIComponentTagAttribute()
134   void setOnchange(final ValueExpression onchange);
135 
136   /**
137    * MethodBinding which generates a list of suggested input values based on
138    * the currently entered text, which could be retrieved via getSubmittedValue() on the UIIn.
139    * The expression has to evaluate to a public method which has a javax.faces.component.UIInput parameter
140    * and returns a List&lt;String&gt;(deprecated), a List&lt;org.apache.myfaces.tobago.model.AutoSuggestItem&gt;
141    * or a org.apache.myfaces.tobago.model.AutoSuggestItems.
142    *
143    * @deprecated since 2.0.0, please use tc:suggest
144    */
145   @Deprecated
146   @TagAttribute
147   @UIComponentTagAttribute(type = {},
148       expression = DynamicExpression.METHOD_EXPRESSION_REQUIRED,
149       methodSignature = "javax.faces.component.UIInput")
150   void setSuggestMethod(final MethodExpression suggestMethod);
151 
152   /**
153    * Minimum number of chars to type before the list will be requested.
154    *
155    * @since 1.5.9
156    * @deprecated since 2.0.0
157    */
158   @Deprecated
159   @TagAttribute
160   @UIComponentTagAttribute(type = "java.lang.Integer", defaultValue = "1")
161   void setSuggestMinChars(final ValueExpression suggestMinChars);
162 
163   /**
164    * Time in milli seconds before the list will be requested.
165    *
166    * @since 1.5.9
167    * @deprecated since 2.0.0
168    */
169   @Deprecated
170   @TagAttribute
171   @UIComponentTagAttribute(type = "java.lang.Integer", defaultValue = "300")
172   void setSuggestDelay(final ValueExpression suggestDelay);
173 
174   /**
175    * A method binding EL expression,
176    * accepting FacesContext, UIComponent,
177    * and Object parameters, and returning void, that validates
178    * the component's local value.
179    */
180   @TagAttribute
181   @UIComponentTagAttribute(type = {},
182       expression = DynamicExpression.METHOD_EXPRESSION,
183       methodSignature = {"javax.faces.context.FacesContext", "javax.faces.component.UIComponent", "java.lang.Object"})
184   void setValidator(final MethodExpression validator);
185 
186   /**
187    * Flag indicating whether or not this component should be rendered as
188    * password field , so you will not see the typed charakters.
189    */
190   @TagAttribute
191   @UIComponentTagAttribute(type = "boolean", defaultValue = "false")
192   void setPassword(final ValueExpression password);
193 
194   /**
195    * Flag indicating that this component will prohibit changes by the user.
196    */
197   @TagAttribute
198   @UIComponentTagAttribute(type = "boolean", defaultValue = "false")
199   void setReadonly(final ValueExpression readonly);
200 
201   /**
202    * Flag indicating that this element is disabled.
203    */
204   @TagAttribute()
205   @UIComponentTagAttribute(type = "boolean", defaultValue = "false")
206   void setDisabled(final ValueExpression disabled);
207 
208   /**
209    * Flag indicating that a value is required.
210    * If the value is an empty string a
211    * ValidationError occurs and a Error Message is rendered.
212    */
213   @TagAttribute
214   @UIComponentTagAttribute(type = "boolean", defaultValue = "false")
215   void setRequired(final ValueExpression required);
216 
217   /**
218    * Text value to display as tooltip.
219    */
220   @TagAttribute
221   @UIComponentTagAttribute()
222   void setTip(final ValueExpression tip);
223 
224   /**
225    * Displays a short text in the input field, that describes the meaning of this field.
226    * This is part of HTML 5, the theme should emulate the behaviour, when the browser doesn't support it.
227    */
228   @TagAttribute
229   @UIComponentTagAttribute()
230   void setPlaceholder(final ValueExpression placeholder);
231 
232   /**
233    * The width for the label component. Default: 'auto'.
234    * This value is used in the gridLayouts columns attribute.
235    * See gridLayout tag for valid values.
236    */
237   @TagAttribute
238   @UIComponentTagAttribute()
239   void setLabelWidth(final ValueExpression labelWidth);
240 
241   @TagAttribute
242   @UIComponentTagAttribute(type = "java.lang.Integer")
243   void setTabIndex(final ValueExpression tabIndex);
244 
245   /**
246    * An expression that specifies the validator message
247    */
248   @TagAttribute
249   @UIComponentTagAttribute()
250   void setValidatorMessage(final ValueExpression validatorMessage);
251 
252   /**
253    * An expression that specifies the converter message
254    */
255   @TagAttribute
256   @UIComponentTagAttribute()
257   void setConverterMessage(final ValueExpression converterMessage);
258 
259   /**
260    * An expression that specifies the required message
261    */
262   @TagAttribute
263   @UIComponentTagAttribute()
264   void setRequiredMessage(final ValueExpression requiredMessage);
265 
266   /**
267    * The component identifier for the input field component inside of the container.
268    * This value must be unique within the closest parent component that is a naming container.
269    */
270   @TagAttribute(rtexprvalue = true)
271   @UIComponentTagAttribute
272   void setFieldId(final String fieldId);
273 
274   /**
275    * The component identifier for this component.
276    * This value must be unique within the closest parent component that is a naming container.
277    * For tx components the id will be set to the container (e. g. the panel).
278    * To set the id of the input field, you have to use the attribute "fieldId".
279    */
280   @TagAttribute(rtexprvalue = true)
281   @UIComponentTagAttribute
282   void setId(final String id);
283 }