RapidSpell Desktop


com.keyoti.rapidSpell.desktop
Class RapidSpellGUIDialog

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Container
              |
              +--java.awt.Window
                    |
                    +--java.awt.Dialog
                          |
                          +--javax.swing.JDialog
                                |
                                +--com.keyoti.rapidSpell.desktop.RapidSpellGUIDialog

public class RapidSpellGUIDialog
extends javax.swing.JDialog
implements java.awt.event.ActionListener, java.awt.event.ItemListener, java.lang.Runnable, java.awt.event.FocusListener

Multi-threaded GUI for user to spell check any JTextComponent (eg, JEditorPane, JTextArea, JTextField).

To use this GUI bean component as an integral part of your application simply instantiate it, set the JTextComponent you wish this GUI to spell check and call check(), which will bring up this component in a new JFrame allowing the user to correct their document in the JTextComponent.

Example 1. Complete trivial application using the RapidSpell GUI.



import com.keyoti.rapidSpell.desktop.*;
import javax.swing.*;
import java.awt.event.*;

public class TestGUI extends JFrame {

	JTextArea box = new JTextArea("This is sume text to check.", 20, 60);
	RapidSpellGUI rapidGUI = new RapidSpellGUI();

	public TestGUI() {
		//put the text box in the JFrame
		getContentPane().add(box);

		//pack and display the JFrame
		pack(); 
		setVisible(true);

		//open the GUI spell checker and begin checking the text box.
		rapidGUI.check( box );
	}

	public static void main(String[] args) {
		TestGUI t = new TestGUI();
	}
}

	

You may wish to customise this GUI yourself, in which case simply extend this class, override buildGUI() and use the protected fields as you wish. For example

Example 2. Custom GUI for this component (see CustomGUI.java for more).


import com.keyoti.rapidSpell.desktop.*;
import javax.swing.*;
import java.awt.*;

public class CustomGUI extends RapidSpellGUI
{
	public CustomGUI()
	{
		super();
	}
	
	// VERY SIMPLE, BUT UGLY LOOKING EXAMPLE
	public void buildGUI()
	{
		Box myBox = Box.createVerticalBox();

		//define the protected fields as I want
		ignoreButton.setText("Ignore");
		ignoreAllButton.setText("Ignore All");
		changeButton.setText("Change");
		changeAllButton.setText("Change All");
		cancelButton.setText("Cancel");

		//add all the protected fields I want to use and layout as I wish
		myBox.add(notInDictionaryLabel);
		myBox.add(queryWordPane);
		myBox.add(ignoreButton);
		myBox.add(ignoreAllButton);
		myBox.add(new JScrollPane(suggestionsList, JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED, JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED ));
		myBox.add(changeButton);
		myBox.add(changeAllButton);
		myBox.add(cancelButton);
		
		getContentPane().add(myBox);
	}
}
 

Version:
2.0.0
See Also:
Serialized Form

Inner classes inherited from class javax.swing.JDialog
javax.swing.JDialog.AccessibleJDialog
 
Field Summary
protected  javax.swing.JButton addButton
          Function button - adds word in query pane to user dictionary if specified.
protected  javax.swing.JButton cancelButton
          Function button - cancels the search and disposes of this JFrame.
protected  javax.swing.JButton changeAllButton
          Function button - changes every occurance of bad word in document.
protected  javax.swing.JButton changeButton
          Function button - changes bad word in document to selected suggestion or amended query pane word.
 boolean disposeAtEnd
          Whether to dispose of this frame when checking is finished
protected  boolean findSuggestions
          Whether this should look up suggestions for misspelt words or not
static int HASHING_SUGGESTIONS
          Indicator for suggestion method (Hashing is default).
protected  javax.swing.JButton ignoreAllButton
          Function button - ignores all occurances of current bad word.
protected  javax.swing.JButton ignoreButton
          Function button - ignores current bad word and continues checking document.
protected  javax.swing.JLabel notInDictionaryLabel
          JLabel marking the not in dictionary query pane.
static int PHONETIC_SUGGESTIONS
          Indicator for suggestion method (Hashing is default).
protected  javax.swing.JTextArea queryWordPane
          JTextArea where not in dictionary (bad words) are queried and replacements can be entered.
protected  javax.swing.JCheckBox suggestionFinderCheckBox
          Check box - enables/disables the suggestion finder
protected  javax.swing.JLabel suggestionsLabel
          JLabel marking the suggestions JList, is changed to "Finding Suggestions..." periodically.
