1 package org.columba.mail.gui.composer; 17 18 import java.io.File ; 19 20 import org.columba.core.gui.externaltools.ExternalToolsManager; 21 import org.columba.mail.spellcheck.ASpellInterface; 22 23 public class ComposerSpellCheck { 24 25 public ComposerSpellCheck() { 26 27 } 28 29 public String checkText(String text) { 30 31 try { 32 33 File externalToolFile = ExternalToolsManager.getInstance() 34 .getLocationOfExternalTool("aspell"); 35 36 if (externalToolFile != null) { 37 ASpellInterface 38 .setAspellExeFilename(externalToolFile.getPath()); 39 } 40 } catch (Exception e) { 41 e.printStackTrace(); 42 } 43 44 String checked = ASpellInterface.checkBuffer(text); 45 46 if (checked == null) { 47 return text; 50 } else { 51 return checked; 52 } 53 } 54 } 55 | Popular Tags |