Commit [3d492b] Maximize Restore History

-> ignore-all on a per-buffer basis,

-> user dictionary (not editable yet)
both features still need testing

git-svn-id: https://jedit.svn.sourceforge.net/svnroot/jedit/plugins/SpellCheck/trunk@13047 6b1eeb88-9816-0410-afa2-b43733a0f04e

kerik-sf kerik-sf 2008-07-12

1 2 3 > >> (Page 1 of 3)
added docs
added docs/spellcheck.zargo
added resources
added resources/cswilly
added resources/cswilly/spell
added resources/cswilly/spell/ignored-words.png
added src/main/cswilly/jeditPlugins/spell/AspellEngineManager.java
added src/main/cswilly/spell/EngineManager.java
added src/main/cswilly/spell/WordListValidator.java
added src/test/cswilly/jeditPlugins/spell/AspellEngineManagerTest.java
added src/test/cswilly/jeditPlugins/spell/ErrorListSpellCheckerTest.java
added src/test/cswilly/jeditPlugins/spell/ErrorListValidatorTest.java
added src/test/cswilly/spell/MockEngine.java
added src/test/cswilly/spell/WordListValidatorTest.java
added tests/a.cpp
added tests/word-list-empty-line.dict
added tests/word-list-empty.dict
added tests/word-list-ok.dict
changed SpellCheckPlugin.props
changed actions.xml
changed build.xml
changed src
changed src/main
changed src/main/cswilly
changed src/main/cswilly/jeditPlugins
changed src/main/cswilly/jeditPlugins/spell
changed src/main/cswilly/jeditPlugins/spell/BufferDialogValidator.java
changed src/main/cswilly/jeditPlugins/spell/BufferSpellChecker.java
changed src/main/cswilly/jeditPlugins/spell/DictionaryPicker.java
changed src/main/cswilly/jeditPlugins/spell/ErrorListSpellChecker.java
changed src/main/cswilly/jeditPlugins/spell/ErrorListValidator.java
changed src/main/cswilly/jeditPlugins/spell/SpellCheckOptionPane.java
changed src/main/cswilly/jeditPlugins/spell/SpellCheckPlugin.java
changed src/main/cswilly/spell
changed src/main/cswilly/spell/AspellEngine.java
changed src/main/cswilly/spell/DialogValidator.java
changed src/main/cswilly/spell/FileSpellChecker.java
changed src/main/cswilly/spell/Result.java
changed src/main/cswilly/spell/ValidationDialog.java
changed src/main/cswilly/spell/Validator.java
changed src/test
changed src/test/cswilly
changed src/test/cswilly/jeditPlugins
changed src/test/cswilly/jeditPlugins/spell
changed src/test/cswilly/jeditPlugins/spell/BufferDialogValidatorTest.java
changed src/test/cswilly/jeditPlugins/spell/BufferSpellCheckerTest.java
changed src/test/cswilly/jeditPlugins/spell/DictionaryPickerTest.java
changed src/test/cswilly/jeditPlugins/spell/SpellCheckOptionPaneTest.java
changed src/test/cswilly/jeditPlugins/spell/SpellCheckPluginTest.java
changed src/test/cswilly/jeditPlugins/spell/TestUtils.java
changed src/test/cswilly/spell
changed src/test/cswilly/spell/AspellEngineTest.java
changed tests
copied src/main/cswilly/spell/Test.java -> src/main/cswilly/spell/ChainingValidator.java
copied users-guide.xml -> docs/users-guide.xml
docs
Directory.
docs/spellcheck.zargo Diff Switch to side-by-side view
Loading...
resources
Directory.
resources/cswilly
Directory.
resources/cswilly/spell/ignored-words.png Diff Switch to side-by-side view
Loading...
src/main/cswilly/jeditPlugins/spell/AspellEngineManager.java Diff Switch to side-by-side view
Loading...
src/main/cswilly/spell/EngineManager.java Diff Switch to side-by-side view
Loading...
src/main/cswilly/spell/WordListValidator.java Diff Switch to side-by-side view
Loading...
src/test/cswilly/jeditPlugins/spell/AspellEngineManagerTest.java Diff Switch to side-by-side view
Loading...
src/test/cswilly/jeditPlugins/spell/ErrorListSpellCheckerTest.java Diff Switch to side-by-side view
Loading...
src/test/cswilly/jeditPlugins/spell/ErrorListValidatorTest.java Diff Switch to side-by-side view
Loading...
src/test/cswilly/spell/MockEngine.java Diff Switch to side-by-side view
Loading...
src/test/cswilly/spell/WordListValidatorTest.java Diff Switch to side-by-side view
Loading...
tests/a.cpp Diff Switch to side-by-side view
Loading...
tests/word-list-empty-line.dict Diff Switch to side-by-side view
Loading...
tests/word-list-empty.dict Diff Switch to side-by-side view
Loading...
tests/word-list-ok.dict Diff Switch to side-by-side view
Loading...
SpellCheckPlugin.props Diff Switch to side-by-side view
Loading...
actions.xml Diff Switch to side-by-side view
Loading...
build.xml Diff Switch to side-by-side view
Loading...
src
Directory.
src/main
Directory.
src/main/cswilly
Directory.
src/main/cswilly/jeditPlugins/spell/BufferDialogValidator.java Diff Switch to side-by-side view
Loading...
src/main/cswilly/jeditPlugins/spell/BufferSpellChecker.java Diff Switch to side-by-side view
Loading...
src/main/cswilly/jeditPlugins/spell/DictionaryPicker.java Diff Switch to side-by-side view
Loading...
src/main/cswilly/jeditPlugins/spell/ErrorListSpellChecker.java Diff Switch to side-by-side view
Loading...
src/main/cswilly/jeditPlugins/spell/ErrorListValidator.java Diff Switch to side-by-side view
Loading...
src/main/cswilly/jeditPlugins/spell/SpellCheckOptionPane.java Diff Switch to side-by-side view
Loading...
src/main/cswilly/jeditPlugins/spell/SpellCheckPlugin.java Diff Switch to side-by-side view
Loading...
src/main/cswilly/spell/AspellEngine.java Diff Switch to side-by-side view
Loading...
src/main/cswilly/spell/DialogValidator.java Diff Switch to side-by-side view
Loading...
src/main/cswilly/spell/FileSpellChecker.java Diff Switch to side-by-side view
Loading...
src/main/cswilly/spell/Result.java Diff Switch to side-by-side view
Loading...
src/main/cswilly/spell/ValidationDialog.java Diff Switch to side-by-side view
Loading...
src/main/cswilly/spell/Validator.java Diff Switch to side-by-side view
Loading...
src/test
Directory.
src/test/cswilly
Directory.
src/test/cswilly/jeditPlugins/spell/BufferDialogValidatorTest.java Diff Switch to side-by-side view
Loading...
src/test/cswilly/jeditPlugins/spell/BufferSpellCheckerTest.java Diff Switch to side-by-side view
Loading...
src/test/cswilly/jeditPlugins/spell/DictionaryPickerTest.java Diff Switch to side-by-side view
Loading...
src/test/cswilly/jeditPlugins/spell/SpellCheckOptionPaneTest.java Diff Switch to side-by-side view
Loading...
src/test/cswilly/jeditPlugins/spell/SpellCheckPluginTest.java Diff Switch to side-by-side view
Loading...
src/test/cswilly/jeditPlugins/spell/TestUtils.java Diff Switch to side-by-side view
Loading...
src/test/cswilly/spell/AspellEngineTest.java Diff Switch to side-by-side view
Loading...
tests
Directory.
src/main/cswilly/spell/Test.java to src/main/cswilly/spell/ChainingValidator.java
--- a/src/main/cswilly/spell/Test.java
+++ b/src/main/cswilly/spell/ChainingValidator.java
@@ -20,69 +20,63 @@
  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
  */
 
