|
RapidSpell Desktop |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.keyoti.rapidSpell.desktop.RapidSpellAsYouType
RapidSpell Desktop As-You-Type Control, spell checks text boxes as the user types. This class works with any JTextComponent derived classes. This class not only checks as the user types, but also follows any text modifying actions, such as; Cut, paste, selection delete etc.
To use this component in an application, just instantiate it and set setTextComponent to a JTextComponent (or sub-class of).
Example.
RapidSpellAsYouType rapidAYT;
JTextComponent jTextComponent;
....
jTextComponent = new JTextComponent();
rapidAYT = new RapidSpellAsYouType();
rapidAYT.setTextComponent(jTextComponent);
Constructor Summary | |
RapidSpellAsYouType()
Default constructor. |
Method Summary | |
void |
actionPerformed(java.awt.event.ActionEvent e)
|
void |
changedUpdate(javax.swing.event.DocumentEvent e)
Gives notification that an attribute or set of attributes changed. |
void |
clearAllHighlights()
Clears all spell check highlights (underlines) from the whole document (all text boxes). |
protected TextBoxUtilityAdapter |
createNewTextBoxUtilityAdapter(javax.swing.text.JTextComponent textBox)
Returns a new instance of a TextBoxUtilityAdapter, for 'textBox'. |
protected void |
deHighlightText(BadWord theBadWord)
Removes a highlight from a bad word in the text component |
void |
dispose()
Frees up resources. |
protected void |
finalize()
Clears up references to text boxes |
void |
focusGained(java.awt.event.FocusEvent e)
|
void |
focusLost(java.awt.event.FocusEvent e)
|
void |
forceCheckAll()
Forces a check of the whole document. |
java.lang.String |
getAddMenuText()
Add button text. |
boolean |
getCheckAsYouType()
Whether to spell check words as the user types/modifies text. |
boolean |
getCheckCompoundWords()
Whether to check if words are made of compound forms - to be used in languages which use compounds, such as German. |
int |
getConsiderationRange()
Sets the factor for words to consider for suggestions, lower values are faster but consider less words for suggestions. |
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.lang.String |
getIgnoreAllMenuText()
Ignore All button text. |
boolean |
getIgnoreCapitalizedWords()
Whether to ignore words 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()
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. |
RapidSpellChecker |
getRapidSpellChecker()
The core spell checker object |
boolean |
getSeparateHyphenWords()
Gets whether to treat hyphenated (-) words as separate words, default is false. |
boolean |
getShowAddMenuOption()
Whether to show the Add option in the context menu. |
boolean |
getShowSuggestionsContextMenu()
Whether to show a context menu with suggestions when a misspelt word is right clicked, has no effect on developer set context menu. |
javax.swing.JMenuItem[] |
getSuggestions()
Returns suggestions menu items for the last right clicked word. |
int |
getSuggestionsMethod()
The suggestions method to use. |
boolean |
getSuggestSplitWords()
Whether to check for joined words when looking for suggestions. |
javax.swing.text.JTextComponent |
getTextComponent()
The JTextComponent to check as the user types/modifies text. |
javax.swing.text.JTextComponent[] |
getTextComponents()
The JTextComponents to check as the user types/modifies text. |
java.awt.Color |
getUnderlineColor()
The underline color to use with mis-spelt words. |
int |
getUnderlineStyle()
The underline style to use with mis-spelt words. |
protected void |
highlightText(BadWord theBadWord)
Highlights a bad word in the text component The location of theBadWord must be relative to the checkFromPosition. |
protected int[] |
IdentifyChange()
Returns the start and end indices in the current RTF text of the changed text (must later be adjusted for word start and end) note that end index is on right side of last character. |
void |
insertUpdate(javax.swing.event.DocumentEvent e)
Gives notification that there was an insert into the document. |
protected boolean |
isInIgnorePos(int pos)
Whether to ignore words starting at this position. |
void |
keyPressed(java.awt.event.KeyEvent e)
Invoked when a key has been pressed. |
void |
keyReleased(java.awt.event.KeyEvent e)
Invoked when a key has been pressed. |
void |
keyTyped(java.awt.event.KeyEvent e)
Invoked when a key has been pressed. |
void |
mouseClicked(java.awt.event.MouseEvent e)
Invoked when the mouse has been clicked on a component. |
void |
mouseEntered(java.awt.event.MouseEvent e)
Invoked when the mouse enters a component. |
void |
mouseExited(java.awt.event.MouseEvent e)
Invoked when the mouse exits a component. |
void |
mousePressed(java.awt.event.MouseEvent e)
Invoked when a mouse button has been pressed on a component. |
void |
mouseReleased(java.awt.event.MouseEvent e)
Invoked when a mouse button has been released on a component. |
protected void |
OnFocus(java.awt.Component sender)
Called when text box is focused |
protected void |
OnPopup(java.awt.event.MouseEvent e)
Called when context menu is popped up. |
protected void |
OnTextChanged()
Called when text in text box changes |
void |
removeUpdate(javax.swing.event.DocumentEvent e)
|
void |
setAddMenuText(java.lang.String value)
Add button text. |
void |
setCheckAsYouType(boolean value)
Whether to spell check words as the user types/modifies text. |
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 |
setConsiderationRange(int value)
Sets the factor for words to consider for suggestions, lower values are faster but consider less words for suggestions. |
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 |
setIgnoreAllMenuText(java.lang.String value)
Ignore All button text. |
void |
setIgnoreCapitalizedWords(boolean value)
Whether to ignore words 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 value)
Whether the user dictionary should be used in finding suggestions for misspelt words. |
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 |
setRapidSpellChecker(RapidSpellChecker value)
The core spell checker object |
void |
setSeparateHyphenWords(boolean f)
Sets whether to treat hyphenated (-) words as separate words, default is false. |
void |
setShowAddMenuOption(boolean value)
Whether to show the Add option in the context menu. |
void |
setShowSuggestionsContextMenu(boolean value)
Whether to show a context menu with suggestions when a misspelt word is right clicked, has no effect on developer set context menu. |
void |
setSuggestionsMethod(int value)
The suggestions method to use. |
void |
setSuggestSplitWords(boolean value)
Whether to check for joined words when looking for suggestions. |
void |
setTextComponent(javax.swing.text.JTextComponent value)
The JTextComponent to check as the user types/modifies text. |
void |
setTextComponents(javax.swing.text.JTextComponent[] value)
The JTextComponents to check as the user types/modifies text. |
void |
setUnderlineColor(java.awt.Color value)
The underline color to use with mis-spelt words. |
void |
setUnderlineStyle(int value)
The underline style to use with mis-spelt words. |
void |
setUserDictionaryFile(java.io.File userDictionaryFile)
Set the user dictionary file, if this file doesn't exist it will be created. |
void |
SetUserDictionaryFile(java.io.File userDictionaryFile)
Set the user dictionary file, if this file doesn't exist it will be created. |
Methods inherited from class java.lang.Object |
clone,
equals,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Constructor Detail |
public RapidSpellAsYouType()
Method Detail |
public RapidSpellChecker getRapidSpellChecker()
public void setRapidSpellChecker(RapidSpellChecker value)
public int getSuggestionsMethod()
public void setSuggestionsMethod(int value)
public boolean getShowAddMenuOption()
public void setShowAddMenuOption(boolean value)
public boolean getIgnoreXML()
public void setIgnoreXML(boolean value)
public boolean getCheckCompoundWords()
public void setCheckCompoundWords(boolean value)
public boolean getSuggestSplitWords()
public void setSuggestSplitWords(boolean value)
public boolean getIgnoreWordsWithDigits()
public void setIgnoreWordsWithDigits(boolean value)
public void setUserDictionaryFile(java.io.File userDictionaryFile)
userDictionaryFile
- the File to use as a user dictionary.public void setSeparateHyphenWords(boolean f)
Also see setLookIntoHyphenatedText.
public boolean getSeparateHyphenWords()
Also see setLookIntoHyphenatedText.
public boolean getShowSuggestionsContextMenu()
public void setShowSuggestionsContextMenu(boolean value)
public java.lang.String getDictFilePath()
public void setDictFilePath(java.lang.String value)
public boolean getLookIntoHyphenatedText()
public void setLookIntoHyphenatedText(boolean value)
public int getLanguageParser()
Eg. If the dictionary is set to French, you should use the French parser.
LanguageType
public void setLanguageParser(int language)
Eg. If the dictionary is set to French, you should use the French parser.
LanguageType
public int getGUILanguage()
public void setGUILanguage(int value)
public java.lang.String getIgnoreAllMenuText()
public void setIgnoreAllMenuText(java.lang.String value)
public java.lang.String getAddMenuText()
public void dispose()
public void setAddMenuText(java.lang.String value)
public boolean getIncludeUserDictionaryInSuggestions()
public void setIncludeUserDictionaryInSuggestions(boolean value)
public void setIgnoreCapitalizedWords(boolean value)
public boolean getIgnoreCapitalizedWords()
public int getConsiderationRange()
public void setConsiderationRange(int value)
public boolean getCheckAsYouType()
public void setCheckAsYouType(boolean value)
public javax.swing.text.JTextComponent getTextComponent()
public void setTextComponent(javax.swing.text.JTextComponent value)
protected void finalize() throws java.lang.Throwable
public javax.swing.text.JTextComponent[] getTextComponents()
public void setTextComponents(javax.swing.text.JTextComponent[] value)
public int getUnderlineStyle()
public void setUnderlineStyle(int value)
public java.awt.Color getUnderlineColor()
public void setUnderlineColor(java.awt.Color value)
public void forceCheckAll()
public void clearAllHighlights()
public void SetUserDictionaryFile(java.io.File userDictionaryFile)
userDictionaryFile
- the File to use as a user dictionary.public void mouseClicked(java.awt.event.MouseEvent e)
public void mouseEntered(java.awt.event.MouseEvent e)
public void mouseExited(java.awt.event.MouseEvent e)
public void mousePressed(java.awt.event.MouseEvent e)
public void mouseReleased(java.awt.event.MouseEvent e)
public void actionPerformed(java.awt.event.ActionEvent e)
public void keyPressed(java.awt.event.KeyEvent e)
public void keyReleased(java.awt.event.KeyEvent e)
public void keyTyped(java.awt.event.KeyEvent e)
protected void highlightText(BadWord theBadWord)
protected void deHighlightText(BadWord theBadWord)
public javax.swing.JMenuItem[] getSuggestions()
protected void OnPopup(java.awt.event.MouseEvent e)
public void changedUpdate(javax.swing.event.DocumentEvent e)
public void insertUpdate(javax.swing.event.DocumentEvent e)
public void removeUpdate(javax.swing.event.DocumentEvent e)
protected void OnTextChanged()
public void focusGained(java.awt.event.FocusEvent e)
public void focusLost(java.awt.event.FocusEvent e)
protected void OnFocus(java.awt.Component sender)
protected int[] IdentifyChange()
protected boolean isInIgnorePos(int pos)
protected TextBoxUtilityAdapter createNewTextBoxUtilityAdapter(javax.swing.text.JTextComponent textBox)
|
RapidSpell Desktop |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |