Package org.languagetool.gui
Class Configuration
- java.lang.Object
-
- org.languagetool.gui.Configuration
-
public class Configuration extends java.lang.Object
Configuration like list of disabled rule IDs, server mode etc. Configuration is loaded from and stored to a properties file.
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.List<java.lang.String>
allProfileKeys
private java.util.List<java.lang.String>
allProfileLangKeys
private static java.lang.String
AUTO_DETECT_KEY
private boolean
autoDetect
private static java.lang.String
BLANK
private static java.lang.String
BLANK_REPLACE
private static java.lang.String
COLOR_SPLITTER_REGEXP
private static java.lang.String
COLOR_SPLITTER_REGEXP_COLON
private static java.lang.String
CONFIG_FILE
private java.io.File
configFile
private java.util.Map<java.lang.String,java.lang.String>
configForOtherLanguages
private java.util.Map<java.lang.String,java.lang.String>
configForOtherProfiles
private static java.lang.String
CONFIGURABLE_RULE_SPLITTER_REGEXP
private static java.lang.String
CONFIGURABLE_RULE_VALUES_KEY
private java.util.Map<java.lang.String,java.lang.Integer>
configurableRuleValues
private static java.lang.String
CURRENT_PROFILE_KEY
private java.lang.String
currentProfile
(package private) static int
DEFAULT_NUM_CHECK_PARAS
(package private) static int
DEFAULT_SERVER_PORT
private static java.lang.String
DEFINED_PROFILES_KEY
private java.util.List<java.lang.String>
definedProfiles
private static java.lang.String
DELIMITER
private static java.lang.String
DISABLED_CATEGORIES_KEY
private static java.lang.String
DISABLED_RULES_KEY
private java.util.Set<java.lang.String>
disabledCategoryNames
private java.util.Set<java.lang.String>
disabledRuleIds
private static java.lang.String
DO_FULL_CHECK_AT_FIRST_KEY
private static java.lang.String
DO_REMOTE_CHECK_KEY
private boolean
doFullCheckAtFirst
private boolean
doRemoteCheck
private boolean
doResetCheck
private static java.lang.String
ENABLED_CATEGORIES_KEY
private static java.lang.String
ENABLED_RULES_KEY
private static java.lang.String
ENABLED_RULES_ONLY_KEY
private java.util.Set<java.lang.String>
enabledCategoryNames
private java.util.Set<java.lang.String>
enabledRuleIds
private boolean
enabledRulesOnly
private static java.lang.String
ERROR_COLORS_KEY
private java.util.Map<org.languagetool.rules.ITSIssueType,java.awt.Color>
errorColors
private static java.lang.String
EXTERNAL_RULE_DIRECTORY
private java.lang.String
externalRuleDirectory
private static java.lang.String
FONT_NAME_KEY
(package private) static int
FONT_SIZE_INVALID
private static java.lang.String
FONT_SIZE_KEY
(package private) static int
FONT_STYLE_INVALID
private static java.lang.String
FONT_STYLE_KEY
private java.lang.String
fontName
private int
fontSize
private int
fontStyle
private boolean
guiConfig
private static java.lang.String
IS_MULTI_THREAD_LO_KEY
private boolean
isMultiThreadLO
private org.languagetool.Language
lang
private org.languagetool.Language
language
private static java.lang.String
LANGUAGE_KEY
private static java.lang.String
LF_NAME_KEY
private java.lang.String
lookAndFeelName
private static java.lang.String
LT_SWITCHED_OFF_KEY
private static java.lang.String
MOTHER_TONGUE_KEY
private org.languagetool.Language
motherTongue
private static java.lang.String
NGRAM_DIR_KEY
private java.io.File
ngramDirectory
private static java.lang.String
NO_MULTI_RESET_KEY
private boolean
noMultiReset
private int
numParasToCheck
private java.io.File
oldConfigFile
private static java.lang.String
OTHER_SERVER_URL_KEY
private java.lang.String
otherServerUrl
private static java.lang.String
PARA_CHECK_KEY
private static java.lang.String
PROFILE_DELIMITER
private static java.lang.String
RESET_CHECK_KEY
private boolean
runServer
private static java.lang.String
SERVER_PORT_KEY
private static java.lang.String
SERVER_RUN_KEY
private int
serverPort
private java.util.Map<java.lang.String,java.lang.String>
specialTabCategories
(package private) static java.awt.Color
STYLE_COLOR
private java.util.Set<java.lang.String>
styleLikeCategories
private boolean
switchOff
private static java.lang.String
TAGGER_SHOWS_DISAMBIG_LOG_KEY
private boolean
taggerShowsDisambigLog
private static java.lang.String
UNDERLINE_COLORS_KEY
private java.util.Map<java.lang.String,java.awt.Color>
underlineColors
private static java.lang.String
USE_DOC_LANG_KEY
private static java.lang.String
USE_GUI_KEY
private static java.lang.String
USE_OTHER_SERVER_KEY
private boolean
useDocLanguage
private boolean
useOtherServer
private static java.lang.String
WORD2VEC_DIR_KEY
private java.io.File
word2vecDirectory
-
Constructor Summary
Constructors Modifier Constructor Description private
Configuration()
Configuration(java.io.File baseDir, java.lang.String filename, java.io.File oldConfigFile, org.languagetool.Language lang, org.languagetool.LinguServices linguServices)
Configuration(java.io.File baseDir, java.lang.String filename, org.languagetool.Language lang)
Configuration(java.io.File baseDir, java.lang.String filename, org.languagetool.Language lang, org.languagetool.LinguServices linguServices)
Configuration(java.io.File baseDir, org.languagetool.Language lang)
Configuration(org.languagetool.Language lang)
Uses the configuration file from the default location.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addDisabledRuleIds(java.util.Set<java.lang.String> ruleIds)
private void
addListToProperties(java.util.Properties props, java.lang.String key, java.util.Set<java.lang.String> list)
void
addProfile(java.lang.String profile)
add a new profilevoid
addProfiles(java.util.List<java.lang.String> profiles)
add a list of profiles(package private) Configuration
copy(Configuration configuration)
Returns a copy of the given configuration.boolean
doFullCheckAtFirst()
do a full check at first iteration?boolean
doRemoteCheck()
boolean
getAutoDetect()
int
getConfigurableValue(java.lang.String ruleID)
java.util.Map<java.lang.String,java.lang.Integer>
getConfigurableValues()
returns all configured valuesjava.lang.String
getCurrentProfile()
get the current profileorg.languagetool.Language
getDefaultLanguage()
java.util.List<java.lang.String>
getDefinedProfiles()
get the current profilejava.util.Set<java.lang.String>
getDisabledCategoryNames()
java.util.Set<java.lang.String>
getDisabledRuleIds()
java.util.Set<java.lang.String>
getEnabledCategoryNames()
java.util.Set<java.lang.String>
getEnabledRuleIds()
boolean
getEnabledRulesOnly()
java.util.Map<org.languagetool.rules.ITSIssueType,java.awt.Color>
getErrorColors()
java.lang.String
getExternalRuleDirectory()
java.lang.String
getFontName()
Returns the name of the GUI's editing textarea font.int
getFontSize()
Returns the size of the GUI's editing textarea font.int
getFontStyle()
Returns the style of the GUI's editing textarea font.org.languagetool.Language
getLanguage()
private java.util.Collection<? extends java.lang.String>
getListFromProperties(java.util.Properties props, java.lang.String key)
java.lang.String
getLookAndFeelName()
Returns the name of the GUI's LaF.org.languagetool.Language
getMotherTongue()
@Nullable java.io.File
getNgramDirectory()
Directory with ngram data or null.int
getNumParasToCheck()
get the number of paragraphs to be checked for TextLevelRulesprivate java.lang.String
getQualifier(org.languagetool.Language lang)
boolean
getRunServer()
int
getServerPort()
java.lang.String
getServerUrl()
java.util.Set<java.lang.String>
getSpecialTabCategories(java.lang.String tabName)
java.lang.String[]
getSpecialTabNames()
boolean
getTaggerShowsDisambigLog()
Determines whether the tagger window will also print the disambiguation log.java.awt.Color
getUnderlineColor(java.lang.String category)
java.util.Map<java.lang.String,java.awt.Color>
getUnderlineColors()
boolean
getUseDocLanguage()
boolean
getUseGUIConfig()
@Nullable java.io.File
getWord2VecDirectory()
Directory with word2vec data or null.void
initOptions()
Initialize variables and clears Maps, Sets and Listsvoid
initStyleCategories(java.util.List<org.languagetool.rules.Rule> allRules)
boolean
isInSpecialTab(java.lang.String category, java.lang.String tabName)
boolean
isMultiThread()
shall LO run in multi thread modeboolean
isNoMultiReset()
will all paragraphs not checked after every change of text if more than one document loaded?boolean
isResetCheck()
will all paragraphs check after every change of text?boolean
isSpecialTabCategory(java.lang.String category)
boolean
isStyleCategory(java.lang.String category)
boolean
isSwitchedOff()
private void
loadConfigForOtherLanguages(org.languagetool.Language lang, java.util.Properties prop, java.lang.String prefix)
private void
loadConfiguration()
void
loadConfiguration(java.lang.String profile)
private void
parseConfigurableRuleValues(java.lang.String rulesValueString)
private void
parseErrorColors(java.lang.String colorsString)
private void
parseUnderlineColors(java.lang.String colorsString)
void
removeDisabledRuleIds(java.util.Set<java.lang.String> ruleIds)
void
removeProfile(java.lang.String profile)
remove an existing profile(package private) void
restoreState(Configuration configuration)
Restore the state of this object from configuration.private void
saveConfigforProfile(java.util.Properties props, java.lang.String prefix)
void
saveConfiguration(org.languagetool.Language lang)
private void
setAllProfileKeys()
void
setAutoDetect(boolean autoDetect)
void
setConfigurableValue(java.lang.String ruleID, int value)
void
setCurrentProfile(java.lang.String profile)
set the current profilevoid
setDefaultUnderlineColor(java.lang.String category)
void
setDisabledCategoryNames(java.util.Set<java.lang.String> categoryNames)
void
setDisabledRuleIds(java.util.Set<java.lang.String> ruleIds)
void
setDoResetCheck(boolean resetCheck)
set all paragraphs to be checked after every change of textvoid
setEnabledCategoryNames(java.util.Set<java.lang.String> categoryNames)
void
setEnabledRuleIds(java.util.Set<java.lang.String> ruleIds)
void
setExternalRuleDirectory(java.lang.String path)
void
setFontName(java.lang.String fontName)
Sets the name of the GUI's editing textarea font.void
setFontSize(int fontSize)
Sets the size of the GUI's editing textarea font.void
setFontStyle(int fontStyle)
Sets the style of the GUI's editing textarea font.void
setFullCheckAtFirst(boolean doFullCheckAtFirst)
set option to do a full check at first iterationvoid
setLanguage(org.languagetool.Language language)
void
setLookAndFeelName(java.lang.String lookAndFeelName)
Sets the name of the GUI's LaF.void
setMotherTongue(org.languagetool.Language motherTongue)
void
setMultiThreadLO(boolean isMultiThread)
run LO in multi thread modevoid
setNgramDirectory(java.io.File dir)
Sets the directory with ngram data (may be null).void
setNoMultiReset(boolean noMultiReset)
set all paragraphs to be not checked after every change of text if more than one document loaded?void
setNumParasToCheck(int numParas)
set the number of paragraphs to be checked for TextLevelRulesvoid
setOtherServerUrl(java.lang.String otherServerUrl)
void
setRemoteCheck(boolean doRemoteCheck)
void
setRunServer(boolean runServer)
void
setServerPort(int serverPort)
void
setSwitchedOff(boolean switchOff, org.languagetool.Language lang)
void
setTaggerShowsDisambigLog(boolean taggerShowsDisambigLog)
Enables or disables the disambiguation log on the tagger window, depending on the value of the parameter taggerShowsDisambigLog.void
setUnderlineColor(java.lang.String category, java.awt.Color col)
void
setUseDocLanguage(boolean useDocLang)
void
setUseGUIConfig(boolean useGUIConfig)
void
setUseOtherServer(boolean useOtherServer)
void
setWord2VecDirectory(java.io.File dir)
Sets the directory with word2vec data (may be null).private void
storeConfigforAllProfiles(java.util.Properties props)
private void
storeConfigKeyFromProp(java.util.Properties prop, java.lang.String key)
boolean
useOtherServer()
-
-
-
Field Detail
-
DEFAULT_SERVER_PORT
static final int DEFAULT_SERVER_PORT
- See Also:
- Constant Field Values
-
DEFAULT_NUM_CHECK_PARAS
static final int DEFAULT_NUM_CHECK_PARAS
- See Also:
- Constant Field Values
-
FONT_STYLE_INVALID
static final int FONT_STYLE_INVALID
- See Also:
- Constant Field Values
-
FONT_SIZE_INVALID
static final int FONT_SIZE_INVALID
- See Also:
- Constant Field Values
-
STYLE_COLOR
static final java.awt.Color STYLE_COLOR
-
CONFIG_FILE
private static final java.lang.String CONFIG_FILE
- See Also:
- Constant Field Values
-
CURRENT_PROFILE_KEY
private static final java.lang.String CURRENT_PROFILE_KEY
- See Also:
- Constant Field Values
-
DEFINED_PROFILES_KEY
private static final java.lang.String DEFINED_PROFILES_KEY
- See Also:
- Constant Field Values
-
DISABLED_RULES_KEY
private static final java.lang.String DISABLED_RULES_KEY
- See Also:
- Constant Field Values
-
ENABLED_RULES_KEY
private static final java.lang.String ENABLED_RULES_KEY
- See Also:
- Constant Field Values
-
DISABLED_CATEGORIES_KEY
private static final java.lang.String DISABLED_CATEGORIES_KEY
- See Also:
- Constant Field Values
-
ENABLED_CATEGORIES_KEY
private static final java.lang.String ENABLED_CATEGORIES_KEY
- See Also:
- Constant Field Values
-
ENABLED_RULES_ONLY_KEY
private static final java.lang.String ENABLED_RULES_ONLY_KEY
- See Also:
- Constant Field Values
-
LANGUAGE_KEY
private static final java.lang.String LANGUAGE_KEY
- See Also:
- Constant Field Values
-
MOTHER_TONGUE_KEY
private static final java.lang.String MOTHER_TONGUE_KEY
- See Also:
- Constant Field Values
-
NGRAM_DIR_KEY
private static final java.lang.String NGRAM_DIR_KEY
- See Also:
- Constant Field Values
-
WORD2VEC_DIR_KEY
private static final java.lang.String WORD2VEC_DIR_KEY
- See Also:
- Constant Field Values
-
AUTO_DETECT_KEY
private static final java.lang.String AUTO_DETECT_KEY
- See Also:
- Constant Field Values
-
TAGGER_SHOWS_DISAMBIG_LOG_KEY
private static final java.lang.String TAGGER_SHOWS_DISAMBIG_LOG_KEY
- See Also:
- Constant Field Values
-
SERVER_RUN_KEY
private static final java.lang.String SERVER_RUN_KEY
- See Also:
- Constant Field Values
-
SERVER_PORT_KEY
private static final java.lang.String SERVER_PORT_KEY
- See Also:
- Constant Field Values
-
PARA_CHECK_KEY
private static final java.lang.String PARA_CHECK_KEY
- See Also:
- Constant Field Values
-
RESET_CHECK_KEY
private static final java.lang.String RESET_CHECK_KEY
- See Also:
- Constant Field Values
-
NO_MULTI_RESET_KEY
private static final java.lang.String NO_MULTI_RESET_KEY
- See Also:
- Constant Field Values
-
DO_FULL_CHECK_AT_FIRST_KEY
private static final java.lang.String DO_FULL_CHECK_AT_FIRST_KEY
- See Also:
- Constant Field Values
-
USE_DOC_LANG_KEY
private static final java.lang.String USE_DOC_LANG_KEY
- See Also:
- Constant Field Values
-
USE_GUI_KEY
private static final java.lang.String USE_GUI_KEY
- See Also:
- Constant Field Values
-
FONT_NAME_KEY
private static final java.lang.String FONT_NAME_KEY
- See Also:
- Constant Field Values
-
FONT_STYLE_KEY
private static final java.lang.String FONT_STYLE_KEY
- See Also:
- Constant Field Values
-
FONT_SIZE_KEY
private static final java.lang.String FONT_SIZE_KEY
- See Also:
- Constant Field Values
-
LF_NAME_KEY
private static final java.lang.String LF_NAME_KEY
- See Also:
- Constant Field Values
-
ERROR_COLORS_KEY
private static final java.lang.String ERROR_COLORS_KEY
- See Also:
- Constant Field Values
-
UNDERLINE_COLORS_KEY
private static final java.lang.String UNDERLINE_COLORS_KEY
- See Also:
- Constant Field Values
-
CONFIGURABLE_RULE_VALUES_KEY
private static final java.lang.String CONFIGURABLE_RULE_VALUES_KEY
- See Also:
- Constant Field Values
-
LT_SWITCHED_OFF_KEY
private static final java.lang.String LT_SWITCHED_OFF_KEY
- See Also:
- Constant Field Values
-
IS_MULTI_THREAD_LO_KEY
private static final java.lang.String IS_MULTI_THREAD_LO_KEY
- See Also:
- Constant Field Values
-
EXTERNAL_RULE_DIRECTORY
private static final java.lang.String EXTERNAL_RULE_DIRECTORY
- See Also:
- Constant Field Values
-
DO_REMOTE_CHECK_KEY
private static final java.lang.String DO_REMOTE_CHECK_KEY
- See Also:
- Constant Field Values
-
OTHER_SERVER_URL_KEY
private static final java.lang.String OTHER_SERVER_URL_KEY
- See Also:
- Constant Field Values
-
USE_OTHER_SERVER_KEY
private static final java.lang.String USE_OTHER_SERVER_KEY
- See Also:
- Constant Field Values
-
DELIMITER
private static final java.lang.String DELIMITER
- See Also:
- Constant Field Values
-
COLOR_SPLITTER_REGEXP
private static final java.lang.String COLOR_SPLITTER_REGEXP
- See Also:
- Constant Field Values
-
COLOR_SPLITTER_REGEXP_COLON
private static final java.lang.String COLOR_SPLITTER_REGEXP_COLON
- See Also:
- Constant Field Values
-
CONFIGURABLE_RULE_SPLITTER_REGEXP
private static final java.lang.String CONFIGURABLE_RULE_SPLITTER_REGEXP
- See Also:
- Constant Field Values
-
BLANK
private static final java.lang.String BLANK
- See Also:
- Constant Field Values
-
BLANK_REPLACE
private static final java.lang.String BLANK_REPLACE
- See Also:
- Constant Field Values
-
PROFILE_DELIMITER
private static final java.lang.String PROFILE_DELIMITER
- See Also:
- Constant Field Values
-
configForOtherProfiles
private final java.util.Map<java.lang.String,java.lang.String> configForOtherProfiles
-
configForOtherLanguages
private final java.util.Map<java.lang.String,java.lang.String> configForOtherLanguages
-
errorColors
private final java.util.Map<org.languagetool.rules.ITSIssueType,java.awt.Color> errorColors
-
underlineColors
private final java.util.Map<java.lang.String,java.awt.Color> underlineColors
-
configurableRuleValues
private final java.util.Map<java.lang.String,java.lang.Integer> configurableRuleValues
-
styleLikeCategories
private final java.util.Set<java.lang.String> styleLikeCategories
-
specialTabCategories
private final java.util.Map<java.lang.String,java.lang.String> specialTabCategories
-
disabledRuleIds
private java.util.Set<java.lang.String> disabledRuleIds
-
enabledRuleIds
private java.util.Set<java.lang.String> enabledRuleIds
-
disabledCategoryNames
private java.util.Set<java.lang.String> disabledCategoryNames
-
enabledCategoryNames
private java.util.Set<java.lang.String> enabledCategoryNames
-
definedProfiles
private java.util.List<java.lang.String> definedProfiles
-
allProfileKeys
private java.util.List<java.lang.String> allProfileKeys
-
allProfileLangKeys
private java.util.List<java.lang.String> allProfileLangKeys
-
lang
private org.languagetool.Language lang
-
configFile
private java.io.File configFile
-
oldConfigFile
private java.io.File oldConfigFile
-
enabledRulesOnly
private boolean enabledRulesOnly
-
language
private org.languagetool.Language language
-
motherTongue
private org.languagetool.Language motherTongue
-
ngramDirectory
private java.io.File ngramDirectory
-
word2vecDirectory
private java.io.File word2vecDirectory
-
runServer
private boolean runServer
-
autoDetect
private boolean autoDetect
-
taggerShowsDisambigLog
private boolean taggerShowsDisambigLog
-
guiConfig
private boolean guiConfig
-
fontName
private java.lang.String fontName
-
fontStyle
private int fontStyle
-
fontSize
private int fontSize
-
serverPort
private int serverPort
-
numParasToCheck
private int numParasToCheck
-
doResetCheck
private boolean doResetCheck
-
noMultiReset
private boolean noMultiReset
-
doFullCheckAtFirst
private boolean doFullCheckAtFirst
-
externalRuleDirectory
private java.lang.String externalRuleDirectory
-
lookAndFeelName
private java.lang.String lookAndFeelName
-
switchOff
private boolean switchOff
-
useDocLanguage
private boolean useDocLanguage
-
isMultiThreadLO
private boolean isMultiThreadLO
-
currentProfile
private java.lang.String currentProfile
-
doRemoteCheck
private boolean doRemoteCheck
-
useOtherServer
private boolean useOtherServer
-
otherServerUrl
private java.lang.String otherServerUrl
-
-
Constructor Detail
-
Configuration
public Configuration(org.languagetool.Language lang) throws java.io.IOException
Uses the configuration file from the default location.- Parameters:
lang
- The language for the configuration, used to distinguish rules that are enabled or disabled per language.- Throws:
java.io.IOException
-
Configuration
public Configuration(java.io.File baseDir, org.languagetool.Language lang) throws java.io.IOException
- Throws:
java.io.IOException
-
Configuration
public Configuration(java.io.File baseDir, java.lang.String filename, org.languagetool.Language lang) throws java.io.IOException
- Throws:
java.io.IOException
-
Configuration
public Configuration(java.io.File baseDir, java.lang.String filename, org.languagetool.Language lang, org.languagetool.LinguServices linguServices) throws java.io.IOException
- Throws:
java.io.IOException
-
Configuration
public Configuration(java.io.File baseDir, java.lang.String filename, java.io.File oldConfigFile, org.languagetool.Language lang, org.languagetool.LinguServices linguServices) throws java.io.IOException
- Throws:
java.io.IOException
-
Configuration
private Configuration()
-
-
Method Detail
-
initOptions
public void initOptions()
Initialize variables and clears Maps, Sets and Lists
-
copy
Configuration copy(Configuration configuration)
Returns a copy of the given configuration.- Parameters:
configuration
- the object to copy.- Since:
- 2.6
-
restoreState
void restoreState(Configuration configuration)
Restore the state of this object from configuration.- Parameters:
configuration
- the object from which we will read the state- Since:
- 2.6
-
getDisabledRuleIds
public java.util.Set<java.lang.String> getDisabledRuleIds()
-
getEnabledRuleIds
public java.util.Set<java.lang.String> getEnabledRuleIds()
-
getDisabledCategoryNames
public java.util.Set<java.lang.String> getDisabledCategoryNames()
-
getEnabledCategoryNames
public java.util.Set<java.lang.String> getEnabledCategoryNames()
-
setDisabledRuleIds
public void setDisabledRuleIds(java.util.Set<java.lang.String> ruleIds)
-
addDisabledRuleIds
public void addDisabledRuleIds(java.util.Set<java.lang.String> ruleIds)
-
removeDisabledRuleIds
public void removeDisabledRuleIds(java.util.Set<java.lang.String> ruleIds)
-
setEnabledRuleIds
public void setEnabledRuleIds(java.util.Set<java.lang.String> ruleIds)
-
setDisabledCategoryNames
public void setDisabledCategoryNames(java.util.Set<java.lang.String> categoryNames)
-
setEnabledCategoryNames
public void setEnabledCategoryNames(java.util.Set<java.lang.String> categoryNames)
-
getEnabledRulesOnly
public boolean getEnabledRulesOnly()
-
getLanguage
public org.languagetool.Language getLanguage()
-
setLanguage
public void setLanguage(org.languagetool.Language language)
-
getMotherTongue
public org.languagetool.Language getMotherTongue()
-
setMotherTongue
public void setMotherTongue(org.languagetool.Language motherTongue)
-
getDefaultLanguage
public org.languagetool.Language getDefaultLanguage()
-
setUseDocLanguage
public void setUseDocLanguage(boolean useDocLang)
-
getUseDocLanguage
public boolean getUseDocLanguage()
-
getAutoDetect
public boolean getAutoDetect()
-
setAutoDetect
public void setAutoDetect(boolean autoDetect)
-
setRemoteCheck
public void setRemoteCheck(boolean doRemoteCheck)
-
doRemoteCheck
public boolean doRemoteCheck()
-
setUseOtherServer
public void setUseOtherServer(boolean useOtherServer)
-
useOtherServer
public boolean useOtherServer()
-
setOtherServerUrl
public void setOtherServerUrl(java.lang.String otherServerUrl)
-
getServerUrl
public java.lang.String getServerUrl()
-
getTaggerShowsDisambigLog
public boolean getTaggerShowsDisambigLog()
Determines whether the tagger window will also print the disambiguation log.- Returns:
- true if the tagger window will print the disambiguation log, false otherwise
- Since:
- 3.3
-
setTaggerShowsDisambigLog
public void setTaggerShowsDisambigLog(boolean taggerShowsDisambigLog)
Enables or disables the disambiguation log on the tagger window, depending on the value of the parameter taggerShowsDisambigLog.- Parameters:
taggerShowsDisambigLog
- If true, the tagger window will print the- Since:
- 3.3
-
getRunServer
public boolean getRunServer()
-
setRunServer
public void setRunServer(boolean runServer)
-
getServerPort
public int getServerPort()
-
setUseGUIConfig
public void setUseGUIConfig(boolean useGUIConfig)
-
getUseGUIConfig
public boolean getUseGUIConfig()
-
setServerPort
public void setServerPort(int serverPort)
-
getExternalRuleDirectory
public java.lang.String getExternalRuleDirectory()
-
setExternalRuleDirectory
public void setExternalRuleDirectory(java.lang.String path)
-
getNumParasToCheck
public int getNumParasToCheck()
get the number of paragraphs to be checked for TextLevelRules- Since:
- 4.0
-
setNumParasToCheck
public void setNumParasToCheck(int numParas)
set the number of paragraphs to be checked for TextLevelRules- Since:
- 4.0
-
isResetCheck
public boolean isResetCheck()
will all paragraphs check after every change of text?- Since:
- 4.2
-
setDoResetCheck
public void setDoResetCheck(boolean resetCheck)
set all paragraphs to be checked after every change of text- Since:
- 4.2
-
isNoMultiReset
public boolean isNoMultiReset()
will all paragraphs not checked after every change of text if more than one document loaded?- Since:
- 4.5
-
setNoMultiReset
public void setNoMultiReset(boolean noMultiReset)
set all paragraphs to be not checked after every change of text if more than one document loaded?- Since:
- 4.5
-
setFullCheckAtFirst
public void setFullCheckAtFirst(boolean doFullCheckAtFirst)
set option to do a full check at first iteration- Since:
- 4.7
-
doFullCheckAtFirst
public boolean doFullCheckAtFirst()
do a full check at first iteration?- Since:
- 4.7
-
getCurrentProfile
public java.lang.String getCurrentProfile()
get the current profile- Since:
- 4.7
-
setCurrentProfile
public void setCurrentProfile(java.lang.String profile)
set the current profile- Since:
- 4.7
-
getDefinedProfiles
public java.util.List<java.lang.String> getDefinedProfiles()
get the current profile- Since:
- 4.7
-
addProfile
public void addProfile(java.lang.String profile)
add a new profile- Since:
- 4.7
-
addProfiles
public void addProfiles(java.util.List<java.lang.String> profiles)
add a list of profiles- Since:
- 4.7
-
removeProfile
public void removeProfile(java.lang.String profile)
remove an existing profile- Since:
- 4.7
-
setMultiThreadLO
public void setMultiThreadLO(boolean isMultiThread)
run LO in multi thread mode- Since:
- 4.6
-
isMultiThread
public boolean isMultiThread()
shall LO run in multi thread mode- Since:
- 4.6
-
getFontName
public java.lang.String getFontName()
Returns the name of the GUI's editing textarea font.- Returns:
- the name of the font.
- Since:
- 2.6
- See Also:
Font.getFamily()
-
setFontName
public void setFontName(java.lang.String fontName)
Sets the name of the GUI's editing textarea font.- Parameters:
fontName
- the name of the font.- Since:
- 2.6
- See Also:
Font.getFamily()
-
getFontStyle
public int getFontStyle()
Returns the style of the GUI's editing textarea font.- Returns:
- the style of the font.
- Since:
- 2.6
- See Also:
Font.getStyle()
-
setFontStyle
public void setFontStyle(int fontStyle)
Sets the style of the GUI's editing textarea font.- Parameters:
fontStyle
- the style of the font.- Since:
- 2.6
- See Also:
Font.getStyle()
-
getFontSize
public int getFontSize()
Returns the size of the GUI's editing textarea font.- Returns:
- the size of the font.
- Since:
- 2.6
- See Also:
Font.getSize()
-
setFontSize
public void setFontSize(int fontSize)
Sets the size of the GUI's editing textarea font.- Parameters:
fontSize
- the size of the font.- Since:
- 2.6
- See Also:
Font.getSize()
-
getLookAndFeelName
public java.lang.String getLookAndFeelName()
Returns the name of the GUI's LaF.- Returns:
- the name of the LaF.
- Since:
- 2.6
- See Also:
UIManager.LookAndFeelInfo.getName()
-
setLookAndFeelName
public void setLookAndFeelName(java.lang.String lookAndFeelName)
Sets the name of the GUI's LaF.- Parameters:
lookAndFeelName
- the name of the LaF.- Since:
- 2.6 @see
- See Also:
UIManager.LookAndFeelInfo.getName()
-
getNgramDirectory
@Nullable public @Nullable java.io.File getNgramDirectory()
Directory with ngram data or null.- Since:
- 3.0
-
setNgramDirectory
public void setNgramDirectory(java.io.File dir)
Sets the directory with ngram data (may be null).- Since:
- 3.0
-
getWord2VecDirectory
@Nullable public @Nullable java.io.File getWord2VecDirectory()
Directory with word2vec data or null.- Since:
- 4.0
-
setWord2VecDirectory
public void setWord2VecDirectory(java.io.File dir)
Sets the directory with word2vec data (may be null).- Since:
- 4.0
-
getErrorColors
public java.util.Map<org.languagetool.rules.ITSIssueType,java.awt.Color> getErrorColors()
- Since:
- 2.8
-
isStyleCategory
public boolean isStyleCategory(java.lang.String category)
- Since:
- 4.3 Returns true if category is style like
-
initStyleCategories
public void initStyleCategories(java.util.List<org.languagetool.rules.Rule> allRules)
- Since:
- 4.4 Initialize set of style like categories
-
isSpecialTabCategory
public boolean isSpecialTabCategory(java.lang.String category)
- Since:
- 4.3 Returns true if category is a special Tab category
-
isInSpecialTab
public boolean isInSpecialTab(java.lang.String category, java.lang.String tabName)
- Since:
- 4.3 Returns true if category is member of named special Tab
-
getSpecialTabNames
public java.lang.String[] getSpecialTabNames()
- Since:
- 4.3 Returns all special tab names
-
getSpecialTabCategories
public java.util.Set<java.lang.String> getSpecialTabCategories(java.lang.String tabName)
- Since:
- 4.3 Returns all categories for a named special tab
-
getUnderlineColors
public java.util.Map<java.lang.String,java.awt.Color> getUnderlineColors()
- Since:
- 4.2
-
getUnderlineColor
public java.awt.Color getUnderlineColor(java.lang.String category)
- Since:
- 4.2 Get the color to underline a rule match by the Name of its category
-
setUnderlineColor
public void setUnderlineColor(java.lang.String category, java.awt.Color col)
- Since:
- 4.2 Set the color to underline a rule match for its category
-
setDefaultUnderlineColor
public void setDefaultUnderlineColor(java.lang.String category)
- Since:
- 4.2 Set the color back to default (removes category from map)
-
getConfigurableValues
public java.util.Map<java.lang.String,java.lang.Integer> getConfigurableValues()
returns all configured values- Since:
- 4.2
-
getConfigurableValue
public int getConfigurableValue(java.lang.String ruleID)
- Since:
- 4.2 Get the configurable value of a rule by ruleID returns -1 if no value is set by configuration
-
setConfigurableValue
public void setConfigurableValue(java.lang.String ruleID, int value)
- Since:
- 4.2 Set the value for a rule with ruleID
-
isSwitchedOff
public boolean isSwitchedOff()
- Since:
- 4.4 if true: LT is switched Off, else: LT is switched On
-
setSwitchedOff
public void setSwitchedOff(boolean switchOff, org.languagetool.Language lang) throws java.io.IOException
- Throws:
java.io.IOException
- Since:
- 4.4 Set LT is switched Off or On save configuration
-
loadConfiguration
private void loadConfiguration() throws java.io.IOException
- Throws:
java.io.IOException
-
loadConfiguration
public void loadConfiguration(java.lang.String profile) throws java.io.IOException
- Throws:
java.io.IOException
-
parseErrorColors
private void parseErrorColors(java.lang.String colorsString)
-
parseUnderlineColors
private void parseUnderlineColors(java.lang.String colorsString)
-
parseConfigurableRuleValues
private void parseConfigurableRuleValues(java.lang.String rulesValueString)
-
getQualifier
private java.lang.String getQualifier(org.languagetool.Language lang)
-
loadConfigForOtherLanguages
private void loadConfigForOtherLanguages(org.languagetool.Language lang, java.util.Properties prop, java.lang.String prefix)
-
storeConfigKeyFromProp
private void storeConfigKeyFromProp(java.util.Properties prop, java.lang.String key)
-
getListFromProperties
private java.util.Collection<? extends java.lang.String> getListFromProperties(java.util.Properties props, java.lang.String key)
-
saveConfiguration
public void saveConfiguration(org.languagetool.Language lang) throws java.io.IOException
- Throws:
java.io.IOException
-
addListToProperties
private void addListToProperties(java.util.Properties props, java.lang.String key, java.util.Set<java.lang.String> list)
-
setAllProfileKeys
private void setAllProfileKeys()
-
storeConfigforAllProfiles
private void storeConfigforAllProfiles(java.util.Properties props)
-
saveConfigforProfile
private void saveConfigforProfile(java.util.Properties props, java.lang.String prefix)
-
-