Interface SpellChecker
- All Superinterfaces:
ProfileService
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addLanguage
(Language language) Adds the language to the list of the languages for which spell checking is performed.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
Indicates whether spell checking is enabled or not.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.Methods inherited from interface com.teamdev.jxbrowser.profile.ProfileService
profile
-
Method Details
-
isEnabled
boolean isEnabled()Indicates whether spell checking is enabled or not. By default, it is enabled.- Throws:
ObjectClosedException
- when the profile is deleted or its engine is closed
-
enable
void enable()Enables spell checking on the web pages loaded in the browser instances of the profile. -
disable
void disable()Disables spell checking on the web pages loaded in the browser instances of the profile.- Throws:
ObjectClosedException
- when the profile is deleted or its engine is closed
-
languages
Returns an immutable list of the languages used for spell checking.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.
- Throws:
ObjectClosedException
- when the profile is deleted or its engine is closed
-
addLanguage
Adds the language to the list of the languages for which spell checking is performed.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.- Parameters:
language
- a language for which the dictionary must be loaded- Throws:
IllegalArgumentException
- whenlanguage
isnull
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)- Since:
- 7.27
-
removeLanguage
Removes the language from the list of the languages for which spell checking is performed.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.
- Parameters:
language
- the language to be removed from the list of the languages available for spell checking- Throws:
IllegalArgumentException
- whenlanguage
isnull
ObjectClosedException
- when the profile is deleted or its engine is closed- Since:
- 7.27
-
customDictionary
Dictionary customDictionary()Returns the custom dictionary.
-