KickJava   Java API By Example, From Geeks To Geeks.

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


1 /*******************************************************************************
2  * Copyright (c) 2000, 2007 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
16 import org.eclipse.jdt.ui.PreferenceConstants;
17
18 /**
19  * Interface for a spell check engine.
20  * <p>
21  * This engine can be configured with multiple
22  * dictionaries.
23  * </p>
24  *
25  * @since 3.0
26  */

27 public interface ISpellCheckEngine {
28
29     /**
30      * Returns a spell checker configured with the global
31      * dictionaries and the locale dictionary that correspond to the current
32      * {@linkplain PreferenceConstants#SPELLING_LOCALE locale preference}.
33      * <p>
34      * <strong>Note:</strong> Changes to the spelling engine dictionaries
35      * are not propagated to this spell checker.</p>
36      *
37      * @return a configured instance of the spell checker or <code>null</code> if none
38      * @throws IllegalStateException if called after being shut down
39      */

40     ISpellChecker getSpellChecker() throws IllegalStateException JavaDoc;
41
42     /**
43      * Returns the locale of the current spell check engine.
44      *
45      * @return the locale of the current spell check engine
46      */

47     Locale JavaDoc getLocale();
48
49     /**
50      * Registers a global dictionary.
51      *
52      * @param dictionary the global dictionary to register
53      */

54     void registerGlobalDictionary(ISpellDictionary dictionary);
55
56     /**
57      * Registers a dictionary tuned for the specified locale with this engine.
58      *
59      * @param locale
60      * The locale to register the dictionary with
61      * @param dictionary
62      * The dictionary to register
63      */

64     void registerDictionary(Locale JavaDoc locale, ISpellDictionary dictionary);
65
66     /**
67      * Shuts down this spell check engine and its associated components.
68      * <p>
69      * Further calls to this engine result in exceptions.
70      * </p>
71      */

72     void shutdown();
73
74     /**
75      * Unregisters a dictionary previously registered either by a call to
76      * <code>registerDictionary(Locale,ISpellDictionary)</code> or <code>registerDictionary(ISpellDictionary)</code>.
77      * <p>
78      * If the dictionary was not registered before, nothing happens.</p>
79      *
80      * @param dictionary the dictionary to unregister
81      */

82     void unregisterDictionary(ISpellDictionary dictionary);
83     
84 }
85
Popular Tags