Index: tmp/org.txm.rcp/src/main/java/org/txm/rcp/views/cmdparameters/ParametersComposite.java
===================================================================
--- tmp/org.txm.rcp/src/main/java/org/txm/rcp/views/cmdparameters/ParametersComposite.java	(revision 2956)
+++ tmp/org.txm.rcp/src/main/java/org/txm/rcp/views/cmdparameters/ParametersComposite.java	(revision 2957)
@@ -44,7 +44,7 @@
 	public ParametersComposite(Composite parent, int style) {
 		super(parent, style, "Parameters");
 		
-		tv = new TreeViewer(this);
+		tv = new TreeViewer(this, SWT.VIRTUAL);
 		tv.getTree().setLayoutData(GridDataFactory.fillDefaults().align(GridData.FILL, GridData.FILL).grab(true, true).create());
 		tv.getTree().setHeaderVisible(true);
 		tv.getTree().setLinesVisible(true);
Index: tmp/org.txm.rcp/src/main/java/org/txm/rcp/swt/widget/parameters/LabelField.java
===================================================================
--- tmp/org.txm.rcp/src/main/java/org/txm/rcp/swt/widget/parameters/LabelField.java	(revision 2956)
+++ tmp/org.txm.rcp/src/main/java/org/txm/rcp/swt/widget/parameters/LabelField.java	(revision 2957)
@@ -22,11 +22,11 @@
 		this.setLayoutData(new GridData(GridData.FILL, GridData.BEGINNING, true, false));
 		
 		l = new Label(this, SWT.NONE);
-		l.setAlignment(SWT.RIGHT);
+		l.setAlignment(SWT.LEFT);
 		l.setText(getWidgetLabel());
 		l.setToolTipText(getWidgetUsage());
-		GridData gd = new GridData(SWT.FILL, SWT.FILL, false, false);
-		gd.widthHint = 170;
+		GridData gd = new GridData(SWT.FILL, SWT.FILL, true, false);
+		gd.widthHint = 100;
 		l.setLayoutData(gd);
 	}
 
Index: tmp/org.txm.rcp/src/main/java/org/txm/rcp/swt/widget/parameters/ParametersDialog.java
===================================================================
--- tmp/org.txm.rcp/src/main/java/org/txm/rcp/swt/widget/parameters/ParametersDialog.java	(revision 2956)
+++ tmp/org.txm.rcp/src/main/java/org/txm/rcp/swt/widget/parameters/ParametersDialog.java	(revision 2957)
@@ -1,7 +1,6 @@
 package org.txm.rcp.swt.widget.parameters;
 
 import java.io.File;
-import java.io.FileNotFoundException;
 import java.io.FileReader;
 import java.io.FileWriter;
 import java.io.IOException;
@@ -18,60 +17,66 @@
 import org.eclipse.jface.dialogs.Dialog;
 import org.eclipse.jface.dialogs.IDialogConstants;
 import org.eclipse.swt.SWT;
+import org.eclipse.swt.custom.ScrolledComposite;
+import org.eclipse.swt.events.ControlAdapter;
+import org.eclipse.swt.events.ControlEvent;
 import org.eclipse.swt.events.SelectionAdapter;
 import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.graphics.Rectangle;
 import org.eclipse.swt.layout.GridData;
 import org.eclipse.swt.layout.GridLayout;
 import org.eclipse.swt.widgets.Button;
 import org.eclipse.swt.widgets.Composite;
 import org.eclipse.swt.widgets.Control;
 import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.FileDialog;
 import org.eclipse.swt.widgets.Label;
 import org.eclipse.swt.widgets.Shell;
 import org.kohsuke.args4j.CmdLineParser;
 import org.kohsuke.args4j.NamedOptionDef;
 import org.kohsuke.args4j.spi.OptionHandler;
 import org.txm.Toolbox;
-import org.txm.core.preferences.TBXPreferences;
 import org.txm.rcp.messages.TXMUIMessages;
