Index: tmp/org.txm.lexicaltable.rcp/OSGI-INF/l10n/bundle.properties
===================================================================
--- tmp/org.txm.lexicaltable.rcp/OSGI-INF/l10n/bundle.properties	(revision 0)
+++ tmp/org.txm.lexicaltable.rcp/OSGI-INF/l10n/bundle.properties	(revision 264)
@@ -0,0 +1,16 @@
+
+command.name = Lexical Table
+
+command.name.37 = Delete line
+
+command.name.38 = Merge lines
+
+command.name.39 = Export table to re-import
+
+command.name.40 = Import Table
+
+command.tooltip = Compute Lexical Table
+
+editor.name = Lexical Table
+
+page.name = Lexical Table

Property changes on: tmp/org.txm.lexicaltable.rcp/OSGI-INF/l10n/bundle.properties
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/org.txm.lexicaltable.rcp/OSGI-INF/l10n/bundle_ru.properties
===================================================================
--- tmp/org.txm.lexicaltable.rcp/OSGI-INF/l10n/bundle_ru.properties	(revision 0)
+++ tmp/org.txm.lexicaltable.rcp/OSGI-INF/l10n/bundle_ru.properties	(revision 264)
@@ -0,0 +1,16 @@
+
+command.name = Словарная таблица
+
+command.name.37 = Удалить строку
+
+command.name.38 = Объединить строки
+
+command.name.39 = Экспортировать таблицу
+
+command.name.40 = Импортировать таблицу
+
+command.tooltip = Словарная таблица
+
+editor.name = Словарная таблица
+
+page.name = Словарная таблица

Property changes on: tmp/org.txm.lexicaltable.rcp/OSGI-INF/l10n/bundle_ru.properties
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/org.txm.lexicaltable.rcp/OSGI-INF/l10n/bundle_fr.properties
===================================================================
--- tmp/org.txm.lexicaltable.rcp/OSGI-INF/l10n/bundle_fr.properties	(revision 0)
+++ tmp/org.txm.lexicaltable.rcp/OSGI-INF/l10n/bundle_fr.properties	(revision 264)
@@ -0,0 +1,16 @@
+
+command.name = Table lexicale
+
+command.name.37 = Supprimer la ligne
+
+command.name.38 = Fusionner les lignes
+
+command.name.39 = Exporter la table pour ré-import
+
+command.name.40 = Importer une table
+
+command.tooltip = Calculer une table lexicale
+
+editor.name = Table lexicale
+
+page.name = Table lexicale

Property changes on: tmp/org.txm.lexicaltable.rcp/OSGI-INF/l10n/bundle_fr.properties
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/org.txm.lexicaltable.rcp/plugin.xml
===================================================================
--- tmp/org.txm.lexicaltable.rcp/plugin.xml	(revision 263)
+++ tmp/org.txm.lexicaltable.rcp/plugin.xml	(revision 264)
@@ -7,7 +7,7 @@
             category="org.txm.rcpapplication.preferences.UserPreferencePage"
             class="org.txm.lexicaltable.rcp.preferences.LexicalTablePreferencePage"
             id="org.txm.lexicaltable.rcp.preferences.LexicalTablePreferencePage"
-            name="%page.name.13">
+            name="%page.name">
       </page>
    </extension>
    <extension
@@ -17,9 +17,7 @@
          <command
                commandId="ComputeLexicalTable"
                icon="icons/lexicaltable.png"
-               label="%command.label.97"
-               style="push"
-               tooltip="%command.tooltip.58">
+               style="push">
             <visibleWhen
                   checkEnabled="false">
                <or>
@@ -41,9 +39,7 @@
          <command
                commandId="ComputeLexicalTable"
                icon="icons/lexicaltable.png"
-               label="%command.label.89"
-               style="push"
-               tooltip="%command.tooltip.51">
+               style="push">
             <visibleWhen
                   checkEnabled="false">
                <or>
@@ -66,9 +62,8 @@
          <command
                commandId="ComputeLexicalTable"
                icon="icons/lexicaltable.png"
-               label="%command.label.94"
                style="push"
-               tooltip="%command.tooltip.55">
+               tooltip="%command.tooltip">
             <visibleWhen
                   checkEnabled="false">
                <or>
@@ -86,15 +81,13 @@
          </command>
       </menuContribution>
             <menuContribution
-            locationURI="popup:org.txm.lexicaltable.rcp.editors.LexicalTableEditor">
+            locationURI="popup:LexicalTableEditor">
          <command
                commandId="DeleteLines"
-               label="%command.label.104"
                style="push">
          </command>
          <command
                commandId="MergeLines"
-               label="%command.label.105"
                style="push">
          </command>
          <separator
@@ -103,12 +96,10 @@
          </separator>
          <command
                commandId="ExportLexicalTable"
-               label="%command.label.106"
                style="push">
          </command>
          <command
                commandId="ImportTable"
-               label="%command.label.107"
                style="push">
          </command>
       </menuContribution>
@@ -120,8 +111,14 @@
             categoryId="org.txm.rcpapplication.category.txm"
             defaultHandler="org.txm.lexicaltable.rcp.handlers.ComputeLexicalTable"
             id="ComputeLexicalTable"
-            name="%command.name.36">
+            name="%command.name">
       </command>
+            <command
+            defaultHandler="org.txm.lexicaltable.rcp.handlers.DeleteLines"
+            id="DeleteLines"
+            name="%command.name.37">
+      </command>
+      
       <command
             defaultHandler="org.txm.lexicaltable.rcp.handlers.MergeLines"
             id="MergeLines"
@@ -145,7 +142,7 @@
             default="false"
             icon="icons/lexicaltable.png"
             id="LexicalTableEditor"
-            name="%editor.name.11">
+            name="%editor.name">
       </editor>
    </extension>
    <extension
@@ -158,5 +155,21 @@
          </adapter>
       </factory>
    </extension>
+   <extension
+         point="org.eclipse.core.expressions.definitions">
+      <definition
+            id="OneLexicalTableSelected">
+         <with
+               variable="selection">
+            <iterate
+                  ifEmpty="false"
+                  operator="and">
+               <instanceof
+                     value="org.txm.lexicaltable.core.statsengine.data.LexicalTable">
+               </instanceof>
+            </iterate>
+         </with>
+      </definition>
+   </extension>
 
 </plugin>
