KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > opensymphony > webwork > components > TabbedPanel


1 package com.opensymphony.webwork.components;
2
3 import com.opensymphony.xwork.util.OgnlValueStack;
4
5 import javax.servlet.http.HttpServletRequest JavaDoc;
6 import javax.servlet.http.HttpServletResponse JavaDoc;
7 import java.util.ArrayList JavaDoc;
8 import java.util.List JavaDoc;
9
10 /**
11  * User: plightbo
12  * Date: Jul 20, 2005
13  * Time: 7:23:18 AM
14  */

15 public class TabbedPanel extends ClosingUIBean {
16     public static final String JavaDoc TEMPLATE = "tabbedpanel";
17     public static final String JavaDoc TEMPLATE_CLOSE = "tabbedpanel-close";
18     final private static String JavaDoc COMPONENT_NAME = TabbedPanel.class.getName();
19
20     protected List JavaDoc tabs = new ArrayList JavaDoc();
21
22     public TabbedPanel(OgnlValueStack stack, HttpServletRequest JavaDoc request, HttpServletResponse JavaDoc response) {
23         super(stack, request, response);
24     }
25
26     public void addTab(Panel pane) {
27         tabs.add(pane);
28     }
29
30     public List JavaDoc getTabs() {
31         return tabs;
32     }
33
34     public String JavaDoc getTopicName() {
35         return "topic_tab_" + id + "_selected";
36     }
37
38     protected void evaluateExtraParams() {
39         super.evaluateExtraParams();
40
41         addParameter("topicName", "topic_tab_" + id + "_selected");
42         addParameter("tabs", tabs);
43
44     }
45
46     public String JavaDoc getDefaultOpenTemplate() {
47         return TEMPLATE;
48     }
49
50     protected String JavaDoc getDefaultTemplate() {
51         return TEMPLATE_CLOSE;
52     }
53
54     public String JavaDoc getComponentName() {
55         return COMPONENT_NAME;
56     }
57 }
58
Popular Tags