KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > openedit > webui > list > DefaultWebListNode


1 /*
2 Copyright (c) 2003 eInnovation Inc. All rights reserved
3
4 This library is free software; you can redistribute it and/or modify it under the terms
5 of the GNU Lesser General Public License as published by the Free Software Foundation;
6 either version 2.1 of the License, or (at your option) any later version.
7
8 This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
9 without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
10 See the GNU Lesser General Public License for more details.
11 */

12
13 package com.openedit.webui.list;
14
15 import javax.swing.ListModel JavaDoc;
16
17 /**
18  * This class represents a node in a <code>{@link ListModel}</code>. It has the attributes most
19  * people will need: name, URL, and icon URL.
20  *
21  * @author Eric and Matt
22  */

23 public class DefaultWebListNode
24 {
25     protected String JavaDoc fieldIconURL;
26     protected String JavaDoc fieldName;
27     protected String JavaDoc fieldURL;
28
29     /**
30      * Create a tree node with the given name, without an icon or link.
31      *
32      * @param inName DOCUMENT ME!
33      */

34     public DefaultWebListNode(String JavaDoc inName)
35     {
36         this(inName, null, null);
37     }
38
39     /**
40      * Create a tree node with the given name and link, without an icon.
41      *
42      * @param inName DOCUMENT ME!
43      * @param inURL DOCUMENT ME!
44      */

45     public DefaultWebListNode(String JavaDoc inName, String JavaDoc inURL)
46     {
47         this(inName, inURL, null);
48     }
49
50     /**
51      * Create a tree node with the given name, link, and icon.
52      *
53      * @param inName DOCUMENT ME!
54      * @param inURL DOCUMENT ME!
55      * @param inIconURL DOCUMENT ME!
56      */

57     public DefaultWebListNode(String JavaDoc inName, String JavaDoc inURL, String JavaDoc inIconURL)
58     {
59         fieldName = inName;
60         fieldURL = inURL;
61         fieldIconURL = inIconURL;
62     }
63
64     /**
65      * Sets the icon URL.
66      *
67      * @param iconURL The icon URL to set
68      */

69     public void setIconURL(String JavaDoc iconURL)
70     {
71         fieldIconURL = iconURL;
72     }
73
74     /**
75      * Gets the icon URL.
76      *
77      * @return Returns a String
78      */

79     public String JavaDoc getIconURL()
80     {
81         return fieldIconURL;
82     }
83
84     /**
85      * Sets the name.
86      *
87      * @param name The name to set
88      */

89     public void setName(String JavaDoc name)
90     {
91         fieldName = name;
92     }
93
94     /**
95      * Gets the name.
96      *
97      * @return Returns a String
98      */

99     public String JavaDoc getName()
100     {
101         return fieldName;
102     }
103
104     /**
105      * Sets the URL.
106      *
107      * @param url The URL to set
108      */

109     public void setURL(String JavaDoc url)
110     {
111         fieldURL = url;
112     }
113
114     /**
115      * Gets the URL.
116      *
117      * @return Returns a String
118      */

119     public String JavaDoc getURL()
120     {
121         return fieldURL;
122     }
123 }
124
Popular Tags