Class FileUserDictionary

    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.io.File file  
      private java.lang.String fileBase  
    • Constructor Summary

      Constructors 
      Constructor Description
      FileUserDictionary()
      Create a FileUserDictionary with the dictionaries in the root of the current application.
      FileUserDictionary​(java.lang.String fileBase)
      Create a FileUserDictionary with the dictionaries on a specific location.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addWord​(java.lang.String word)
      Adds a new word to the current user dictionary.
      java.util.Iterator<java.lang.String> getWords​(java.util.Locale locale)
      Gets the list of custom words for this locale.
      void setUserWords​(java.lang.String wordList)
      Set a completely new word list
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • fileBase

        private final java.lang.String fileBase
      • file

        private java.io.File file
    • Constructor Detail

      • FileUserDictionary

        public FileUserDictionary()
        Create a FileUserDictionary with the dictionaries in the root of the current application.
      • FileUserDictionary

        public FileUserDictionary​(java.lang.String fileBase)
        Create a FileUserDictionary with the dictionaries on a specific location.
        Parameters:
        fileBase - the base
    • Method Detail

      • addWord

        public void addWord​(java.lang.String word)
        Adds a new word to the current user dictionary. The implementor must save this word in its own backend.
        Specified by:
        addWord in interface UserDictionaryProvider
        Parameters:
        word - the new word.
      • getWords

        public java.util.Iterator<java.lang.String> getWords​(java.util.Locale locale)
        Gets the list of custom words for this locale. The implementation can decide if there is a custom dictionary for each available language or only one. This method is called before the language change event is fired if the language is changed and the dictionary is loaded.
        Specified by:
        getWords in interface CustomDictionaryProvider
        Parameters:
        locale - The locale of the selected language.
        Returns:
        A list of words delimited with line breaks. It can be null.
      • setUserWords

        public void setUserWords​(java.lang.String wordList)
        Set a completely new word list
        Specified by:
        setUserWords in interface UserDictionaryProvider
        Parameters:
        wordList - the new word list. Can be empty but not null.