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 package org.apache.myfaces.custom.layout;
20
21 import javax.faces.component.UIComponent;
22 import javax.faces.component.behavior.ClientBehaviorHolder;
23 import javax.faces.component.html.HtmlPanelGroup;
24
25 import org.apache.myfaces.component.AlignProperty;
26 import org.apache.myfaces.component.DataProperties;
27 import org.apache.myfaces.component.EventAware;
28 import org.apache.myfaces.component.PanelProperties;
29 import org.apache.myfaces.component.UniversalProperties;
30
31 /**
32 * Determines where its children are positioned within the page
33 * relative to each other, similar to a Swing layout component.
34 *
35 * Unless otherwise specified, all attributes accept static values
36 * or EL expressions.
37 *
38 * @JSFComponent
39 * name = "t:panelLayout"
40 * class = "org.apache.myfaces.custom.layout.HtmlPanelLayout"
41 * tagClass = "org.apache.myfaces.custom.layout.HtmlPanelLayoutTag"
42 * @since 1.1.7
43 * @author Manfred Geiler (latest modification by $Author: lu4242 $)
44 * @version $Revision: 691856 $ $Date: 2008-09-03 21:40:30 -0500 (miƩ, 03 sep 2008) $
45 */
46 public abstract class AbstractHtmlPanelLayout
47 extends HtmlPanelGroup implements
48 AlignProperty, UniversalProperties, EventAware, DataProperties,
49 PanelProperties, ClientBehaviorHolder
50 {
51 //private static final Log log = LogFactory.getLog(HtmlPanelLayout.class);
52 public static final String COMPONENT_TYPE = "org.apache.myfaces.HtmlPanelLayout";
53 public static final String COMPONENT_FAMILY = "javax.faces.Panel";
54 private static final String DEFAULT_RENDERER_TYPE = "org.apache.myfaces.Layout";
55
56 private static final int DEFAULT_BORDER = Integer.MIN_VALUE;
57 private static final String DEFAULT_LAYOUT = "classic";
58
59 // typesafe facet getters
60
61 /**
62 * @JSFFacet
63 */
64 public UIComponent getHeader()
65 {
66 return (UIComponent)getFacet("header");
67 }
68
69 /**
70 * @JSFFacet
71 */
72 public UIComponent getNavigation()
73 {
74 return (UIComponent)getFacet("navigation");
75 }
76
77 /**
78 * @JSFFacet
79 */
80 public UIComponent getBody()
81 {
82 return (UIComponent)getFacet("body");
83 }
84
85 /**
86 * @JSFFacet
87 */
88 public UIComponent getFooter()
89 {
90 return (UIComponent)getFacet("footer");
91 }
92
93 /**
94 * The CSS class to be applied to footer cells.
95 *
96 * @JSFProperty
97 */
98 public abstract String getFooterClass();
99
100 /**
101 * The CSS class to be applied to header cells.
102 *
103 * @JSFProperty
104 */
105 public abstract String getHeaderClass();
106
107 /**
108 * <pre>
109 * layout | header | navigation | body | footer
110 * =================|========|============|=======|========
111 * classic (Default)| top | left | right | bottom
112 * navigationRight | top | right | left | bottom
113 * upsideDown | bottom | left | right | top
114 * </pre>
115 *
116 * @JSFProperty
117 * defaultValue="classic"
118 */
119 public abstract String getLayout();
120
121 /**
122 * CSS class to be used for the table cell.
123 *
124 * @JSFProperty
125 */
126 public abstract String getNavigationClass();
127
128 /**
129 * CSS class to be used for the table cell.
130 *
131 * @JSFProperty
132 */
133 public abstract String getBodyClass();
134
135 /**
136 * CSS class to be used for the table cell.
137 *
138 * @JSFProperty
139 */
140 public abstract String getHeaderStyle();
141
142 /**
143 * CSS class to be used for the table cell.
144 *
145 * @JSFProperty
146 */
147 public abstract String getNavigationStyle();
148
149 /**
150 * CSS class to be used for the table cell.
151 *
152 * @JSFProperty
153 */
154 public abstract String getBodyStyle();
155
156 /**
157 * CSS class to be used for the table cell.
158 *
159 * @JSFProperty
160 */
161 public abstract String getFooterStyle();
162
163 }