Index: tmp/org.txm.rcp/src/main/java/org/txm/rcp/editors/TXMEditor.java
===================================================================
--- tmp/org.txm.rcp/src/main/java/org/txm/rcp/editors/TXMEditor.java	(revision 2100)
+++ tmp/org.txm.rcp/src/main/java/org/txm/rcp/editors/TXMEditor.java	(revision 2101)
@@ -25,6 +25,7 @@
 import org.eclipse.jface.viewers.TableViewer;
 import org.eclipse.jface.viewers.Viewer;
 import org.eclipse.swt.SWT;
+import org.eclipse.swt.custom.StyledText;
 import org.eclipse.swt.events.MouseAdapter;
 import org.eclipse.swt.events.MouseEvent;
 import org.eclipse.swt.graphics.Point;
@@ -1196,6 +1197,9 @@
 				else if(object instanceof Text)	{
 					((Text)object).setText(String.valueOf(value)); 
 				}
+				else if(object instanceof StyledText)	{
+					((StyledText)object).setText(String.valueOf(value)); 
+				}
 				else if(object instanceof Button)	{
 					((Button)object).setSelection((Boolean) value);
 				}
@@ -1319,6 +1323,9 @@
 				else if(object instanceof Text)	{
 					value = ((Text)object).getText(); 
 				}
+				else if(object instanceof StyledText)	{
+					value = ((StyledText)object).getText(); 
+				}
 				else if(object instanceof Button)	{
 					value = ((Button)object).getSelection(); 
 				}
Index: tmp/org.txm.core/src/java/org/txm/core/results/TXMResult.java
===================================================================
--- tmp/org.txm.core/src/java/org/txm/core/results/TXMResult.java	(revision 2100)
+++ tmp/org.txm.core/src/java/org/txm/core/results/TXMResult.java	(revision 2101)
@@ -1804,7 +1804,7 @@
 	 */
 	// FIXME: SJ: this method must become abstract in TXM0.8.1 and implemented by subclasses
 	public String getComputingStartMessage() {
-		return "";
+		return "Computing "+this.getClass().getSimpleName()+"...";
 	}
 //	public abstract String getComputingStartMessage();
 
Index: tmp/org.txm.tigersearch.rcp/plugin.xml
===================================================================
--- tmp/org.txm.tigersearch.rcp/plugin.xml	(revision 2100)
+++ tmp/org.txm.tigersearch.rcp/plugin.xml	(revision 2101)
@@ -11,6 +11,7 @@
       </category>
       <command
             categoryId="TIGERSearch4TXM.commands.category"
+            defaultHandler="org.txm.tigersearch.commands.ComputeTIGERSearch"
             id="org.txm.tigersearch.commands.ComputeTIGERSearch"
             name="%command.name"
             returnTypeId="org.txm.function.tigersearch.TIGERSearch">
@@ -50,9 +51,11 @@
             <visibleWhen
                   checkEnabled="false">
                <or>
-                  <reference
-                        definitionId="OneCorpusSelected">
-                  </reference>
+                  <test
+                        forcePluginActivation="true"
+                        property="org.txm.rcp.testers.TIGERSearchReady"
+                        value="TIGERSearchReady">
+                  </test>
                </or>
             </visibleWhen>
          </command>
@@ -116,9 +119,11 @@
             <visibleWhen
                   checkEnabled="false">
                <or>
-                  <reference
-                        definitionId="OneCorpusSelected">
-                  </reference>
+                  <test
+                        forcePluginActivation="true"
+                        property="org.txm.rcp.testers.TIGERSearchReady"
+                        value="TIGERSearchReady">
+                  </test>
                </or>
             </visibleWhen>
          </command>
@@ -134,9 +139,11 @@
             <visibleWhen
                   checkEnabled="false">
                <or>
