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.Facet;
23  import org.apache.myfaces.tobago.apt.annotation.Tag;
24  import org.apache.myfaces.tobago.apt.annotation.TagAttribute;
25  import org.apache.myfaces.tobago.apt.annotation.UIComponentTag;
26  import org.apache.myfaces.tobago.apt.annotation.UIComponentTagAttribute;
27  import org.apache.myfaces.tobago.component.Facets;
28  import org.apache.myfaces.tobago.component.RendererTypes;
29  import org.apache.myfaces.tobago.internal.taglib.declaration.HasBinding;
30  import org.apache.myfaces.tobago.internal.taglib.declaration.HasId;
31  import org.apache.myfaces.tobago.internal.taglib.declaration.HasLabel;
32  import org.apache.myfaces.tobago.internal.taglib.declaration.IsVisual;
33  
34  import javax.faces.component.UIForm;
35  
36  /**
37   * Renders a page element.
38   */
39  @Tag(name = "page")
40  @UIComponentTag(
41      uiComponent = "org.apache.myfaces.tobago.component.UIPage",
42      uiComponentBaseClass = "org.apache.myfaces.tobago.internal.component.AbstractUIPage",
43      uiComponentFacesClass = "javax.faces.component.UIForm",
44      componentFamily = UIForm.COMPONENT_FAMILY,
45      rendererType = RendererTypes.PAGE,
46      facets =
47          { @Facet(name = Facets.ACTION,
48                  description ="Contains an instance of UICommand (tc:command) for an auto-action",
49                  allowedChildComponenents = "org.apache.myfaces.tobago.Command"),
50            @Facet(name = Facets.RESIZE,
51                  description ="Contains an instance of UICommand which will be executed when the"
52                      + "size of the user agent was changed. Typically a <tc:command immediate='true' />",
53                  allowedChildComponenents = {"org.apache.myfaces.tobago.Command", "org.apache.myfaces.tobago.Form"}),
54            @Facet(name = Facets.MENU_BAR, description = "Deprecated! Please consult the demo how to build a "
55                + "menu bar on the top of the page.",
56                  allowedChildComponenents = "javax.faces.component.UIPanel"), //fake
57            @Facet(name=Facets.LAYOUT, description = "Deprecated! Contains an layout manager. "
58                + "The layout manager tag should surround the content instead.")})
59  
60  public interface PageTagDeclaration
61      extends HasLabel, HasId, HasBinding, IsVisual {
62  
63    /**
64     * Contains the id of the component which should have the focus after
65     * loading the page.
66     * Set to empty string for disabling setting of focus.
67     * Default (null) enables the "auto focus" feature.
68     */
69    @TagAttribute
70    @UIComponentTagAttribute()
71    void setFocusId(String focusId);
72  
73    /**
74     * Absolute URL to an image or image name to lookup in tobago resource path
75     * representing the application. In HTML it is used as a favicon.
76     */
77    @TagAttribute
78    @UIComponentTagAttribute()
79    void setApplicationIcon(String icon);
80  }