本文整理汇总了Java中com.inet.jortho.SpellChecker类的典型用法代码示例。如果您正苦于以下问题:Java SpellChecker类的具体用法?Java SpellChecker怎么用?Java SpellChecker使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SpellChecker类属于com.inet.jortho包,在下文中一共展示了SpellChecker类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: createWysiwygEditor
import com.inet.jortho.SpellChecker; //导入依赖的package包/类
private JEditorPane createWysiwygEditor() {
JEditorPane ed = new JEditorPane();
ed.setEditorKitForContentType("text/html", new WysiwygHTMLEditorKit());
ed.setContentType("text/html");
insertHTML(ed, "<p></p>", 0);
ed.addCaretListener(caretHandler);
ed.addFocusListener(focusHandler);
// spell checker, must be before the popup handler
Preference pref = PrefUtil.get(PreferenceKey.SPELLING,
Spelling.none.toString());
Spelling spelling = Spelling.valueOf(pref.getStringValue());
if (Spelling.none != spelling)
SpellChecker.register(ed);
ed.addMouseListener(popupHandler);
HTMLDocument document = (HTMLDocument) ed.getDocument();
CompoundUndoManager cuh = new CompoundUndoManager(document,
new UndoManager());
document.addUndoableEditListener(cuh);
document.addDocumentListener(textChangedHandler);
return ed;
}
开发者ID:markkohdev,项目名称:oStorybook,代码行数:26,代码来源:HtmlEditor.java
示例2: registerDictionaries
import com.inet.jortho.SpellChecker; //导入依赖的package包/类
public static void registerDictionaries() {
SbApp.trace("SpellCheckerUtil.registerDictionaries()");
try {
URL url = getDictionaryDirAsURL();
Preference pref = PrefUtil.get(PreferenceKey.SPELLING, Spelling.none.toString());
String spelling = pref.getStringValue();
String lang = spelling.substring(0, 2);
SpellChecker.registerDictionaries(url, "en,de,es,fr,it,nl,pl", lang);
// user dictionary directory
File usrDictDir = initUserDictDir();
FileUserDictionary fud = new FileUserDictionary(usrDictDir.toString());
SpellChecker.setUserDictionaryProvider(fud);
} catch (IOException e) {
SbApp.error("SpellCheckerUtil.registerDictionaries()",e);
}
}
开发者ID:markkohdev,项目名称:oStorybook,代码行数:19,代码来源:SpellCheckerUtil.java
示例3: conditionallyShowPopup
import com.inet.jortho.SpellChecker; //导入依赖的package包/类
private void conditionallyShowPopup(MouseEvent e) {
if (e.isPopupTrigger()) {
JPopupMenu popupMenu = new EditPopupMenu(textfield);
if (checkSpelling) {
popupMenu.add(SpellChecker.createCheckerMenu());
popupMenu.add(SpellChecker.createLanguagesMenu());
mEventSource.setValue(CANCEL); // disallow real focus lost
}
popupMenu.show(e.getComponent(), e.getX(), e.getY());
e.consume();
}
}
开发者ID:iwabuchiken,项目名称:freemind_1.0.0_20140624_214725,代码行数:13,代码来源:EditNodeTextField.java
示例4: getHtmlEditorPanel
import com.inet.jortho.SpellChecker; //导入依赖的package包/类
public static SHTMLPanel getHtmlEditorPanel() {
if (htmlEditorPanel == null) {
SHTMLPanel.setResources(new SimplyHtmlResources());
htmlEditorPanel = SHTMLPanel.createSHTMLPanel();
htmlEditorPanel.setMinimumSize(new Dimension(100, 100));
boolean checkSpelling = Resources.getInstance().
getBoolProperty(FreeMindCommon.CHECK_SPELLING);
if (checkSpelling) {
SpellChecker.register(htmlEditorPanel.getEditorPane());
}
}
return htmlEditorPanel;
}
开发者ID:iwabuchiken,项目名称:freemind_1.0.0_20140624_214725,代码行数:15,代码来源:NodeNoteRegistration.java
示例5: registerDictionaries
import com.inet.jortho.SpellChecker; //导入依赖的package包/类
/**
* Registers the Dictionaries. First calculate which ones are available,
* then register them.
*/
public static void registerDictionaries() {
String names = checkDictionariesAvailable();
SpellChecker.registerDictionaries(SpellCheckerIntegration.class.getResource("/"), names, null);
SpellChecker.getOptions().setLanguageDisableVisible(true);
}
开发者ID:kolchagov,项目名称:jlokalize,代码行数:10,代码来源:SpellCheckerIntegration.java
示例6: register
import com.inet.jortho.SpellChecker; //导入依赖的package包/类
/**
* Call this method to add the spell checker into the desired text-components.
* @throws FileNotFoundException
*/
public SpellCheckerRegisterResult register() throws FileNotFoundException
{
SpellCheckerRegisterResult result = SpellCheckerRegisterResult.NOT_REGISTERED_SHOULD_EXIT;
File dicFile = new File(DICTIONARY_FILE_NAME);
if (!dicFile.exists())
{
String message = "It seems that the dictionary file \""+DICTIONARY_FILE_NAME+"\" " +
"does not exist in the working directory.\n" +
"Thus, the spell-checker cannot be registered.\n" +
"To enable spell checker, copy the dictionary file to the " +
"working directory, and restart the application.\n" +
"The file can be found at $JARS/jortho/dictionary_en_2010_09/ \n" +
"See also http://jortho.sourceforge.net/\n" +
"Do you want to exit? Click \"Yes\" for exit, click \"No\" to continue without spell-checker."
;
int userClick = JOptionPane.showOptionDialog(owner, message, "Spell checker warning", JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE, null, new String[]{"Yes", "No"}, null);
if (userClick == JOptionPane.NO_OPTION)
result = SpellCheckerRegisterResult.NOT_REGISTERED_BUT_CONTINUE;
else
result = SpellCheckerRegisterResult.NOT_REGISTERED_SHOULD_EXIT;
// JOptionPane.showMessageDialog(null,
// "It seems that the dictionary file \""+DICTIONARY_FILE_NAME+"\" " +
// "does not exist in the working directory.\n" +
// "Thus, the spell-checker will not be registered.\n" +
// "To enable spell checker, copy the dictionary file to the " +
// "working directory, and restart the application.\n" +
// "The file can be found at $JARS/jortho/dictionary_en_2010_09/ \n" +
// "See also http://jortho.sourceforge.net/",
// "Spell checker warning",
// JOptionPane.WARNING_MESSAGE);
}
else
{
File cnfFile = new File(CNF_FILE_NAME);
if (!cnfFile.exists())
{
PrintWriter writer = new PrintWriter(cnfFile);
try
{
writer.println(CNF_FILE_CONTENTS);
}
finally
{
writer.close();
}
}
// Create user dictionary in the current working directory of your application
SpellChecker.setUserDictionaryProvider( new FileUserDictionary() );
// Load the configuration from the file dictionaries.cnf and
// use the current locale or the first language as default
SpellChecker.registerDictionaries( null, ACTIVE_LANGUAGE );
for (JTextComponent text : textComponents)
{
SpellChecker.register( text );
}
result = SpellCheckerRegisterResult.REGISTERED;
}
return result;
}
开发者ID:hltfbk,项目名称:Excitement-TDMLEDA,代码行数:74,代码来源:SpellCheckerRegister.java
示例7: showSpellCheckerDialog
import com.inet.jortho.SpellChecker; //导入依赖的package包/类
public void showSpellCheckerDialog()
{
SpellChecker.showSpellCheckerDialog(tpDesignDocument,new SpellCheckerOptions());
}
开发者ID:dasatti,项目名称:urduhtmlmaster,代码行数:5,代码来源:UMasterDocument.java
示例8: enableAutoSpellCheck
import com.inet.jortho.SpellChecker; //导入依赖的package包/类
public void enableAutoSpellCheck(boolean _enable)
{
SpellChecker.enableAutoSpell(tpDesignDocument, _enable );
}
开发者ID:dasatti,项目名称:urduhtmlmaster,代码行数:5,代码来源:UMasterDocument.java
示例9: getCheckerMenu
import com.inet.jortho.SpellChecker; //导入依赖的package包/类
public JMenu getCheckerMenu()
{
return SpellChecker.createCheckerMenu(new SpellCheckerOptions());
}
开发者ID:dasatti,项目名称:urduhtmlmaster,代码行数:5,代码来源:UMasterDocument.java
示例10: unregisterComponents
import com.inet.jortho.SpellChecker; //导入依赖的package包/类
/**
* Unregisters the spell checker from two text areas.
*
* @param c1 Text area 1.
* @param c2 Text area 2.
*/
public static void unregisterComponents(JTextArea c1, JTextArea c2) {
SpellChecker.unregister(c1);
SpellChecker.unregister(c2);
}
开发者ID:kolchagov,项目名称:jlokalize,代码行数:11,代码来源:SpellCheckerIntegration.java
示例11: registerComponents
import com.inet.jortho.SpellChecker; //导入依赖的package包/类
/**
* Registers the spell checker on two text areas.
*
* @param c1 Text area 1.
* @param c2 Text area 2.
*/
public static void registerComponents(JTextArea c1, JTextArea c2) {
SpellChecker.register(c1);
SpellChecker.register(c2);
}
开发者ID:kolchagov,项目名称:jlokalize,代码行数:11,代码来源:SpellCheckerIntegration.java
注:本文中的com.inet.jortho.SpellChecker类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论