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.html;
021:
022: import java.io.Serializable;
023:
024: /////////////////////////
025: //$Archive: /SOFIA/SourceCode/com/salmonllc/html/HtmlOption.java $
026: //$Author: Saqib $
027: //$Revision: 5 $
028: //$Modtime: 4/22/04 4:23p $
029: /////////////////////////
030:
031: /**
032: * This type is used for the options in the HtmlDropDownList.
033: */
034: public class HtmlOption implements Serializable, Cloneable {
035: private String _classname;
036: private String _display;
037: private String _key;
038: private String _style;
039: private boolean _selected;
040:
041: /**
042: * This method is the default Constructor
043: */
044: public HtmlOption() {
045: super ();
046: }
047:
048: public HtmlOption(String key, String disp) {
049: this (key, disp, false);
050:
051: }
052:
053: public HtmlOption(String key, String disp, boolean selected) {
054: super ();
055: setKey(key);
056: setDisplay(disp);
057: setSelected(selected);
058:
059: }
060:
061: /**
062: * Sets the classname.
063: *
064: * @param classname The classname to set
065: */
066: public void setClassname(String classname) {
067: _classname = classname;
068: }
069:
070: /**
071: * Returns the classname.
072: *
073: * @return String
074: */
075: public String getClassname() {
076: return _classname;
077: }
078:
079: /**
080: * Sets the display.
081: *
082: * @param display The display to set
083: */
084: public void setDisplay(String display) {
085: _display = display;
086: }
087:
088: /**
089: * Returns the display.
090: *
091: * @return String
092: */
093: public String getDisplay() {
094: return _display;
095: }
096:
097: /**
098: * Sets the key.
099: *
100: * @param key The key to set
101: */
102: public void setKey(String key) {
103: _key = key;
104: }
105:
106: /**
107: * Returns the key.
108: *
109: * @return String
110: */
111: public String getKey() {
112: return _key;
113: }
114:
115: /**
116: * Sets the style.
117: *
118: * @param style The style to set
119: */
120: public void setStyle(String style) {
121: _style = style;
122: }
123:
124: /**
125: * Returns the style.
126: *
127: * @return String
128: */
129: public String getStyle() {
130: return _style;
131: }
132:
133: /**
134: * @see java.lang.Object#toString()
135: */
136: public String toString() {
137: String ret = super .toString();
138: ret += "\nKey:'" + getKey() + "'";
139: ret += "\nDisplay:'" + getDisplay() + "'";
140:
141: return ret;
142: }
143:
144: /**
145: * Returns the selected.
146: * @return boolean
147: */
148: public boolean isSelected() {
149: return _selected;
150: }
151:
152: /**
153: * Sets the selected.
154: * @param selected The selected to set
155: */
156: public void setSelected(boolean selected) {
157: _selected = selected;
158: }
159:
160: public Object clone() throws CloneNotSupportedException {
161: return super.clone();
162: }
163:
164: }
|