KickJava   Java API By Example, From Geeks To Geeks.

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


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.engine;
13
14 import java.util.Locale JavaDoc;
15 import java.util.Set JavaDoc;
16
17 /**
18  * Interface for spell checkers.
19  *
20  * @since 3.0
21  */

22 public interface ISpellChecker {
23
24     /**
25      * Adds a dictionary to the list of active dictionaries.
26      *
27      * @param dictionary
28      * The dictionary to add
29      */

30     void addDictionary(ISpellDictionary dictionary);
31
32     /**
33      * Adds a spell event listener to the active listeners.
34      *
35      * @param listener
36      * The listener to add
37      */

38     void addListener(ISpellEventListener listener);
39
40     /**
41      * Returns whether this spell checker accepts word additions.
42      *
43      * @return <code>true</code> if word additions are accepted, <code>false</code> otherwise
44      */

45     boolean acceptsWords();
46
47     /**
48      * Adds the specified word to the set of correct words.
49      *
50      * @param word
51      * The word to add to the set of correct words
52      */

53     void addWord(String JavaDoc word);
54
55     /**
56      * Checks the specified word until calling <code>ignoreWord(String)</code>.
57      *
58      * @param word
59      * The word to check
60      */

61     void checkWord(String JavaDoc word);
62
63     /**
64      * Checks the spelling with the spell check iterator. Implementations must
65      * be thread safe as this may be called inside a reconciler thread.
66      *
67      * @param iterator
68      * The iterator to use for spell checking
69      */

70     void execute(ISpellCheckIterator iterator);
71
72     /**
73      * Returns the ranked proposals for a word.
74      *
75      * @param word
76      * The word to retrieve the proposals for
77      * @param sentence
78      * <code>true</code> iff the proposals should start a
79      * sentence, <code>false</code> otherwise
80      * @return Set of ranked proposals for the word
81      */

82     Set JavaDoc getProposals(String JavaDoc word, boolean sentence);
83
84     /**
85      * Ignores the specified word until calling <code>checkWord(String)</code>.
86      *
87      * @param word
88      * The word to ignore
89      */

90     void ignoreWord(String JavaDoc word);
91
92     /**
93      * Is the specified word correctly spelled? Implementations must be thread
94      * safe as this may be called from within a reconciler thread.
95      *
96      * @param word
97      * The word to check its spelling
98      * @return <code>true</code> iff the word is correctly spelled, <code>false</code>
99      * otherwise
100      */

101     boolean isCorrect(String JavaDoc word);
102
103     /**
104      * Remove a dictionary from the list of active dictionaries.
105      *
106      * @param dictionary
107      * The dictionary to remove
108      */

109     void removeDictionary(ISpellDictionary dictionary);
110
111     /**
112      * Removes a spell event listener from the active listeners.
113      *
114      * @param listener
115      * The listener to remove
116      */

117     void removeListener(ISpellEventListener listener);
118     
119     /**
120      * Returns the current locale of the spell check engine.
121      *
122      * @return The current locale of the engine
123      * @since 3.3
124      */

125     Locale JavaDoc getLocale();
126 }
127
Popular Tags