public interface SpellChecker extends ProfileService
Modifier and Type | Method and Description |
---|---|
void |
addLanguage(Language language)
Adds the language to the list of the languages for which spell checking is performed.
|
Dictionary |
customDictionary()
Returns the custom dictionary.
|
void |
disable()
Disables spell checking on the web pages loaded in the browser instances of the profile.
|
void |
enable()
Enables spell checking on the web pages loaded in the browser instances of the profile.
|
boolean |
isEnabled()
Indicates whether spell checking is enabled or not.
|
java.util.List<Language> |
languages()
Returns an immutable list of the languages used for spell checking.
|
void |
removeLanguage(Language language)
Removes the language from the list of the languages for which spell checking is performed.
|
profile
boolean isEnabled()
ObjectClosedException
- when the profile is deleted or its engine is closedvoid enable()
void disable()
ObjectClosedException
- when the profile is deleted or its engine is closedjava.util.List<Language> languages()
On Linux and Windows the dictionaries for spell checking are downloaded programmatically and stored in the user data directory.
On macOS returns the languages for spell checking configured in the system settings.
ObjectClosedException
- when the profile is deleted or its engine is closedvoid addLanguage(Language language)
On Windows and Linux, this method loads the dictionary for the given
language
and blocks the current thread execution until the dictionary
is loaded from the user data directory. If the dictionary does not exist in
the user data directory, the engine will download it from the remote server.
On macOS, this method checks whether the specified dictionaries are
present in the system, and throws a LanguageNotAvailableException
if not.
language
- a language for which the dictionary must be loadedjava.lang.IllegalArgumentException
- when language
is null
ObjectClosedException
- when the profile is deleted or its engine is closedLanguageNotAvailableException
- if Chromium fails to download the dictionary for the given language
(Windows and Linux), or the dictionary is not available in the system (macOS)void removeLanguage(Language language)
If all languages are removed, Chromium performs no spell checking. To enable spell checking, add a language using the @link SpellChecker#addLanguage(Language)} method.
On macOS, this method does nothing because spellcheck languages are configured in the OS settings.
language
- the language to be removed from the list of the languages
available for spell checkingjava.lang.IllegalArgumentException
- when language
is null
ObjectClosedException
- when the profile is deleted or its engine is closedDictionary customDictionary()