001: //** Copyright Statement ***************************************************
002: //The Salmon Open Framework for Internet Applications (SOFIA)
003: // Copyright (C) 1999 - 2002, Salmon LLC
004: //
005: // This program is free software; you can redistribute it and/or
006: // modify it under the terms of the GNU General Public License version 2
007: // as published by the Free Software Foundation;
008: //
009: // This program is distributed in the hope that it will be useful,
010: // but WITHOUT ANY WARRANTY; without even the implied warranty of
011: // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
012: // GNU General Public License for more details.
013: //
014: // You should have received a copy of the GNU General Public License
015: // along with this program; if not, write to the Free Software
016: // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
017: //
018: // For more information please visit http://www.salmonllc.com
019: //** End Copyright Statement ***************************************************
020: package com.salmonllc.jsp.tags;
021:
022: /////////////////////////
023: //$Archive: /SOFIA/SourceCode/com/salmonllc/jsp/tags/NavBarItemTag.java $
024: //$Author: Srufle $
025: //$Revision: 16 $
026: //$Modtime: 4/15/03 10:24a $
027: /////////////////////////
028: import com.salmonllc.html.HtmlComponent;
029: import com.salmonllc.jsp.JspNavBar;
030:
031: /**
032: * Represents a line item in a nav bar
033: */
034: public class NavBarItemTag extends BaseEmptyTag {
035: private String _title;
036: private String _href;
037: private String _hspace;
038: private String _target;
039: private String _bgcolor;
040: private String _showpopup;
041: private String _subMenuName;
042:
043: /**
044: * This method creates a NavBarItem. Must find the NavBar Tag and the last group added. Will be placed in this group
045: */
046: public HtmlComponent createComponent() {
047: NavBarTag nbt = getHelper().getNavBarTag();
048: if (nbt != null) {
049: JspNavBar nb = (JspNavBar) nbt.getHelper().getComponent();
050: boolean showPopup = true;
051: if (_showpopup != null)
052: showPopup = new Boolean(_showpopup).booleanValue();
053: nb.addGroupItem(getName(), nb.getLastGroupAdded(), _title,
054: _href, _target, BaseTagHelper.stringToInt(_hspace),
055: _bgcolor, _subMenuName, showPopup);
056: }
057: return null;
058: }
059:
060: /**
061: * Get the Bg Color attribute for the tag
062: */
063: public String getBgcolor() {
064: return _bgcolor;
065: }
066:
067: /**
068: * Get the Href attribute for the tag
069: */
070: public String getHref() {
071: return _href;
072: }
073:
074: /**
075: * Get the Hspace attribute for the tag
076: */
077: public String getHspace() {
078: return _hspace;
079: }
080:
081: /**
082: * Get the Show Popup attribute for the tag
083: */
084: public String getShowpopu() {
085: return _showpopup;
086: }
087:
088: /**
089: * Get the SubMenu attribute for the tag
090: */
091: public String getSubmenuname() {
092: return _subMenuName;
093: }
094:
095: /**
096: * Get the Target attribute for the tag
097: */
098: public String getTarget() {
099: return _target;
100: }
101:
102: /**
103: * Get the Title attribute for the tag
104: */
105: public String getTitle() {
106: return _title;
107: }
108:
109: /**
110: * Part of the tag library specification. Clears all resources used by the tag.
111: */
112: public void release() {
113: super .release();
114: _title = null;
115: _href = null;
116: _hspace = null;
117: _target = null;
118: _subMenuName = null;
119: _bgcolor = null;
120: _showpopup = null;
121: }
122:
123: /**
124: * This method sets the Bg Color attribute for the tag
125: */
126: public void setBgcolor(String val) {
127: _bgcolor = val;
128: }
129:
130: /**
131: * This method sets the Href attribute for the tag
132: */
133: public void setHref(String val) {
134: _href = val;
135: }
136:
137: /**
138: * This method sets the Horizontal space attribute for the tag
139: */
140: public void setHspace(String val) {
141: _hspace = val;
142: }
143:
144: /**
145: * This method sets the Show Popup attribute for the tag
146: */
147: public void setShowpopup(String val) {
148: _showpopup = val;
149: }
150:
151: /**
152: * This method sets the Submenu Name attribute for the tag
153: */
154: public void setSubmenuname(String val) {
155: _subMenuName = val;
156: }
157:
158: /**
159: * This method sets the Target attribute for the tag
160: */
161: public void setTarget(String val) {
162: _target = val;
163: }
164:
165: /**
166: * This method sets the Title attribute for the tag
167: */
168: public void setTitle(String val) {
169: _title = val;
170: }
171: }
|