+import org.txm.rcp.swt.GLComposite;
 import org.txm.searchengine.cqp.corpus.query.CQLQuery;
 import org.txm.utils.Timer;
 import org.txm.utils.logger.Log;
 
 @SuppressWarnings("rawtypes")
 public class ParametersDialog extends Dialog {
-	
+
+	public int MAX_PARAMETERS_PER_LINE = 10;
+
 	Object bean;
-	
+
 	String script;
-	
+
 	String title;
-	
+
 	List<NamedOptionDef> parameters;
-	
+
 	List<String> fieldNames = new ArrayList<>(); // store all the declared parameters names
-	
+
 	LinkedHashMap<String, ParameterField> widgets = new LinkedHashMap<>();
-	
+
 	protected boolean error = false;
-	
+
 	protected Map args; // store values given by another Macro, if contains all the needed values, no dialog is shown
-	
+
 	protected int numberOfParameters; // number of parameters to show in the dialog box (not set by 'args'), if 0 parameters no dialog is shown
-	
+
 	protected boolean mustShowDialog; // show dialog if args.size == 0 OR if there is at least one mandatory field to set
-	
+
 	HashMap<String, Object> values = new HashMap<>(); // store the values of the parameters (may not contains all the values needed
-	
+
 	Properties defaultValues; // default values set by the .properties file
-	
+
 	Properties defaultScriptValues = new Properties(); // default values set by the Groovy script @Field@def annotation attribute
-	
+
 	File propFile;
 	// private int titleWidth;
 	// private Composite parent;
-	
+
 	/**
 	 * 
 	 * @param parentShell
@@ -81,13 +86,14 @@
 	 */
 	public ParametersDialog(Shell parentShell, Object bean, List<OptionHandler> allParameters, Map args) {
 		super(parentShell);
-		if (bean != null)
+		if (bean != null) {
 			this.script = bean.getClass().getName();
+		}
 		this.parameters = new ArrayList<>();
 		this.bean = bean;
 		this.args = args;
 		setShellStyle(getShellStyle() | SWT.RESIZE);
-		
+
 		// count the number of fields to show. If "0" then don't show the dialog, see the "open()" function
 		// and select only the NamedOptionDef annotations
 		numberOfParameters = 0; // number of parameters not set by args
@@ -100,27 +106,25 @@
 				if (args.containsKey(option.name())) {
 					continue; // don't show the field
 				}
-				
+
 				// count number of mandatory fields set AND add exception for "Separator" widget types
 				if (option.required() || "Separator".equals(option.widget())) numberOfMandatoryFields++;
 				numberOfParameters++;
 			}
 		}
-		
+
 		mustShowDialog = numberOfMandatoryFields > 0 || (args.size() == 0 && numberOfParameters > 0);
-		
+
 		// initialize the properties file default values store
 		defaultValues = new Properties();
 		String scriptRootDir = Toolbox.getTxmHomePath() + "/scripts/groovy/user"; //$NON-NLS-1$
-		
+
 		propFile = new File(scriptRootDir, this.script.replace(".", "/") + ".properties");
-		
+
 		loadDefaultValuesFromPropFile();
-		
-		
 	}
-	
-	
+
+
 	private void loadDefaultValuesFromPropFile() {
 		if (propFile.exists()) {
 			try {
@@ -132,7 +136,7 @@
 				Log.printStackTrace(e);
 			}
 		}
-		
+
 		// initialize the script default values
 		for (NamedOptionDef option : this.parameters) {
 			String widgetName = option.widget();
@@ -197,8 +201,7 @@
 			}
 		}
 	}
