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.Markup;
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.RendererTypes;
30  import org.apache.myfaces.tobago.internal.taglib.declaration.HasBinding;
31  import org.apache.myfaces.tobago.internal.taglib.declaration.HasId;
32  import org.apache.myfaces.tobago.internal.taglib.declaration.HasLabel;
33  import org.apache.myfaces.tobago.internal.taglib.declaration.IsVisual;
34  
35  import javax.faces.component.UIForm;
36  
37  /**
38   * <p>
39   * Renders a page element.
40   * </p>
41   * <p>
42   * The markup {@link org.apache.myfaces.tobago.context.Markup#SPREAD}
43   * means the page should spread over the hole available area.
44   * So the content will use the full height of the browser window.
45   * <b>Warning: This feature is preliminary and may change, if necessary, in minor releases!</b>
46   * </p>
47   */
48  @Tag(name = "page")
49  @UIComponentTag(
50      uiComponent = "org.apache.myfaces.tobago.component.UIPage",
51      uiComponentFacesClass = "javax.faces.component.UIForm",
52      componentFamily = UIForm.COMPONENT_FAMILY,
53      rendererType = RendererTypes.PAGE,
54      behaviors = {
55          @Behavior(
56              name = ClientBehaviors.CLICK,
57              isDefault = true),
58          @Behavior(
59              name = ClientBehaviors.DBLCLICK),
60          @Behavior(
61              name = ClientBehaviors.LOAD),
62          @Behavior(
63              name = ClientBehaviors.RESIZE)
64      },
65      markups = {
66          @Markup(
67              name = org.apache.myfaces.tobago.context.Markup.STRING_SPREAD,
68              description = "Use the full browser height for the HTML content."
69          )
70      })
71  
72  public interface PageTagDeclaration
73      extends HasLabel, HasId, HasBinding, IsVisual {
74  
75    /**
76     * Contains the id of the component which should have the focus after
77     * loading the page.
78     * Set to empty string for disabling setting of focus.
79     * Default (null) enables the "auto focus" feature.
80     */
81    @TagAttribute
82    @UIComponentTagAttribute()
83    void setFocusId(String focusId);
84  }