01: /**
02: * @author <a href="mailto:novotny@gridsphere.org">Jason Novotny</a>
03: * @version $Id: TabTag.java 6385 2007-10-25 14:02:26Z wehrens $
04: */package org.gridsphere.provider.portletui.tags;
05:
06: import org.gridsphere.provider.portletui.beans.TabBean;
07:
08: import javax.servlet.jsp.JspException;
09:
10: /**
11: * The <code>TableRowTag</code> represents a table row element that is conatined within a <code>TableTag</code>
12: * and itself may contain <code>TableCellTag</code>s
13: */
14: public class TabTag extends BaseComponentTag {
15:
16: protected boolean isActive = false;
17:
18: protected String label = "";
19: protected String page = null;
20:
21: public void setActive(boolean isActive) {
22: this .isActive = isActive;
23: }
24:
25: public boolean getActive() {
26: return isActive;
27: }
28:
29: public void setLabel(String label) {
30: this .label = label;
31: }
32:
33: public String getLabel() {
34: return label;
35: }
36:
37: public void setPage(String page) {
38: this .page = page;
39: }
40:
41: public String getPage() {
42: return page;
43: }
44:
45: public void release() {
46: super .release();
47: }
48:
49: public int doStartTag() throws JspException {
50: TabbedPaneTag tabbedPaneTag = (TabbedPaneTag) findAncestorWithClass(
51: this , TabbedPaneTag.class);
52: if (tabbedPaneTag != null) {
53: TabBean tab = new TabBean();
54: tab.setPage(page);
55: if (key != null) {
56: value = getLocalizedText(key);
57: }
58: tab.setValue(value);
59: tab.setLabel(label);
60: tabbedPaneTag.addTabBean(tab);
61: }
62: return SKIP_BODY;
63: }
64:
65: public int doEndTag() throws JspException {
66: return EVAL_PAGE;
67: }
68: }
|