1 /*******************************************************************************
2 * Copyright (c) 2000, 2008 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
9 * IBM Corporation - initial API and implementation
10 *******************************************************************************/
12 package org.eclipse.jdt.internal.ui.text.spelling.engine;
14 import java.util.Locale;
16 import org.eclipse.jdt.ui.PreferenceConstants;
19 * Interface for a spell check engine.
21 * This engine can be configured with multiple
27 public interface ISpellCheckEngine {
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}.
34 * <strong>Note:</strong> Changes to the spelling engine dictionaries
35 * are not propagated to this spell checker.</p>
37 * @return a configured instance of the spell checker or <code>null</code> if none
38 * @throws IllegalStateException if called after being shut down
40 ISpellChecker getSpellChecker() throws IllegalStateException;
43 * Returns the locale of the current spell check engine.
45 * @return the locale of the current spell check engine
50 * Registers a global dictionary.
52 * @param dictionary the global dictionary to register
54 void registerGlobalDictionary(ISpellDictionary dictionary);
57 * Registers a dictionary tuned for the specified locale with this engine.
60 * The locale to register the dictionary with
62 * The dictionary to register
64 void registerDictionary(Locale locale, ISpellDictionary dictionary);
67 * Shuts down this spell check engine and its associated components.
69 * Further calls to this engine result in exceptions.
75 * Unregisters a dictionary previously registered either by a call to
76 * <code>registerDictionary(Locale,ISpellDictionary)</code> or <code>registerDictionary(ISpellDictionary)</code>.
78 * If the dictionary was not registered before, nothing happens.</p>
80 * @param dictionary the dictionary to unregister
82 void unregisterDictionary(ISpellDictionary dictionary);