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)
           
 GrammarCheckingResult doGrammarChecking(int docID, String paraText, Locale locale, int startOfSentencePos, int suggEndOfSentencePos, int[] aLanguagePortions, Locale[] aLanguagePortionsLocales)
          Runs the grammar checker on paragraph text.
 void endDocument(int oldDocID)
          Called when the document check is finished.
 void endParagraph(int docID)
          Called to clear the paragraph state.
 String getImplementationName()
           
 Locale[] getLocales()
           
static String[] getServiceNames()
           
 String[] getSupportedServiceNames()
           
 boolean hasLocale(Locale locale)
           
 boolean hasOptionsDialog()
          LT has an options dialog box, so we return true.
 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 runOptionsDialog()
          Runs LT options dialog box.
 void startDocument(int docID)
          Called to setup the doc state via ID.
 void startParagraph(int docID)
          Called to setup the paragraph state in a doc with some ID.
 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 void changeContext(XComponentContext xCompContext)

doGrammarChecking

public final GrammarCheckingResult doGrammarChecking(int docID,
                                                     String paraText,
                                                     Locale locale,
                                                     int startOfSentencePos,
                                                     int suggEndOfSentencePos,
                                                     int[] aLanguagePortions,
                                                     Locale[] aLanguagePortionsLocales)
                                              throws IllegalArgumentException
Runs the grammar checker on paragraph text.

Parameters:
docID - int - document ID
paraText - - paragraph text
locale - Locale - the text Locale
startOfSentencePos - int start of sentence position
suggEndOfSentencePos - int end of sentence position
aLanguagePortions - - lengths of language portions with a given locale
aLanguagePortionsLocales - - locales of language portions
Returns:
GrammarCheckingResult containing the results of the check.
Throws:
IllegalArgumentException - (not really, LT simply returns the GrammarCheckingResult with the values supplied)

endDocument

public void endDocument(int oldDocID)
                 throws IllegalArgumentException
Called when the document check is finished.

Parameters:
oldDocID - - the ID of the document already checked
Throws:
IllegalArgumentException - in case oldDocID is not a valid myDocID.

endParagraph

public void endParagraph(int docID)
Called to clear the paragraph state. Not used yet in our implementation.

Parameters:
docID - - the ID of the document already checked valid myDocID.

hasOptionsDialog

public final boolean hasOptionsDialog()
LT has an options dialog box, so we return true.

Returns:
true

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.


startDocument

public final void startDocument(int docID)
                         throws IllegalArgumentException
Called to setup the doc state via ID.

Parameters:
docID - - the doc ID
Throws:
IllegalArgumentException - in case docID is not a valid document ID.

startParagraph

public void startParagraph(int docID)
                    throws IllegalArgumentException
Called to setup the paragraph state in a doc with some ID. Not yet implemented (probably will be implemented in the future).

Parameters:
docID - - the doc ID
Throws:
IllegalArgumentException - in case docID is not a valid myDocID.

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)


Copyright © 2005-2007 Daniel Naber