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.HasBorder;
30  import org.apache.myfaces.tobago.internal.taglib.declaration.HasColumnLayout;
31  import org.apache.myfaces.tobago.internal.taglib.declaration.HasCurrentMarkup;
32  import org.apache.myfaces.tobago.internal.taglib.declaration.HasId;
33  import org.apache.myfaces.tobago.internal.taglib.declaration.HasMargin;
34  import org.apache.myfaces.tobago.internal.taglib.declaration.HasMargins;
35  import org.apache.myfaces.tobago.internal.taglib.declaration.HasMarkup;
36  import org.apache.myfaces.tobago.internal.taglib.declaration.HasRowLayout;
37  import org.apache.myfaces.tobago.internal.taglib.declaration.HasSpacing;
38  
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] "*"
48   * </pre>
49   * <p/>
50   * <table border="1">
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>LayoutManager 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  @Tag(name = "gridLayout")
97  @UIComponentTag(
98      uiComponent = "org.apache.myfaces.tobago.component.UIGridLayout",
99      uiComponentBaseClass = "org.apache.myfaces.tobago.internal.component.AbstractUIGridLayout",
100     uiComponentFacesClass = "javax.faces.component.UIComponentBase",
101     componentFamily = AbstractUIGridLayout.COMPONENT_FAMILY,
102     rendererType = RendererTypes.GRID_LAYOUT,
103     allowedChildComponenents = "NONE", isLayout = true)
104 public interface GridLayoutTagDeclaration extends HasId, HasBorder, HasSpacing, HasMargin,
105     HasMargins, HasColumnLayout, HasRowLayout, HasBinding, HasMarkup, HasCurrentMarkup {
106 
107   /**
108    * This attribute is a hint for the layout manager. Should not be used in most cases.
109    *
110    * @param columnOverflow Does the component need a horizontal scrollbar?
111    */
112   @TagAttribute
113   @UIComponentTagAttribute(type = "boolean")
114   void setColumnOverflow(String columnOverflow);
115 
116   /**
117    * This attribute is a hint for the layout manager. Should not be used in most cases.
118    *
119    * @param rowOverflow Does the component need a vertical scrollbar?
120    */
121   @TagAttribute
122   @UIComponentTagAttribute(type = "boolean")
123   void setRowOverflow(String rowOverflow);
124 
125   /**
126    * This attribute advises the layout manager, to not use space that comes from non rendered components.
127    */
128   @TagAttribute
129   @UIComponentTagAttribute(type = "boolean")
130   void setRigid(String rigid);
131 
132 }