-	
-	
+
 	/*
 	 * (non-Javadoc)
 	 * @see org.eclipse.jface.window.Window#configureShell(org.eclipse.swt.widgets.Shell)
@@ -210,9 +213,43 @@
 		if (idx2 < 0) idx2 = script.length();
 		title = TXMUIMessages.bind(TXMUIMessages.p0ParametersInput, script.substring(script.lastIndexOf(".") + 1, idx2));
 		newShell.setText(title);
+		newShell.setMinimumSize(250, 450);
+
+//		newShell.addControlListener(new ControlAdapter() {
+//			public void controlResized(ControlEvent e) {
+//				Rectangle area = newShell.getClientArea();
+//				Point preferredSize = table.computeSize(SWT.DEFAULT, SWT.DEFAULT);
+//				int width = area.width - 2*table.getBorderWidth();
+//				if (preferredSize.y > area.height + table.getHeaderHeight()) {
+//					// Subtract the scrollbar width from the total column width
+//					// if a vertical scrollbar will be required
+//					Point vBarSize = table.getVerticalBar().getSize();
+//					width -= vBarSize.x;
+//				}
+//				Point oldSize = table.getSize();
+//				if (oldSize.x > area.width) {
+//					// table is getting smaller so make the columns // smaller first and then resize the table to
+//					// match the client area width
+//					column1.setWidth(width/3);
+//					column2.setWidth(width - column1.getWidth());
+//					table.setSize(area.width, area.height);
+//				} else {
+//					// table is getting bigger so make the table // bigger first and then make the columns wider
+//					// to match the client area width
+//					table.setSize(area.width, area.height);
+//					column1.setWidth(width/3);
+//					column2.setWidth(width - column1.getWidth());
+//				}
+//			}
+//		});
 	}
 	
 	@Override
+	protected boolean isResizable() {
+	    return true;
+	}
+
+	@Override
 	protected void createButtonsForButtonBar(Composite parent) {
 		// create the reset button (hack of the Back button)
 		// Button propButton = createButton(parent, IDialogConstants.BACK_ID,
@@ -233,13 +270,12 @@
 		// }
 		// }
 		// });
-		
-		Button button = createButton(parent, IDialogConstants.BACK_ID,
-				"Reset values", false);
+
+		Button button = createButton(parent, IDialogConstants.BACK_ID, "Reset values", false);
 		button.removeListener(SWT.Selection, button.getListeners(SWT.Selection)[0]);
-		
+
 		button.addSelectionListener(new SelectionAdapter() {
-			
+
 			@Override
 			public void widgetSelected(SelectionEvent e) {
 				// System.out.println("Reseting fields to default values");
@@ -249,24 +285,24 @@
 			}
 		});
 		if (numberOfParameters == 0) button.setEnabled(false);
-		
+
 		super.createButtonsForButtonBar(parent);
 		this.getButton(IDialogConstants.OK_ID).setText(TXMUIMessages.run);
 	}
-	
+
 	@Override
 	protected Control createButtonBar(Composite parent) {
 		Control c = super.createButtonBar(parent);
-		
+
 		// int barWidth = c.getSize().x;
 		// if (barWidth > titleWidth) {
 		// GridData cdata = (GridData)(this.parent.getLayoutData());
 		// cdata.widthHint = barWidth;
 		// }
-		
+
 		return c;
 	}
-	
+
 	/*
 	 * (non-Javadoc)
 	 * @see org.eclipse.jface.dialogs.Dialog#createDialogArea(org.eclipse.swt.widgets.Composite)
@@ -275,100 +311,118 @@
 	protected Control createDialogArea(Composite composite) {
 		// this.parent = composite;
 		super.createDialogArea(composite);
-		
-		composite.setLayoutData(new GridData(SWT.FILL, SWT.BEGINNING, true, true));
-		
+
+		composite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
 		GridLayout layout = new GridLayout(1, true);
 		composite.setLayout(layout);
+
+//		ScrolledComposite scrolledComposite = new ScrolledComposite(composite, SWT.BORDER| SWT.H_SCROLL | SWT.V_SCROLL);
+//		scrolledComposite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
+//		scrolledComposite.setLayout(new GridLayout(1, true));
+
+		GLComposite columns = new GLComposite(composite, SWT.NONE, "columns");
+		columns.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
+		columns.getLayout().numColumns = 1;
+
+//		scrolledComposite.setContent(columns);
+//		scrolledComposite.addListener( SWT.Resize, event -> {
+//			  int width = scrolledComposite.getClientArea().width;
+//			  scrolledComposite.setMinSize( composite.computeSize( width, SWT.DEFAULT ) );
+//			} );
+
+
+		if (numberOfParameters > MAX_PARAMETERS_PER_LINE) {
+			columns.getLayout().numColumns = 1 + (numberOfParameters / MAX_PARAMETERS_PER_LINE);
+		}
+
+		GLComposite column = new GLComposite(columns, SWT.NONE, "column");
+		GridData gdata = new GridData(SWT.FILL, SWT.FILL, true, true);
+		gdata.minimumWidth = 200;
+		column.setLayoutData(gdata);
+		column.getLayout().makeColumnsEqualWidth = false;
 		
-		// TODO: this width initialization does not works : it does not depends on the buttonBar width
-		// GridData cdata = (GridData)(composite.getLayoutData());
-		// titleWidth = FitFontSize.calculate(composite, title) + 100;
-		// cdata.widthHint = titleWidth;
-		
 		// initialize each widget + default value *of the widget*
+		int n = 0;
 		for (NamedOptionDef option : parameters) {
-			// if (arg.option instanceof NamedOptionDef) {
-			
-			// NamedOptionDef option = (NamedOptionDef)arg.option;
-			
-			// if the 'args' contains a value filled by another Macro, don't show the widget
-			if (args.containsKey(option.name())) {
-				// System.out.println("Args contains '"+option.name()+"' with value '"+args.get(option.name())+"'");
-				continue; // don't show the field
+			n++;
+			if (n % MAX_PARAMETERS_PER_LINE == 0) {
+				column = new GLComposite(columns, SWT.NONE, "column");
+				gdata = new GridData(SWT.FILL, SWT.FILL, true, true);
+				gdata.minimumWidth = 200;
+				column.setLayoutData(gdata);
+				column.getLayout().makeColumnsEqualWidth = false;
 			}
-			
+
 			// each widget is initialized with de default value set in @Field@def attribute
 			String widgetName = option.widget();
 			ParameterField widget = null;
 			if ("File".equals(widgetName) || "FileOpen".equals(widgetName)) { //$NON-NLS-1$
-				widget = new FileField(composite, SWT.NONE, option);
+				widget = new FileField(column, SWT.NONE, option);
 			}
 			else if ("CreateFile".equals(widgetName) || "FileSave".equals(widgetName)) { //$NON-NLS-1$
-				widget = new CreateFileField(composite, SWT.NONE, option);
+				widget = new CreateFileField(column, SWT.NONE, option);
 			}
 			else if ("Folder".equals(widgetName)) { //$NON-NLS-1$
-				widget = new FolderField(composite, SWT.NONE, option);
+				widget = new FolderField(column, SWT.NONE, option);
 			}
 			else if ("Query".equals(widgetName)) { //$NON-NLS-1$
-				widget = new QueryField(composite, SWT.NONE, option);
+				widget = new QueryField(column, SWT.NONE, option);
 			}
 			else if ("Date".equals(widgetName)) { //$NON-NLS-1$
-				widget = new DateField(composite, SWT.NONE, option);
+				widget = new DateField(column, SWT.NONE, option);
 			}
 			else if ("Time".equals(widgetName)) { //$NON-NLS-1$
-				widget = new TimeField(composite, SWT.NONE, option);
+				widget = new TimeField(column, SWT.NONE, option);
 			}
 			else if ("Separator".equals(widgetName)) { //$NON-NLS-1$
-				widget = new SeparatorField(composite, SWT.NONE, option);
+				widget = new SeparatorField(column, SWT.NONE, option);
 			}
 			else if ("String".equals(widgetName)) { //$NON-NLS-1$
-				widget = new StringField(composite, SWT.NONE, option);
+				widget = new StringField(column, SWT.NONE, option);
 			}
 			else if ("Password".equals(widgetName)) { //$NON-NLS-1$
-				widget = new PasswordField(composite, SWT.NONE, option);
+				widget = new PasswordField(column, SWT.NONE, option);
 			}
 			else if ("StringArray".equals(widgetName)) { //$NON-NLS-1$
-				widget = new StringArrayField(composite, SWT.NONE, option);
+				widget = new StringArrayField(column, SWT.NONE, option);
 			}
 			else if ("StringArrayMultiple".equals(widgetName)) { //$NON-NLS-1$
-				widget = new StringArrayMultipleField(composite, SWT.NONE, option);
+				widget = new StringArrayMultipleField(column, SWT.NONE, option);
 			}
 			else if ("StructuralUnits".equals(widgetName)) { //$NON-NLS-1$
-				widget = new CospusStructuresField(composite, SWT.NONE, option);
+				widget = new CospusStructuresField(column, SWT.NONE, option);
 			}
 			else if ("Text".equals(widgetName)) { //$NON-NLS-1$
-				widget = new LongStringField(composite, SWT.NONE, option);
+				widget = new LongStringField(column, SWT.NONE, option);
 			}
 			else if ("Integer".equals(widgetName)) { //$NON-NLS-1$
-				widget = new IntegerField(composite, SWT.NONE, option);
+				widget = new IntegerField(column, SWT.NONE, option);
 			}
 			else if ("Float".equals(widgetName)) { //$NON-NLS-1$
-				widget = new FloatField(composite, SWT.NONE, option);
+				widget = new FloatField(column, SWT.NONE, option);
 			}
 			else if ("Boolean".equals(widgetName)) { //$NON-NLS-1$
-				widget = new BooleanField(composite, SWT.NONE, option);
+				widget = new BooleanField(column, SWT.NONE, option);
 			}
 			else {
 				System.out.println(TXMUIMessages.unknowedWidgetNameColon + widgetName + TXMUIMessages.FileTreeContentProvider_4);
 			}
-			
+
 			if (widget != null) {
 				widgets.put(option.name(), widget);
-				
+
 				// set default value in the fields, not enough if args contains the value
 				String value = defaultValues.getProperty(option.name());
 				if (value != null) { // set the default value using the properties stored
 					widget.setDefault(value);
 				}
 			}
-			// }
 		}
 		new Label(composite, SWT.NONE).setText(TXMUIMessages.mandatoryFields);
-		
+
 		return composite;
 	}
-	
+
 	/*
 	 * (non-Javadoc)
 	 * @see org.eclipse.jface.dialogs.Dialog#okPressed()
@@ -376,12 +430,12 @@
 	@Override
 	protected void okPressed() {
 		error = false;
-		
+
 		// get widget values
 		for (String field : widgets.keySet()) {
 			ParameterField w = widgets.get(field);
 			Object value = w.getWidgetValue();
-			
+
 			// is widget set if mandatory EXCEPT "Separator" widgets
 			if (w.isWidgetMandatory() && value == null && !("Separator".equals(w.getWidgetType()))) {
 				System.out.println(TXMUIMessages.errorColonMissingValueColon + field);
@@ -392,18 +446,18 @@
 				// System.out.println(""+field+"\t"+values.get(field));
 			} // else value is not filled
 		}
-		
+
 		// initialize variables
 		if (!error) {
 			initializeMacroVariables();
 			saveParameters();
-			
+
 			if (!error) {
 				super.okPressed();
 			}
 		}
 	}
-	
+
 	private void saveParameters() {
 		if (!error) {
 			try {
@@ -416,15 +470,15 @@
 			}
 		}
 	}
-	
-	
+
+
 	/**
 	 * can use the args map to initialize variable not set with the dialog box
 	 */
 	private void initializeMacroVariables() {
 		// System.out.println("Initialize macro variables of "+fieldNames);
 		if (bean == null) return;
-		
+
 		Class c = bean.getClass();
 		for (String name : fieldNames) {
 			Object value = values.get(name);
@@ -443,7 +497,7 @@
 					defaultValues.setProperty(name, value.toString());
 				}
 			}
