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: /JADE/SourceCode/com/salmonllc/jsp/tags/CrumbleTag.java $
024: //$Author: Dan $
025: //$Revision: 6 $
026: //$Modtime: 10/30/02 2:40p $
027: ////////////////////////////////////////////////////////////
028:
029: import com.salmonllc.html.HtmlComponent;
030: import com.salmonllc.jsp.JspCookieCrumble;
031:
032: /**
033: * The CrumbleTag tag represents the crumbles in a CookieCrumble tag.
034: */
035: public class CrumbleTag extends BaseEmptyTag {
036: private String _fDisplay;
037: private String _fKey;
038: private String _fHref;
039:
040: /**
041: * There is no component for a crumble. It adds the crumble to it's parent CookieCrumble tag.
042: */
043: public HtmlComponent createComponent() {
044: CookieCrumbleTag cct = (CookieCrumbleTag) getParent();
045: HtmlComponent comp = cct.getHelper().getComponent();
046: // add to parent tag and return null
047: ((JspCookieCrumble) comp).addCrumble(_fKey, _fDisplay, _fHref);
048:
049: return null;
050: }
051:
052: /**
053: * Get the text that is to be displayed on the screen.
054: * @return java.lang.String
055: */
056: public java.lang.String getDisplay() {
057: return _fDisplay;
058: }
059:
060: /**
061: * Get the href that is to be used.
062: * @return java.lang.String
063: */
064: public java.lang.String getHref() {
065: return _fHref;
066: }
067:
068: /**
069: * Get the key to be used for looking up this crumble object.
070: * @return java.lang.String
071: */
072: public java.lang.String getKey() {
073: return _fKey;
074: }
075:
076: /**
077: * Release all resources used by the tag.
078: */
079: public void release() {
080: super .release();
081: _fDisplay = null;
082: _fKey = null;
083: _fHref = null;
084: }
085:
086: /**
087: * Sets the text that is to be displayed on the screen.
088: * @param newDisplay java.lang.String
089: */
090: public void setDisplay(java.lang.String newDisplay) {
091: _fDisplay = newDisplay;
092: }
093:
094: /**
095: * Sets the href that is to be used.
096: * @param newHref java.lang.String
097: */
098: public void setHref(java.lang.String newHref) {
099: _fHref = newHref;
100: }
101:
102: /**
103: * Sets the key that is to be used for looking up this crumble object.
104: * @param newKey java.lang.String
105: */
106: public void setKey(java.lang.String newKey) {
107: _fKey = newKey;
108: }
109: }
|