Class SpellCheckLoader


  • public class SpellCheckLoader
    extends Object
    Utility class that uses reflection to load the http://jortho.sourceforge.net/ library. The Jortho project allows of the easy wrapping of JTextComponent with a spell check feature. The library and dictionary are a fairly large size so this class ues reflection to try and load the library when available on the class path.
    Since:
    6.3
    • Constructor Detail

      • SpellCheckLoader

        public SpellCheckLoader()
    • Method Detail

      • addSpellChecker

        public static void addSpellChecker​(JTextComponent textComponent)
      • registerDictionaries

        public static void registerDictionaries​(URL baseURL,
                                                String activeLocale)
        Registers the available dictionaries. The dictionaries' URLs must have the form "dictionary_xx.xxxxx" and must be relative to the baseURL. The available languages and extension of the dictionaries is load from a configuration file. The configuration file must also relative to the baseURL and must be named dictionaries.cnf, dictionaries.properties or dictionaries.txt. If the dictionary of the active Locale does not exist, the first dictionary is loaded. There is only one dictionary loaded in memory at a given time. You can download the dictionary files from http://sourceforge.net/projects/jortho/files/Dictionaries/ The configuration file has a Java Properties format. Currently there are the follow options: languages, extension.
        Parameters:
        baseURL - base url that contains at least one dictionary_xx.xxxxx file.
        activeLocale - the locale that should be loaded and made active. If null or empty then the default locale is used.
      • setUserDictionaryProvider

        public static void setUserDictionaryProvider​(Object fileUserDictionary)
        Sets the UserDictionaryProvider. This is needed if the user should be able to add their own words. This method must be called before registerDictionaries(URL, String, String).
        Parameters:
        fileUserDictionary - the new UserDictionaryProvider or null