    001    package sidekick.enhanced;
    002
    003    import javax.swing.text.*;
    004    import javax.swing.Icon;
    005    import javax.swing.ImageIcon;
    006
    007    import sidekick.Asset;
    008
    009
    010    /**
    011     * SourceAsset: extends sidekick.Asset, provides the nodes for a structure tree
    012     *
    013     * @author     Martin Raspe
    014     * @created    Oct 15, 2005
    015     * @modified   $Id: SourceAsset.java,v 1.4 2006/03/21 20:30:35 hertzhaft Exp $
    016     * @version    $Revision: 1.4 $
    017     */
    018    public class SourceAsset extends Asset {
    019            private String shortDesc;
    020            private String longDesc;
    021            private Icon _icon;
    022            private int _lineNo;
    023            private int _type;
    024
    025            public SourceAsset() {
    026                    super("SourceAsset");
    027                    }
    028
    029            public SourceAsset(String name, int lineNo, Position start) {
    030                    super(name);
    031                    this.start = start;
    032                    this.end = start;
    033                    this.shortDesc = name;
    034                    this.longDesc = "";
    035                    if (lineNo > 0)
    036                            this.longDesc = "Line: " + lineNo;
    037                    _lineNo = lineNo;
    038                    }
    039
    040            public int getLineNo() {
    041                    return _lineNo;
    042                    }
    043
    044            public Icon getIcon() {
    045                    return _icon;
    046                    }
    047
    048            public void setIcon(ImageIcon icon) {
    049                    _icon = icon;
    050                    }
    051
    052            public int get_type() {
    053                    return _type;
    054                    }
    055
    056            public String getShortString() {
    057                    return shortDesc;
    058                    }
    059
    060            public String getLongString() {
    061                    return longDesc;
    062                    }
    063
    064            public String getShortDescription() {
    065                    return shortDesc;
    066                    }
    067
    068            public String getLongDescription() {
    069                    return longDesc;
    070                    }
    071
    072            public void setShort(String shortDesc) {
    073                    this.shortDesc = shortDesc;
    074                    }
    075
    076            public void setLong(String longDesc) {
    077                    this.longDesc = longDesc;
    078                    }
    079
    080            public void setShortDescription(String shortDesc) {
    081                    this.shortDesc = shortDesc;
    082                    }
    083
    084            public void setLongDescription(String longDesc) {
    085                    this.longDesc = longDesc;
    086                    }
    087
    088            public String toString() {
    089                    return shortDesc + " " + longDesc;
    090                    }
    091
    092    }