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.BodyContentDescription;
23  import org.apache.myfaces.tobago.apt.annotation.DynamicExpression;
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.RendererTypes;
29  import org.apache.myfaces.tobago.internal.component.AbstractUITabGroup;
30  import org.apache.myfaces.tobago.internal.taglib.declaration.HasAction;
31  import org.apache.myfaces.tobago.internal.taglib.declaration.HasActionListener;
32  import org.apache.myfaces.tobago.internal.taglib.declaration.HasCurrentMarkup;
33  import org.apache.myfaces.tobago.internal.taglib.declaration.HasIdBindingAndRendered;
34  import org.apache.myfaces.tobago.internal.taglib.declaration.HasMarkup;
35  import org.apache.myfaces.tobago.internal.taglib.declaration.HasRenderedPartially;
36  import org.apache.myfaces.tobago.internal.taglib.declaration.IsGridLayoutComponent;
37  import org.apache.myfaces.tobago.internal.taglib.declaration.IsGridLayoutContainer;
38  import org.apache.myfaces.tobago.internal.taglib.declaration.IsImmediateCommand;
39  
40  import javax.faces.component.UIPanel;
41  
42  /**
43   * Renders a tab group which contains tab panels.
44   */
45  @Tag(name = "tabGroup")
46  @BodyContentDescription(anyTagOf = "(<tc:tab>* ")
47  @UIComponentTag(
48      uiComponent = "org.apache.myfaces.tobago.component.UITabGroup",
49      uiComponentBaseClass = "org.apache.myfaces.tobago.internal.component.AbstractUITabGroup",
50      uiComponentFacesClass = "javax.faces.component.UIPanel",
51      componentFamily = UIPanel.COMPONENT_FAMILY,
52      rendererType = RendererTypes.TAB_GROUP,
53      interfaces = "javax.faces.component.ActionSource2",
54      allowedChildComponenents = "org.apache.myfaces.tobago.Tab")
55  
56  public interface TabGroupTagDeclaration
57      extends HasIdBindingAndRendered, IsImmediateCommand, HasAction, HasActionListener, HasMarkup, HasCurrentMarkup,
58      IsGridLayoutComponent, IsGridLayoutContainer, HasRenderedPartially {
59  
60    /**
61     * Flag indicating that the tab navigation bar is rendered.
62     */
63    @TagAttribute
64    @UIComponentTagAttribute(type = "boolean", defaultValue = "true")
65    void setShowNavigationBar(String showNavigationBar);
66  
67    /**
68     * Indicating how tab switching should be done.
69     * <p/>
70     * Possible values are:
71     * <dl>
72     *   <dt>client</dt>
73     *   <dd>Tab switching is done on client, no server Request.</dd>
74     *   <dt>reloadPage</dt>
75     *   <dd>Tab switching is done by server request. Full page is reloaded.</dd>
76     *   <dt>reloadTab</dt>
77     *   <dd>Tab switching is done by server request. Only the Tab is reloaded.</dd>
78     * </dl>
79     * @param switchType Sets the switching type.
80     */
81    @TagAttribute
82    @UIComponentTagAttribute(type = "java.lang.String",
83        allowedValues = {AbstractUITabGroup.SWITCH_TYPE_CLIENT, AbstractUITabGroup.SWITCH_TYPE_RELOAD_PAGE,
84                AbstractUITabGroup.SWITCH_TYPE_RELOAD_TAB},
85        defaultValue = AbstractUITabGroup.SWITCH_TYPE_CLIENT)
86    void setSwitchType(String switchType);
87  
88    /**
89     *
90     * <strong>ValueBindingExpression</strong> pointing to a Integer to save the
91     * component's selected Tab.
92     *
93     */
94    @TagAttribute
95    @UIComponentTagAttribute(type = "java.lang.Integer", defaultValue = "0")
96    void setSelectedIndex(String selectedIndex);
97  
98    /**
99     * For internal use. TODO: Check if this long needed
100    */
101   @UIComponentTagAttribute(type = "java.lang.Integer", defaultValue = "0")
102   void setRenderedIndex(String renderedIndex);
103 
104   @TagAttribute  
105   @UIComponentTagAttribute(
106       type = {},
107       expression = DynamicExpression.METHOD_EXPRESSION_REQUIRED,
108       methodSignature = "org.apache.myfaces.tobago.event.TabChangeEvent")
109   void setTabChangeListener(String listener);
110 }