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.BodyContent; 23 import org.apache.myfaces.tobago.apt.annotation.Tag; 24 import org.apache.myfaces.tobago.apt.annotation.TagAttribute; 25 import org.apache.myfaces.tobago.apt.annotation.UIComponentTag; 26 import org.apache.myfaces.tobago.apt.annotation.UIComponentTagAttribute; 27 import org.apache.myfaces.tobago.component.RendererTypes; 28 import org.apache.myfaces.tobago.internal.component.AbstractUIGridLayout; 29 import org.apache.myfaces.tobago.internal.taglib.declaration.HasBinding; 30 import org.apache.myfaces.tobago.internal.taglib.declaration.HasBorder; 31 import org.apache.myfaces.tobago.internal.taglib.declaration.HasColumnLayout; 32 import org.apache.myfaces.tobago.internal.taglib.declaration.HasCurrentMarkup; 33 import org.apache.myfaces.tobago.internal.taglib.declaration.HasId; 34 import org.apache.myfaces.tobago.internal.taglib.declaration.HasMargin; 35 import org.apache.myfaces.tobago.internal.taglib.declaration.HasMargins; 36 import org.apache.myfaces.tobago.internal.taglib.declaration.HasMarkup; 37 import org.apache.myfaces.tobago.internal.taglib.declaration.HasRowLayout; 38 import org.apache.myfaces.tobago.internal.taglib.declaration.HasSpacing; 39 40 /** 41 * Renders a GridLayout. 42 * <pre> 43 * columns/rows ::= LAYOUT 44 * LAYOUT ::= TOKEN [";" TOKEN]+ 45 * TOKEN ::= AUTO | PIXEL | PROPORTIONAL 46 * AUTO ::= "auto" | "fixed" 47 * PIXEL ::= NUMBER "px" 48 * PROPORTIONAL ::= [NUMBER] "*" 49 * </pre> 50 * <p/> 51 * <table border="1"> 52 * <tr> 53 * <th>Parent</th> 54 * <th>Child</th> 55 * <th>Okay?</th> 56 * <th>Remarks</th> 57 * </tr> 58 * <tr> 59 * <td>AUTO</td> 60 * <td>any combination of AUTO or PIXEL but no PROPORTIONAL</td> 61 * <td>okay</td> 62 * <td>-</td> 63 * </tr> 64 * <tr> 65 * <td>AUTO</td> 66 * <td>any combination with at least one PROPORTIONAL</td> 67 * <td>wrong</td> 68 * <td>LayoutManager cannot compute the auto value.</td> 69 * </tr> 70 * <tr> 71 * <td>PIXEL</td> 72 * <td>any combination of AUTO or PIXEL but no PROPORTIONAL</td> 73 * <td>potentially wrong</td> 74 * <td>The values depend on each other, the programmer has to keep consistency manually.</td> 75 * </tr> 76 * <tr> 77 * <td>PIXEL</td> 78 * <td>any combination with at least one PROPORTIONAL</td> 79 * <td>okay</td> 80 * <td>-</td> 81 * </tr> 82 * <tr> 83 * <td>PROPORTIONAL</td> 84 * <td>any combination of AUTO or PIXEL but no PROPORTIONAL</td> 85 * <td>potentially wrong</td> 86 * <td>No automatic matching:<ul><li>too little space: scroll bar</li> 87 * <li>too much space: elements will be spread.</li></ul></td> 88 * </tr> 89 * <tr> 90 * <td>PROPORTIONAL</td> 91 * <td>any combination with at least one PROPORTIONAL</td> 92 * <td>okay</td> 93 * <td>-</td> 94 * </tr> 95 * </table> 96 */ 97 @Tag(name = "gridLayout", bodyContent = BodyContent.EMPTY) 98 @UIComponentTag( 99 uiComponent = "org.apache.myfaces.tobago.component.UIGridLayout", 100 uiComponentBaseClass = "org.apache.myfaces.tobago.internal.component.AbstractUIGridLayout", 101 uiComponentFacesClass = "javax.faces.component.UIComponentBase", 102 componentFamily = AbstractUIGridLayout.COMPONENT_FAMILY, 103 rendererType = RendererTypes.GRID_LAYOUT, 104 allowedChildComponenents = "NONE", isLayout = true) 105 public interface GridLayoutTagDeclaration extends HasId, HasBorder, HasSpacing, HasMargin, 106 HasMargins, HasColumnLayout, HasRowLayout, HasBinding, HasMarkup, HasCurrentMarkup { 107 108 /** 109 * This attribute is a hint for the layout manager. Should not be used in most cases. 110 * 111 * @param columnOverflow Does the component need a horizontal scrollbar? 112 */ 113 @TagAttribute 114 @UIComponentTagAttribute( 115 type = "boolean") 116 void setColumnOverflow(String columnOverflow); 117 118 /** 119 * This attribute is a hint for the layout manager. Should not be used in most cases. 120 * 121 * @param rowOverflow Does the component need a vertical scrollbar? 122 */ 123 @TagAttribute 124 @UIComponentTagAttribute( 125 type = "boolean") 126 void setRowOverflow(String rowOverflow); 127 128 }