KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > jdt > internal > ui > text > spelling > JavaDocTagDictionary


1 /*******************************************************************************
2  * Copyright (c) 2000, 2006 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  * IBM Corporation - initial API and implementation
10  *******************************************************************************/

11
12 package org.eclipse.jdt.internal.ui.text.spelling;
13
14 import java.net.URL JavaDoc;
15
16 import org.eclipse.jdt.internal.ui.text.spelling.engine.AbstractSpellDictionary;
17
18 import org.eclipse.jdt.internal.ui.text.javadoc.IJavaDocTagConstants;
19
20 /**
21  * Dictionary for Javadoc tags.
22  *
23  * @since 3.0
24  */

25 public class JavaDocTagDictionary extends AbstractSpellDictionary implements IJavaDocTagConstants {
26
27     /*
28      * @see org.eclipse.jdt.internal.ui.text.spelling.engine.AbstractSpellDictionary#getName()
29      */

30     protected final URL JavaDoc getURL() {
31         return null;
32     }
33
34     /*
35      * @see org.eclipse.jdt.internal.ui.text.spelling.engine.ISpellDictionary#isCorrect(java.lang.String)
36      */

37     public boolean isCorrect(final String JavaDoc word) {
38
39         if (word.charAt(0) == JAVADOC_TAG_PREFIX)
40             return super.isCorrect(word);
41
42         return false;
43     }
44
45     /*
46      * @see org.eclipse.jdt.ui.text.spelling.engine.AbstractSpellDictionary#load(java.net.URL)
47      */

48     protected synchronized boolean load(final URL JavaDoc url) {
49
50         unload();
51
52         for (int index= 0; index < JAVADOC_LINK_TAGS.length; index++)
53             hashWord(JAVADOC_LINK_TAGS[index]);
54
55         for (int index= 0; index < JAVADOC_ROOT_TAGS.length; index++)
56             hashWord(JAVADOC_ROOT_TAGS[index]);
57
58         for (int index= 0; index < JAVADOC_PARAM_TAGS.length; index++)
59             hashWord(JAVADOC_PARAM_TAGS[index]);
60
61         return true;
62     }
63     
64     /*
65      * @see org.eclipse.jdt.internal.ui.text.spelling.engine.AbstractSpellDictionary#stripNonLetters(java.lang.String)
66      * @since 3.3
67      */

68     protected String JavaDoc stripNonLetters(String JavaDoc word) {
69         return word;
70     }
71
72 }
73
Popular Tags