-			
+
 			try {
 				// System.out.println("setting "+name+ " with "+values.get(name));
 				Field field = c.getDeclaredField(name);
@@ -455,21 +509,21 @@
 				Log.printStackTrace(e);
 				error = true;
 			}
-			
+
 		}
 	}
-	
-	
+
+
 	protected boolean isError() {
 		return error;
 	}
-	
+
 	public HashMap<String, Object> getValues() {
 		return values;
 	}
-	
+
 	static boolean errorOpen, retOpen;
-	
+
 	/**
 	 * Conveniance method to initialize the parameters dialog.
 	 * Can detect the "args" Groovy binding and use it to set variables
@@ -481,22 +535,22 @@
 	public static boolean open(final Object bean) {
 		errorOpen = true;
 		retOpen = false;
-		
+
 		// if (!(bean instanceof groovy.lang.Script)) {
 		// System.out.println(Messages.ParametersDialog_15);
 		// return false;
 		// }
-		
+
 		Object oArgs = null;
 		if (bean instanceof groovy.lang.Script) {
 			groovy.lang.Script script = (groovy.lang.Script) bean;
-			
+
 			// if the "args" variable exists then use its values. Can be used to set a default value by another Macro
 			if (script.getBinding().hasVariable("args")) {
 				oArgs = script.getBinding().getVariable("args"); //$NON-NLS-1$
 			}
 		}
-		
+
 		final Map args;
 		if (oArgs == null || !(oArgs instanceof Map)) {
 			args = new HashMap<String, Object>();
@@ -504,24 +558,24 @@
 		else {
 			args = (Map) oArgs;
 		}
-		
+
 		if (bean instanceof groovy.lang.Script) { // create the args binding if not already existing
 			groovy.lang.Script script = (groovy.lang.Script) bean;
 			if (!script.getBinding().hasVariable("args")) {
 				script.getBinding().setVariable("args", args);
 			}
 		}
-		
+
 		Display.getDefault().syncExec(new Runnable() {
-			
+
 			@Override
 			public void run() {
 				boolean okNames = true;
 				CmdLineParser parser = new CmdLineParser(bean);
-				
+
 				Display display = Display.getCurrent();
 				Shell shell = display.getActiveShell();
-				
+
 				// check names
 				Class c = bean.getClass();
 				for (OptionHandler opt : parser.getOptions()) {
@@ -550,7 +604,7 @@
 						retOpen = true;
 						errorOpen = false;
 					}
-					
+
 					if (bean instanceof groovy.lang.Script) { // reset the timer binding if already existing
 						groovy.lang.Script script = (groovy.lang.Script) bean;
 						if (script.getBinding().hasVariable("timer")) {
@@ -563,15 +617,15 @@
 		});
 		return retOpen && !errorOpen;
 	}
-	
+
 	public boolean getMustShowDialog() {
 		return mustShowDialog;
 	}
-	
+
 	protected int getNumberOfFields() {
 		return numberOfParameters;
 	}
-	
+
 	// TODO: uncomment this to enable "args" detection
 	// public int open() {
 	// System.out.println("Number of parameters: "+numberOfParameters);
Index: tmp/org.txm.rcp/src/main/java/org/txm/rcp/swt/widget/parameters/LongStringField.java
===================================================================
--- tmp/org.txm.rcp/src/main/java/org/txm/rcp/swt/widget/parameters/LongStringField.java	(revision 2956)
+++ tmp/org.txm.rcp/src/main/java/org/txm/rcp/swt/widget/parameters/LongStringField.java	(revision 2957)
@@ -16,7 +16,7 @@
 		this.setLayoutData(new GridData(SWT.FILL, SWT.FILL,true, true));
 		
 		Label l = new Label(this, SWT.NONE);
-		l.setAlignment(SWT.RIGHT);
+		l.setAlignment(SWT.LEFT);
 		l.setText(getWidgetLabel());
 		l.setToolTipText(getWidgetUsage());
 		GridData gd = new GridData(SWT.FILL, SWT.CENTER, true, false);
Index: tmp/org.txm.rcp/src/main/java/org/txm/rcp/swt/widget/parameters/QueryField.java
===================================================================
--- tmp/org.txm.rcp/src/main/java/org/txm/rcp/swt/widget/parameters/QueryField.java	(revision 2956)
+++ tmp/org.txm.rcp/src/main/java/org/txm/rcp/swt/widget/parameters/QueryField.java	(revision 2957)
@@ -8,7 +8,6 @@
 import org.kohsuke.args4j.NamedOptionDef;
 import org.txm.rcp.swt.widget.QueryWidget;
 import org.txm.searchengine.core.IQuery;
-import org.txm.searchengine.cqp.corpus.query.CQLQuery;
 
 public class QueryField extends ParameterField {
 	QueryWidget w;
@@ -19,7 +18,7 @@
 		this.setLayoutData(new GridData(GridData.FILL, GridData.BEGINNING, true, false));
 
 		Label l = new Label(this, SWT.NONE);
-		l.setAlignment(SWT.RIGHT);
+		l.setAlignment(SWT.LEFT);
 		l.setText(getWidgetLabel());
 		l.setToolTipText(getWidgetUsage());
 		GridData gd = new GridData(SWT.FILL, SWT.CENTER, true, false);
Index: tmp/org.txm.rcp/plugin.xml
===================================================================
--- tmp/org.txm.rcp/plugin.xml	(revision 2956)
+++ tmp/org.txm.rcp/plugin.xml	(revision 2957)
@@ -183,7 +183,7 @@
             class="org.txm.rcp.views.cmdparameters.TXMResultPreferencesView"
             icon="icons/functions/Properties.png"
             id="org.txm.rcp.views.cmdparameters.TXMResultPreferencesView"
-            name="Selection preferences"
+            name="Parameters"
             restorable="true">
       </view>
    </extension>
Index: tmp/org.txm.utils/src/org/txm/utils/io/IOUtils.java
===================================================================
--- tmp/org.txm.utils/src/org/txm/utils/io/IOUtils.java	(revision 2956)
+++ tmp/org.txm.utils/src/org/txm/utils/io/IOUtils.java	(revision 2957)
@@ -24,6 +24,7 @@
 
 import org.eclipse.osgi.util.NLS;
 import org.txm.utils.i18n.DetectBOM;
+import org.txm.utils.logger.Log;
 
 public class IOUtils {
 
@@ -217,11 +218,20 @@
 		return getWriter(new File(file), UTF8);
 	}
 
-	public static void write(File file, String str) throws UnsupportedEncodingException, FileNotFoundException {
-		PrintWriter writer = getWriter(file);
-		writer.write(str);
-		writer.close();
-
+	public static boolean write(File file, String str) {
+		PrintWriter writer = null;
+		try {
+			writer = getWriter(file);
+			writer.write(str);
+		} catch(Exception e) {
+			Log.warning(NLS.bind("Error while writing the {0} file: {1}", file, e));
+			return false;
+		} finally {
+			if (writer != null) {
+				writer.close();
+			}
+		}
+		return true;
 	}
 
 	public static ArrayList<String> getLines(File file, String encoding) {
Index: tmp/org.txm.searchengine.cqp.core/src/org/txm/searchengine/cqp/corpus/CQPLexicon.java
===================================================================
--- tmp/org.txm.searchengine.cqp.core/src/org/txm/searchengine/cqp/corpus/CQPLexicon.java	(revision 2956)
+++ tmp/org.txm.searchengine.cqp.core/src/org/txm/searchengine/cqp/corpus/CQPLexicon.java	(revision 2957)
@@ -668,11 +668,13 @@
 	public static CQPLexicon getLexicon(CQPCorpus corpus, WordProperty property, TXMProgressMonitor monitor, boolean visible) throws Exception {
 		CQPLexicon lexicon = null;
 
-		// recycling parent Lexicon if exists
-		ArrayList<CQPLexicon> partLexicons = (ArrayList<CQPLexicon>) corpus.getObjectCacheForClass(CQPLexicon.class);
-		for (int i = 0; i < partLexicons.size(); i++) {
-			if (partLexicons.get(i).getProperty() == property) {
-				lexicon = partLexicons.get(i);
+		property = corpus.getProperty(property.getName()); // ensure to use the subcorpus property
+		
+		// recycling Lexicon if exists
+		ArrayList<CQPLexicon> cachedLexicons = (ArrayList<CQPLexicon>) corpus.getObjectCacheForClass(CQPLexicon.class);
+		for (int i = 0; i < cachedLexicons.size(); i++) {
+			if (cachedLexicons.get(i).getProperty() == property) {
+				lexicon = cachedLexicons.get(i);
 				break;
 			}
 		}
@@ -684,7 +686,8 @@
 			lexicon._compute();
 			
 			// and store it !
-			partLexicons.add(lexicon);
+			ArrayList<CQPLexicon> cache = corpus.getObjectCacheForClass(CQPLexicon.class);
+			cache.add(lexicon);
 		}
 
 		Log.finest(TXMCoreMessages.bind("Lexicon = {0} {1}.", lexicon, lexicon.hashCode()));
Index: tmp/org.txm.searchengine.cqp.core/src/org/txm/searchengine/cqp/corpus/CQPCorpus.java
===================================================================
--- tmp/org.txm.searchengine.cqp.core/src/org/txm/searchengine/cqp/corpus/CQPCorpus.java	(revision 2956)
+++ tmp/org.txm.searchengine.cqp.core/src/org/txm/searchengine/cqp/corpus/CQPCorpus.java	(revision 2957)
@@ -107,7 +107,7 @@
 	 * @param toCache
 	 * @return
 	 */
