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.Behavior;
23  import org.apache.myfaces.tobago.apt.annotation.Facet;
24  import org.apache.myfaces.tobago.apt.annotation.Tag;
25  import org.apache.myfaces.tobago.apt.annotation.TagAttribute;
26  import org.apache.myfaces.tobago.apt.annotation.UIComponentTag;
27  import org.apache.myfaces.tobago.apt.annotation.UIComponentTagAttribute;
28  import org.apache.myfaces.tobago.component.ClientBehaviors;
29  import org.apache.myfaces.tobago.component.Facets;
30  import org.apache.myfaces.tobago.component.RendererTypes;
31  import org.apache.myfaces.tobago.internal.taglib.declaration.HasBinding;
32  import org.apache.myfaces.tobago.internal.taglib.declaration.HasId;
33  import org.apache.myfaces.tobago.internal.taglib.declaration.HasLabel;
34  import org.apache.myfaces.tobago.internal.taglib.declaration.IsVisual;
35  
36  import javax.faces.component.UIForm;
37  
38  /**
39   * <p>
40   * Renders a page element.
41   * </p>
42   * <p>
43   * The markup {@link org.apache.myfaces.tobago.context.Markup#SPREAD}
44   * means the page should spread over the hole available area.
45   * So the content will use the full height of the browser window.
46   * <b>Warning: This feature is preliminary and may change, if necessary, in minor releases!</b>
47   * </p>
48   */
49  @Tag(name = "page")
50  @UIComponentTag(
51      uiComponent = "org.apache.myfaces.tobago.component.UIPage",
52      uiComponentBaseClass = "org.apache.myfaces.tobago.internal.component.AbstractUIPage",
53      uiComponentFacesClass = "javax.faces.component.UIForm",
54      componentFamily = UIForm.COMPONENT_FAMILY,
55      rendererType = RendererTypes.PAGE,
56      facets =
57          { @Facet(name=Facets.LAYOUT, description = "Deprecated! Contains an layout manager. "
58                + "The layout manager tag should surround the content instead.")},
59      behaviors = {
60          @Behavior(
61              name = ClientBehaviors.CLICK,
62              isDefault = true),
63          @Behavior(
64              name = ClientBehaviors.DBLCLICK),
65          @Behavior(
66              name = ClientBehaviors.LOAD),
67          @Behavior(
68              name = ClientBehaviors.RESIZE)
69      })
70  
71  public interface PageTagDeclaration
72      extends HasLabel, HasId, HasBinding, IsVisual {
73  
74    /**
75     * Contains the id of the component which should have the focus after
76     * loading the page.
77     * Set to empty string for disabling setting of focus.
78     * Default (null) enables the "auto focus" feature.
79     */
80    @TagAttribute
81    @UIComponentTagAttribute()
82    void setFocusId(String focusId);
83  
84    /**
85     * Absolute URL to an image or image name to lookup in tobago resource path
86     * representing the application. In HTML it is used as a favicon.
87     */
88    @TagAttribute
89    @UIComponentTagAttribute()
90    void setApplicationIcon(String icon);
91  
92    /**
93     * Adding the value for the viewport meta tag in the page header in HTML.
94     */
95    @TagAttribute
96    @UIComponentTagAttribute(defaultValue = "width=device-width, initial-scale=1.0")
97    void setViewport(String viewport);
98  }