protected  javax.swing.JList suggestionsList
          JList where suggestions are loaded.
protected  ICheckerEngine theSpellChecker
          The spell checker component being used
protected  java.lang.ref.WeakReference theTextComponentRef
          Weak reference to the text component being checked
 
Fields inherited from class javax.swing.JDialog
accessibleContext, rootPane, rootPaneCheckingEnabled
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Constructor Summary
RapidSpellGUIDialog()
          Construct this GUI component - this will NOT open a new JDialog, call check() to do that.
RapidSpellGUIDialog(java.awt.Dialog owner)
          Construct this GUI component - this will NOT open a new JDialog, call check() to do that.
RapidSpellGUIDialog(java.awt.Dialog owner, boolean modal)
          Construct this GUI component - this will NOT open a new JDialog, call check() to do that.
RapidSpellGUIDialog(java.awt.Dialog owner, java.lang.String title)
          Construct this GUI component - this will NOT open a new JDialog, call check() to do that.
RapidSpellGUIDialog(java.awt.Dialog owner, java.lang.String title, boolean modal)
          Construct this GUI component - this will NOT open a new JDialog, call check() to do that.
RapidSpellGUIDialog(javax.swing.JFrame owner)
          Construct this GUI component - this will NOT open a new JDialog, call check() to do that.
RapidSpellGUIDialog(javax.swing.JFrame owner, boolean modal)
          Construct this GUI component - this will NOT open a new JDialog, call check() to do that.
RapidSpellGUIDialog(javax.swing.JFrame owner, java.lang.String title)
          Construct this GUI component - this will NOT open a new JDialog, call check() to do that.
RapidSpellGUIDialog(javax.swing.JFrame owner, java.lang.String title, boolean modal)
          Construct this GUI component - this will NOT open a new JDialog, call check() to do that.
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent e)
          Listen to GUI events and perform actions depending on the button sending the event.
 void addSpellCheckListener(SpellCheckListener l)
          Adds a SpellCheckListener.
protected  void buildGUI()
          Constructs the GUI - This should be over-ridden by sub-classes that wish to use their own layout.
 void check()
          Bring up the spell checker JFrame and start checking the component set by setJTextComponentToCheck().
 void check(javax.swing.text.JTextComponent textComponent)
          Bring up the spell checker JFrame and start checking the JTextComponent textComponent.
 void dispose()
          Frees up resources.
 void focusGained(java.awt.event.FocusEvent e)
          Called when objects whose focus this is listening to gain focus.
 void focusLost(java.awt.event.FocusEvent e)
          Empty
 boolean getCheckCompoundWords()
          Whether to check if words are made of compound forms - to be used in languages which use compounds, such as German.
 ICheckerEngine getCheckerEngine()
          Gets the checker engine to use, this object must implement the ICheckerEngine interface, allows customization or replacement of the spell checker.
 java.lang.String getDictFilePath()
          The file to be used as the main dictionary, if this is null then the RapidSpellMDict jar is used.
 int getGUILanguage()
          The language to show the UI in.
 java.awt.Color getHighlightColor()
          Gets the color of the highlight used in the JTextComponent when misspelt words are found.
 boolean getIgnoreCapitalizedWords()
          Gets whether to ignore words that start with capital letters.
 boolean getIgnoreWordsWithDigits()
          Whether to ignore words with digits in them.
 boolean getIgnoreXML()
          Whether to ignore XML/HTML tags, should be set true for 'rich HTML text box' support, false by default.
 boolean getIncludeUserDictionaryInSuggestions()
          Gets whether the user dictionary should be used in finding suggestions for misspelt words.
 int getLanguageParser()
          Gets the type of language parsing to use.
 boolean getLookIntoHyphenatedText()
          Whether to 'look into' text with hyphens (-), if the word has hyphens in it and LookIntoHyphenatedText is set true (default), the parts of the text around the hyphens will be checked individually.
 boolean getSeparateHyphenWords()
          Gets whether to treat hyphenated (-) words as separate words, default is false.
 SpellCheckListener[] getSpellCheckListeners()
          Gets all SpellCheckListeners.
 int getSuggestionsMethod()
          Gets the suggestions method to use.
 boolean getSuggestSplitWords()
          Whether to check for joined words when looking for suggestions.
 boolean isCancelled()
          Whether the spell check was cancelled
 boolean isShowFinishedMessageBox()
          Returns whether a JOptionPane message box should be opened when the spell check is complete.
 void itemStateChanged(java.awt.event.ItemEvent e)
          Listen to GUI events and perform actions.
