01: /**
02: * Copyright 2007 Webmedia Group Ltd.
03: *
04: * Licensed under the Apache License, Version 2.0 (the "License");
05: * you may not use this file except in compliance with the License.
06: * You may obtain a copy of the License at
07: *
08: * http://www.apache.org/licenses/LICENSE-2.0
09: *
10: * Unless required by applicable law or agreed to in writing, software
11: * distributed under the License is distributed on an "AS IS" BASIS,
12: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13: * See the License for the specific language governing permissions and
14: * limitations under the License.
15: **/package org.araneaframework.jsp.tag.uilib.tab;
16:
17: import java.io.Writer;
18: import javax.servlet.jsp.JspException;
19: import org.araneaframework.jsp.tag.BaseTag;
20: import org.araneaframework.uilib.tab.TabContainerWidget;
21:
22: /**
23: * @jsp.tag
24: * name = "tabs"
25: * body-content = "empty"
26: * description = "Writes out tabs' labels and the active tab content."
27: *
28: * @author Taimo Peelo (taimo@araneaframework.org)
29: *
30: * @see TabContainerWidget
31: * @see TabContainerHtmlTag
32: * @see TabBodyTag
33: *
34: * @since 1.1
35: */
36: public class TabsHtmlTag extends BaseTag {
37: protected String id;
38:
39: protected int doStartTag(Writer out) throws Exception {
40: TabContainerHtmlTag tabContainerHtmlTag = new TabContainerHtmlTag();
41: tabContainerHtmlTag.setId(id);
42: registerAndExecuteStartTag(tabContainerHtmlTag);
43:
44: TabBodyTag tabBodyTag = new TabBodyTag();
45: registerAndExecuteStartTag(tabBodyTag);
46: executeEndTagAndUnregister(tabBodyTag);
47:
48: executeEndTagAndUnregister(tabContainerHtmlTag);
49:
50: return SKIP_BODY;
51: }
52:
53: protected int doEndTag(Writer out) throws Exception {
54: return super .doEndTag(out);
55: }
56:
57: /**
58: * @jsp.attribute
59: * type = "java.lang.String"
60: * required = "true"
61: * description = "Id of Uilib TabContainerWidget"
62: */
63: public void setId(String id) throws JspException {
64: this .id = (String) evaluateNotNull("id", id, String.class);
65: }
66: }
|