FileDocCategorySizeDatePackage
RuntimeSpellPlugin.javaAPI DocExample871Sun Dec 08 00:46:52 GMT 2002com.wiverson.macosbook.spelling

RuntimeSpellPlugin.java

package com.wiverson.macosbook.spelling;

import com.wiverson.macosbook.SimpleEdit;

public class RuntimeSpellPlugin implements com.wiverson.macosbook.SimpleEditPlugin
{
    
    public RuntimeSpellPlugin()
    {
    }
    
    private boolean runtimespell = false;
    com.apple.spell.ui.JTxtCmpontDrvr mySpellchecker = new com.apple.spell.ui.JTxtCmpontDrvr();
    
    public void doAction(SimpleEdit frame, java.awt.event.ActionEvent evt)
    {
        if(!runtimespell)
        {
            mySpellchecker.startRealtimeChecking(frame.getJTextArea());
        } else
        {
            mySpellchecker.stopRealtimeChecking();
        }
        runtimespell = !runtimespell;
    }
    
    public String getAction()
    {
        return "Toggle Realtime Spelling";
    }
    
    public void init(SimpleEdit frame)
    {
    }
}