-                  <reference
-                        definitionId="OneCorpusSelected">
-                  </reference>
+                  <test
+                        forcePluginActivation="true"
+                        property="org.txm.rcp.testers.TIGERSearchReady"
+                        value="TIGERSearchReady">
+                  </test>
                </or>
             </visibleWhen>
          </command>
@@ -176,20 +183,6 @@
          point="org.txm.PostInstallationStep">
    </extension>
    <extension
-         point="org.eclipse.ui.handlers">
-      <handler
-            class="org.txm.tigersearch.commands.ComputeTIGERSearch"
-            commandId="org.txm.tigersearch.commands.ComputeTIGERSearch">
-         <enabledWhen>
-            <test
-                  forcePluginActivation="true"
-                  property="org.txm.rcp.testers.TIGERSearchReady"
-                  value="TIGERSearchReady">
-            </test>
-         </enabledWhen>
-      </handler>
-   </extension>
-   <extension
          point="org.txm.PostTXMHOMEInstallationStep">
       <PostTXMHOMEInstallationStep
             class="org.txm.tigersearch.rcp.InstallGroovyTIGERFiles"
@@ -225,5 +218,20 @@
          </adapter>
       </factory>
    </extension>
+   <extension
+         point="org.eclipse.ui.preferencePages">
+      <page
+            category="org.txm.rcp.preferences.UserPreferencePage"
+            class="org.txm.tigersearch.rcp.preferences.TIGERSearchPreferencePage"
+            id="org.txm.tigersearch.rcp.preferences.TIGERSearchPreferencePage"
+            name="TIGERSearch">
+      </page>
+   </extension>
+   <extension
+         point="org.eclipse.core.runtime.preferences">
+      <initializer
+            class="org.txm.tigersearch.rcp.preferences.TIGERSearchPreferences">
+      </initializer>
+   </extension>
 
 </plugin>
Index: tmp/org.txm.tigersearch.rcp/META-INF/MANIFEST.MF
===================================================================
--- tmp/org.txm.tigersearch.rcp/META-INF/MANIFEST.MF	(revision 2100)
+++ tmp/org.txm.tigersearch.rcp/META-INF/MANIFEST.MF	(revision 2101)
@@ -60,6 +60,7 @@
  org.txm.tigersearch.commands,
  org.txm.tigersearch.editors,
  org.txm.tigersearch.rcp,
+ org.txm.tigersearch.rcp.preferences,
  org.txm.tigersearch.rcp.tester,
  tigerAPI,
  tigerAPI.converters,
