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.component;
21  
22  import org.apache.myfaces.tobago.apt.annotation.BodyContentDescription;
23  import org.apache.myfaces.tobago.apt.annotation.DynamicExpression;
24  import org.apache.myfaces.tobago.apt.annotation.Facet;
25  import org.apache.myfaces.tobago.apt.annotation.Tag;
26  import org.apache.myfaces.tobago.apt.annotation.TagAttribute;
27  import org.apache.myfaces.tobago.apt.annotation.UIComponentTag;
28  import org.apache.myfaces.tobago.apt.annotation.UIComponentTagAttribute;
29  import org.apache.myfaces.tobago.component.Facets;
30  import org.apache.myfaces.tobago.component.RendererTypes;
31  import org.apache.myfaces.tobago.internal.taglib.declaration.HasCurrentMarkup;
32  import org.apache.myfaces.tobago.internal.taglib.declaration.HasIdBindingAndRendered;
33  import org.apache.myfaces.tobago.internal.taglib.declaration.HasMarkup;
34  import org.apache.myfaces.tobago.internal.taglib.declaration.HasRenderedPartially;
35  import org.apache.myfaces.tobago.internal.taglib.declaration.HasVar;
36  import org.apache.myfaces.tobago.internal.taglib.declaration.IsGridLayoutComponent;
37  import org.apache.myfaces.tobago.internal.taglib.declaration.IsGridLayoutContainer;
38  import org.apache.myfaces.tobago.internal.taglib.declaration.IsShowRoot;
39  import org.apache.myfaces.tobago.internal.taglib.declaration.IsShowRootJunction;
40  
41  import javax.faces.component.UIData;
42  
43  /**
44   * Render a sheet element.
45   */
46  @Tag(name = "sheet")
47  @BodyContentDescription(anyTagOf = "<tc:column>* <tc:columnSelector>? <tc:columnEvent>?")
48  @UIComponentTag(
49      uiComponent = "org.apache.myfaces.tobago.component.UISheet",
50      uiComponentBaseClass = "org.apache.myfaces.tobago.internal.component.AbstractUISheet",
51      interfaces = "org.apache.myfaces.tobago.event.SortActionSource2",
52      uiComponentFacesClass = "javax.faces.component.UIData",
53      componentFamily = UIData.COMPONENT_FAMILY,
54      rendererType = RendererTypes.SHEET,
55      allowedChildComponenents = {
56          "javax.faces.Column",
57          "org.apache.myfaces.tobago.ColumnSelector"},
58      facets = {@Facet(name = Facets.RELOAD, description = "Contains an instance of UIReload",
59                       allowedChildComponenents = "org.apache.myfaces.tobago.Reload")})
60  public interface SheetTagDeclaration 
61      extends HasIdBindingAndRendered, IsGridLayoutComponent, IsGridLayoutContainer, HasMarkup, HasCurrentMarkup,
62      HasRenderedPartially, IsShowRoot, IsShowRootJunction, HasVar {
63    /**
64     * LayoutConstraints for column layout.
65     * Semicolon separated list of layout tokens ('&lt;x>*', '&lt;x>px' or '&lt;x>%').
66     */
67    @TagAttribute
68    @UIComponentTagAttribute()
69    void setColumns(String columns);
70  
71    /**
72     * Flag indicating the header should be rendered.
73     */
74    @TagAttribute
75    @UIComponentTagAttribute(type = "boolean", defaultValue = "true")
76    void setShowHeader(String showHeader);
77  
78    /**
79     * The number of rows to display, starting with the one identified by the
80     * "first" property.
81     * <br/> The default has been changed from 100 to 0 because this is the default
82     * in the JSF standard (since Tobago 1.5).
83     */
84    @TagAttribute
85    @UIComponentTagAttribute(
86        type = "int",
87        defaultValue = "0")
88    void setRows(String rows);
89  
90    /**
91     * Zero-relative row number of the first row to be displayed.
92     */
93    @TagAttribute
94    @UIComponentTagAttribute(
95        type = "int",
96        defaultValue = "0")
97    void setFirst(String first);
98  
99    /**
100    * The sheet's data.
101    */
102   @TagAttribute
103   @UIComponentTagAttribute(type = {"java.lang.Object[]", "java.util.List", "javax.servlet.jsp.jstl.sql.Result",
104       "java.sql.ResultSet", "java.lang.Object", "javax.faces.model.DataModel"},
105       expression = DynamicExpression.VALUE_EXPRESSION_REQUIRED)
106   void setValue(String value);
107 
108   /**
109    * Flag indicating whether or not the paging panel should be display, if it is not needed for paging.<br />
110    * <ul>
111    * <li>showPagingAlways="false" which is the default means, that the paging footer should be displayed,
112    * only when it is needed.</li>
113    * <ul>
114    * <li>When the rows="0" paging is not needed, so the footer will not be rendered,</li>
115    * <li>when rows="N", N &gt; 0 and the size of the data value is &lt;= N paging is not needed
116    * and the footer will not be rendered,</li>
117    * <li>in any other case the paging footer will be displayed.</li>
118    * </ul>
119    * <li>showPagingAlways="true" means, that the paging footer should be displayed in any case.</li>
120    * </ul>
121    */
122   @TagAttribute
123   @UIComponentTagAttribute(type = "boolean", defaultValue = "false")
124   void setShowPagingAlways(String showPagingAlways);
125 
126   /**
127    * The count of rendered direct paging links in the sheet's footer.<br />
128    */
129   @TagAttribute
130   @UIComponentTagAttribute(type = "java.lang.Integer", defaultValue = "9")
131   void setDirectLinkCount(String directLinkCount);
132 
133   /**
134    * Flag indicating whether or not this sheet should reserve space for
135    * vertical toolbar when calculating column width's.<br />
136    * Possible values are: <pre>
137    *      'auto'  : sheet try to estimate the need of scrollbar.
138    *      'true'  : space for scrollbar is reserved.
139    *      'false' : no space is reserved.
140    *      </pre>
141    */
142   @TagAttribute
143   @UIComponentTagAttribute(defaultValue = "auto",
144       allowedValues = {"auto", "true", "false"})
145   void setForceVerticalScrollbar(String forceVerticalScrollbar);
146 
147   /**
148    * Flag indicating whether or not a range of direct paging links should be
149    * rendered in the sheet's footer.
150    */
151   @TagAttribute
152   @UIComponentTagAttribute(defaultValue = "center",
153       allowedValues = {"left", "center", "right", "none"})
154   void setShowDirectLinks(String showDirectLinks);
155 
156   /**
157    * Flag indicating whether and where the range pages should
158    * rendered in the sheet's footer. Rendering this range also offers the
159    * capability to enter the index displayed page directly.
160    */
161   @TagAttribute
162   @UIComponentTagAttribute(defaultValue = "right",
163       allowedValues = {"left", "center", "right", "none"})
164   void setShowPageRange(String showPageRange);
165 
166   /**
167    * Flag indicating whether or not the range of displayed rows should
168    * rendered in the sheet's footer. Rendering this range also offers the
169    * capability to enter the index of the start row directly.
170    */
171   @TagAttribute
172   @UIComponentTagAttribute(defaultValue = "left",
173       allowedValues = {"left", "center", "right", "none"})
174   void setShowRowRange(String showRowRange);
175 
176   /**
177    * Flag indicating whether or not the sheet should be selectable.
178    */
179   @TagAttribute
180   @UIComponentTagAttribute(defaultValue = "multi",
181       allowedValues = {"none", "single", "singleOrNone", "multi"})
182   void setSelectable(String selectable);
183 
184   /**
185    * Sheet state saving object.
186    */
187   @TagAttribute
188   @UIComponentTagAttribute(
189       type = "org.apache.myfaces.tobago.model.SheetState",
190       expression = DynamicExpression.VALUE_EXPRESSION_REQUIRED,
191       generate = false)
192   void setState(String state);
193 
194   /**
195    * Method binding representing a stateChangeListener method that will be
196    * notified when the state was changed by the user.
197     * The expression must evaluate to a public method that takes a
198     * SheetStateChangeEvent parameter, with a return type of void.
199    */
200   @TagAttribute
201   @UIComponentTagAttribute(type = {},
202       expression = DynamicExpression.METHOD_EXPRESSION_REQUIRED,
203       methodSignature = "javax.faces.event.ActionEvent")
204   void setStateChangeListener(String stateChangeListener);
205 
206   /**
207    * Method binding representing an actionListener method that will be
208    * invoked when sorting was requested by the user.
209    * Use this if your application needs special handling for sorting columns.
210    * If this is not set and the sortable attribute column is set to true the sheet
211    * implementation will use a default sort method.
212    * The expression must evaluate to a public method which takes an
213    * ActionEvent as parameter and with a return type of void.
214    * The method will receive a {@link org.apache.myfaces.tobago.event.SortActionEvent}.
215    * The method should sort according to the sortColumnId and direction getting from
216    * the sheet's {@link org.apache.myfaces.tobago.model.SheetState} object.
217    */
218   @TagAttribute
219   @UIComponentTagAttribute(
220       type = {},
221       expression = DynamicExpression.METHOD_BINDING_REQUIRED,
222       methodSignature = "javax.faces.event.ActionEvent")
223   void setSortActionListener(String sortActionListener);
224 
225 }