Index: tmp/org.txm.lexicaltable.rcp/META-INF/MANIFEST.MF
===================================================================
--- tmp/org.txm.lexicaltable.rcp/META-INF/MANIFEST.MF	(revision 263)
+++ tmp/org.txm.lexicaltable.rcp/META-INF/MANIFEST.MF	(revision 264)
@@ -10,7 +10,8 @@
  org.eclipse.core.runtime,
  org.txm.rcp,
  org.eclipse.ui;bundle-version="3.106.1",
- org.txm.statsengine.r.rcp
+ org.txm.statsengine.r.rcp,
+ org.eclipse.core.expressions;bundle-version="3.4.600"
 Bundle-RequiredExecutionEnvironment: JavaSE-1.6
 Bundle-ActivationPolicy: lazy
 Export-Package: org.txm.lexicaltable.rcp.adapters,
@@ -18,3 +19,4 @@
  org.txm.lexicaltable.rcp.handlers,
  org.txm.lexicaltable.rcp.messages,
  org.txm.lexicaltable.rcp.preferences
+Bundle-Vendor: Textometrie.org
Index: tmp/org.txm.lexicaltable.rcp/src/org/txm/lexicaltable/rcp/messages/LexicalTableUIMessages.java
===================================================================
--- tmp/org.txm.lexicaltable.rcp/src/org/txm/lexicaltable/rcp/messages/LexicalTableUIMessages.java	(revision 263)
+++ tmp/org.txm.lexicaltable.rcp/src/org/txm/lexicaltable/rcp/messages/LexicalTableUIMessages.java	(revision 264)
@@ -1,7 +1,7 @@
 package org.txm.lexicaltable.rcp.messages;
 
 import org.eclipse.osgi.util.NLS;