protected  java.lang.String makeChange(boolean inChangeAllProcess)
          Changes the current bad word for one selected from the suggestions list or entered in the query pane returns the word used.
 void removeSpellCheckListener(SpellCheckListener l)
          Removes a SpellCheckListener.
 void run()
          Called by the constructor in a new thread, to setup document parameters and check the text while the GUI components instantiate.
 void setCheckCompoundWords(boolean value)
          Whether to check if words are made of compound forms - to be used in languages which use compounds, such as German.
 void setCheckerEngine(ICheckerEngine value)
          Sets the checker engine to use, this object must implement the ICheckerEngine interface, allows customization or replacement of the spell checker.
 void setDictFilePath(java.lang.String value)
          The file to be used as the main dictionary, if this is null then the RapidSpellMDict jar is used.
 void setGUILanguage(int value)
          The language to show the UI in.
 void setHighlightColor(java.awt.Color c)
          Sets the color of the highlight used in the JTextComponent when misspelt words are found.
 void setIgnoreCapitalizedWords(boolean v)
          Sets whether to ignore words that start with capital letters.
 void setIgnoreWordsWithDigits(boolean value)
          Whether to ignore words with digits in them.
 void setIgnoreXML(boolean value)
          Whether to ignore XML/HTML tags, should be set true for 'rich HTML text box' support, false by default.
 void setIncludeUserDictionaryInSuggestions(boolean v)
          Sets whether the user dictionary should be used in finding suggestions for misspelt words.
 void setJTextComponentToCheck(javax.swing.text.JTextComponent textComponent)
          Set the JTextComponent (eg; JTextArea etc) that this GUI will spell check.
 void setLanguageParser(int language)
          The type of language parsing to use.
 void setLookIntoHyphenatedText(boolean value)
          Whether to 'look into' text with hyphens (-), if the word has hyphens in it and LookIntoHyphenatedText is set true (default), the parts of the text around the hyphens will be checked individually.
 void setSeparateHyphenWords(boolean f)
          Sets whether to treat hyphenated (-) words as separate words, default is false.
 void setShowFinishedMessageBox(boolean b)
          Sets whether a JOptionPane message box should be opened when the spell check is complete.
 void setSuggestionsMethod(int method)
          Sets the suggestions method to use.
 void setSuggestSplitWords(boolean value)
          Whether to check for joined words when looking for suggestions.
 void setUserDictionaryFile(java.io.File userDictionaryFile)
          Set the user dictionary file, if this file doesn't exist it will be created.
protected  boolean shouldEnableAddButton()
           
protected  javax.swing.text.JTextComponent theTextComponent()
          Returns the instance of the text component being checked, from the WeakReference held
 
Methods inherited from class javax.swing.JDialog
addImpl, createRootPane, dialogInit, getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getJMenuBar, getLayeredPane, getRootPane, isRootPaneCheckingEnabled, paramString, processKeyEvent, processWindowEvent, remove, setContentPane, setDefaultCloseOperation, setGlassPane, setJMenuBar, setLayeredPane, setLayout, setLocationRelativeTo, setRootPane, setRootPaneCheckingEnabled, update
 
Methods inherited from class java.awt.Dialog
addNotify, getTitle, hide, isModal, isResizable, setModal, setResizable, setTitle, show
 
Methods inherited from class java.awt.Window
addWindowListener, applyResourceBundle, applyResourceBundle, finalize, getFocusOwner, getInputContext, getLocale, getOwnedWindows, getOwner, getToolkit, getWarningString, isShowing, pack, postEvent, processEvent, removeWindowListener, setCursor, toBack, toFront
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getInsets, getLayout, getMaximumSize, getMinimumSize, getPreferredSize, insets, invalidate, isAncestorOf, layout, list, list, locate, minimumSize, paint, paintComponents, preferredSize, print, printComponents, processContainerEvent, remove, removeAll, removeContainerListener, removeNotify, setFont, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addPropertyChangeListener, addPropertyChangeListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, getBackground, getBounds, getBounds, getColorModel, getComponentOrientation, getCursor, getDropTarget, getFont, getFontMetrics, getForeground, getGraphics, getHeight, getInputMethodRequests, getLocation, getLocation, getLocationOnScreen, getName, getParent, getPeer, getSize, getSize, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isDisplayable, isDoubleBuffered, isEnabled, isFocusTraversable, isLightweight, isOpaque, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processInputMethodEvent, processMouseEvent, processMouseMotionEvent, remove, removeComponentListener, removeFocusListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setDropTarget, setEnabled, setForeground, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, size, toString, transferFocus
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

