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.table;
06:
07: import javax.servlet.jsp.JspException;
08: import javax.servlet.http.HttpServletRequest;
09:
10: import com.sun.portal.desktop.taglib.BaseDesktopTagSupport;
11: import com.sun.portal.desktop.taglib.DesktopTaglibException;
12: import com.sun.portal.providers.ProviderException;
13: import com.sun.portal.providers.containers.jsp.table.JSPTableContainerProvider;
14:
15: public class GetColumnWidthTag extends BaseDesktopTagSupport {
16: private int m_column = 0;
17:
18: public void setColumn(String column) throws JspException {
19: column = resolveParameter(column).toString();
20: if (column.equalsIgnoreCase("left")) {
21: m_column = JSPTableContainerProvider.LEFT;
22: } else if (column.equalsIgnoreCase("right")) {
23: m_column = JSPTableContainerProvider.RIGHT;
24: } else if (column.equalsIgnoreCase("center")) {
25: m_column = JSPTableContainerProvider.CENTER;
26: } else {
27: throw new DesktopTaglibException(
28: DesktopTaglibException.INVALID_PARAMETER, column);
29: }
30: }
31:
32: public int doStartTag() throws JspException {
33: JSPTableContainerProvider tcp = (JSPTableContainerProvider) getCurrentObj();
34: int result = -1;
35: try {
36: result = tcp.getWidths(m_column);
37: } catch (ProviderException pe) {
38: throw new DesktopTaglibException(pe);
39: }
40: processResult(new Integer(result));
41: return SKIP_BODY;
42: }
43:
44: }
|