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