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.Tag;
23  import org.apache.myfaces.tobago.apt.annotation.TagAttribute;
24  import org.apache.myfaces.tobago.apt.annotation.UIComponentTag;
25  import org.apache.myfaces.tobago.apt.annotation.UIComponentTagAttribute;
26  import org.apache.myfaces.tobago.component.RendererTypes;
27  import org.apache.myfaces.tobago.internal.component.AbstractUIGridLayout;
28  import org.apache.myfaces.tobago.internal.taglib.declaration.HasBinding;
29  import org.apache.myfaces.tobago.internal.taglib.declaration.HasColumnLayout;
30  import org.apache.myfaces.tobago.internal.taglib.declaration.HasId;
31  import org.apache.myfaces.tobago.internal.taglib.declaration.HasRowLayout;
32  import org.apache.myfaces.tobago.internal.taglib.declaration.HasSpacing;
33  import org.apache.myfaces.tobago.internal.taglib.declaration.IsVisual;
34  
35  /**
36   * Renders a GridLayout.
37   * <pre>
38   * columns/rows ::= LAYOUT
39   * LAYOUT       ::= TOKEN [";" TOKEN]+
40   * TOKEN        ::= AUTO | PIXEL | PROPORTIONAL
41   * AUTO         ::= "auto" | "fixed"
42   * PIXEL        ::= NUMBER "px"
43   * PROPORTIONAL ::= [NUMBER] "*"
44   * </pre>
45   * <table border="1">
46   * <caption>GridLayout</caption>
47   * <tr>
48   * <th>Parent</th>
49   * <th>Child</th>
50   * <th>Okay?</th>
51   * <th>Remarks</th>
52   * </tr>
53   * <tr>
54   * <td>AUTO</td>
55   * <td>any combination of AUTO or PIXEL but no PROPORTIONAL</td>
56   * <td>okay</td>
57   * <td>-</td>
58   * </tr>
59   * <tr>
60   * <td>AUTO</td>
61   * <td>any combination with at least one PROPORTIONAL</td>
62   * <td>wrong</td>
63   * <td>Layout manager cannot compute the auto value.</td>
64   * </tr>
65   * <tr>
66   * <td>PIXEL</td>
67   * <td>any combination of AUTO or PIXEL but no PROPORTIONAL</td>
68   * <td>potentially wrong</td>
69   * <td>The values depend on each other, the programmer has to keep consistency manually.</td>
70   * </tr>
71   * <tr>
72   * <td>PIXEL</td>
73   * <td>any combination with at least one PROPORTIONAL</td>
74   * <td>okay</td>
75   * <td>-</td>
76   * </tr>
77   * <tr>
78   * <td>PROPORTIONAL</td>
79   * <td>any combination of AUTO or PIXEL but no PROPORTIONAL</td>
80   * <td>potentially wrong</td>
81   * <td>No automatic matching:<ul><li>too little space: scroll bar</li>
82   * <li>too much space: elements will be spread.</li></ul></td>
83   * </tr>
84   * <tr>
85   * <td>PROPORTIONAL</td>
86   * <td>any combination with at least one PROPORTIONAL</td>
87   * <td>okay</td>
88   * <td>-</td>
89   * </tr>
90   * </table>
91   */
92  @Tag(name = "gridLayout")
93  @UIComponentTag(
94      uiComponent = "org.apache.myfaces.tobago.component.UIGridLayout",
95      uiComponentBaseClass = "org.apache.myfaces.tobago.internal.component.AbstractUIGridLayout",
96      uiComponentFacesClass = "javax.faces.component.UIComponentBase",
97      componentFamily = AbstractUIGridLayout.COMPONENT_FAMILY,
98      rendererType = RendererTypes.GRID_LAYOUT,
99      allowedChildComponenents = "NONE")
100 public interface GridLayoutTagDeclaration extends HasId, HasSpacing,
101     HasColumnLayout, HasRowLayout, HasBinding, IsVisual {
102 
103   /**
104    * This attribute advises the layout manager, to not use space that comes from non rendered components.
105    */
106   @TagAttribute
107   @UIComponentTagAttribute(type = "boolean")
108   void setRigid(String rigid);
109 
110 }