-import org.txm.core.messages.TXMCoreMessages;
+import org.txm.utils.messages.Utf8NLS;
 
 public class LexicalTableUIMessages extends NLS {
 
@@ -32,7 +32,7 @@
 	
 	static {
 		// initialize resource bundle
-		TXMCoreMessages.initializeMessages(BUNDLE_NAME, LexicalTableUIMessages.class);
+		Utf8NLS.initializeMessages(BUNDLE_NAME, LexicalTableUIMessages.class);
 	}
 
 	private LexicalTableUIMessages() {
Index: tmp/org.txm.lexicaltable.rcp/src/org/txm/lexicaltable/rcp/editors/LexicalTableEditor2.java
===================================================================
--- tmp/org.txm.lexicaltable.rcp/src/org/txm/lexicaltable/rcp/editors/LexicalTableEditor2.java	(revision 263)
+++ tmp/org.txm.lexicaltable.rcp/src/org/txm/lexicaltable/rcp/editors/LexicalTableEditor2.java	(revision 264)
@@ -78,7 +78,7 @@
 import org.txm.searchengine.cqp.corpus.Corpus;
 import org.txm.statsengine.core.StatException;
 import org.txm.statsengine.core.data.Vector;
-import org.txm.statsengine.r.core.RWorkspaceException;
+import org.txm.statsengine.r.core.exceptions.RWorkspaceException;
 // TODO: Auto-generated Javadoc
 /**
  * display the lexical table tools to merge/delete lines or columns and display
@@ -128,7 +128,7 @@
 	Spinner minfreqspinner;
 
 	/** The top spinner. */
-	Spinner topSpinner;
+	Spinner nLinesSpinner;
 
 	/** The fusion text. */
 	Text fusionText;
@@ -208,7 +208,6 @@
 			viewer.getTable().setSortDirection(SWT.UP);
 	}
 
-	Label infos;
 	/**
 	 * Creates the part control.
 	 *
@@ -218,48 +217,32 @@
 	@Override
 	public void createPartControl(final Composite parent) {
 		
-		//FIXME: to do
-		//super.createPartControl(parent);
+		super.createPartControl(parent);
 		
-		
-		FormLayout parentLayout = new FormLayout();
-		parent.setLayout(parentLayout);
+		Composite paramArea = new Composite(this.commandParametersGroup, SWT.NONE);
 
-		final Composite paramArea = new Composite(parent, SWT.NONE);
-		FormData paramLayoutData = new FormData();
-		paramLayoutData.top = new FormAttachment(0);
-		paramLayoutData.left = new FormAttachment(0);
-		paramLayoutData.right = new FormAttachment(100);
-		paramArea.setLayoutData(paramLayoutData);
-
 		GridLayout paramLayout = new GridLayout(5, false);
 		paramArea.setLayout(paramLayout);
 
-		infos = new Label(paramArea, SWT.NONE);
-		infos.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true,
-				true, 5, 1));
-		refreshInfos();
-
+		// Apply button
 		Button keepTop = new Button(paramArea, SWT.PUSH);
 		keepTop.setText(LexicalTableUIMessages.LexicalTableEditor_4);
 		keepTop.addSelectionListener(new SelectionListener() {
 			@Override
 			public void widgetSelected(SelectionEvent e) {
 				StatusLine.setMessage(LexicalTableUIMessages.LexicalTableEditor_16);
-				System.out.println(NLS.bind(LexicalTableUIMessages.LexicalTableEditor_5, topSpinner.getSelection(), minfreqspinner.getSelection()));
+				System.out.println(NLS.bind(LexicalTableUIMessages.LexicalTableEditor_5, nLinesSpinner.getSelection(), minfreqspinner.getSelection()));
 
-				MessageBox messageBox = new MessageBox(e.display
-						.getActiveShell(), SWT.ICON_QUESTION | SWT.YES | SWT.NO);
+				MessageBox messageBox = new MessageBox(e.display.getActiveShell(), SWT.ICON_QUESTION | SWT.YES | SWT.NO);
 				messageBox.setMessage(Messages.DeleteLines_1);
 				int response = messageBox.open();
 				if (response != SWT.YES)
 					return;
 
 				try {
-					table.filter(topSpinner.getSelection(), minfreqspinner.getSelection());
-					refreshTable();
+					table.filter(nLinesSpinner.getSelection(), minfreqspinner.getSelection());
+					refresh();
 					StatusLine.setMessage(""); //$NON-NLS-1$
-					CorporaView.refreshObject(table);
 				} catch (Exception e1) {
 					// TODO Auto-generated catch block
 					org.txm.rcpapplication.utils.Logger.printStackTrace(e1);
@@ -271,14 +254,18 @@
 			public void widgetDefaultSelected(SelectionEvent e) {
 			}
 		});
-		infos = new Label(paramArea, SWT.NONE);
-		infos.setText(LexicalTableUIMessages.LexicalTableEditor_8);
-		topSpinner = new Spinner(paramArea, SWT.BORDER);
+		
+		// Number of lines
+		Label nLines = new Label(paramArea, SWT.NONE);
+		nLines.setText(LexicalTableUIMessages.LexicalTableEditor_8);
+		nLinesSpinner = new Spinner(paramArea, SWT.BORDER);
 
-		infos = new Label(paramArea, SWT.NONE);
-		infos.setText(LexicalTableUIMessages.LexicalTableEditor_6);
+		// Fmin
+		Label fmin = new Label(paramArea, SWT.NONE);
+		fmin.setText(LexicalTableUIMessages.LexicalTableEditor_6);
 		minfreqspinner = new Spinner(paramArea, SWT.BORDER);
 
+		// Merge or delete columns button
 		Button fusionCol = new Button(paramArea, SWT.PUSH);
 		fusionCol.setText(LexicalTableUIMessages.LexicalTableEditor_10);
 		fusionCol.addSelectionListener(new SelectionListener() {
@@ -377,6 +364,7 @@
 			}
 		});
 
+		// Merge or delete lines button
 		Button mergeDeleteRows = new Button(paramArea, SWT.PUSH);
 		mergeDeleteRows.setText(LexicalTableUIMessages.LexicalTableEditor_13);
 		mergeDeleteRows.addSelectionListener(new SelectionListener() {
@@ -415,13 +403,13 @@
 
 		// result
 		Composite resultArea = new Composite(parent, SWT.NONE);
-		FormData resultLayoutData = new FormData();
-		resultLayoutData.top = new FormAttachment(paramArea, 0);
-		resultLayoutData.left = new FormAttachment(0);
-		resultLayoutData.right = new FormAttachment(100);
-		resultLayoutData.bottom = new FormAttachment(100);
-		resultArea.setLayoutData(resultLayoutData);
-
+		
+		GridData gd = new GridData(GridData.FILL_BOTH);
+		gd.grabExcessVerticalSpace = true;
+		gd.grabExcessHorizontalSpace = true;
+		//gd.horizontalSpan = 2;
+		resultArea.setLayoutData(gd);
+		
 		FormLayout resultLayout = new FormLayout();
 		resultArea.setLayout(resultLayout);
 
@@ -445,14 +433,12 @@
 		formColumn = new TableViewerColumn(viewer, SWT.LEFT);
 		formColumn.getColumn().setText(this.table.getProperty().getName()); 
 		formColumn.getColumn().setWidth(200);
-		formColumn.getColumn().addSelectionListener(
-				new ColumnSelectionListener(formColumn, -2));
+		formColumn.getColumn().addSelectionListener(new ColumnSelectionListener(formColumn, -2));
 
 		freqColumn = new TableViewerColumn(viewer, SWT.LEFT);
 		freqColumn.getColumn().setText(Messages.FrequencyListEditorInput_4); 
 		freqColumn.getColumn().setWidth(200);
-		freqColumn.getColumn().addSelectionListener(
-				new ColumnSelectionListener(freqColumn, -1));
+		freqColumn.getColumn().addSelectionListener(new ColumnSelectionListener(freqColumn, -1));
 		collist = new ArrayList<Object>();
 		Vector colnames = table.getColNames();
 		
@@ -467,8 +453,7 @@
 				partColumn.getColumn().setToolTipText(colname); 
 				collist.add(colname);
 				partColumn.getColumn().setWidth(200);
-				partColumn.getColumn().addSelectionListener(
-						new ColumnSelectionListener(partColumn, i));
+				partColumn.getColumn().addSelectionListener(new ColumnSelectionListener(partColumn, i));
 				i++;
 			}
 		} catch (StatException e1) {
@@ -481,7 +466,6 @@
 		nColumn.getColumn().pack();
 
 		viewer.setContentProvider(new LineContentProvider());
-		refreshTable();
 		viewer.setInput(table);
 		parent.layout();
 
@@ -489,7 +473,14 @@
 		viewer.getTable().setSortColumn(formColumn.getColumn());
 		viewer.getTable().setSortDirection(SWT.UP);
 
+
+		refresh();
+
+		
 		createContextMenu(viewer);
+		
+		this.commandParametersGroup.pack();
+		
 	}
 
 	private void refreshColNames() throws StatException, CqiClientException {
@@ -501,57 +492,80 @@
 		}
 	}
 
-	private void refreshInfos() {
+	/**
+	 * Refreshes the description area.
+	 */
+	public void refreshInfos() {
 		try {
-			infos.setText(TXMCoreMessages.T + table.getTotal()
+			this.setContentDescription(TXMCoreMessages.T + table.getTotal()
 					+ TXMCoreMessages.V + table.getNRows()
 					+ TXMCoreMessages.FMIN_2 + table.getFmin()
 					+ TXMCoreMessages.FMAX_2 + table.getFmax());
-			infos.redraw();
-			infos.getParent().layout();
 		} catch (RWorkspaceException e3) {
 			// TODO Auto-generated catch block
 			org.txm.rcpapplication.utils.Logger.printStackTrace(e3);
 		}
+		catch(StatException e) {
+			// TODO Auto-generated catch block
+			e.printStackTrace();
+		}
 	}
 
 	/**
-	 * Creates the context menu.
-	 *
-	 * @param tableViewer the table viewer
-	 */
-	private void createContextMenu(TableViewer tableViewer) {
-
-		MenuManager menuManager = new MenuManager();
-		Menu menu = menuManager.createContextMenu(tableViewer.getTable());
-		tableViewer.getTable().setMenu(menu);
-		getSite().registerContextMenu(menuManager, tableViewer);
-		getSite().setSelectionProvider(tableViewer);
-	}
-
-	/**
 	 * Refresh table.
 	 */
 	public void refreshTable() {
+		
 		LineLabelProvider labelprovider = new LineLabelProvider(table);
 		viewer.setLabelProvider(labelprovider);
 		this.cols = labelprovider.getCols();
 		this.rows = labelprovider.getRows();
 		//this.freqs = labelprovider.getFreqs();
+
+
+		// Refresh and pack the columns
+		viewer.getControl().setRedraw(false);
 		viewer.refresh();
 		for (TableColumn col : viewer.getTable().getColumns()) {
 			col.pack();
 		}
-
-		topSpinner.setMinimum(1);
-		topSpinner.setMaximum(table.getNRows());
-		topSpinner.setSelection(table.getNRows());
+		viewer.getControl().setRedraw(true);
+		
+		nLinesSpinner.setMinimum(1);
+		nLinesSpinner.setMaximum(table.getNRows());
+		nLinesSpinner.setSelection(table.getNRows());
 		minfreqspinner.setMinimum(table.getFmin());
 		minfreqspinner.setMaximum(table.getFmax());
 		viewer.getTable().setFocus();
 	}
 
+	
+	@Override
+	public void refresh()	{
+		this.refreshTable();
+		this.viewer.getTable().deselectAll();
+		this.refreshInfos();
+		super.refresh();
+	}
+	
+	
+
 	/**
+	 * Creates the context menu.
+	 *
+	 * @param tableViewer the table viewer
+	 */
+	private void createContextMenu(TableViewer tableViewer) {
+
+		MenuManager menuManager = new MenuManager();
+		Menu menu = menuManager.createContextMenu(tableViewer.getTable());
+		tableViewer.getTable().setMenu(menu);
+		getSite().registerContextMenu(menuManager, tableViewer);
+		getSite().setSelectionProvider(tableViewer);
+	}
+
+	
+	/**
 	 * Sets the col comparator.
 	 *
 	 * @param comp the comp
Index: tmp/org.txm.lexicaltable.rcp/src/org/txm/lexicaltable/rcp/handlers/ComputeLexicalTable.java
===================================================================
--- tmp/org.txm.lexicaltable.rcp/src/org/txm/lexicaltable/rcp/handlers/ComputeLexicalTable.java	(revision 263)
+++ tmp/org.txm.lexicaltable.rcp/src/org/txm/lexicaltable/rcp/handlers/ComputeLexicalTable.java	(revision 264)
@@ -303,8 +303,6 @@
 						syncExec(new Runnable() {
 							@Override
 							public void run() {
-								CorporaView.refresh();
-								CorporaView.expand(table.getParent());
 								QueriesView.refresh();
 								RVariablesView.refresh();
 							}
Index: tmp/org.txm.lexicaltable.rcp/src/org/txm/lexicaltable/rcp/handlers/MergeLines.java
===================================================================
--- tmp/org.txm.lexicaltable.rcp/src/org/txm/lexicaltable/rcp/handlers/MergeLines.java	(revision 263)
+++ tmp/org.txm.lexicaltable.rcp/src/org/txm/lexicaltable/rcp/handlers/MergeLines.java	(revision 264)
@@ -119,6 +119,7 @@
 
 		LTeditor.refreshTable();
 		lineTableViewer.getTable().deselectAll();
+		LTeditor.refresh();
 		StatusLine.setMessage(""); //$NON-NLS-1$
 	}
 }
Index: tmp/org.txm.lexicaltable.rcp/src/org/txm/lexicaltable/rcp/handlers/DeleteLines.java
===================================================================
--- tmp/org.txm.lexicaltable.rcp/src/org/txm/lexicaltable/rcp/handlers/DeleteLines.java	(revision 263)
+++ tmp/org.txm.lexicaltable.rcp/src/org/txm/lexicaltable/rcp/handlers/DeleteLines.java	(revision 264)
@@ -91,6 +91,7 @@
 
 		LTeditor.refreshTable();
 		LTeditor.getlineTableViewer().getTable().deselectAll();
+		LTeditor.refresh();
 	}
 
 }
Index: tmp/org.txm.lexicaltable.core/src/org/txm/lexicaltable/core/statsengine/r/data/LexicalTableImpl.java
===================================================================
--- tmp/org.txm.lexicaltable.core/src/org/txm/lexicaltable/core/statsengine/r/data/LexicalTableImpl.java	(revision 263)
+++ tmp/org.txm.lexicaltable.core/src/org/txm/lexicaltable/core/statsengine/r/data/LexicalTableImpl.java	(revision 264)
@@ -40,24 +40,23 @@
 import java.util.Map;
 
 
-
 //import org.txm.functions.queryindex.*;
 import org.txm.index.core.functions.Index;
 import org.txm.index.core.functions.Line;
 import org.txm.lexicaltable.core.messages.LexicalTableCoreMessages;
 import org.txm.lexicaltable.core.statsengine.data.LexicalTable;
+import org.txm.lexicon.core.corpusengine.cqp.Lexicon;
 import org.txm.searchengine.cqp.clientExceptions.CqiClientException;
 import org.txm.searchengine.cqp.corpus.Corpus;
-import org.txm.searchengine.cqp.corpus.Lexicon;
 import org.txm.searchengine.cqp.corpus.Partition;
 import org.txm.searchengine.cqp.corpus.Property;
 import org.txm.statsengine.core.StatException;
 import org.txm.statsengine.core.data.QuantitativeDataStructure;
 import org.txm.statsengine.core.data.Vector;
-import org.txm.statsengine.r.core.RException;
 import org.txm.statsengine.r.core.RWorkspace;
-import org.txm.statsengine.r.core.RWorkspaceException;
 import org.txm.statsengine.r.core.data.ContingencyTableImpl;
+import org.txm.statsengine.r.core.exceptions.RException;
+import org.txm.statsengine.r.core.exceptions.RWorkspaceException;
 
 import cern.colt.matrix.DoubleFactory2D;
 import cern.colt.matrix.DoubleMatrix2D;
@@ -97,6 +96,8 @@
 	private int constructor_fmin;
 
 
+	protected ArrayList<Integer> frequencies;
+	
 	/**
 	 * Instantiates a new lexical table impl.
 	 *
Index: tmp/org.txm.lexicaltable.core/src/org/txm/lexicaltable/core/statsengine/data/LexicalTable.java
===================================================================
--- tmp/org.txm.lexicaltable.core/src/org/txm/lexicaltable/core/statsengine/data/LexicalTable.java	(revision 263)
+++ tmp/org.txm.lexicaltable.core/src/org/txm/lexicaltable/core/statsengine/data/LexicalTable.java	(revision 264)
@@ -38,7 +38,7 @@
 import org.txm.statsengine.core.StatException;
 import org.txm.statsengine.core.data.ContingencyTable;
 import org.txm.statsengine.core.data.Vector;
-import org.txm.statsengine.r.core.RWorkspaceException;
+import org.txm.statsengine.r.core.exceptions.RWorkspaceException;
 
 // TODO: Auto-generated Javadoc
 /**
Index: tmp/org.txm.lexicaltable.core/src/org/txm/lexicaltable/core/messages/LexicalTableCoreMessages.java
===================================================================
--- tmp/org.txm.lexicaltable.core/src/org/txm/lexicaltable/core/messages/LexicalTableCoreMessages.java	(revision 263)
+++ tmp/org.txm.lexicaltable.core/src/org/txm/lexicaltable/core/messages/LexicalTableCoreMessages.java	(revision 264)
@@ -1,7 +1,7 @@
 package org.txm.lexicaltable.core.messages;
 
 import org.eclipse.osgi.util.NLS;
-import org.txm.core.messages.TXMCoreMessages;
+import org.txm.utils.messages.Utf8NLS;
 
 public class LexicalTableCoreMessages extends NLS {
 	
@@ -22,7 +22,7 @@
 	
 	static {
 		// initialize resource bundle
-		TXMCoreMessages.initializeMessages(BUNDLE_NAME, LexicalTableCoreMessages.class);
+		Utf8NLS.initializeMessages(BUNDLE_NAME, LexicalTableCoreMessages.class);
 	}
 
 	private LexicalTableCoreMessages() {
Index: tmp/org.txm.lexicaltable.core/META-INF/MANIFEST.MF
===================================================================
--- tmp/org.txm.lexicaltable.core/META-INF/MANIFEST.MF	(revision 263)
+++ tmp/org.txm.lexicaltable.core/META-INF/MANIFEST.MF	(revision 264)
@@ -1,12 +1,14 @@
 Manifest-Version: 1.0
 Bundle-ManifestVersion: 2
-Bundle-Name: LexicalTable Core
+Bundle-Name: Lexical Table Core
 Bundle-SymbolicName: org.txm.lexicaltable.core;singleton:=true
 Bundle-Version: 1.0.0.qualifier
-Require-Bundle: org.txm.statsengine.r.core;bundle-version="1.0.0",
+Require-Bundle: org.txm.statsengine.core;bundle-version="1.0.0",
+ org.txm.statsengine.r.core;bundle-version="1.0.0",
  org.txm.core;bundle-version="0.7.0",
  org.eclipse.core.runtime,
- org.txm.index.core;bundle-version="1.0.0"
+ org.txm.index.core;bundle-version="1.0.0",
+ org.txm.lexicon.core;bundle-version="1.0.0"
 Bundle-RequiredExecutionEnvironment: JavaSE-1.6
 Bundle-ActivationPolicy: lazy
 Export-Package: org.txm.functions.intertextualdistance,
@@ -15,3 +17,4 @@
  org.txm.lexicaltable.core.preferences,
  org.txm.lexicaltable.core.statsengine.data,
  org.txm.lexicaltable.core.statsengine.r.data
+Bundle-Vendor: Textometrie.org
Index: tmp/org.txm.index.rcp/plugin.xml
===================================================================
--- tmp/org.txm.index.rcp/plugin.xml	(revision 263)
+++ tmp/org.txm.index.rcp/plugin.xml	(revision 264)
@@ -8,7 +8,6 @@
          <command
                commandId="ComputeIndex"
                icon="icons/index.png"
-               label="%command.label.66"
                style="push">
             <visibleWhen
                   checkEnabled="false">
@@ -28,7 +27,6 @@
          <command
                commandId="ComputeIndex"
                icon="icons/index.png"
-               label="%command.label.66"
                style="push">
             <visibleWhen
                   checkEnabled="false">
@@ -49,9 +47,8 @@
          <command
                commandId="ComputeIndex"
                icon="icons/index.png"
-               label="%command.label.66"
                style="push"
-               tooltip="%command.tooltip.62">
+               tooltip="%command.tooltip">
             <visibleWhen
                   checkEnabled="false">
                <or>
@@ -67,23 +64,13 @@
       </menuContribution>
    </extension>
    <extension
-         point="org.eclipse.ui.preferencePages">
-   </extension>
-   <extension
          point="org.eclipse.ui.editors">
       <editor
-            class="org.txm.rcpapplication.editors.TableEditor"
-            default="false"
-            icon="icons/index.png"
-            id="org.txm.rcpapplication.editors.TableEditor"
-            name="%editor.name.0">
-      </editor>
-      <editor
             class="org.txm.index.rcp.editors.IndexEditor"
             default="false"
             icon="icons/index.png"
             id="IndexEditor"
-            name="%editor.name.7">
+            name="%editor.name">
       </editor>
    </extension>
    <extension
@@ -102,8 +89,24 @@
             categoryId="org.txm.rcpapplication.category.txm"
             defaultHandler="org.txm.index.rcp.handlers.ComputeIndex"
             id="ComputeIndex"
-            name="%command.name.27">
+            name="%command.name">
       </command>
    </extension>
+   <extension
+         point="org.eclipse.core.expressions.definitions">
+      <definition
+            id="OneIndexSelected">
+         <with
+               variable="selection">
+            <iterate
+                  ifEmpty="false"
+                  operator="and">
+               <instanceof
+                     value="org.txm.index.core.functions.Index">
+               </instanceof>
+            </iterate>
+         </with>
+      </definition>
+   </extension>
 
 </plugin>
Index: tmp/org.txm.index.rcp/META-INF/MANIFEST.MF
===================================================================
--- tmp/org.txm.index.rcp/META-INF/MANIFEST.MF	(revision 263)
+++ tmp/org.txm.index.rcp/META-INF/MANIFEST.MF	(revision 264)
@@ -10,7 +10,10 @@
  org.eclipse.core.runtime;bundle-version="3.10.0",
  org.txm.rcp,
  org.txm.statsengine.r.core;bundle-version="1.0.0",
- org.txm.statsengine.r.rcp
+ org.txm.statsengine.r.rcp,
+ org.eclipse.core.expressions;bundle-version="3.4.600"
 Export-Package: org.txm.index.rcp.adapters,
  org.txm.index.rcp.editors,
- org.txm.index.rcp.handlers
+ org.txm.index.rcp.handlers,
+ org.txm.index.rcp.messages
+Bundle-Vendor: Textometrie.org
Index: tmp/org.txm.index.rcp/src/org/txm/index/rcp/handlers/ComputeIndex.java
===================================================================
--- tmp/org.txm.index.rcp/src/org/txm/index/rcp/handlers/ComputeIndex.java	(revision 263)
+++ tmp/org.txm.index.rcp/src/org/txm/index/rcp/handlers/ComputeIndex.java	(revision 264)
@@ -27,29 +27,27 @@
 //
 package org.txm.index.rcp.handlers;
 
-import org.eclipse.core.commands.AbstractHandler;
 import org.eclipse.core.commands.ExecutionEvent;
 import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.jface.viewers.IStructuredSelection;
 import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.handlers.HandlerUtil;
-import org.txm.Toolbox;
 import org.txm.index.core.functions.Index;
 import org.txm.index.rcp.editors.IndexEditor;
 import org.txm.index.rcp.editors.IndexEditorInput;
-import org.txm.rcpapplication.Messages;
+import org.txm.index.rcp.messages.IndexUIMessages;
+import org.txm.rcp.handlers.BaseAbstractHandler;
 import org.txm.rcpapplication.StatusLine;
 import org.txm.rcpapplication.TXMWindows;
 import org.txm.rcpapplication.views.corpora.CorporaView;
 import org.txm.searchengine.cqp.corpus.Corpus;
 import org.txm.searchengine.cqp.corpus.Partition;
+
 /**
- * Open the Index Editor.
+ * Computes an index and opens an editor.
  * 
  * @author mdecorde
  * @author sjacquot
  */
-public class ComputeIndex extends AbstractHandler {
+public class ComputeIndex extends BaseAbstractHandler {
 
 	
 	
@@ -59,60 +57,45 @@
 	}
 	
 	
-	/* (non-Javadoc)
-	 * @see org.eclipse.core.commands.AbstractHandler#execute(org.eclipse.core.commands.ExecutionEvent)
-	 */
 	@Override
 	public Object execute(ExecutionEvent event) throws ExecutionException {
-		if (!Toolbox.isSearchEngineInitialized()) return false;
+
+		if(!this.checkCorpusEngine()) {
+			return false;
+		}
+
 		
 		IndexEditorInput editorInput = null;
 		boolean initializeFields = false;
-		Object s = ((IStructuredSelection) HandlerUtil.getCurrentSelection(event)).getFirstElement();
+		Object selection = this.getSelection();
 		
-		System.err.println("ComputeIndex.execute(): " + s);
-		
 		// New editor from corpus
-		if (s instanceof Corpus) {
-			editorInput = new IndexEditorInput((Corpus) s);
+		if (selection instanceof Corpus) {
+			editorInput = new IndexEditorInput((Corpus) selection);
 		}
 		// New editor from partition
-		else if (s instanceof Partition) {
-			editorInput = new IndexEditorInput((Partition) s);
+		else if (selection instanceof Partition) {
+			editorInput = new IndexEditorInput((Partition) selection);
 			initializeFields = true;
 		}
 		// Reopen an existing result
-		else if (s instanceof Index) {
-			editorInput = new IndexEditorInput((Index) s);
+		else if (selection instanceof Index) {
+			editorInput = new IndexEditorInput((Index) selection);
 		}
-		openEditor(editorInput, initializeFields);
-
-		return null;
-	}
-	
-	
-	/**
-	 * Opens the editor with specified input.
-	 * @param editorInput
-	 * @param initializeFields
-	 * @return
-	 */
-	public static boolean openEditor(IndexEditorInput editorInput, boolean initializeFields) {
-		if (!Toolbox.isSearchEngineInitialized()) return false;
 		
-		IWorkbenchPage page = TXMWindows.getActiveWindow().getActivePage();
+		
 		try {
-			StatusLine.setMessage(Messages.ComputeIndex_0);
+			IWorkbenchPage page = TXMWindows.getActiveWindow().getActivePage();
+			StatusLine.setMessage(IndexUIMessages.ComputeIndex_0);
 			IndexEditor editor = (IndexEditor) page.openEditor(editorInput, "IndexEditor"); //$NON-NLS-1$
 			if(initializeFields)	{
 				editor.initializeFields();
 			}
-			return true;
-		} catch (Exception e) {
+		}
+		catch (Exception e) {
 			org.txm.rcpapplication.utils.Logger.printStackTrace(e);
 		}
-		return false;
+		return null;
 	}
-	
 
 }
Index: tmp/org.txm.index.rcp/src/org/txm/index/rcp/messages/messages.properties
===================================================================
--- tmp/org.txm.index.rcp/src/org/txm/index/rcp/messages/messages.properties	(revision 263)
+++ tmp/org.txm.index.rcp/src/org/txm/index/rcp/messages/messages.properties	(revision 264)
@@ -1,4 +1,6 @@
 
+ComputeIndex_0 = Opening Index results
+
 IndexEditor_0  = Index: query is empty
 IndexEditor_1  = ** Failed to compute index
 IndexEditor_10 = CQP error:
Index: tmp/org.txm.index.rcp/src/org/txm/index/rcp/messages/messages_ru.properties
===================================================================
--- tmp/org.txm.index.rcp/src/org/txm/index/rcp/messages/messages_ru.properties	(revision 263)
+++ tmp/org.txm.index.rcp/src/org/txm/index/rcp/messages/messages_ru.properties	(revision 264)
@@ -1,4 +1,6 @@
 
+ComputeIndex_0 = Открытие Индекса
+
 IndexEditor_0  = Запрос пуст
 IndexEditor_1  = ** Не удалось вычислить индекс
 IndexEditor_10 = N/A_CQP error:
Index: tmp/org.txm.index.rcp/src/org/txm/index/rcp/messages/messages_fr.properties
===================================================================
--- tmp/org.txm.index.rcp/src/org/txm/index/rcp/messages/messages_fr.properties	(revision 263)
+++ tmp/org.txm.index.rcp/src/org/txm/index/rcp/messages/messages_fr.properties	(revision 264)
@@ -1,4 +1,6 @@
 
+ComputeIndex_0 = Ouverture de l'Index
+
 IndexEditor_0  = La requête est vide
 IndexEditor_1  = ** Échec du calcul de l'index
 IndexEditor_10 = Echec de la récupération de la dernière erreur CQP:  
Index: tmp/org.txm.index.rcp/src/org/txm/index/rcp/messages/IndexUIMessages.java
===================================================================
--- tmp/org.txm.index.rcp/src/org/txm/index/rcp/messages/IndexUIMessages.java	(revision 263)
+++ tmp/org.txm.index.rcp/src/org/txm/index/rcp/messages/IndexUIMessages.java	(revision 264)
@@ -1,7 +1,7 @@
 package org.txm.index.rcp.messages;
 
 import org.eclipse.osgi.util.NLS;
-import org.txm.core.messages.TXMCoreMessages;
+import org.txm.utils.messages.Utf8NLS;
 
 public class IndexUIMessages extends NLS {
 
@@ -18,11 +18,12 @@
 	public static String IndexEditor_33;
 	public static String IndexEditor_8;
 	public static String IndexEditor_9;
+	public static String ComputeIndex_0;
 
 	
 	static {
 		// initialize resource bundle
-		TXMCoreMessages.initializeMessages(BUNDLE_NAME, IndexUIMessages.class);
+		Utf8NLS.initializeMessages(BUNDLE_NAME, IndexUIMessages.class);
 	}
 
 	private IndexUIMessages() {
Index: tmp/org.txm.index.rcp/src/org/txm/index/rcp/editors/IndexEditor.java
===================================================================
--- tmp/org.txm.index.rcp/src/org/txm/index/rcp/editors/IndexEditor.java	(revision 263)
+++ tmp/org.txm.index.rcp/src/org/txm/index/rcp/editors/IndexEditor.java	(revision 264)
@@ -251,9 +251,16 @@
 	}
 
 	/**
-	 * Compute index.
+	 * Computes index and sets the result node as visible.
 	 */
 	public void compute() {
+		this.compute(true);
+	}
+
+	/**
+	 * Computes index.
+	 */
+	public void compute(final boolean visibleIndex) {
 		StatusLine.setMessage(IndexUIMessages.IndexEditor_33);
 		final Query query; // if the query is empty then we put "[]" instead
 		if (queryWidget.isDisposed()) { // lexicon editor
@@ -300,7 +307,9 @@
 								index = new Index(corpus, query, properties);
 							}
 						}
-
+						
+						index.setVisible(visibleIndex);
+						
 						if (monitor.isCanceled())
 							return Status.CANCEL_STATUS;
 
@@ -358,7 +367,7 @@
 								System.out.println(message);
 								StatusLine.setMessage(message);
 
-								refreshCorporaView();
+								refresh();
 								
 								QueriesView.refresh();
 								RVariablesView.refresh();
@@ -918,8 +927,7 @@
 		if (this.partition != null) {
 			List<String> partnames = this.partition.getPartNames();
 			if (partnames.size() > 1)
-				if (viewer.getTable().getColumnCount() < partnames
-						.size() + 3) {
+				if (viewer.getTable().getColumnCount() < partnames.size() + 3) {
 					for (int i = 0; i < partnames.size(); i++) {
 						final TableColumn partColumn = new TableColumn(
 								viewer.getTable(), SWT.RIGHT);
@@ -1111,9 +1119,15 @@
 		// System.out.println("table refreshed from "+from+" to "+to+" with : "+lines);
 		topLine = from;
 		bottomLine = to;
+		
+		
+		// Refresh and pack the columns
+		viewer.getControl().setRedraw(false);
+		viewer.refresh();
 		for (TableColumn col : viewer.getTable().getColumns()) {
 			col.pack();
 		}
+		viewer.getControl().setRedraw(true);
 	}
 
 
Index: tmp/org.txm.index.rcp/src/org/txm/index/rcp/editors/IndexEditorInput.java
===================================================================
--- tmp/org.txm.index.rcp/src/org/txm/index/rcp/editors/IndexEditorInput.java	(revision 263)
+++ tmp/org.txm.index.rcp/src/org/txm/index/rcp/editors/IndexEditorInput.java	(revision 264)
@@ -46,6 +46,7 @@
 	/** The partition. */
 	protected Partition partition;
 
+	
 	/**
 	 * Instantiates a new index editor input.
 	 *
@@ -114,5 +115,17 @@
 	}
 
 
+	@Override
+	public boolean equals(Object obj) {
+		//compare the Lexicons instead of the Index
+		if(obj instanceof TXMResultEditorInput && this.getIndex() != null && this.getIndex().getLexicon() != null
+				&& ((TXMResultEditorInput) obj).getResult() != null && ((TXMResultEditorInput) obj).getResult() instanceof Index && ((Index)((TXMResultEditorInput) obj).getResult()).getLexicon() != null)	{
+			if(this.alwaysRecreateEditor)	{
+				return false;
+			}
+			return this.getIndex().getLexicon() == ((Index)((TXMResultEditorInput) obj).getResult()).getLexicon();
+		}
+		return super.equals(obj);
+	}
 
 }
Index: tmp/org.txm.index.rcp/OSGI-INF/l10n/bundle.properties
===================================================================
--- tmp/org.txm.index.rcp/OSGI-INF/l10n/bundle.properties	(revision 0)
+++ tmp/org.txm.index.rcp/OSGI-INF/l10n/bundle.properties	(revision 264)
@@ -0,0 +1,6 @@
+
+command.name = Index
+
+command.tooltip = Process the lexicon of a query
+
+editor.name = Index

Property changes on: tmp/org.txm.index.rcp/OSGI-INF/l10n/bundle.properties
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/org.txm.index.rcp/OSGI-INF/l10n/bundle_ru.properties
===================================================================
--- tmp/org.txm.index.rcp/OSGI-INF/l10n/bundle_ru.properties	(revision 0)
+++ tmp/org.txm.index.rcp/OSGI-INF/l10n/bundle_ru.properties	(revision 264)
@@ -0,0 +1,6 @@
+
+command.name = Индекс
+
+command.tooltip = Вычислить словарный состав ответов на запрос
+
+editor.name = Индекс

Property changes on: tmp/org.txm.index.rcp/OSGI-INF/l10n/bundle_ru.properties
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/org.txm.index.rcp/OSGI-INF/l10n/bundle_fr.properties
===================================================================
--- tmp/org.txm.index.rcp/OSGI-INF/l10n/bundle_fr.properties	(revision 0)
+++ tmp/org.txm.index.rcp/OSGI-INF/l10n/bundle_fr.properties	(revision 264)
@@ -0,0 +1,6 @@
+
+command.name = Index
+
+command.tooltip = Calculer le lexique d'une requête
+
+editor.name = Index

Property changes on: tmp/org.txm.index.rcp/OSGI-INF/l10n/bundle_fr.properties
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/org.txm.index.core/META-INF/MANIFEST.MF
===================================================================
--- tmp/org.txm.index.core/META-INF/MANIFEST.MF	(revision 263)
+++ tmp/org.txm.index.core/META-INF/MANIFEST.MF	(revision 264)
@@ -4,6 +4,7 @@
 Bundle-SymbolicName: org.txm.index.core
 Bundle-Version: 1.0.0.qualifier
 Require-Bundle: org.txm.statsengine.r.core;bundle-version="1.0.0",
+ org.txm.lexicon.core;bundle-version="1.0.0",
  org.eclipse.core.runtime,
  org.txm.core;bundle-version="0.7.0",
  org.txm.utils;bundle-version="1.0.0"
@@ -13,3 +14,4 @@
  org.txm.index.core.messages,
  org.txm.macro.r,
  org.txm.test
+Bundle-Vendor: Textometrie.org
Index: tmp/org.txm.index.core/src/org/txm/index/core/messages/messages.properties
===================================================================
--- tmp/org.txm.index.core/src/org/txm/index/core/messages/messages.properties	(revision 263)
+++ tmp/org.txm.index.core/src/org/txm/index/core/messages/messages.properties	(revision 264)
@@ -3,4 +3,8 @@
 
 DetailsFromPartition = Index:\n\	Partition {0}\n\	query {1}\n\	properties {2}\n\	Fmin {3}\n\	Fmax {4}
 
+Index_0 = ** Error while computing lexicon:\n 
+Index_1 = Console : 
+Index_7 = ** Failed to export Lexicon : 
+
 RESULT_TYPE = Index
Index: tmp/org.txm.index.core/src/org/txm/index/core/messages/IndexCoreMessages.java
===================================================================
--- tmp/org.txm.index.core/src/org/txm/index/core/messages/IndexCoreMessages.java	(revision 263)
+++ tmp/org.txm.index.core/src/org/txm/index/core/messages/IndexCoreMessages.java	(revision 264)
@@ -1,7 +1,7 @@
 package org.txm.index.core.messages;
 
 import org.eclipse.osgi.util.NLS;
-import org.txm.core.messages.TXMCoreMessages;
+import org.txm.utils.messages.Utf8NLS;
 
 public class IndexCoreMessages extends NLS {
 
@@ -13,11 +13,16 @@
 	
 	
 	public static String RESULT_TYPE;
+	public static String Index_1;
+	public static String Index_7;
 
+	//FIXME unused key
+	public static String Index_0;
+	//end of fixme
 	
 	static {
 		// initialize resource bundle
-		TXMCoreMessages.initializeMessages(BUNDLE_NAME, IndexCoreMessages.class);
+		Utf8NLS.initializeMessages(BUNDLE_NAME, IndexCoreMessages.class);
 	}
 
 	private IndexCoreMessages() {
Index: tmp/org.txm.index.core/src/org/txm/index/core/messages/messages_fr.properties
===================================================================
--- tmp/org.txm.index.core/src/org/txm/index/core/messages/messages_fr.properties	(revision 263)
+++ tmp/org.txm.index.core/src/org/txm/index/core/messages/messages_fr.properties	(revision 264)
@@ -1,4 +1,8 @@
+Index_0 = ** Erreur lors du calcul du lexique : \n
+Index_1 = console : 
+Index_7 = ** Echec de l'exportation du Lexique : 
 
+
 DetailsFromCorpus = Index:\n\	Corpus {0}\n\	Requête {1}\n\	propriétés {2}\n\	Fmin {3}\n\	Fmax {4}
 
 DetailsFromPartition = Index:\n\	Partition {0}\n\	Requête {1}\n\	propriétés {2}\n\	Fmin {3}\n\	Fmax {4}
Index: tmp/org.txm.index.core/src/org/txm/index/core/functions/Index.java
===================================================================
--- tmp/org.txm.index.core/src/org/txm/index/core/functions/Index.java	(revision 263)
+++ tmp/org.txm.index.core/src/org/txm/index/core/functions/Index.java	(revision 264)
@@ -43,14 +43,13 @@
 import org.apache.commons.lang.StringUtils;
 import org.eclipse.osgi.util.NLS;
 import org.txm.Toolbox;
-import org.txm.core.messages.TXMCoreMessages;
 import org.txm.functions.Function;
 import org.txm.index.core.messages.IndexCoreMessages;
+import org.txm.lexicon.core.corpusengine.cqp.Lexicon;
 import org.txm.searchengine.cqp.ICqiClient;
 import org.txm.searchengine.cqp.clientExceptions.CqiClientException;
 import org.txm.searchengine.cqp.corpus.Corpus;
 import org.txm.searchengine.cqp.corpus.CorpusManager;
-import org.txm.searchengine.cqp.corpus.Lexicon;
 import org.txm.searchengine.cqp.corpus.Part;
 import org.txm.searchengine.cqp.corpus.Partition;
 import org.txm.searchengine.cqp.corpus.Property;
@@ -60,7 +59,7 @@
 import org.txm.searchengine.cqp.corpus.query.Query;
 import org.txm.searchengine.cqp.serverException.CqiServerError;
 import org.txm.statsengine.r.core.RWorkspace;
-import org.txm.statsengine.r.core.RWorkspaceException;
+import org.txm.statsengine.r.core.exceptions.RWorkspaceException;
 import org.txm.utils.logger.Log;
 
 // TODO: Auto-generated Javadoc
@@ -218,7 +217,7 @@
 	
 	
 	/**
-	 * Inits the Index using a lexicon.
+	 * Initializes the index using a lexicon.
 	 *
 	 * @param corpus the corpus
 	 * @param property the property
@@ -231,6 +230,9 @@
 			this.props.add(property);
 
 			lexicon = corpus.getLexicon(property);
+
+			lexicon.addResult(this);
+			
 			this.nLines = lexicon.nbrOfToken();
 			String[] forms = lexicon.getForms();
 			int[] freqs = lexicon.getFreq();
@@ -620,7 +622,7 @@
 		try {
 			toTxt(outfile, 0, lines.size(), encoding, colseparator, txtseparator);
 		} catch (Exception e) {
-			System.err.println(TXMCoreMessages.Index_7 + Log.toString(e));
+			System.err.println(IndexCoreMessages.Index_7 + Log.toString(e));
 			return false;
 		}
 		return true;
@@ -728,7 +730,7 @@
 	 * @throws IOException Signals that an I/O exception has occurred.
 	 */
 	public void toConsole() throws CqiClientException, IOException {
-		System.out.println(TXMCoreMessages.Index_1 + (lines.size()));
+		System.out.println(IndexCoreMessages.Index_1 + (lines.size()));
 		toConsole(0, lines.size());
 	}
 
@@ -776,8 +778,14 @@
 			return ((Partition)this.parent).getCorpus();
 		}
 		catch(Exception e) {
+			try {
+				return (Corpus) this.parent;
+			}
+			catch(Exception e1) {
+				return (Corpus) this.lexicon.getCorpus();
+			}
 		}
-		return (Corpus) this.parent;
+		
 	}
 
 	/**