theSpellChecker

protected ICheckerEngine theSpellChecker
The spell checker component being used

theTextComponentRef

protected java.lang.ref.WeakReference theTextComponentRef
Weak reference to the text component being checked

findSuggestions

protected boolean findSuggestions
Whether this should look up suggestions for misspelt words or not

changeButton

protected javax.swing.JButton changeButton
Function button - changes bad word in document to selected suggestion or amended query pane word.

ignoreButton

protected javax.swing.JButton ignoreButton
Function button - ignores current bad word and continues checking document.

ignoreAllButton

protected javax.swing.JButton ignoreAllButton
Function button - ignores all occurances of current bad word.

addButton

protected javax.swing.JButton addButton
Function button - adds word in query pane to user dictionary if specified.

changeAllButton

protected javax.swing.JButton changeAllButton
Function button - changes every occurance of bad word in document.

cancelButton

protected javax.swing.JButton cancelButton
Function button - cancels the search and disposes of this JFrame.

suggestionFinderCheckBox

protected javax.swing.JCheckBox suggestionFinderCheckBox
Check box - enables/disables the suggestion finder

queryWordPane

protected final javax.swing.JTextArea queryWordPane
JTextArea where not in dictionary (bad words) are queried and replacements can be entered.

suggestionsList

protected final javax.swing.JList suggestionsList
JList where suggestions are loaded.

PHONETIC_SUGGESTIONS

public static int PHONETIC_SUGGESTIONS
Indicator for suggestion method (Hashing is default).

HASHING_SUGGESTIONS

public static int HASHING_SUGGESTIONS
Indicator for suggestion method (Hashing is default).

suggestionsLabel

protected javax.swing.JLabel suggestionsLabel
JLabel marking the suggestions JList, is changed to "Finding Suggestions..." periodically.

notInDictionaryLabel

protected javax.swing.JLabel notInDictionaryLabel
JLabel marking the not in dictionary query pane.

disposeAtEnd

public boolean disposeAtEnd
Whether to dispose of this frame when checking is finished
Constructor Detail

RapidSpellGUIDialog

public RapidSpellGUIDialog()
Construct this GUI component - this will NOT open a new JDialog, call check() to do that.

RapidSpellGUIDialog

public RapidSpellGUIDialog(java.awt.Dialog owner)
Construct this GUI component - this will NOT open a new JDialog, call check() to do that.

RapidSpellGUIDialog

public RapidSpellGUIDialog(java.awt.Dialog owner,
                           boolean modal)
Construct this GUI component - this will NOT open a new JDialog, call check() to do that.

RapidSpellGUIDialog

public RapidSpellGUIDialog(java.awt.Dialog owner,
                           java.lang.String title)
Construct this GUI component - this will NOT open a new JDialog, call check() to do that.

RapidSpellGUIDialog

public RapidSpellGUIDialog(java.awt.Dialog owner,
                           java.lang.String title,
                           boolean modal)
Construct this GUI component - this will NOT open a new JDialog, call check() to do that.

RapidSpellGUIDialog

public RapidSpellGUIDialog(javax.swing.JFrame owner)
Construct this GUI component - this will NOT open a new JDialog, call check() to do that.

RapidSpellGUIDialog

public RapidSpellGUIDialog(javax.swing.JFrame owner,
                           boolean modal)
Construct this GUI component - this will NOT open a new JDialog, call check() to do that.

RapidSpellGUIDialog

public RapidSpellGUIDialog(javax.swing.JFrame owner,
                           java.lang.String title)
Construct this GUI component - this will NOT open a new JDialog, call check() to do that.

RapidSpellGUIDialog

public RapidSpellGUIDialog(javax.swing.JFrame owner,
                           java.lang.String title,
                           boolean modal)
Construct this GUI component - this will NOT open a new JDialog, call check() to do that.
Method Detail

theTextComponent

protected javax.swing.text.JTextComponent theTextComponent()
Returns the instance of the text component being checked, from the WeakReference held

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent e)
Listen to GUI events and perform actions depending on the button sending the event.
Specified by:
actionPerformed in interface java.awt.event.ActionListener

check

public void check()
           throws NullJTextComponentException
Bring up the spell checker JFrame and start checking the component set by setJTextComponentToCheck().
Throws:
NullJTextComponentException - if setJTextComponentToCheck() hasn't be called first with a JTextComponent object.

check

