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.Markup;
23  import org.apache.myfaces.tobago.apt.annotation.Preliminary;
24  import org.apache.myfaces.tobago.apt.annotation.Tag;
25  import org.apache.myfaces.tobago.apt.annotation.UIComponentTag;
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   * <p>
37   * WARNING: This component is preliminary and may be changed without a major release.
38   * </p>
39   *
40   * Renders a GridLayout.
41   * <pre>
42   * columns/rows ::= LAYOUT
43   * LAYOUT       ::= TOKEN [" " TOKEN]+
44   * TOKEN        ::= AUTO | PIXEL | PROPORTIONAL
45   * AUTO         ::= "auto" | "fixed"
46   * PIXEL        ::= NUMBER "px"
47   * PROPORTIONAL ::= NUMBER "fr"
48   * </pre>
49   * <table border="1">
50   * <caption>GridLayout</caption>
51   * <tr>
52   * <th>Parent</th>
53   * <th>Child</th>
54   * <th>Okay?</th>
55   * <th>Remarks</th>
56   * </tr>
57   * <tr>
58   * <td>AUTO</td>
59   * <td>any combination of AUTO or PIXEL but no PROPORTIONAL</td>
60   * <td>okay</td>
61   * <td>-</td>
62   * </tr>
63   * <tr>
64   * <td>AUTO</td>
65   * <td>any combination with at least one PROPORTIONAL</td>
66   * <td>wrong</td>
67   * <td>Layout manager cannot compute the auto value.</td>
68   * </tr>
69   * <tr>
70   * <td>PIXEL</td>
71   * <td>any combination of AUTO or PIXEL but no PROPORTIONAL</td>
72   * <td>potentially wrong</td>
73   * <td>The values depend on each other, the programmer has to keep consistency manually.</td>
74   * </tr>
75   * <tr>
76   * <td>PIXEL</td>
77   * <td>any combination with at least one PROPORTIONAL</td>
78   * <td>okay</td>
79   * <td>-</td>
80   * </tr>
81   * <tr>
82   * <td>PROPORTIONAL</td>
83   * <td>any combination of AUTO or PIXEL but no PROPORTIONAL</td>
84   * <td>potentially wrong</td>
85   * <td>No automatic matching:<ul><li>too little space: scroll bar</li>
86   * <li>too much space: elements will be spread.</li></ul></td>
87   * </tr>
88   * <tr>
89   * <td>PROPORTIONAL</td>
90   * <td>any combination with at least one PROPORTIONAL</td>
91   * <td>okay</td>
92   * <td>-</td>
93   * </tr>
94   * </table>
95   */
96  @Preliminary
97  @Tag(name = "gridLayout")
98  @UIComponentTag(
99      uiComponent = "org.apache.myfaces.tobago.component.UIGridLayout",
100     componentFamily = AbstractUIGridLayout.COMPONENT_FAMILY,
101     rendererType = RendererTypes.GRID_LAYOUT,
102     interfaces = {
103         // As long as no behavior event names are defined, ClientBehaviorHolder must be implemented for Mojarra.
104         "javax.faces.component.behavior.ClientBehaviorHolder"
105     },
106     allowedChildComponenents = "NONE",
107     markups = {
108         @Markup(
109             name = org.apache.myfaces.tobago.context.Markup.STRING_SPREAD,
110             description = "Use the full height for the HTML content."
111         )
112     })
113 public interface GridLayoutTagDeclaration extends HasId, HasSpacing,
114     HasColumnLayout, HasRowLayout, HasBinding, IsVisual {
115 
116 }