de.danielnaber.languagetool.openoffice
Class Main

Object
  extended by WeakBase
      extended by Main

public class Main
extends WeakBase


Constructor Summary
Main(XComponentContext xCompContext)
           
 
Method Summary
static XSingleComponentFactory __getComponentFactory(String sImplName)
           
static boolean __writeRegistryServiceInfo(XRegistryKey regKey)
           
 boolean addLinguServiceEventListener(XLinguServiceEventListener xLinEvLis)
          Add a listener that allow re-checking the document after changing the options in the configuration dialog box.
 void changeContext(XComponentContext xCompContext)
           
 ProofreadingResult doProofreading(String docID, String paraText, Locale locale, int startOfSentencePos, int nSuggestedBehindEndOfSentencePosition, PropertyValue[] props)
          Runs the grammar checker on paragraph text.
 String getImplementationName()
           
 Locale[] getLocales()
           
 String getServiceDisplayName(Locale locale)
           
static String[] getServiceNames()
           
 String[] getSupportedServiceNames()
           
 boolean hasLocale(Locale locale)
           
 void ignoreRule(String ruleId, Locale locale)
           
 boolean isSpellChecker()
          LT does not support spell-checking, so we return false.
 boolean removeLinguServiceEventListener(XLinguServiceEventListener xLinEvLis)
          Remove a listener from the event listeners list.
 void resetDocument()
          Inform listener (grammar checking iterator) that options have changed and the doc should be rechecked.
 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 runOptionsDialog()
          Runs LT options dialog box.
 boolean supportsService(String sServiceName)
           
 void trigger(String sEvent)
           
 
Methods inherited from class Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Main

public Main(XComponentContext xCompContext)
Method Detail

changeContext

public final void changeContext(XComponentContext xCompContext)

doProofreading

public final ProofreadingResult doProofreading(String docID,
                                               String paraText,
                                               Locale locale,
                                               int startOfSentencePos,
                                               int nSuggestedBehindEndOfSentencePosition,
                                               PropertyValue[] props)
Runs the grammar checker on paragraph text.

Parameters:
String - docID - document ID
String - paraText - paragraph text
locale - Locale - the text Locale
startOfSentencePos - start of sentence position
nSuggestedBehindEndOfSentencePosition - end of sentence position
PropertyValue - [] props - properties
Returns:
ProofreadingResult containing the results of the check. *
Throws:
IllegalArgumentException - (not really, LT simply returns the ProofreadingResult with the values supplied)

isSpellChecker

public final boolean isSpellChecker()
LT does not support spell-checking, so we return false.

Returns:
false

runOptionsDialog

public final void runOptionsDialog()
Runs LT options dialog box.


getLocales

public final Locale[] getLocales()
Returns:
An array of Locales supported by LT.

hasLocale

public final boolean hasLocale(Locale locale)
Parameters:
locale - The Locale to check.
Returns:
true if LT supports the language of a given locale.

addLinguServiceEventListener

public final boolean addLinguServiceEventListener(XLinguServiceEventListener xLinEvLis)
Add a listener that allow re-checking the document after changing the options in the configuration dialog box.

Parameters:
xLinEvLis - - the listener to be added
Returns:
true if listener is non-null and has been added, false otherwise.

removeLinguServiceEventListener

public final boolean removeLinguServiceEventListener(XLinguServiceEventListener xLinEvLis)
Remove a listener from the event listeners list.

Parameters:
xLinEvLis - - the listener to be removed
Returns:
true if listener is non-null and has been removed, false otherwise.

resetDocument

public final void resetDocument()
Inform listener (grammar checking iterator) that options have changed and the doc should be rechecked.


getSupportedServiceNames

public String[] getSupportedServiceNames()

getServiceNames

public static String[] getServiceNames()

supportsService

public boolean supportsService(String sServiceName)

getImplementationName

public String getImplementationName()

__getComponentFactory

public static XSingleComponentFactory __getComponentFactory(String sImplName)

__writeRegistryServiceInfo

public static boolean __writeRegistryServiceInfo(XRegistryKey regKey)

trigger

public void trigger(String sEvent)

ignoreRule

public void ignoreRule(String ruleId,
                       Locale locale)
                throws IllegalArgumentException
Throws:
IllegalArgumentException

resetIgnoreRules

public 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. The rules disabled in the config dialog box are left as intact.


getServiceDisplayName

public String getServiceDisplayName(Locale locale)


Copyright © 2005-2009 Daniel Naber