-	public static Object cache(Object toCache) {
+	public Object cache(Object toCache) {
 		if (toCache == null) {
 			return null;
 		}
@@ -159,7 +159,7 @@
 	 * @param c
 	 * @return
 	 */
-	public static HashMap<Class<?>, ArrayList<?>> getObjectCache() {
+	public HashMap<Class<?>, ArrayList<?>> getObjectCache() {
 		return cache;
 	}
 	
@@ -170,12 +170,13 @@
 	 * @param c
 	 * @return
 	 */
-	public static ArrayList<?> getObjectCacheForClass(Class<?> c) {
+	@SuppressWarnings("unchecked")
+	public <T extends Object> ArrayList<T> getObjectCacheForClass(Class<T> c) {
 		HashMap<Class<?>, ArrayList<?>> oCache = getObjectCache();
 		if (!oCache.containsKey(c)) {
-			oCache.put(c, new ArrayList<>());
+			oCache.put(c, new ArrayList<T>());
 		}
-		return oCache.get(c);
+		return (ArrayList<T>) oCache.get(c);
 	}
 	
 	/**
@@ -209,7 +210,7 @@
 	 * @param toCache
 	 * @return
 	 */
-	public static boolean uncache(Object toUnCache) {
+	public boolean uncache(Object toUnCache) {
 		if (toUnCache == null) {
 			return false;
 		}
Index: tmp/org.txm.searchengine.cqp.core/src/org/txm/searchengine/cqp/corpus/WordProperty.java
===================================================================
--- tmp/org.txm.searchengine.cqp.core/src/org/txm/searchengine/cqp/corpus/WordProperty.java	(revision 2956)
+++ tmp/org.txm.searchengine.cqp.core/src/org/txm/searchengine/cqp/corpus/WordProperty.java	(revision 2957)
@@ -49,6 +49,14 @@
 		return "@" + str;
 	}
 	
+	/**
+	 * 
+	 * @param positions
+	 * @return the values for the property's corpus positions
+	 * @throws UnexpectedAnswerException
+	 * @throws IOException
+	 * @throws CqiServerError
+	 */
 	public int[] cpos2Id(int[] positions) throws UnexpectedAnswerException, IOException, CqiServerError {
 		return CorpusManager.getCorpusManager().getCqiClient().cpos2Id(this.getQualifiedName(), positions);
 	}
Index: tmp/org.txm.lexicaltable.core/src/org/txm/lexicaltable/core/functions/LexicalTable.java
===================================================================
--- tmp/org.txm.lexicaltable.core/src/org/txm/lexicaltable/core/functions/LexicalTable.java	(revision 2956)
+++ tmp/org.txm.lexicaltable.core/src/org/txm/lexicaltable/core/functions/LexicalTable.java	(revision 2957)
@@ -194,7 +194,7 @@
 		// parts lexicons
 		List<CQPLexicon> partsLexicons = new ArrayList<>();
 		for (int i = 0; i < partition.getPartsCount(); i++) {
-			partsLexicons.add(CQPLexicon.getLexicon(partition.getParts().get(i), this.property, monitor.createNewMonitor(1), false));
+			partsLexicons.add(CQPLexicon.getLexicon(partition.getParts().get(i), partition.getParts().get(i).getProperty(property.getName()), monitor.createNewMonitor(1), false));
 		}
 		
 		// Corpus global lexicon