public void check(javax.swing.text.JTextComponent textComponent)
           throws java.lang.NullPointerException
Bring up the spell checker JFrame and start checking the JTextComponent textComponent.
Throws:
java.lang.NullPointerException - if textComponent parameter is null.

isCancelled

public boolean isCancelled()
Whether the spell check was cancelled

setShowFinishedMessageBox

public void setShowFinishedMessageBox(boolean b)
Sets whether a JOptionPane message box should be opened when the spell check is complete.
Parameters:
b - boolean indicating if the message box should be opened.
Since:
v1.1

isShowFinishedMessageBox

public boolean isShowFinishedMessageBox()
Returns whether a JOptionPane message box should be opened when the spell check is complete.
Since:
v1.1

setJTextComponentToCheck

public void setJTextComponentToCheck(javax.swing.text.JTextComponent textComponent)
Set the JTextComponent (eg; JTextArea etc) that this GUI will spell check.
Parameters:
textComponent - the JTextComponent that this will spell check.
Throws:
java.lang.NullPointerException - if textComponent parameter is null.

setHighlightColor

public void setHighlightColor(java.awt.Color c)
                       throws java.lang.NullPointerException
Sets the color of the highlight used in the JTextComponent when misspelt words are found.
Parameters:
c - new highlight color.
Throws:
java.lang.NullPointerException - if c is null.
Since:
v1.1

getHighlightColor

public java.awt.Color getHighlightColor()
Gets the color of the highlight used in the JTextComponent when misspelt words are found.
Since:
v1.1

setUserDictionaryFile

public void setUserDictionaryFile(java.io.File userDictionaryFile)
                           throws java.lang.NullPointerException
Set the user dictionary file, if this file doesn't exist it will be created. Use of a user dictionary is optional.
Parameters:
userDictionaryFile - the File to use as a user dictionary.

getDictFilePath

public java.lang.String getDictFilePath()
The file to be used as the main dictionary, if this is null then the RapidSpellMDict jar is used.

setDictFilePath

public void setDictFilePath(java.lang.String value)
The file to be used as the main dictionary, if this is null then the RapidSpellMDict jar is used.

getCheckCompoundWords

public boolean getCheckCompoundWords()
Whether to check if words are made of compound forms - to be used in languages which use compounds, such as German.

setCheckCompoundWords

public void setCheckCompoundWords(boolean value)
Whether to check if words are made of compound forms - to be used in languages which use compounds, such as German.

getSuggestSplitWords

public boolean getSuggestSplitWords()
Whether to check for joined words when looking for suggestions.

setSuggestSplitWords

public void setSuggestSplitWords(boolean value)
Whether to check for joined words when looking for suggestions.

getIgnoreWordsWithDigits

public boolean getIgnoreWordsWithDigits()
Whether to ignore words with digits in them.

setIgnoreWordsWithDigits

public void setIgnoreWordsWithDigits(boolean value)
Whether to ignore words with digits in them.

setCheckerEngine

public void setCheckerEngine(ICheckerEngine value)
Sets the checker engine to use, this object must implement the ICheckerEngine interface, allows customization or replacement of the spell checker.

Use this property to replace the object used to perform checking, it is not necessary to replace this with a spell checker, any type of word parser can be used. For example an abbreviations checker could be written to replace common words with abbreviations.


getCheckerEngine

public ICheckerEngine getCheckerEngine()
Gets the checker engine to use, this object must implement the ICheckerEngine interface, allows customization or replacement of the spell checker.

Use this property to replace the object used to perform checking, it is not necessary to replace this with a spell checker, any type of word parser can be used. For example an abbreviations checker could be written to replace common words with abbreviations.


setSuggestionsMethod

public void setSuggestionsMethod(int method)
Sets the suggestions method to use. Either PHONETIC_SUGGESTIONS or HASHING_SUGGESTIONS

getSuggestionsMethod

public int getSuggestionsMethod()
Gets the suggestions method to use. Either PHONETIC_SUGGESTIONS or HASHING_SUGGESTIONS

setSeparateHyphenWords

public void setSeparateHyphenWords(boolean f)
Sets whether to treat hyphenated (-) words as separate words, default is false. For eg. if this is true text like "cheap-deals" will be treated as two words "cheap" and "deals", otherwise this will be treated as one word "cheap-deals".

Also see setLookIntoHyphenatedText.


getSeparateHyphenWords

public boolean getSeparateHyphenWords()
Gets whether to treat hyphenated (-) words as separate words, default is false. For eg. if this is true text like "cheap-deals" will be treated as two words "cheap" and "deals", otherwise this will be treated as one word "cheap-deals".

