public class MultiDocumentsHandler extends Object
Modifier and Type | Method and Description |
---|---|
void |
activateRule(String ruleId)
Activate a rule by rule iD
|
void |
activateRule(String langcode,
String ruleId) |
void |
activateTextRulesByIndex(int index,
SwJLanguageTool lt)
activate all rules stored under a given index related to the list of getNumMinToCheckParas
deactivate all other text level rules
|
boolean |
addLinguServiceEventListener(com.sun.star.linguistic2.XLinguServiceEventListener eventListener)
Add a listener that allow re-checking the document after changing the
options in the configuration dialog box.
|
void |
deactivateRule()
Deactivate a rule as requested by the context menu
|
void |
deactivateRule(String ruleId,
String langcode,
boolean reactivate)
Deactivate a rule by rule iD
|
void |
disposing(com.sun.star.lang.EventObject source)
remove internal stored text if document disposes
|
com.sun.star.linguistic2.ProofreadingResult |
doProofreading(String docID,
String paraText,
com.sun.star.lang.Locale locale,
int startOfSentencePos,
int nSuggestedBehindEndOfSentencePosition,
com.sun.star.beans.PropertyValue[] propertyValues)
Runs the grammar checker on paragraph text.
|
com.sun.star.uno.XComponentContext |
getContext()
Returns xContext
|
SingleDocument |
getCurrentDocument()
Get the current used document
|
com.sun.star.lang.Locale |
getDocumentLocale()
Checks the language under the cursor.
|
List<SingleDocument> |
getDocuments()
Get list of single documents
|
Language |
getLanguage()
Checks the language under the cursor.
|
static Language |
getLanguage(com.sun.star.lang.Locale locale)
Get language from locale
|
SwJLanguageTool |
getLanguageTool()
get LanguageTool
|
LinguisticServices |
getLinguisticServices()
get LinguisticServices
|
com.sun.star.lang.Locale |
getLocale()
Get current locale language
|
static com.sun.star.lang.Locale[] |
getLocales() |
List<Integer> |
getNumMinToCheckParas()
Returns a list of different numbers of paragraphs to check for text level rules
|
static String |
getServiceDisplayName(com.sun.star.lang.Locale locale)
Get the displayed service name for LT
|
TextLevelCheckQueue |
getTextLevelCheckQueue()
Get text level queue
|
boolean |
heapLimitIsReached()
heap limit is reached
|
String |
ignoreOnce()
Call method ignoreOnce for concerned document
|
String |
ignorePermanent()
Call method ignorePermanent for concerned document
|
void |
ignoreRule(String ruleId,
com.sun.star.lang.Locale locale)
Called when "Ignore" is selected e.g. in the context menu for an error.
|
boolean |
isBackgroundCheckOff()
true, if LanguageTool is switched off
|
boolean |
isEnoughHeapSpace()
Test if enough heap space is left
Change to single paragraph mode if not
return false if heap space is to small
|
boolean |
isJavaLookAndFeelSet()
true, if Java look and feel is set
|
boolean |
isSortedRuleForIndex(int index)
Test if sorted rules for index exist
|
boolean |
isSpellChecker()
We leave spell checking to OpenOffice/LibreOffice.
|
boolean |
javaVersionOkay()
Test if the needed java version is installed
|
void |
reactivateTextRules(SwJLanguageTool lt)
reactivate all text level rules
|
boolean |
removeLinguServiceEventListener(com.sun.star.linguistic2.XLinguServiceEventListener eventListener)
Remove a listener from the event listeners list.
|
void |
removeMenuListener(com.sun.star.lang.XComponent xComponent)
Delete the menu listener of a document
|
void |
renewMarkups()
Call method renewMarkups for concerned document
|
boolean |
resetCheck()
Inform listener that the document should be rechecked for grammar and style check.
|
boolean |
resetCheck(short eventFlag)
Inform listener that the doc should be rechecked for a special event flag.
|
void |
resetIgnoreOnce()
reset ignoreOnce information in all documents
|
void |
resetIgnoreRules()
Called on rechecking the document - resets the ignore status for rules that
was set in the spelling dialog box or in the context menu.
|
void |
resetSortedTextRules(SwJLanguageTool lt)
reset sorted text level rules
|
void |
runOptionsDialog()
Runs LT options dialog box.
|
void |
runShapeCheck(boolean hasShapes,
int where)
Start or stop the shape check loop
|
void |
setConfigFileName(String name)
Set Information LT spell and grammar check dialog was started
|
void |
setConfigurationDialog(ConfigurationDialog dialog)
Set pointer to configuration dialog
|
void |
setJavaLookAndFeel()
Set Look and Feel for Java Swing Components
|
void |
setLtDialog(SpellAndGrammarCheckDialog.LtCheckDialog dialog)
Set pointer to LT spell and grammar check dialog
|
void |
setLtDialogIsRunning(boolean running)
Set Information LT spell and grammar check dialog was started
|
void |
setMenuDocId(String docId)
Set docID used within menu
|
void |
setUseOriginalCheckDialog()
Set use original spell und grammar dialog (for OO and old LO)
|
boolean |
toggleNoBackgroundCheck()
Toggle Switch Off / On of LT
return true if toggle was done
|
void |
trigger(String sEvent)
Triggers the events from LT menu
|
boolean |
useOriginalCheckDialog()
Set use original spell und grammar dialog (for OO and old LO)
|
public final com.sun.star.linguistic2.ProofreadingResult doProofreading(String docID, String paraText, com.sun.star.lang.Locale locale, int startOfSentencePos, int nSuggestedBehindEndOfSentencePosition, com.sun.star.beans.PropertyValue[] propertyValues)
docID
- document IDparaText
- paragraph textlocale
- Locale the text LocalestartOfSentencePos
- start of sentence positionnSuggestedBehindEndOfSentencePosition
- end of sentence positionpublic SingleDocument getCurrentDocument()
public void setConfigurationDialog(ConfigurationDialog dialog)
public void setLtDialog(SpellAndGrammarCheckDialog.LtCheckDialog dialog)
public void setLtDialogIsRunning(boolean running)
public void setConfigFileName(String name)
public SwJLanguageTool getLanguageTool()
public LinguisticServices getLinguisticServices()
public Language getLanguage()
@Nullable public com.sun.star.lang.Locale getDocumentLocale()
public static Language getLanguage(com.sun.star.lang.Locale locale)
public void removeMenuListener(com.sun.star.lang.XComponent xComponent)
public com.sun.star.lang.Locale getLocale()
public List<SingleDocument> getDocuments()
public TextLevelCheckQueue getTextLevelCheckQueue()
public boolean isBackgroundCheckOff()
public boolean isJavaLookAndFeelSet()
public boolean toggleNoBackgroundCheck() throws IOException
IOException
public void setMenuDocId(String docId)
public void setUseOriginalCheckDialog()
public boolean useOriginalCheckDialog()
public String ignoreOnce()
public String ignorePermanent()
public void renewMarkups()
public void resetIgnoreOnce()
public void activateRule(String ruleId)
public void deactivateRule()
public void deactivateRule(String ruleId, String langcode, boolean reactivate)
public void resetSortedTextRules(SwJLanguageTool lt)
public List<Integer> getNumMinToCheckParas()
public boolean isSortedRuleForIndex(int index)
public void activateTextRulesByIndex(int index, SwJLanguageTool lt)
public void reactivateTextRules(SwJLanguageTool lt)
public final boolean isSpellChecker()
public com.sun.star.uno.XComponentContext getContext()
public void runOptionsDialog()
public static final com.sun.star.lang.Locale[] getLocales()
public final boolean addLinguServiceEventListener(com.sun.star.linguistic2.XLinguServiceEventListener eventListener)
eventListener
- the listener to be addedpublic final boolean removeLinguServiceEventListener(com.sun.star.linguistic2.XLinguServiceEventListener eventListener)
eventListener
- the listener to be removedpublic boolean resetCheck()
public boolean resetCheck(short eventFlag)
public void trigger(String sEvent)
public boolean javaVersionOkay()
public void setJavaLookAndFeel()
public boolean heapLimitIsReached()
public boolean isEnoughHeapSpace()
public void ignoreRule(String ruleId, com.sun.star.lang.Locale locale)
public void resetIgnoreRules()
public static String getServiceDisplayName(com.sun.star.lang.Locale locale)
public void disposing(com.sun.star.lang.EventObject source)
public void runShapeCheck(boolean hasShapes, int where)