KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > editor > ext > html > javadoc > TagHelpItem


1 /*
2  * The contents of this file are subject to the terms of the Common Development
3  * and Distribution License (the License). You may not use this file except in
4  * compliance with the License.
5  *
6  * You can obtain a copy of the License at http://www.netbeans.org/cddl.html
7  * or http://www.netbeans.org/cddl.txt.
8  *
9  * When distributing Covered Code, include this CDDL Header Notice in each file
10  * and include the License file at http://www.netbeans.org/cddl.txt.
11  * If applicable, add the following below the CDDL Header, with the fields
12  * enclosed by brackets [] replaced by your own identifying information:
13  * "Portions Copyrighted [year] [name of copyright owner]"
14  *
15  * The Original Software is NetBeans. The Initial Developer of the Original
16  * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
17  * Microsystems, Inc. All Rights Reserved.
18  */

19
20 package org.netbeans.editor.ext.html.javadoc;
21
22 /**
23  *
24  * @author Petr Pisl
25  */

26 public class TagHelpItem implements HelpItem {
27
28     private String JavaDoc identical;
29
30     /**
31      * Holds value of property startText.
32      */

33     private String JavaDoc startText;
34
35     /**
36      * Holds value of property startTextOffset.
37      */

38     private int startTextOffset;
39
40     /**
41      * Holds value of property endText.
42      */

43     private String JavaDoc endText;
44
45     /**
46      * Holds value of property endTextOffset.
47      */

48     private int endTextOffset;
49
50     /**
51      * Holds value of property textBefore.
52      */

53     private String JavaDoc textBefore;
54
55     /**
56      * Holds value of property textAfter.
57      */

58     private String JavaDoc textAfter;
59
60     /**
61      * Holds value of property file.
62      */

63     private String JavaDoc file;
64
65     /**
66      * Holds value of property name.
67      */

68     private String JavaDoc name;
69     
70     /** Creates a new instance of HelpItem */
71     
72     public TagHelpItem(String JavaDoc name, String JavaDoc identical) {
73         this.identical = identical;
74         this.name = name;
75         file = null;
76         startTextOffset = 0;
77         startText = null;
78         endTextOffset = 0;
79         endText = null;
80         textBefore = null;
81         textAfter = null;
82     }
83     
84     public TagHelpItem (String JavaDoc name){
85         this.name = name;
86         file = null;
87         startTextOffset = 0;
88         startText = null;
89         endTextOffset = 0;
90         endText = null;
91         textBefore = null;
92         textAfter = null;
93         identical = null;
94         
95     }
96     public TagHelpItem(String JavaDoc name, String JavaDoc file,
97                        String JavaDoc startText, int startOffset,
98                        String JavaDoc endText, int endOffset,
99                        String JavaDoc textBefore, String JavaDoc textAfter){
100         this.name = name;
101         this.file = file;
102         this.startText = startText;
103         this.startTextOffset = startTextOffset;
104         this.endText = endText;
105         this.endTextOffset = endTextOffset;
106         this.textBefore = textBefore;
107         this.textAfter = textAfter;
108         this.identical = null;
109     }
110     
111     public TagHelpItem(String JavaDoc name, String JavaDoc file, String JavaDoc startText, int startOffset,
112                        String JavaDoc endText, int endOffset){
113         this(name, file, startText, startOffset, endText, endOffset, null, null);
114     }
115     
116     
117
118     /**
119      * Getter for property identical.
120      * @return Value of property identical.
121      */

122     public String JavaDoc getIdentical() {
123         return this.identical;
124     }
125
126     
127     /**
128      * Getter for property startText.
129      * @return Value of property startText.
130      */

131     public String JavaDoc getStartText() {
132
133         return this.startText;
134     }
135
136     /**
137      * Getter for property startTextOffset.
138      * @return Value of property startTextOffset.
139      */

140     public int getStartTextOffset() {
141
142         return this.startTextOffset;
143     }
144
145     /**
146      * Getter for property endText.
147      * @return Value of property endText.
148      */

149     public String JavaDoc getEndText() {
150
151         return this.endText;
152     }
153
154     /**
155      * Getter for property endTextOffset.
156      * @return Value of property endTextOffset.
157      */

158     public int getEndTextOffset() {
159
160         return this.endTextOffset;
161     }
162
163     /**
164      * Getter for property textBefore.
165      * @return Value of property textBefore.
166      */

167     public String JavaDoc getTextBefore() {
168
169         return this.textBefore;
170     }
171
172     /**
173      * Getter for property textAfter.
174      * @return Value of property textAfter.
175      */

176     public String JavaDoc getTextAfter() {
177
178         return this.textAfter;
179     }
180
181     public String JavaDoc getHelp(){
182         return "help for key "; // NOI18N
183
}
184
185     /**
186      * Getter for property file.
187      * @return Value of property file.
188      */

189     public String JavaDoc getFile() {
190
191         return this.file;
192     }
193
194     /**
195      * Setter for property endText.
196      * @param endText New value of property endText.
197      */

198     public void setEndText(String JavaDoc endText) {
199         this.endText = endText;
200     }
201
202     /**
203      * Setter for property endTextOffset.
204      * @param endTextOffset New value of property endTextOffset.
205      */

206     public void setEndTextOffset(int endTextOffset) {
207         this.endTextOffset = endTextOffset;
208     }
209
210     /**
211      * Setter for property file.
212      * @param file New value of property file.
213      */

214     public void setFile(String JavaDoc file) {
215         this.file = file;
216     }
217
218     /**
219      * Setter for property identical.
220      * @param identical New value of property identical.
221      */

222     public void setIdentical(String JavaDoc identical) {
223         this.identical = identical;
224     }
225
226     /**
227      * Setter for property startText.
228      * @param startText New value of property startText.
229      */

230     public void setStartText(String JavaDoc startText) {
231         this.startText = startText;
232     }
233
234     /**
235      * Setter for property startTextOffset.
236      * @param startTextOffset New value of property startTextOffset.
237      */

238     public void setStartTextOffset(int startTextOffset) {
239         this.startTextOffset = startTextOffset;
240     }
241
242     /**
243      * Setter for property textAfter.
244      * @param textAfter New value of property textAfter.
245      */

246     public void setTextAfter(String JavaDoc textAfter) {
247         this.textAfter = textAfter;
248     }
249
250     /**
251      * Setter for property textBefore.
252      * @param textBefore New value of property textBefore.
253      */

254     public void setTextBefore(String JavaDoc textBefore) {
255         this.textBefore = textBefore;
256     }
257
258     /**
259      * Getter for property name.
260      * @return Value of property name.
261      */

262     public String JavaDoc getName() {
263
264         return this.name;
265     }
266
267     /**
268      * Setter for property name.
269      * @param name New value of property name.
270      */

271     public void setName(String JavaDoc name) {
272
273         this.name = name;
274     }
275     
276     public String JavaDoc toString(){
277         StringBuffer JavaDoc sb = new StringBuffer JavaDoc();
278         sb.append(name);
279         if (identical == null){
280             sb.append("\n file: "); // NOI18N
281
sb.append(file);
282             sb.append("\n start text: "); // NOI18N
283
sb.append(startText);
284             sb.append("\n start text offset: "); // NOI18N
285
sb.append(startTextOffset);
286             sb.append("\n end text: "); // NOI18N
287
sb.append(endText);
288             sb.append("\n end text offset: "); // NOI18N
289
sb.append(endTextOffset);
290             sb.append("\n text before: "); // NOI18N
291
sb.append(textBefore);
292             sb.append("\n text after: "); // NOI18N
293
sb.append(textAfter);
294         }
295         else{
296             sb.append("\n indentical to: "); // NOI18N
297
sb.append(identical);
298         }
299         return sb.toString();
300     }
301 }
302
Popular Tags