Also see setLookIntoHyphenatedText.


getIgnoreXML

public boolean getIgnoreXML()
Whether to ignore XML/HTML tags, should be set true for 'rich HTML text box' support, false by default.

setIgnoreXML

public void setIgnoreXML(boolean value)
Whether to ignore XML/HTML tags, should be set true for 'rich HTML text box' support, false by default.

getLookIntoHyphenatedText

public boolean getLookIntoHyphenatedText()
Whether to 'look into' text with hyphens (-), if the word has hyphens in it and LookIntoHyphenatedText is set true (default), the parts of the text around the hyphens will be checked individually. Eg. "socio-economic" will be checked as "socio" and "economic".

setLookIntoHyphenatedText

public void setLookIntoHyphenatedText(boolean value)
Whether to 'look into' text with hyphens (-), if the word has hyphens in it and LookIntoHyphenatedText is set true (default), the parts of the text around the hyphens will be checked individually. Eg. "socio-economic" will be checked as "socio" and "economic".

getLanguageParser

public int getLanguageParser()
Gets the type of language parsing to use.

Eg. If the dictionary is set to French, you should use the French parser.

Returns:
int identifier corresponding to LanguageType.XXXX
See Also:
LanguageType

setLanguageParser

public void setLanguageParser(int language)
The type of language parsing to use.

Eg. If the dictionary is set to French, you should use the French parser.

See Also:
LanguageType

getGUILanguage

public int getGUILanguage()
The language to show the UI in.

setGUILanguage

public void setGUILanguage(int value)
The language to show the UI in.

dispose

public void dispose()
Frees up resources.
Overrides:
dispose in class java.awt.Dialog

itemStateChanged

public void itemStateChanged(java.awt.event.ItemEvent e)
Listen to GUI events and perform actions.
Specified by:
itemStateChanged in interface java.awt.event.ItemListener

shouldEnableAddButton

protected boolean shouldEnableAddButton()

buildGUI

protected void buildGUI()
                 throws java.lang.Exception
Constructs the GUI - This should be over-ridden by sub-classes that wish to use their own layout.

Note, the only requirements are as follows:

1. whatever is constructed is added to the contentPane from here, eg;

this.getContentPane().add(myMainJPanel);

2. the queryWordPane and suggestionsList should be used for 'not in dictionary' words and suggestions respectively, these may not be over-ridden.

Returns:
void
Throws:
java.lang.Exception - if any problems occur
See Also:
suggestionsList, queryWordPane

focusGained

public void focusGained(java.awt.event.FocusEvent e)
Called when objects whose focus this is listening to gain focus.
Specified by:
focusGained in interface java.awt.event.FocusListener

focusLost

public void focusLost(java.awt.event.FocusEvent e)
Empty
Specified by:
focusLost in interface java.awt.event.FocusListener

setIncludeUserDictionaryInSuggestions

public void setIncludeUserDictionaryInSuggestions(boolean v)
Sets whether the user dictionary should be used in finding suggestions for misspelt words.

getIncludeUserDictionaryInSuggestions

public boolean getIncludeUserDictionaryInSuggestions()
Gets whether the user dictionary should be used in finding suggestions for misspelt words.

setIgnoreCapitalizedWords

public void setIgnoreCapitalizedWords(boolean v)
Sets whether to ignore words that start with capital letters.

getIgnoreCapitalizedWords

public boolean getIgnoreCapitalizedWords()
Gets whether to ignore words that start with capital letters.

addSpellCheckListener

public void addSpellCheckListener(SpellCheckListener l)
Adds a SpellCheckListener.
Since:
v1.1

removeSpellCheckListener

public void removeSpellCheckListener(SpellCheckListener l)
Removes a SpellCheckListener.
Since:
v1.1

getSpellCheckListeners

public SpellCheckListener[] getSpellCheckListeners()
Gets all SpellCheckListeners.
Since:
v1.1

run

public void run()
Called by the constructor in a new thread, to setup document parameters and check the text while the GUI components instantiate.
Specified by:
run in interface java.lang.Runnable

makeChange

protected java.lang.String makeChange(boolean inChangeAllProcess)
Changes the current bad word for one selected from the suggestions list or entered in the query pane returns the word used. inChangeAllProcess is true if this operation is part of a 'Change All'.

RapidSpell Desktop


Copyright © 2002-2005 Keyoti Inc. All Rights Reserved.