01: /*
02: * Copyright 2001 Sun Microsystems, Inc. All rights reserved.
03: * PROPRIETARY/CONFIDENTIAL. Use of this product is subject to license terms.
04: */
05: package com.sun.portal.desktop.taglib.container.tab;
06:
07: import javax.servlet.jsp.JspException;
08:
09: import com.sun.portal.desktop.taglib.BaseDesktopTagSupport;
10: import com.sun.portal.desktop.taglib.DesktopTaglibException;
11: import com.sun.portal.providers.containers.jsp.tab.UnmodifiableTab;
12: import com.sun.portal.providers.ProviderException;
13: import com.sun.portal.providers.containers.jsp.tab.JSPTabContainerProvider;
14:
15: public class ObtainTabByNameTag extends BaseTabContainerTagSupport {
16: private UnmodifiableTab mTab = null;
17:
18: public void setName(String name) throws DesktopTaglibException {
19: String tabName = resolveParameter(name).toString();
20: JSPTabContainerProvider tcp = (JSPTabContainerProvider) getCurrentObj();
21: try {
22: mTab = tcp.getTab(tabName);
23: } catch (ProviderException pe) {
24: throw new DesktopTaglibException(pe);
25: }
26: }
27:
28: public int doStartTag() throws JspException {
29: setCurrentTab(mTab);
30: return EVAL_BODY_INCLUDE;
31: }
32:
33: public int doEndTag() throws JspException {
34: setCurrentTab(null);
35: return EVAL_PAGE;
36: }
37: }
|