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.BodyContentDescription;
24  import org.apache.myfaces.tobago.apt.annotation.DynamicExpression;
25  import org.apache.myfaces.tobago.apt.annotation.Markup;
26  import org.apache.myfaces.tobago.apt.annotation.Tag;
27  import org.apache.myfaces.tobago.apt.annotation.TagAttribute;
28  import org.apache.myfaces.tobago.apt.annotation.UIComponentTag;
29  import org.apache.myfaces.tobago.apt.annotation.UIComponentTagAttribute;
30  import org.apache.myfaces.tobago.component.ClientBehaviors;
31  import org.apache.myfaces.tobago.component.RendererTypes;
32  import org.apache.myfaces.tobago.internal.taglib.declaration.HasAction;
33  import org.apache.myfaces.tobago.internal.taglib.declaration.HasActionListener;
34  import org.apache.myfaces.tobago.internal.taglib.declaration.HasIdBindingAndRendered;
35  import org.apache.myfaces.tobago.internal.taglib.declaration.HasTip;
36  import org.apache.myfaces.tobago.internal.taglib.declaration.IsImmediateCommand;
37  import org.apache.myfaces.tobago.internal.taglib.declaration.IsVisual;
38  import org.apache.myfaces.tobago.model.SwitchType;
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      allowedChildComponenents = "org.apache.myfaces.tobago.Tab",
54      behaviors = {
55          @Behavior(
56              name = ClientBehaviors.CLICK,
57              isDefault = true)
58      },
59      markups = {
60          @Markup(
61              name = org.apache.myfaces.tobago.context.Markup.STRING_SPREAD,
62              description = "Use the full height for the HTML content."
63          )
64      })
65  public interface TabGroupTagDeclaration
66      extends HasIdBindingAndRendered, IsImmediateCommand, HasAction, HasActionListener, IsVisual, HasTip {
67  
68    /**
69     * Flag indicating that the tab navigation bar is rendered.
70     */
71    @TagAttribute
72    @UIComponentTagAttribute(type = "boolean", defaultValue = "true")
73    void setShowNavigationBar(String showNavigationBar);
74  
75    /**
76     * <p>
77     * Indicating how tab switching should be done.
78     * </p>
79     * <p>
80     * Possible values are:
81     * </p>
82     * <dl>
83     *   <dt>client</dt>
84     *   <dd>Tab switching is done on client, no server Request.</dd>
85     *   <dt>reloadPage</dt>
86     *   <dd>Tab switching is done by server request. Full page is reloaded.</dd>
87     *   <dt>reloadTab</dt>
88     *   <dd>Tab switching is done by server request. Only the Tab is reloaded.</dd>
89     * </dl>
90     * @param switchType Sets the switching type.
91     */
92    @TagAttribute
93    @UIComponentTagAttribute(type = "org.apache.myfaces.tobago.model.SwitchType",
94        allowedValues = {SwitchType.CLIENT, SwitchType.RELOAD_PAGE, SwitchType.RELOAD_TAB},
95        defaultValue = SwitchType.CLIENT,
96        defaultCode = "org.apache.myfaces.tobago.model.SwitchType.client")
97    void setSwitchType(String switchType);
98  
99    /**
100    *
101    * <strong>ValueBindingExpression</strong> pointing to a Integer to save the
102    * component's selected Tab.
103    *
104    */
105   @TagAttribute
106   @UIComponentTagAttribute(type = "java.lang.Integer", defaultValue = "0")
107   void setSelectedIndex(String selectedIndex);
108 
109   /**
110    * For internal use. TBD: Check if this is needed any longer.
111    */
112   @UIComponentTagAttribute(type = "java.lang.Integer", defaultValue = "0")
113   void setRenderedIndex(String renderedIndex);
114 
115   @TagAttribute
116   @UIComponentTagAttribute(
117       type = {},
118       expression = DynamicExpression.METHOD_EXPRESSION_REQUIRED,
119       methodSignature = "org.apache.myfaces.tobago.event.TabChangeEvent")
120   void setTabChangeListener(String listener);
121 }