001: /**
002: * JOnAS: Java(TM) Open Application Server
003: * Copyright (C) 1999 Bull S.A.
004: * Contact: jonas-team@objectweb.org
005: *
006: * This library is free software; you can redistribute it and/or
007: * modify it under the terms of the GNU Lesser General Public
008: * License as published by the Free Software Foundation; either
009: * version 2.1 of the License, or 1any later version.
010: *
011: * This library is distributed in the hope that it will be useful,
012: * but WITHOUT ANY WARRANTY; without even the implied warranty of
013: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
014: * Lesser General Public License for more details.
015: *
016: * You should have received a copy of the GNU Lesser General Public
017: * License along with this library; if not, write to the Free Software
018: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
019: * USA
020: *
021: * Initial developer: Florent BENOIT
022: * --------------------------------------------------------------------------
023: * $Id: Icon.java 4718 2004-05-10 12:06:09Z sauthieg $
024: * --------------------------------------------------------------------------
025: */package org.objectweb.jonas_lib.deployment.xml;
026:
027: /**
028: * This class defines the implementation of the element icon.
029: * @author Florent Benoit
030: */
031: public class Icon extends AbsElement {
032:
033: /**
034: * Name of the small icon
035: */
036: private String smallIcon = null;
037:
038: /**
039: * Name of the large icon
040: */
041: private String largeIcon = null;
042:
043: // Setters
044:
045: /**
046: * Sets the small icon name
047: * @param smallIcon the name of the file for small GIF or JPEG icon image
048: */
049: public void setSmallIcon(String smallIcon) {
050: this .smallIcon = smallIcon;
051: }
052:
053: /**
054: * Sets the large icon name
055: * @param largeIcon the name of the file for large GIF or JPEG icon image
056: */
057: public void setLargeIcon(String largeIcon) {
058: this .largeIcon = largeIcon;
059: }
060:
061: // Getters
062:
063: /**
064: * @return the small icon name
065: */
066: public String getSmallIcon() {
067: return smallIcon;
068: }
069:
070: /**
071: * @return the large icon name
072: */
073: public String getLargeIcon() {
074: return largeIcon;
075: }
076:
077: /**
078: * Represents this element by it's XML description.
079: * @param indent use this indent for prexifing XML representation.
080: * @return the XML description of this object.
081: */
082: public String toXML(int indent) {
083: StringBuffer sb = new StringBuffer();
084: sb.append(indent(indent));
085: sb.append("<icon>\n");
086:
087: indent += 2;
088:
089: // small-icon
090: sb.append(xmlElement(smallIcon, "small-icon", indent));
091:
092: // large-icon
093: sb.append(xmlElement(largeIcon, "large-icon", indent));
094:
095: indent -= 2;
096: sb.append(indent(indent));
097: sb.append("</icon>\n");
098:
099: return sb.toString();
100: }
101:
102: }
|