Index: tmp/org.txm.tigersearch.rcp/src/org/txm/tigersearch/rcp/TIGERSearchAdapterFactory.java
===================================================================
--- tmp/org.txm.tigersearch.rcp/src/org/txm/tigersearch/rcp/TIGERSearchAdapterFactory.java	(revision 2100)
+++ tmp/org.txm.tigersearch.rcp/src/org/txm/tigersearch/rcp/TIGERSearchAdapterFactory.java	(revision 2101)
@@ -19,11 +19,11 @@
 	
 	public static final ImageDescriptor ICON =
 			AbstractUIPlugin.imageDescriptorFromPlugin(FrameworkUtil.getBundle(TIGERSearchAdapterFactory.class).getSymbolicName(),
-					"platform:/plugin/"+ FrameworkUtil.getBundle(TIGERSearchAdapterFactory.class).getSymbolicName() + "/icons/TS.png"); //$NON-NLS-1$ //$NON-NLS-2$
+					"platform:/plugin/"+ FrameworkUtil.getBundle(TIGERSearchAdapterFactory.class).getSymbolicName() + "/icons/functions/TS.png"); //$NON-NLS-1$ //$NON-NLS-2$
 
 	@Override
 	public Object getAdapter(Object adaptableObject, Class adapterType) {
-		if (this.canAdapt(adapterType) && adaptableObject instanceof TIGERSearch)	{
+		if (this.canAdapt(adapterType) && adaptableObject instanceof org.txm.function.tigersearch.TIGERSearch)	{
 			return new TXMResultAdapter() {
 				@Override
 				public ImageDescriptor getImageDescriptor(Object object) {
Index: tmp/org.txm.tigersearch.rcp/src/org/txm/tigersearch/editors/TIGERSearchEditor.java
===================================================================
--- tmp/org.txm.tigersearch.rcp/src/org/txm/tigersearch/editors/TIGERSearchEditor.java	(revision 2100)
+++ tmp/org.txm.tigersearch.rcp/src/org/txm/tigersearch/editors/TIGERSearchEditor.java	(revision 2101)
@@ -23,6 +23,8 @@
 import org.eclipse.ui.IEditorSite;
 import org.eclipse.ui.PartInitException;
 import org.txm.Toolbox;
+import org.txm.core.preferences.TXMPreferences;
+import org.txm.core.results.Parameter;
 import org.txm.function.tigersearch.TIGERSearch;
 import org.txm.objects.CorpusBuild;
 import org.txm.rcp.JobsTimer;
@@ -55,7 +57,9 @@
 
 	private TIGERSearch ts = null;
 
+	@Parameter(key=TXMPreferences.QUERY)
 	private StyledText queryArea;
+	
 	private Label subCounterLabel;
 	private Label sentCounterLabel;
 	private Combo NTCombo;
@@ -259,8 +263,8 @@
 
 	@Override
 	public void updateResultFromEditor() {
-		// FIXME: not yet implemented
-		System.err.println("TIGERSearchEditor.updateResultFromEditor(): not yet implemented.");
+		
+		reloadGraph();
 	}
 
 	@Override
Index: tmp/org.txm.tigersearch.rcp/src/org/txm/function/tigersearch/TIGERSearch.java
===================================================================
--- tmp/org.txm.tigersearch.rcp/src/org/txm/function/tigersearch/TIGERSearch.java	(revision 2100)
+++ tmp/org.txm.tigersearch.rcp/src/org/txm/function/tigersearch/TIGERSearch.java	(revision 2101)
@@ -33,14 +33,20 @@
 	}
 
 	public TIGERSearch(CorpusBuild corpus2) {
-		super(corpus2);
-		this.corpus = corpus2;
+		this(null, corpus2);
 
-		String id = corpus2.getName();
-		File configfile = new File(corpus2.getProjectDirectory(),"tiger/tigersearch.logprop");
-		File registrydir = new File(corpus2.getProjectDirectory(), "tiger");
-		File tscorpusdir = new File(corpus2.getProjectDirectory(), "tiger/"+id);
+	}
+	
+	public TIGERSearch(String parentNodePath, CorpusBuild corpus2) {
+		super(parentNodePath, corpus2);
+		
+		this.corpus = getParent();
 
+		String id = corpus.getName();
+		File configfile = new File(corpus.getProjectDirectory(),"tiger/tigersearch.logprop");
+		File registrydir = new File(corpus.getProjectDirectory(), "tiger");
+		File tscorpusdir = new File(corpus.getProjectDirectory(), "tiger/"+id);
+
 		if (!tscorpusdir.exists()) {
 			System.out.println("Error: can't find corpus directory: "+tscorpusdir);
 			return;
@@ -60,6 +66,10 @@
 			ready = true;
 		}
 	}
+	
+	public TIGERSearch(String parentNodePath) {
+		this( parentNodePath, null);
+	}
 
 	public TSResult getTSResult() {
 		return tsresult;
@@ -77,6 +87,8 @@
 		if (tsresult == null) return false; // no result
 		this.T = T;
 		this.NT = NT;
+		
+		if (tsresult.getNumberOfMatch() == 0) return false;
 
 		tsresult.setDisplayProperties(Arrays.asList(T), NT);
 
@@ -109,7 +121,7 @@
 	}
 
 	public CorpusBuild getParent() {
-		return corpus;
+		return (CorpusBuild)super.getParent();
 	}
 
 	public boolean isReady() {
@@ -131,6 +143,8 @@
 
 	public int getNSubGraph() {
 		if (tsresult == null) return 0;
+		if (tsresult.getCurrentMatch() == null) return 0;
+		
 		return tsresult.getCurrentMatch().getNumberOfSubGraph();
 	}
 
Index: tmp/org.txm.tigersearch.rcp/src/org/txm/searchengine/ts/TIGERSearchEngine.java
===================================================================
--- tmp/org.txm.tigersearch.rcp/src/org/txm/searchengine/ts/TIGERSearchEngine.java	(revision 2100)
+++ tmp/org.txm.tigersearch.rcp/src/org/txm/searchengine/ts/TIGERSearchEngine.java	(revision 2101)
@@ -3,6 +3,7 @@
 import java.io.File;
 import java.lang.reflect.Field;
 import java.util.ArrayList;
+import java.util.LinkedHashSet;
 import java.util.List;
 
 import org.eclipse.core.runtime.IProgressMonitor;
@@ -87,13 +88,13 @@
 			}
 		}
 		
-		ArrayList<TIGERMatch> tigerMatchesList = new ArrayList<TIGERMatch>();
+		LinkedHashSet<TIGERMatch> tigerMatchesList = new LinkedHashSet<TIGERMatch>();
 		//System.out.println("submatchSize: "+subsize);
 		for (int imatch = 0 ; imatch < size; imatch++) { // the matching sentences
 			int sent = mresult.getSentenceNumberAt(imatch);
 			//Sentence sentence = tcorpus.manager.getSentence(sent);
 			
-			System.out.println(" sent: "+sent);
+			//System.out.println(" sent: "+sent);
 			int sent_submatch = mresult.getSentenceSubmatchSize(sent);
 			//System.out.println(" sent submatch size: "+sent_submatch);
 			for (int isubmatch = 0 ; isubmatch < sent_submatch ; isubmatch++) { // the matches in the sentence
@@ -101,14 +102,21 @@
 				
 				int sent_start = starts[sent];
 				
-				TIGERMatch tigerMatch = new TIGERMatch(sent_start+match[0], sent_start+match[match.length-1]);
-				System.out.println("   start="+sent_start+" matches="+Arrays.toString(match));
-				System.out.println("   m="+(tigerMatch));
-				tigerMatchesList.add(tigerMatch);
+				//System.out.println("  sent="+sent_start+ " matches="+Arrays.toString(match));
+				for (int i = 0 ; i < match.length ; i++) {
+					int left = index.getLeftCorner(sent, match[i]);
+					int right = index.getRightCorner(sent, match[i]);
+					//System.out.println("   M="+match[i]+" ("+left+", "+right+")");
+					
+					TIGERMatch tigerMatch = new TIGERMatch(sent_start+left, sent_start+right);
+					
+					//System.out.println("  ajusted="+(tigerMatch));
+					tigerMatchesList.add(tigerMatch);
+				}
 			}
 		}
 
-		return new TIGERSelection(query, tigerMatchesList);
+		return new TIGERSelection(query, new ArrayList<TIGERMatch>(tigerMatchesList));
 	}
 
 	@Override
Index: tmp/org.txm.tigersearch.rcp/src/org/txm/searchengine/ts/TSCorpus.java
===================================================================
--- tmp/org.txm.tigersearch.rcp/src/org/txm/searchengine/ts/TSCorpus.java	(revision 2100)
+++ tmp/org.txm.tigersearch.rcp/src/org/txm/searchengine/ts/TSCorpus.java	(revision 2101)
@@ -61,8 +61,6 @@
 	/** The results. */
 	HashMap<Integer, TSResult> results = new HashMap<Integer, TSResult>();
 
-
-	
 	/**
 	 * Instantiates a new TS corpus.
 	 *