-
 package cswilly.spell;
 
-import java.io.*;
+import java.util.List;
+import java.util.ArrayList;
+import java.util.Iterator;
 
-public
-class Test
+/**
+ * A validator implementation which encapsulate a list of validators
+ *
+ */ 
+public class ChainingValidator implements Validator
 {
-  BufferedReader _aSpellReader;
-  BufferedWriter _aSpellWriter;
+	private Validator mine;
+	private Validator next;
+	
+	public ChainingValidator(Validator mine, Validator next){
+		this.mine = mine;
+		this.next = next;
+	}
+  	
+	public Validator getMyValidator(){
+		return mine;
+	}
+	
+	public Validator getNextValidator(){
+		return next;
+	}
+	
+  /**
+   * Validate a line of words that have the <code>results</code> of a spell
+   * check.
+   *<p>
+   * @param	lineNum	index of the line in the text/buffer/file whatever
+   * @param line String with a line of words that are to be corrected
+   * @param results List of {@link Result} of a spell check
+   * @return valid (false to cancel)
+   */
+  public boolean validate( int lineNum, String line, List<Result> results ){
+	  boolean valid = true;
+	  valid=mine.validate(lineNum, line, results);
+	  if(valid)valid = next.validate(lineNum, line, results);
+	  return valid;
+  }
+  
+  /**
+   * Call this upon new spell-checking
+   */
+   public void start(){
+	   mine.start();
+	   next.start();
+   }
 
-  public static
-  void main( String[] args )
-    throws IOException
-  {
-    new Test();
-  }
-
-  private Test()
-    throws IOException
-  {
-    System.err.println( "TestTest" );
-
-    String aSpellCommandLine = "O:\\local\\aspell\\aspell.exe pipe";
-
-    Runtime runtime = Runtime.getRuntime();
-    Process aSpellProcess = runtime.exec( aSpellCommandLine );
-
-    _aSpellReader =
-      new BufferedReader( new InputStreamReader( aSpellProcess.getInputStream() ) );
-
-    _aSpellWriter =
-      new BufferedWriter( new OutputStreamWriter( aSpellProcess.getOutputStream() ) );
-
-    String aSpellWelcomeMsg;
-    aSpellWelcomeMsg = _aSpellReader.readLine();
-    System.err.println( "aSpellWelcomeMsg: " + aSpellWelcomeMsg );
-
-    checkWords( "expetr nobody noboyd response" );
-    checkWords( "table lable llll" );
-  }
-
-  private
-  void checkWords( String words )
-    throws IOException
-  {
-    System.err.println( "words: " + words );
-
-    final String spellCheckLinePrefix = "^";
-    _aSpellWriter.write( spellCheckLinePrefix + words );
-    _aSpellWriter.newLine();
-    _aSpellWriter.flush();
-
-    String response = _aSpellReader.readLine();
-    while( response != null &&
-           !response.equals( "" ) )
-    {
-      System.err.println( "response: " + response );
-      Result result = new Result( response );
-      System.err.println( "result: " + result );
-
-      response = _aSpellReader.readLine();
-    }
-  }
-
+  /**
+   * Call this at the end of spell-checking
+   */
+   public void done(){
+	   mine.done();
+	   next.done();
+   }
 }
users-guide.xml to docs/users-guide.xml
--- a/users-guide.xml
+++ b/docs/users-guide.xml
@@ -5,7 +5,7 @@
 
 <!-- jEdit buffer-local properties: -->
 <!-- :tabSize=1:indentSize=1:noTabs=true:folding=sidekick: -->
-<!-- $Id$ - $Revision$ -->
+<!-- $Id: users-guide.xml 12872 2008-06-22 07:53:52Z kerik-sf $ - $Revision: 12872 $ -->
 <!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
   "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd">
 <book>
@@ -25,7 +25,7 @@
    <firstname>Eric</firstname>
    <surname>Le Lay</surname>
   </author>
-  <date>$Date$</date>
+  <date>$Date: 2008-06-22 09:53:52 +0200 (Dim 22 jui 2008) $</date>
   
 <legalnotice><title>Legal Notice</title>
   <para>
1 2 3 > >> (Page 1 of 3)