public final class NoSpellCheckerFactory extends Object implements SpellCheckerFactory
SpellCheckerFactory
. Use it when no
real implementation is available.Modifier and Type | Field and Description |
---|---|
static NoSpellCheckerFactory |
INSTANCE |
Constructor and Description |
---|
NoSpellCheckerFactory() |
Modifier and Type | Method and Description |
---|---|
String |
getDescription()
Returns a (couple of lines) description of this plug-in.
|
String |
getName()
Returns the (couple of words) name of this plug-in.
|
String |
getPersonalDictionaryPath()
Returns the path pattern last specified using
SpellCheckerFactory.setPersonalDictionaryPath(java.lang.String) . |
Preferences |
getPreferences()
Returns the object where to read and write user preferences.
|
PreferencesSheet |
getPreferencesSheet()
Returns a newly created preferences sheet which can be used to edit
the user preferences related to this plug-in.
|
LanguageInfo[] |
listLanguages()
Returns a (possibly empty, never
null ) list of items
describing all the available dictionaries. |
SpellChecker |
newSpellChecker()
Returns a newly created spell checker.
|
void |
resetSpellChecker(SpellChecker spellChecker)
Reset the state of specified spell checker.
|
void |
setPersonalDictionaryPath(String path)
Defines a path pattern for personal dictionaries.
|
void |
setPreferences(Preferences preferences)
Invoked by the environment hosting the factory to specify to this
plug-in the object where to read and write user preferences.
|
public static final NoSpellCheckerFactory INSTANCE
public void setPreferences(Preferences preferences)
SpellCheckerFactory
setPreferences
in interface SpellCheckerFactory
public Preferences getPreferences()
SpellCheckerFactory
null
unless SpellCheckerFactory.setPreferences(com.xmlmind.util.Preferences)
has been invoked by
the environment hosting the plug-in (that is, XMLmind XML Editor).getPreferences
in interface SpellCheckerFactory
public void setPersonalDictionaryPath(String path)
SpellCheckerFactory
Each language loads or saves a different file.
setPersonalDictionaryPath
in interface SpellCheckerFactory
path
- a pattern containing the symbol '%L%' which is
replaced by the language name.
For example:
setPersonalDictionaryPath(".mydict_%L%.txt")
would
read/save an English dictionary (language "en") from/to file
.mydict_en.txt.
If set to null
, personal dictionaries are not saved
(i.e. they are made temporary).
public String getPersonalDictionaryPath()
SpellCheckerFactory
SpellCheckerFactory.setPersonalDictionaryPath(java.lang.String)
.getPersonalDictionaryPath
in interface SpellCheckerFactory
public String getName()
SpellCheckerFactory
getName
in interface SpellCheckerFactory
public String getDescription()
SpellCheckerFactory
null
.getDescription
in interface SpellCheckerFactory
public PreferencesSheet getPreferencesSheet()
SpellCheckerFactory
null
.
Changing the preferences using the returned sheet has no effect
on existing instances of SpellChecker
.
getPreferencesSheet
in interface SpellCheckerFactory
public LanguageInfo[] listLanguages()
SpellCheckerFactory
null
) list of items
describing all the available dictionaries.
The items of the returned array must be sorted by language code.
listLanguages
in interface SpellCheckerFactory
public SpellChecker newSpellChecker()
SpellCheckerFactory
null
if,
for any reason, a spell checker cannot be created.
All the users preferences have been applied to this spell checker. A language is preselected.
newSpellChecker
in interface SpellCheckerFactory
SpellCheckerFactory.resetSpellChecker(com.xmlmind.xmleditapp.spellchecker.SpellChecker)
public void resetSpellChecker(SpellChecker spellChecker)
SpellCheckerFactory
SpellCheckerFactory.newSpellChecker()
.resetSpellChecker
in interface SpellCheckerFactory