001 package org.apache.myfaces.tobago.taglib.component; 002 003 /* 004 * Licensed to the Apache Software Foundation (ASF) under one or more 005 * contributor license agreements. See the NOTICE file distributed with 006 * this work for additional information regarding copyright ownership. 007 * The ASF licenses this file to You under the Apache License, Version 2.0 008 * (the "License"); you may not use this file except in compliance with 009 * the License. You may obtain a copy of the License at 010 * 011 * http://www.apache.org/licenses/LICENSE-2.0 012 * 013 * Unless required by applicable law or agreed to in writing, software 014 * distributed under the License is distributed on an "AS IS" BASIS, 015 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 016 * See the License for the specific language governing permissions and 017 * limitations under the License. 018 */ 019 020 import org.apache.myfaces.tobago.apt.annotation.BodyContentDescription; 021 import org.apache.myfaces.tobago.apt.annotation.DynamicExpression; 022 import org.apache.myfaces.tobago.apt.annotation.Tag; 023 import org.apache.myfaces.tobago.apt.annotation.TagAttribute; 024 import org.apache.myfaces.tobago.apt.annotation.UIComponentTag; 025 import org.apache.myfaces.tobago.apt.annotation.UIComponentTagAttribute; 026 import org.apache.myfaces.tobago.apt.annotation.Facet; 027 import org.apache.myfaces.tobago.taglib.decl.HasIdBindingAndRendered; 028 import org.apache.myfaces.tobago.component.UIData; 029 030 /* 031 * Created by IntelliJ IDEA. 032 * User: bommel 033 * Date: 08.04.2006 034 * Time: 15:30:50 035 */ 036 037 /** 038 * Render a sheet element. 039 */ 040 @Tag(name = "sheet") 041 @BodyContentDescription(anyTagOf = "<tc:column>* <tc:columnSelector>?") 042 @UIComponentTag( 043 uiComponent = "org.apache.myfaces.tobago.component.UIData", 044 rendererType = "Sheet", 045 facets = {@Facet(name="reload", description = "Contains an instance of UIReload")}) 046 047 public interface SheetTagDeclaration extends TobagoTagDeclaration, HasIdBindingAndRendered { 048 /** 049 * LayoutConstraints for column layout. 050 * Semicolon separated list of layout tokens ('<x>*', '<x>px' or '<x>%'). 051 */ 052 @TagAttribute(required = true) 053 @UIComponentTagAttribute() 054 void setColumns(String columns); 055 056 /** 057 * Flag indicating the header should be rendered. 058 */ 059 @TagAttribute 060 @UIComponentTagAttribute(type = "java.lang.Boolean", defaultValue = "true") 061 void setShowHeader(String showHeader); 062 063 /** 064 * Please use "rows" instead. 065 * The number of rows to display, starting with the one identified by the 066 * "pageingStart" property. 067 */ 068 @TagAttribute 069 @UIComponentTagAttribute(type = "java.lang.Integer", defaultValue = "100") 070 @Deprecated 071 void setPagingLength(String pagingLength); 072 073 /** 074 * The number of rows to display, starting with the one identified by the 075 * "pageingStart/first" property. 076 */ 077 @TagAttribute 078 @UIComponentTagAttribute(type = "java.lang.Integer", defaultValue = "100") 079 void setRows(String pagingLength); 080 081 /** 082 * Please use "first" instead. 083 * Zero-relative row number of the first row to be displayed. 084 */ 085 @TagAttribute 086 @UIComponentTagAttribute(type = "java.lang.Integer", defaultValue = "0") 087 @Deprecated 088 void setPagingStart(String pagingStart); 089 090 /** 091 * Zero-relative row number of the first row to be displayed. 092 */ 093 @TagAttribute 094 @UIComponentTagAttribute(type = "java.lang.Integer", defaultValue = "0") 095 void setFirst(String pagingStart); 096 097 /** 098 * The sheet's data. 099 */ 100 @TagAttribute 101 @UIComponentTagAttribute(type = {"java.lang.Object[]", "java.util.List", "javax.servlet.jsp.jstl.sql.Result", 102 "java.sql.ResultSet", "java.lang.Object", "javax.faces.model.DataModel"}) 103 void setValue(String value); 104 105 /** 106 * Name of a request-scope attribute under which the model data for the row 107 * selected by the current value of the "rowIndex" property 108 * (i.e. also the current value of the "rowData" property) will be exposed. 109 */ 110 @TagAttribute(required = true) 111 @UIComponentTagAttribute() 112 void setVar(String var); 113 114 /** 115 * The count of rendered direct paging links in the sheet's footer.<br /> 116 * The <strong>default</strong> is 9. 117 */ 118 @TagAttribute 119 @UIComponentTagAttribute(type = "java.lang.Integer", defaultValue = "9") 120 void setDirectLinkCount(String directLinkCount); 121 122 /** 123 * Flag indicating whether or not this sheet should reserve space for 124 * vertical toolbar when calculating column width's.<br /> 125 * Possible values are: <pre> 126 * 'auto' : sheet try to estimate the need of scrollbar, 127 * this is the default. 128 * 'true' : space for scroolbar is reserved. 129 * 'false' : no space is reserved. 130 * </pre> 131 */ 132 @TagAttribute 133 @UIComponentTagAttribute(defaultValue = "auto", 134 allowedValues = {"auto", "true", "false"}) 135 void setForceVerticalScrollbar(String forceVerticalScrollbar); 136 137 /** 138 * Flag indicating whether or not a range of direct paging links should be 139 * rendered in the sheet's footer.<br /> 140 * Valid values are <strong>left</strong>, <strong>center</strong>, 141 * <strong>right</strong> and <strong>none</strong>. 142 * The <strong>default</strong> is <code>none</code>. 143 */ 144 @TagAttribute 145 @UIComponentTagAttribute(defaultValue = "none", 146 allowedValues = {"left", "center", "right", "none"}) 147 void setShowDirectLinks(String showDirectLinks); 148 149 /** 150 * Flag indicating whether and where the range pages should 151 * rendered in the sheet's footer. Rendering this range also offers the 152 * capability to enter the index displayed page directly.<br /> 153 * Valid values are <strong>left</strong>, <strong>center</strong>, 154 * <strong>right</strong> and <strong>none</strong>. 155 * The <strong>default</strong> is <code>none</code>. 156 */ 157 @TagAttribute 158 @UIComponentTagAttribute(defaultValue = "none", 159 allowedValues = {"left", "center", "right", "none"}) 160 void setShowPageRange(String showPageRange); 161 162 /** 163 * Flag indicating whether or not the range of displayed rows should 164 * rendered in the sheet's footer. Rendering this range also offers the 165 * capability to enter the index of the start row directly. <br /> 166 * Valid values are <strong>left</strong>, <strong>center</strong>, 167 * <strong>right</strong> and <strong>none</strong>. 168 * The <strong>default</strong> is <code>none</code>. 169 */ 170 @TagAttribute 171 @UIComponentTagAttribute(defaultValue = "none", 172 allowedValues = {"left", "center", "right", "none"}) 173 void setShowRowRange(String showRowRange); 174 175 /** 176 * Flag indicating whether or not the sheet should be selectable <br /> 177 * Valid values are <strong>none</strong>, <strong>single</strong>, 178 * and <strong>multi</strong>.<br /> 179 * The <strong>default</strong> is <code>multi</code>. 180 */ 181 @TagAttribute 182 @UIComponentTagAttribute(defaultValue = UIData.MULTI, 183 allowedValues = {UIData.NONE, UIData.SINGLE, UIData.MULTI}) 184 void setSelectable(String selectable); 185 186 /** 187 * Sheet state saving object. 188 */ 189 @TagAttribute 190 @UIComponentTagAttribute(type = "org.apache.myfaces.tobago.model.SheetState") 191 void setState(String state); 192 193 /** 194 * Method binding representing a stateChangeListener method that will be 195 * notified when the state was changed by the user. 196 * The expression must evaluate to a public method that takes an 197 * StateChangeEvent parameter, with a return type of void. 198 */ 199 @TagAttribute 200 @UIComponentTagAttribute(type = "javax.faces.el.MethodBinding", 201 expression = DynamicExpression.METHOD_BINDING) 202 void setStateChangeListener(String stateChangeListener); 203 204 /** 205 * Method binding representing an actionListener method that will be 206 * invoked when sorting was requested by the user. 207 * Use this if your application needs special handling for sorting columns. 208 * If this is not set and the sortable attribute column is set to true the sheet 209 * implementation will use a default sort method. 210 * The expression must evaluate to a public method which takes an 211 * ActionEvent as parameter and with a return type of void. 212 * The method will receive a {@link org.apache.myfaces.tobago.event.SortActionEvent}. 213 * The method should sort according to the sortColumnId and direction getting from 214 * the sheet's {@link org.apache.myfaces.tobago.model.SheetState} object. 215 */ 216 @TagAttribute 217 @UIComponentTagAttribute(type = "javax.faces.el.MethodBinding", 218 expression = DynamicExpression.METHOD_BINDING) 219 void setSortActionListener(String sortActionListener); 220 221 }