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