Index: tmp/org.txm.textsbalance.rcp/src/org/txm/textsbalance/rcp/handlers/ComputeBalance.java
===================================================================
--- tmp/org.txm.textsbalance.rcp/src/org/txm/textsbalance/rcp/handlers/ComputeBalance.java	(revision 536)
+++ tmp/org.txm.textsbalance.rcp/src/org/txm/textsbalance/rcp/handlers/ComputeBalance.java	(revision 537)
@@ -58,28 +58,21 @@
 	@Override
 	public Object execute(ExecutionEvent event) throws ExecutionException {
 
-		
 		Object selection = this.getSelection();
-
+		TextsBalance textsBalance = null;
 		
-		ChartEditorInput editorInput = null;
-		
 		// creates new result
 		if(selection instanceof Corpus) {
-			editorInput = new ChartEditorInput(new TextsBalance((Corpus) selection));
+			textsBalance = new TextsBalance((Corpus) selection);
 		}
 		// reopens existing result
 		else if(selection instanceof TextsBalance) {
-			editorInput = new ChartEditorInput((TextsBalance) selection);
+			textsBalance = (TextsBalance) selection;
 		}
 		
-		ChartEditorPart editor = SWTChartsComponentsProvider.getCurrent().openEditor(editorInput);
+		// Create and open the chart editor
+		ChartEditorPart.compute(textsBalance);
 
-		// new result
-		if(!(selection instanceof TextsBalance))	{
-			editor.computeResult();
-		}
-		
 
 		// FIXME: test d'utilisation de la même commande pour la création d'un nouvel éditeur et pour la mise à jour d'un graphique, avec une commande paramétrée (voir plugin.xml)
 //		if(event.getParameter("TextsBalance.createNewEditor") == null)	{
Index: tmp/org.txm.textsbalance.rcp/src/org/txm/textsbalance/rcp/editors/BalanceEditor.java
===================================================================
--- tmp/org.txm.textsbalance.rcp/src/org/txm/textsbalance/rcp/editors/BalanceEditor.java	(revision 536)
+++ tmp/org.txm.textsbalance.rcp/src/org/txm/textsbalance/rcp/editors/BalanceEditor.java	(revision 537)
@@ -1,336 +0,0 @@
-package org.txm.textsbalance.rcp.editors;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.core.runtime.jobs.Job;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.layout.RowLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Combo;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Group;
-import org.txm.chartsengine.rcp.editors.ChartEditorPart;
-import org.txm.core.preferences.TXMPreferences;
-import org.txm.rcp.views.corpora.CorporaView;
-import org.txm.searchengine.cqp.clientExceptions.CqiClientException;
-import org.txm.searchengine.cqp.corpus.StructuralUnit;
-import org.txm.searchengine.cqp.corpus.StructuralUnitProperty;
-import org.txm.searchengine.cqp.corpus.query.Match;
-import org.txm.textsbalance.core.functions.TextsBalance;
-import org.txm.textsbalance.core.preferences.TextsBalancePreferences;
-import org.txm.utils.logger.Log;
-
-/**
- * Texts balance editor.
- * 
- * @author mdecorde
- * @author sjacquot
- *
- */
-public class BalanceEditor extends ChartEditorPart {
-
-	private Combo supCombo;
-
-	private Button groupByTexts;
-
-	private Button groupByWords;
-
-	private Combo suCombo;
-
-	/**
-	 * Structural unit properties to not display.
-	 */
-	protected String[] supsToSkip;
-	
-	
-	/**
-	 * 
-	 */
-	public BalanceEditor() {
-		this.supsToSkip = new String[] {"id", "base", "project"}; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
-	}
-
-	
-	@Override
-	public void createPartControl(Composite parent) {
-		super.createPartControl(parent);
-		
-		if (((TextsBalance)this.getResultData()).getCorpus() == null) {
-			System.out.println("Error: no corpus");
-			return;
-		}
-
-		
-		// for group tests
-		Composite p = this.getCommandParametersGroup();
-		// for tab folder tests
-		//Composite p = this.getCommandParametersComposite();
-
-		
-		
-		Group group = new Group(p, SWT.NONE);
-		
-		group.setText("Group by:");
-		//group.setLayout(new RowLayout(SWT.VERTICAL));
-		group.setLayout(new RowLayout());
-		
-//		GridData gridData = new GridData(SWT.FILL, SWT.FILL, true, false);
-//		gridData.horizontalSpan = 2;
-//		gridData.verticalIndent = 10;
-//		group.setLayoutData(gridData);
-
-		
-		groupByTexts = new Button(group, SWT.RADIO);
-		groupByTexts.setText("text");
-		groupByTexts.setSelection(!this.getBooleanParameterValue(TextsBalancePreferences.GROUP_BY_WORDS));	
-		
-		
-		groupByWords = new Button(group, SWT.RADIO);
-		groupByWords.setText("word");
-		groupByWords.setSelection(!groupByTexts.getSelection());
-
-		
-		suCombo = new Combo(p, SWT.READ_ONLY);
-		supCombo = new Combo(p, SWT.READ_ONLY);
-
-		try {
-			loadSU();
-		}
-		catch (Exception e) {
-			e.printStackTrace();
-		}
-
-
-		suCombo.addSelectionListener(new SelectionListener() {
-			
-			@Override
-			public void widgetSelected(SelectionEvent e) {
-				// persistence
-				TXMPreferences.putLocalString(getResultData(), TextsBalancePreferences.STRUCTURAL_UNIT, suCombo.getText());
-				TXMPreferences.putLocalInt(getResultData(), TextsBalancePreferences.STRUCTURAL_UNIT_PROPERTY_INDEX, 0);
-				
-				try {
-					loadSUP(((TextsBalance)getResultData()).getCorpus().getStructuralUnit(suCombo.getText()));
-					compute();
-				}
-				catch(Exception e1) {
-					// TODO Auto-generated catch block
-					e1.printStackTrace();
-				}
-
-			}
-			
-			@Override
-			public void widgetDefaultSelected(SelectionEvent e) {
-				// TODO Auto-generated method stub
-				
-			}
-		});
-		
-
-		
-		SelectionListener listener = new SelectionListener() {
-			@Override
-			public void widgetSelected(SelectionEvent e) {
-				
-			
-				// persistence
-				TXMPreferences.putLocalInt(getResultData(), TextsBalancePreferences.STRUCTURAL_UNIT_PROPERTY_INDEX, supCombo.getSelectionIndex());
-				TXMPreferences.putLocalBoolean(getResultData(), TextsBalancePreferences.GROUP_BY_WORDS, !groupByTexts.getSelection());
-				compute();
-			}
-
-			@Override
-			public void widgetDefaultSelected(SelectionEvent e) {
-				
-			}
-		};
-		
-		supCombo.addSelectionListener(listener);
-		groupByTexts.addSelectionListener(listener);
-		groupByWords.addSelectionListener(listener);
-		
-		
-		this.compute();
-	}
-
-	
-	/**
-	 * Computes the balance using local or default parameters.
-	 */
-	public void compute()	{
-		try {
-			
-			String suName = this.getStringParameterValue(TextsBalancePreferences.STRUCTURAL_UNIT);
-
-			// gets the structural unit property name
-			String supName = null;
-			int i = 0;
-			for(StructuralUnitProperty p : ((TextsBalance) this.getResultData()).getCorpus().getStructuralUnit(suName).getOrderedProperties()) {
-				if(Arrays.asList(this.supsToSkip).contains(p.getName()))	{ 
-					continue;
-				}
-				if(i == this.getIntParameterValue(TextsBalancePreferences.STRUCTURAL_UNIT_PROPERTY_INDEX))	{
-					supName = p.getName();
-					break;
-				}
-				i++;
-			}
-			
-			this.compute(
-					this.getIntParameterValue(TextsBalancePreferences.METHOD),
-					((TextsBalance) this.getResultData()).getCorpus().getStructuralUnit(suName),
-					supName,
-					!this.getBooleanParameterValue(TextsBalancePreferences.GROUP_BY_WORDS)
-					);
-			
-			
-		}
-		catch(Exception e) {
-			// TODO Auto-generated catch block
-			e.printStackTrace();
-		}
-	}
-	
-	
-	/**
-	 * 
-	 * @param method 1: use CQL to solve matches, 2 uses corpus struct indexes, 2 is faster !
-	 * @throws CqiClientException
-	 */
-	public void compute(final int method, final StructuralUnit su, final String propertyName, final boolean groupByTexts) {
-
-		Job job = new Job("Compute Texts Balance") {
-		    @Override
-		    protected IStatus run(IProgressMonitor monitor) {
-
-		    	// creating
-				monitor.beginTask("Computing", IProgressMonitor.UNKNOWN);
-				
-				final TextsBalance textsBalance = (TextsBalance)getResultData();
-				try {
-					textsBalance.setParameters(method, su, propertyName, groupByTexts);
-					textsBalance.compute(false, monitor);
-				}
-				catch(Exception e) {
-					System.out.println("Error: "+e.getLocalizedMessage());
-					Log.printStackTrace(e);
-				}
-		
-				computeChart(true);
-				
-				// done
-				monitor.done(); 
-				return Status.OK_STATUS;
-	    }
-
-		};
-		//job.setUser(true); // show progress bar, without that the progress is located to bottom right
-		job.schedule();
-		
-		
-	}
-
-	
-	
-	/**
-	 * Fills the SU combo box from the corpus.
-	 * @throws CqiClientException
-	 */
-	private void loadSU() throws CqiClientException {
-
-		String selectedSuName = TextsBalancePreferences.getString(TextsBalancePreferences.PREFERENCES_NODE, (TextsBalance) this.getResultData(), TextsBalancePreferences.STRUCTURAL_UNIT);
-		int selectedIndex = 0;
-		int i = 0;
-		
-		for (StructuralUnit p : ((TextsBalance) this.getResultData()).getCorpus().getOrderedStructuralUnits()) {
-			if (p.getName().equals("txmcorpus"))	{ //$NON-NLS-1$
-				continue;
-			}
-			suCombo.add(p.getName());
-			if (selectedSuName.equals(p.getName()))	{
-				selectedIndex = i;
-			}
-			i++;
-		}
-		suCombo.select(selectedIndex);
-		loadSUP(((TextsBalance)this.getResultData()).getCorpus().getStructuralUnit(suCombo.getText()));
-	}
-
-	/**
-	 * Fills the SUP combo box from the specified structural unit.
-	 * @param su
-	 * @throws CqiClientException
-	 */
-	private void loadSUP(StructuralUnit su) throws CqiClientException {
-		supCombo.removeAll();
-		for (StructuralUnitProperty p : su.getOrderedProperties()) {
-			if (Arrays.asList(this.supsToSkip).contains(p.getName()))	{ 
-				continue;
-			}
-			supCombo.add(p.getName());
-		}
-		if (supCombo.getItemCount() > 0) {
-			supCombo.select(TextsBalancePreferences.getInt(TextsBalancePreferences.PREFERENCES_NODE, this.getResultData(), TextsBalancePreferences.STRUCTURAL_UNIT_PROPERTY_INDEX));
-		}
-	}
-	
-	/**
-	 * 
-	 * @param corpus
-	 * @param structs
-	 * @return
-	 */
-	public ArrayList<Integer> intersect(List<Match> corpus, List<Match> structs) {
-		int ai=0, bi=0;
-		ArrayList<Integer> result = new ArrayList<Integer>();
-
-		while (ai < corpus.size() && bi < structs.size() ) {
-			if (structs.get(bi).contains(corpus.get(ai))) { 
-				result.add(bi);
-				ai++; 
-			} else if (corpus.get(ai).contains(structs.get(bi))) { 
-				result.add(bi);
-				bi++; 
-			} else { 
-				if (structs.get(bi).getStart() < corpus.get(ai).getStart()) {
-					bi++;
-				} else {
-					ai++;	
-				}
-			} 
-		}
-
-		return result;
-	}
-
-	@Override
-	public void doSave(IProgressMonitor monitor) {
-		// Do the Save operation
-	}
-
-	@Override
-	public void doSaveAs() {
-		// Do the Save As operation
-	}
-
-
-	@Override
-	public boolean isDirty() {
-		return false;
-	}
-
-	@Override
-	public boolean isSaveAsAllowed() {
-		return false;
-	}
-
-
-}
Index: tmp/org.txm.textsbalance.rcp/src/org/txm/textsbalance/rcp/editors/___BalanceEditorInput.java
===================================================================
--- tmp/org.txm.textsbalance.rcp/src/org/txm/textsbalance/rcp/editors/___BalanceEditorInput.java	(revision 536)
+++ tmp/org.txm.textsbalance.rcp/src/org/txm/textsbalance/rcp/editors/___BalanceEditorInput.java	(revision 537)
@@ -1,124 +0,0 @@
-// Copyright © 2010-2013 ENS de Lyon.
-// Copyright © 2007-2010 ENS de Lyon, CNRS, INRP, University of
-// Lyon 2, University of Franche-Comté, University of Nice
-// Sophia Antipolis, University of Paris 3.
-// 
-// The TXM platform is free software: you can redistribute it
-// and/or modify it under the terms of the GNU General Public
-// License as published by the Free Software Foundation,
-// either version 2 of the License, or (at your option) any
-// later version.
-// 
-// The TXM platform is distributed in the hope that it will be
-// useful, but WITHOUT ANY WARRANTY; without even the implied
-// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
-// PURPOSE. See the GNU General Public License for more
-// details.
-// 
-// You should have received a copy of the GNU General
-// Public License along with the TXM platform. If not, see
-// http://www.gnu.org/licenses.
-// 
-// 
-// 
-// $LastChangedDate:$
-// $LastChangedRevision:$
-// $LastChangedBy:$ 
-//
-package org.txm.textsbalance.rcp.editors;
-
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.ui.IPersistableElement;
-import org.txm.chartsengine.rcp.editors.ChartEditorInput;
-import org.txm.searchengine.cqp.corpus.Corpus;
-import org.txm.textsbalance.core.functions.TextsBalance;
-/**
- * Editor input for TextBalance.
- *
- * @author mdecorde
- * @author sjacquot
- */
-@Deprecated
-public class ___BalanceEditorInput extends ChartEditorInput {
-	
-	/** The corpus. */
-	private Corpus corpus;
-	
-	/**
-	 * Instantiates a new index editor input.
-	 *
-	 * @param corpus the corpus
-	 */
-	public ___BalanceEditorInput(TextsBalance textBalance) {
-		super(textBalance);
-		this.corpus = textBalance.getCorpus();
-	}
-
-	/**
-	 * Exists.
-	 *
-	 * @return true, if successful
-	 * @see org.eclipse.ui.IEditorInput#exists()
-	 */
-	@Override
-	public boolean exists() {
-		return false;
-	}
-
-	/**
-	 * Gets the image descriptor.
-	 *
-	 * @return the image descriptor
-	 * @see org.eclipse.ui.IEditorInput#getImageDescriptor()
-	 */
-	@Override
-	public ImageDescriptor getImageDescriptor() {
-		return null;
-	}
-
-	/**
-	 * Gets the persistable.
-	 *
-	 * @return the persistable
-	 * @see org.eclipse.ui.IEditorInput#getPersistable()
-	 */
-	@Override
-	public IPersistableElement getPersistable() {
-		return null;
-	}
-
-	/**
-	 * Gets the tool tip text.
-	 *
-	 * @return the tool tip text
-	 * @see org.eclipse.ui.IEditorInput#getToolTipText()
-	 */
-	@Override
-	public String getToolTipText() {
-		return getName();
-	}
-	
-	/**
-	 * Gets the adapter.
-	 *
-	 * @param arg0 the arg0
-	 * @return the adapter
-	 * @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class)
-	 */
-	@Override
-	@SuppressWarnings("unchecked") //$NON-NLS-1$
-	public Object getAdapter(Class arg0) {
-		return null;
-	}
-
-	/**
-	 * Gets the corpus.
-	 *
-	 * @return the corpus
-	 */
-	public Corpus getCorpus() {
-		return corpus;
-	}
-
-
-}
Index: tmp/org.txm.textsbalance.rcp/src/org/txm/textsbalance/rcp/editors/TextsBalanceEditor.java
===================================================================
--- tmp/org.txm.textsbalance.rcp/src/org/txm/textsbalance/rcp/editors/TextsBalanceEditor.java	(revision 0)
+++ tmp/org.txm.textsbalance.rcp/src/org/txm/textsbalance/rcp/editors/TextsBalanceEditor.java	(revision 537)
@@ -0,0 +1,338 @@
+package org.txm.textsbalance.rcp.editors;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.layout.RowLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Combo;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Group;
+import org.txm.chartsengine.rcp.editors.ChartEditorPart;
+import org.txm.core.preferences.TXMPreferences;
+import org.txm.rcp.views.corpora.CorporaView;
+import org.txm.searchengine.cqp.clientExceptions.CqiClientException;
+import org.txm.searchengine.cqp.corpus.StructuralUnit;
+import org.txm.searchengine.cqp.corpus.StructuralUnitProperty;
+import org.txm.searchengine.cqp.corpus.query.Match;
+import org.txm.textsbalance.core.functions.TextsBalance;
+import org.txm.textsbalance.core.preferences.TextsBalancePreferences;
+import org.txm.utils.logger.Log;
+
+/**
+ * Texts balance editor.
+ * 
+ * @author mdecorde
+ * @author sjacquot
+ *
+ */
+public class TextsBalanceEditor extends ChartEditorPart {
+
+	private Combo supCombo;
+
+	private Button groupByTexts;
+
+	private Button groupByWords;
+
+	private Combo suCombo;
+
+	/**
+	 * Structural unit properties to not display.
+	 */
+	protected String[] supsToSkip;
+	
+	
+	/**
+	 * 
+	 */
+	public TextsBalanceEditor() {
+		this.supsToSkip = new String[] {"id", "base", "project"}; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+	}
+
+	
+	@Override
+	public void createPartControl(Composite parent) {
+		super.createPartControl(parent);
+		
+		if (((TextsBalance)this.getResultData()).getCorpus() == null) {
+			System.out.println("Error: no corpus");
+			return;
+		}
+
+		
+		// for group tests
+		Composite p = this.getCommandParametersGroup();
+		// for tab folder tests
+		//Composite p = this.getCommandParametersComposite();
+
+		
+		
+		Group group = new Group(p, SWT.NONE);
+		
+		group.setText("Group by:");
+		//group.setLayout(new RowLayout(SWT.VERTICAL));
+		group.setLayout(new RowLayout());
+		
+//		GridData gridData = new GridData(SWT.FILL, SWT.FILL, true, false);
+//		gridData.horizontalSpan = 2;
+//		gridData.verticalIndent = 10;
+//		group.setLayoutData(gridData);
+
+		
+		groupByTexts = new Button(group, SWT.RADIO);
+		groupByTexts.setText("text");
+		groupByTexts.setSelection(!this.getBooleanParameterValue(TextsBalancePreferences.GROUP_BY_WORDS));	
+		
+		
+		groupByWords = new Button(group, SWT.RADIO);
+		groupByWords.setText("word");
+		groupByWords.setSelection(!groupByTexts.getSelection());
+
+		
+		suCombo = new Combo(p, SWT.READ_ONLY);
+		supCombo = new Combo(p, SWT.READ_ONLY);
+
+		try {
+			loadSU();
+		}
+		catch (Exception e) {
+			e.printStackTrace();
+		}
+
+
+		suCombo.addSelectionListener(new SelectionListener() {
+			
+			@Override
+			public void widgetSelected(SelectionEvent e) {
+				// persistence
+				TXMPreferences.putLocalString(getResultData(), TextsBalancePreferences.STRUCTURAL_UNIT, suCombo.getText());
+				TXMPreferences.putLocalInt(getResultData(), TextsBalancePreferences.STRUCTURAL_UNIT_PROPERTY_INDEX, 0);
+				
+				try {
+					loadSUP(((TextsBalance)getResultData()).getCorpus().getStructuralUnit(suCombo.getText()));
+					getResultData().setDirty();
+					computeChart(true);
+				}
+				catch(Exception e1) {
+					// TODO Auto-generated catch block
+					e1.printStackTrace();
+				}
+
+			}
+			
+			@Override
+			public void widgetDefaultSelected(SelectionEvent e) {
+				// TODO Auto-generated method stub
+				
+			}
+		});
+		
+
+		
+		SelectionListener listener = new SelectionListener() {
+			@Override
+			public void widgetSelected(SelectionEvent e) {
+				
+			
+				// persistence
+				TXMPreferences.putLocalInt(getResultData(), TextsBalancePreferences.STRUCTURAL_UNIT_PROPERTY_INDEX, supCombo.getSelectionIndex());
+				TXMPreferences.putLocalBoolean(getResultData(), TextsBalancePreferences.GROUP_BY_WORDS, !groupByTexts.getSelection());
+				getResultData().setDirty();
+				computeChart(true);
+			}
+
+			@Override
+			public void widgetDefaultSelected(SelectionEvent e) {
+				
+			}
+		};
+		
+		supCombo.addSelectionListener(listener);
+		groupByTexts.addSelectionListener(listener);
+		groupByWords.addSelectionListener(listener);
+		
+		
+		//this.compute();
+	}
+
+	
+//	/**
+//	 * Computes the balance using local or default parameters.
+//	 */
+//	public void compute()	{
+//		try {
+//			
+//			String suName = this.getStringParameterValue(TextsBalancePreferences.STRUCTURAL_UNIT);
+//
+//			// gets the structural unit property name
+//			String supName = null;
+//			int i = 0;
+//			for(StructuralUnitProperty p : ((TextsBalance) this.getResultData()).getCorpus().getStructuralUnit(suName).getOrderedProperties()) {
+//				if(Arrays.asList(this.supsToSkip).contains(p.getName()))	{ 
+//					continue;
+//				}
+//				if(i == this.getIntParameterValue(TextsBalancePreferences.STRUCTURAL_UNIT_PROPERTY_INDEX))	{
+//					supName = p.getName();
+//					break;
+//				}
+//				i++;
+//			}
+//			
+//			this.compute(
+//					this.getIntParameterValue(TextsBalancePreferences.METHOD),
+//					((TextsBalance) this.getResultData()).getCorpus().getStructuralUnit(suName),
+//					supName,
+//					!this.getBooleanParameterValue(TextsBalancePreferences.GROUP_BY_WORDS)
+//					);
+//			
+//			
+//		}
+//		catch(Exception e) {
+//			// TODO Auto-generated catch block
+//			e.printStackTrace();
+//		}
+//	}
+//	
+//	
+//	/**
+//	 * 
+//	 * @param method 1: use CQL to solve matches, 2 uses corpus struct indexes, 2 is faster !
+//	 * @throws CqiClientException
+//	 */
+//	public void compute(final int method, final StructuralUnit su, final String propertyName, final boolean groupByTexts) {
+//
+//		Job job = new Job("Compute Texts Balance") {
+//		    @Override
+//		    protected IStatus run(IProgressMonitor monitor) {
+//
+//		    	// creating
+//				monitor.beginTask("Computing", IProgressMonitor.UNKNOWN);
+//				
+//				final TextsBalance textsBalance = (TextsBalance)getResultData();
+//				try {
+//					textsBalance.setParameters(method, su, propertyName, groupByTexts);
+//					textsBalance.compute(false, monitor);
+//				}
+//				catch(Exception e) {
+//					System.out.println("Error: "+e.getLocalizedMessage());
+//					Log.printStackTrace(e);
+//				}
+//		
+//				computeChart(true);
+//				
+//				// done
+//				monitor.done(); 
+//				return Status.OK_STATUS;
+//	    }
+//
+//		};
+//		//job.setUser(true); // show progress bar, without that the progress is located to bottom right
+//		job.schedule();
+//		
+//		
+//	}
+
+	
+	
+	/**
+	 * Fills the SU combo box from the corpus.
+	 * @throws CqiClientException
+	 */
+	private void loadSU() throws CqiClientException {
+
+		String selectedSuName = TextsBalancePreferences.getString(TextsBalancePreferences.PREFERENCES_NODE, (TextsBalance) this.getResultData(), TextsBalancePreferences.STRUCTURAL_UNIT);
+		int selectedIndex = 0;
+		int i = 0;
+		
+		for (StructuralUnit p : ((TextsBalance) this.getResultData()).getCorpus().getOrderedStructuralUnits()) {
+			if (p.getName().equals("txmcorpus"))	{ //$NON-NLS-1$
+				continue;
+			}
+			suCombo.add(p.getName());
+			if (selectedSuName.equals(p.getName()))	{
+				selectedIndex = i;
+			}
+			i++;
+		}
+		suCombo.select(selectedIndex);
+		loadSUP(((TextsBalance)this.getResultData()).getCorpus().getStructuralUnit(suCombo.getText()));
+	}
+
+	/**
+	 * Fills the SUP combo box from the specified structural unit.
+	 * @param su
+	 * @throws CqiClientException
+	 */
+	private void loadSUP(StructuralUnit su) throws CqiClientException {
+		supCombo.removeAll();
+		for (StructuralUnitProperty p : su.getOrderedProperties()) {
+			if (Arrays.asList(this.supsToSkip).contains(p.getName()))	{ 
+				continue;
+			}
+			supCombo.add(p.getName());
+		}
+		if (supCombo.getItemCount() > 0) {
+			supCombo.select(TextsBalancePreferences.getInt(TextsBalancePreferences.PREFERENCES_NODE, this.getResultData(), TextsBalancePreferences.STRUCTURAL_UNIT_PROPERTY_INDEX));
+		}
+	}
+	
+	/**
+	 * 
+	 * @param corpus
+	 * @param structs
+	 * @return
+	 */
+	public ArrayList<Integer> intersect(List<Match> corpus, List<Match> structs) {
+		int ai=0, bi=0;
+		ArrayList<Integer> result = new ArrayList<Integer>();
+
+		while (ai < corpus.size() && bi < structs.size() ) {
+			if (structs.get(bi).contains(corpus.get(ai))) { 
+				result.add(bi);
+				ai++; 
+			} else if (corpus.get(ai).contains(structs.get(bi))) { 
+				result.add(bi);
+				bi++; 
+			} else { 
+				if (structs.get(bi).getStart() < corpus.get(ai).getStart()) {
+					bi++;
+				} else {
+					ai++;	
+				}
+			} 
+		}
+
+		return result;
+	}
+
+	@Override
+	public void doSave(IProgressMonitor monitor) {
+		// Do the Save operation
+	}
+
+	@Override
+	public void doSaveAs() {
+		// Do the Save As operation
+	}
+
+
+	@Override
+	public boolean isDirty() {
+		return false;
+	}
+
+	@Override
+	public boolean isSaveAsAllowed() {
+		return false;
+	}
+
+
+}

Property changes on: tmp/org.txm.textsbalance.rcp/src/org/txm/textsbalance/rcp/editors/TextsBalanceEditor.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/org.txm.textsbalance.rcp/plugin.xml
===================================================================
--- tmp/org.txm.textsbalance.rcp/plugin.xml	(revision 536)
+++ tmp/org.txm.textsbalance.rcp/plugin.xml	(revision 537)
@@ -5,7 +5,7 @@
    <extension
          point="org.eclipse.ui.editors">
       <editor
-            class="org.txm.textsbalance.rcp.editors.BalanceEditor"
+            class="org.txm.textsbalance.rcp.editors.TextsBalanceEditor"
             icon="icons/balance.png"
             id="org.txm.textsbalance.core.functions.TextsBalance"
             name="Texts Balance">
@@ -28,7 +28,7 @@
          point="org.eclipse.ui.menus">
       <menuContribution
             allPopups="false"
-            locationURI="toolbar:org.txm.rcp.toolbartools?after=ComputeWordCloud">
+            locationURI="toolbar:org.txm.rcp.toolbartools">
          <command
                commandId="org.txm.textsbalance.rcp.handlers.ComputeBalance"
                icon="icons/balance.png"
@@ -43,7 +43,7 @@
       </menuContribution>
       <menuContribution
             allPopups="false"
-            locationURI="popup:org.txm.rcp.views.CorporaView">
+            locationURI="popup:org.txm.rcp.views.corpora.CorporaView">
          <command
                commandId="org.txm.textsbalance.rcp.handlers.ComputeBalance"
                icon="icons/balance.png"
@@ -78,7 +78,7 @@
          <with
                variable="activeEditor">
             <instanceof
-                  value="org.txm.textsbalance.rcp.editors.BalanceEditor">
+                  value="org.txm.textsbalance.rcp.editors.TextsBalanceEditor">
             </instanceof>
          </with>
       </definition>
Index: tmp/org.txm.partition.core/src/org/txm/partition/core/functions/PartitionDimensions.java
===================================================================
--- tmp/org.txm.partition.core/src/org/txm/partition/core/functions/PartitionDimensions.java	(revision 536)
+++ tmp/org.txm.partition.core/src/org/txm/partition/core/functions/PartitionDimensions.java	(revision 537)
@@ -10,8 +10,10 @@
 import java.util.List;
 
 import org.txm.chartsengine.core.results.ChartResult;
+import org.txm.core.preferences.TXMPreferences;
 import org.txm.core.results.TXMParameters;
 import org.txm.partition.core.messages.PartitionCoreMessages;
+import org.txm.partition.core.preferences.PartitionDimensionsPreferences;
 import org.txm.searchengine.cqp.clientExceptions.CqiClientException;
 import org.txm.searchengine.cqp.corpus.Corpus;
 import org.txm.searchengine.cqp.corpus.Part;
@@ -26,6 +28,7 @@
 public class PartitionDimensions extends ChartResult {
 
 	
+	
 	/**
 	 * Creates a partition dimensions result from the specified <link>Partition</link>.
 	 */
@@ -54,11 +57,29 @@
 
 	@Override
 	public boolean setParameters(TXMParameters parameters) {
+		try {
+			this.setParameters((boolean)parameters.get(PartitionDimensionsPreferences.CHART_DIMENSIONS_SORTED_BY_SIZE));
+			return true;
+		}
+		catch(Exception e) {
+			// TODO Auto-generated catch block
+			e.printStackTrace();
+		}
 		return false;
 	}
 
 
 	/**
+	 * 
+	 * @param sortByPartSize
+	 */
+	public void setParameters(boolean sortByPartSize)	{
+		TXMPreferences.putLocal(this, PartitionDimensionsPreferences.CHART_DIMENSIONS_SORTED_BY_SIZE, sortByPartSize);
+		this.setDirty();
+		this.setChartDirty();
+	}
+	
+	/**
 	 * Convenience method.
 	 */
 	public Partition getPartition()	{
@@ -148,11 +169,8 @@
 	public String getDetails() {
 		return this.getName();
 	}
-	
 
 
-
-
 	@Override
 	public boolean toTxt(File arg0, String arg1, String arg2, String arg3) throws Exception {
 		// TODO Auto-generated method stub
@@ -160,4 +178,5 @@
 	}
 
 
+
 }
Index: tmp/org.txm.progression.core/src/org/txm/progression/core/functions/Progression.java
===================================================================
--- tmp/org.txm.progression.core/src/org/txm/progression/core/functions/Progression.java	(revision 536)
+++ tmp/org.txm.progression.core/src/org/txm/progression/core/functions/Progression.java	(revision 537)
@@ -41,6 +41,7 @@
 import org.txm.chartsengine.r.core.themes.DefaultTheme;
 import org.txm.core.results.TXMParameters;
 import org.txm.progression.core.messages.ProgressionCoreMessages;
+import org.txm.progression.core.preferences.ProgressionPreferences;
 import org.txm.searchengine.cqp.clientExceptions.CqiClientException;
 import org.txm.searchengine.cqp.corpus.Corpus;
 import org.txm.searchengine.cqp.corpus.CorpusManager;
@@ -70,7 +71,7 @@
 	List<Query> queries;
 
 	/** The structure. */
-	StructuralUnit structure;
+	StructuralUnit structuralUnit;
 
 	/** The property. */
 	StructuralUnitProperty property;
@@ -88,13 +89,13 @@
 	private BufferedWriter writer;
 
 	/** List of token position in the text. */
-	List<int[]> allPositions = new ArrayList<int[]>();
+	List<int[]> allPositions;
 
 	/** The structurepositions. */
-	int[] structurePositions = new int[0];
+	int[] structurePositions;
 
 	/** The structurenames. */
-	String[] structureNames = new String[0];
+	String[] structureNames;
 
 	/** graph boundaries. */
 	int maxY;
@@ -105,13 +106,13 @@
 
 
 	/** The repeatvalues. */
-	private boolean repeatvalues;
+	private boolean repeatValues;
 
 	/** The bande. */
 	private float bande = 0.0f;
 
 	/** The bandemultiplier. */
-	private float bandemultiplier;
+	private float bandeMultiplier;
 
 	
 	/** The norep. */
@@ -125,45 +126,81 @@
 	
 	
 	/**
-	 * Instantiates a new progression.
-	 *
-	 * @param corpus the corpus
-	 * @param queries , a curve per query
-	 * @param structure , the structural unit to show
-	 * @param property , the value to display
-	 * @param propertyregex , a selection of the values to display
-	 * @param doCumulative , if true do a cumulative graph, if not compute the density (R
-	 * function)
-	 * @param monochrome the monochrome
-	 * @param monostyle the monostyle
-	 * @param linewidth the linewidth
-	 * @param repeat the repeat
-	 * @param bandemultiplier the bandemultiplier
+	 * Creates an empty Progression result with no parent.
+	 * @param corpus
 	 */
-	@Deprecated
-	// FIXME : to remove when charts engine will be validated
+	public Progression(Corpus corpus)	{
+		super();
+		this.corpus = corpus;
+	}
+	
+
+	
+	@Override
+	public boolean canCompute() {
+		// FIXME: not yet implemented
+		System.err.println("Progression.canCompute(): partially implemented.");
+		return 
+				this.corpus != null
+				&& this.queries != null
+				;
+	}
+
+	/**
+	 * 
+	 * @param queries
+	 * @param structuralUnit
+	 * @param property
+	 * @param propertyregex
+	 * @param doCumulative
+	 * @param lineWidth
+	 * @param repeatValues
+	 * @param bandeMultiplier
+	 */
 	// FIXME : all parameters related to rendering should removed from this class and centralized in the charts engine system
-	public Progression(Corpus corpus, List<Query> queries, StructuralUnit structure, StructuralUnitProperty property, String propertyregex,
-			boolean doCumulative, int linewidth, boolean repeat, float bandemultiplier) {
-		
-		super(corpus);
-		
-		//System.out.println("monochrome: "+monochrome+" monostyle: "+monostyle+" width: "+linewidth);
-		this.corpus = corpus; // the corpus which we compute on
+	public void setParameters(List<Query> queries, StructuralUnit structuralUnit, StructuralUnitProperty property, String propertyregex, boolean doCumulative, int lineWidth, boolean repeatValues, float bandeMultiplier)	{
 		this.queries = queries; // the query of the selection
-		this.structure = structure;
+		this.structuralUnit = structuralUnit;
 		this.property = property;
 		this.propertyRegex = propertyregex;
-		this.repeatvalues = repeat;
-		this.bandemultiplier = bandemultiplier;
+		this.repeatValues = repeatValues;
+		this.bandeMultiplier = bandeMultiplier;
 
-		for (int i = 0 ; i < DefaultTheme.monowidths.length ; i++) {
-			DefaultTheme.monowidths[i] = linewidth;
+		for (int i = 0 ; i < DefaultTheme.monoWidths.length ; i++) {
+			DefaultTheme.monoWidths[i] = lineWidth;
 		}
+		
+		this.setDirty();
 	}
-
 	
 	/**
+	 * 
+	 * @param structuralUnit
+	 */
+	public void setStructuralUnit(StructuralUnit structuralUnit)	{
+		this.structuralUnit = structuralUnit;
+	}
+	
+	/**
+	 * 
+	 * @param structuralUnitProperty
+	 */
+	public void setStructuralUnitProperty(StructuralUnitProperty structuralUnitProperty)	{
+		this.property = structuralUnitProperty;
+	}
+	
+// FIXME	
+//	@Override
+//	public void loadParameters() {
+//		// FIXME:
+//		System.err.println("Progression.loadParameters(): partially implemented.");
+//		
+//		this.repeatValues = this.getBooleanParameterValue(ProgressionPreferences.CHART_REPEAT_VALUES);
+//		this.bandeMultiplier = this.getFloatParameterValue(ProgressionPreferences.CHART_BANDE_MULTIPLIER);
+//	}
+	
+	
+	/**
 	 * Computes.
 	 *
 	 * @return true, if successful
@@ -173,17 +210,24 @@
 	 */
 	protected boolean _compute(boolean update) throws Exception {
 		
-		this.subTask("processing queries");
-		if (!stepQueries()) {
-			System.out.println(ProgressionCoreMessages.ComputeProgression_3);
-			return false;
+		if(!update)	{
+			this.allPositions = new ArrayList<int[]>();
+			this.structurePositions = new int[0];
+			this.structureNames = new String[0];
+			
+			this.subTask("processing queries");
+			if (!stepQueries()) {
+				System.out.println(ProgressionCoreMessages.ComputeProgression_3);
+				return false;
+			}
+			
+			if (this.isCanceled())	{
+				return false;
+			}
+			this.worked(10);
+
 		}
 		
-		if (this.isCanceled())	{
-			return false;
-		}
-		this.worked(10);
-
 		
 		this.subTask("processing structural units");
 		if (!stepStructuralUnits() || this.isCanceled())	{
@@ -191,12 +235,17 @@
 		}
 		this.worked(20);
 
-		this.subTask("finalizing");
-		if (!stepFinalize() || this.isCanceled())	{
-			return false;
+		
+		if(!update)	{
+			this.subTask("finalizing");
+			if (!stepFinalize() || this.isCanceled())	{
+				return false;
+			}
+			this.worked(20);
+			
+			this.corpus.addResult(this);
 		}
-		this.worked(20);
-
+		
 		return true;
 	}
 
@@ -207,7 +256,9 @@
 	 */
 	public static boolean canRunProgression(Corpus corpus) {
 		//System.out.println(corpus.getMatches());
-		if (corpus.getMatches().size() == 1) return true;
+		if (corpus.getMatches().size() == 1) {
+			return true;
+		}
 		else {
 			Match previousMatch = null;
 			for (Match m : corpus.getMatches()) {
@@ -262,10 +313,12 @@
 				this.worked(1);
 				
 				// FIXME: long process test for Thread user canceling
-				System.err.println("Progression.stepQueries(): fixme: simulating a long process for canceling tests purpose.");
-				for(long j = 0; j < 100000000L; j++)	{
-					;
-				}
+//				System.err.println("Progression.stepQueries(): fixme: simulating a long process for canceling tests purpose.");
+//				for(long j = 0; j < 10000000L; j++)	{
+//					;
+//				}
+
+				
 			}
 		}
 		return npositions > 0;
@@ -280,8 +333,8 @@
 	 */
 	public boolean stepStructuralUnits() throws CqiClientException, IOException, CqiServerError	{
 		// structure query
-		if (structure != null) {
-			Query query = new Query("<" + structure.getName() + ">[]"); //$NON-NLS-1$ //$NON-NLS-2$
+		if (structuralUnit != null) {
+			Query query = new Query("<" + structuralUnit.getName() + ">[]"); //$NON-NLS-1$ //$NON-NLS-2$
 			if (property != null) {
 				query = new Query("<" + property.getFullName() + ">[]"); //$NON-NLS-1$ //$NON-NLS-2$
 				if (propertyRegex != null)
@@ -322,9 +375,9 @@
 				if (property != null)
 					currentname = refValues.get(property).get(i);
 				else
-					currentname = structure.getName() + i;
+					currentname = structuralUnit.getName() + i;
 
-				if (repeatvalues) {
+				if (repeatValues) {
 					structureNames[i] = currentname;
 					structurePositions[i] = m;
 				} else {
@@ -345,7 +398,7 @@
 
 				i++;
 			}
-			this.bande = distmin*bandemultiplier;
+			this.bande = distmin * this.bandeMultiplier;
 		}
 		return true;
 	}
@@ -372,36 +425,13 @@
 		//System.out.println("min: "+XminCorpus+ "max: "+XmaxCorpus);
 
 		if (bande <= 0) {
-			bande = ((XmaxCorpus - XminCorpus)/100)*bandemultiplier;
+			bande = ((XmaxCorpus - XminCorpus)/100)*bandeMultiplier;
 			if (bande == 0)
 				bande = 1.0f;
 		}
 		return true;
 	}
 
-	/**
-	 * 
-	 * @param outfile
-	 * @param encoding
-	 * @return
-	 * @throws IOException
-	 */
-	public boolean toTxt(File outfile, String encoding) throws IOException {
-		// NK: writer declared as class attribute to perform a clean if the operation is interrupted
-		tryAcquireSemaphore();
-		this.writer = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(outfile),
-				encoding)); 
-		for (int i = 0 ; i < queries.size() ; i++) {
-			writer.write("* "+queries.get(i)+"\n"); //$NON-NLS-1$ //$NON-NLS-2$
-			for (int p : allPositions.get(i)) {
-				writer.write(""+p+"\n"); //$NON-NLS-1$ //$NON-NLS-2$
-			}
-		}
-		writer.close();
-		releaseSemaphore();
-		return true;
-	}
-	
 
 
 
@@ -470,7 +500,7 @@
 	 * @return true, if is repeatvalues
 	 */
 	public boolean isRepeatvalues() {
-		return repeatvalues;
+		return repeatValues;
 	}
 
 
@@ -495,7 +525,32 @@
 		return toTxt(outfile, encoding);
 	}
 
+
 	/**
+	 * 
+	 * @param outfile
+	 * @param encoding
+	 * @return
+	 * @throws IOException
+	 */
+	public boolean toTxt(File outfile, String encoding) throws IOException {
+		// NK: writer declared as class attribute to perform a clean if the operation is interrupted
+		tryAcquireSemaphore();
+		this.writer = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(outfile),
+				encoding)); 
+		for (int i = 0 ; i < queries.size() ; i++) {
+			writer.write("* "+queries.get(i)+"\n"); //$NON-NLS-1$ //$NON-NLS-2$
+			for (int p : allPositions.get(i)) {
+				writer.write(""+p+"\n"); //$NON-NLS-1$ //$NON-NLS-2$
+			}
+		}
+		writer.close();
+		releaseSemaphore();
+		return true;
+	}
+	
+	
+	/**
 	 * @return the allPositions
 	 */
 	public List<int[]> getAllPositions() {
@@ -520,7 +575,7 @@
 	 * @return the structure
 	 */
 	public StructuralUnit getStructure() {
-		return structure;
+		return structuralUnit;
 	}
 
 	/**
@@ -620,25 +675,25 @@
 			return this.parent.getSimpleName() + ": " + this.getSimpleName();			
 		}
 		catch(Exception e) {
-			return super.toString();
+			return "";
 		}
 
 	}
 
 	@Override
 	public String getSimpleName() {
-		return this.queries.toString();
+		String output  = this.queries.toString();
+		if (this.propertyRegex != null) {
+			output += " " + this.propertyRegex;
+		}
+		return output;
 	}
 
-	@Override
-	public boolean canCompute() {
-		// FIXME: not yet implemented
-		System.err.println("Progression.canCompute(): not yet implemented.");
-		return corpus != null;
-	}
 
 	@Override
 	public boolean setParameters(TXMParameters parameters) {
 		return false;
 	}
+
+
 }
Index: tmp/org.txm.progression.core/src/org/txm/progression/core/chartsengine/jfreechart/JFCProgressionChartCreator.java
===================================================================
--- tmp/org.txm.progression.core/src/org/txm/progression/core/chartsengine/jfreechart/JFCProgressionChartCreator.java	(revision 536)
+++ tmp/org.txm.progression.core/src/org/txm/progression/core/chartsengine/jfreechart/JFCProgressionChartCreator.java	(revision 537)
@@ -15,12 +15,11 @@
 import org.jfree.ui.RectangleAnchor;
 import org.jfree.ui.TextAnchor;
 import org.txm.chartsengine.core.ChartsEngine;
-import org.txm.core.preferences.TXMPreferences;
-import org.txm.core.results.TXMResult;
 import org.txm.chartsengine.jfreechart.core.JFCChartCreator;
 import org.txm.chartsengine.jfreechart.core.renderers.MultipleItemsSelector;
 import org.txm.chartsengine.jfreechart.core.renderers.interfaces.IRendererWithItemSelection;
 import org.txm.chartsengine.jfreechart.core.themes.base.ExtendedNumberAxis;
+import org.txm.core.results.TXMResult;
 import org.txm.progression.core.chartsengine.base.ProgressionChartCreator;
 import org.txm.progression.core.chartsengine.base.Utils;
 import org.txm.progression.core.chartsengine.jfreechart.themes.highcharts.renderers.ProgressionItemSelectionRenderer;
@@ -37,9 +36,6 @@
  */
 public class JFCProgressionChartCreator extends JFCChartCreator implements ProgressionChartCreator {
 
-	public JFCProgressionChartCreator() {
-		// TODO Auto-generated constructor stub
-	}
 
 	@Override
 	public JFreeChart createChart(TXMResult result) {
@@ -61,6 +57,7 @@
 		// Y axis label
 		String yAxisLabel;
 
+		
 		// Cumulative
 		if(cumulative)	{
 			for(int i = 0; i < progression.getAllpositions().size(); i++) {
@@ -69,14 +66,14 @@
 				XYSeries series = new XYSeries(query.toString() + " " + list.length);
 				int c = 1;
 				for(int j = 0; j < list.length; j++) {
-					// Add a first point to draw a vertical line
+					// add a first point to draw a vertical line
 					if(j == 0)	{
 						series.add(list[j], 0);
 					}
 					series.add(list[j], c++);
 				}
 
-				// FIXME: add a dummy point to draw horizontal line between last point and max X corpus
+				// add a dummy point to draw horizontal line between last point and max X corpus
 				series.add(progression.getXmaxCorpus(), --c);
 				dataset.addSeries(series);
 			}
@@ -95,7 +92,7 @@
 		else	{
 
 			// FIXME : density not yet implemented
-			System.err.println("JFCChartsEngine.createProgressionChart(): density mode not yet implemented.");
+			System.err.println("JFCProgressionChartCreator.createChart(): density mode not yet implemented.");
 
 			for(int i = 0; i < progression.getAllpositions().size(); i++) {
 				int[] liste = positions.get(i);
@@ -127,16 +124,42 @@
         ((IRendererWithItemSelection) chart.getXYPlot().getRenderer()).getItemsSelector().setResultData(progression);
 
 
+		// Custom domain axis for ticks drawing options
+		chart.getXYPlot().setDomainAxis(new ExtendedNumberAxis((NumberAxis) chart.getXYPlot().getDomainAxis(), true, true, progression.getXminCorpus(), progression.getXmaxCorpus()));
+
+		// Custom range axis for ticks drawing options
+		chart.getXYPlot().setRangeAxis(new ExtendedNumberAxis((NumberAxis) chart.getXYPlot().getRangeAxis(), false, true, 0, progression.getMaxY()));
+
+		// Match the X-axis origin value to the min x corpus (for subcorpus case)
+		chart.getXYPlot().getDomainAxis().setLowerBound(progression.getXminCorpus());
+
+		this.updateChart(chart, result);
+		
+		return chart;
+		
+	}
+
+
+	@Override
+	public void updateChart(Object chart, TXMResult result) {
+
+		Progression progression = (Progression) result;
+		
+		JFreeChart c = (JFreeChart) chart;
+		
+		// removes all existing domain marker
+		c.getXYPlot().clearDomainMarkers();
+		
 		// Add the limit markers
 		BasicStroke dashedStroke = new BasicStroke(0.5f, BasicStroke.CAP_ROUND, BasicStroke.JOIN_ROUND, 1f, new float[] {2f}, 0f);
 		Marker marker = new ValueMarker(progression.getXminCorpus());
         marker.setPaint(Color.gray);
         marker.setStroke(dashedStroke);
-        chart.getXYPlot().addDomainMarker(marker);
+        c.getXYPlot().addDomainMarker(marker);
 		marker = new ValueMarker(progression.getXmaxCorpus());
         marker.setPaint(Color.gray);
         marker.setStroke(dashedStroke);
-        chart.getXYPlot().addDomainMarker(marker);
+        c.getXYPlot().addDomainMarker(marker);
 
 
 //        // FIXME : limit with annotations rather than markers (marker height is dynamically adapted to the real chart height.
@@ -170,42 +193,20 @@
 
 
 
-			        chart.getXYPlot().addDomainMarker(marker);
+			        c.getXYPlot().addDomainMarker(marker);
 				}
 			}
 		}
-
-		// Custom domain axis for ticks drawing options
-		chart.getXYPlot().setDomainAxis(new ExtendedNumberAxis((NumberAxis) chart.getXYPlot().getDomainAxis(), true, true, progression.getXminCorpus(), progression.getXmaxCorpus()));
-
-		// Custom range axis for ticks drawing options
-		chart.getXYPlot().setRangeAxis(new ExtendedNumberAxis((NumberAxis) chart.getXYPlot().getRangeAxis(), false, true, 0, progression.getMaxY()));
-
-		// Match the X-axis origin value to the min x corpus (for subcorpus case)
-		chart.getXYPlot().getDomainAxis().setLowerBound(progression.getXminCorpus());
-
-
-//        int itemsColorsRenderingMode = Theme.ITEMS_RENDERING_COLORS_MODE;
-//		// Grayscale
-//        if(grayscale)	{
-//        	itemsColorsRenderingMode = Theme.ITEMS_RENDERING_GRAYSCALE_MODE;
-//        }
-
+		
+		super.updateChart(chart, result);
+		
         // Re-apply theme to the chart to match the colors rendering mode
         // FIXME : the rendering mode should be pass to all methods, even base methods as createXYLineChart(), createBarChart(), etc.
         // or better, to be stocked into a member variable in the theme ?
-      //  this.getChartsEngine().getTheme().applyThemeToChart(chart, TXMPreferences.getInt(ProgressionPreferences.PREFERENCES_NODE, resultData, ChartsEnginePreferences.RENDERING_COLORS_MODE, ChartsEnginePreferences.PREFERENCES_NODE), monostyle);
+		this.getChartsEngine().getJFCTheme().applyThemeToChart(c, progression, true);
 
-		// synchronizes the chart with the shared preferences 
-		//super.syncChart(chart, resultData, ProgressionPreferences.PREFERENCES_NODE);
-		
-		return chart;
-		
 	}
 
-
-	
-
 	@Override
 	public ArrayList<Integer> getSelectedPointPositions(Object chart) {
 
Index: tmp/org.txm.progression.core/src/org/txm/progression/core/chartsengine/r/RProgressionChartCreator.java
===================================================================
--- tmp/org.txm.progression.core/src/org/txm/progression/core/chartsengine/r/RProgressionChartCreator.java	(revision 536)
+++ tmp/org.txm.progression.core/src/org/txm/progression/core/chartsengine/r/RProgressionChartCreator.java	(revision 537)
@@ -104,7 +104,7 @@
 
 			// System.out.println("create styles vector");
 			rw.eval("rm(widths)"); //$NON-NLS-1$
-			rw.addVectorToWorkspace("widths", DefaultTheme.monowidths); //$NON-NLS-1$
+			rw.addVectorToWorkspace("widths", DefaultTheme.monoWidths); //$NON-NLS-1$
 
 			// System.out.println("create names vector");
 			String[] queriesstring = new String[progression.getQueries().size()];
Index: tmp/org.txm.concordance.core/src/org/txm/concordance/core/functions/Concordance.java
===================================================================
--- tmp/org.txm.concordance.core/src/org/txm/concordance/core/functions/Concordance.java	(revision 536)
+++ tmp/org.txm.concordance.core/src/org/txm/concordance/core/functions/Concordance.java	(revision 537)
@@ -127,33 +127,33 @@
 		}
 
 		// initialize default preference values of this Concordance
-		try {
-			this.parameters = new TXMParameters();
-			this.parameters.put(ConcordancePreferences.QUERY, this.getStringParameterValue(ConcordancePreferences.QUERY));
-			this.parameters.put(ConcordancePreferences.LEFT_ANALYSIS_PROPERTIES, this.getStringParameterValue(ConcordancePreferences.LEFT_ANALYSIS_PROPERTIES));
-			this.parameters.put(ConcordancePreferences.KEYWORD_ANALYSIS_PROPERTIES, this.getStringParameterValue(ConcordancePreferences.KEYWORD_ANALYSIS_PROPERTIES));
-			this.parameters.put(ConcordancePreferences.RIGHT_ANALYSIS_PROPERTIES, this.getStringParameterValue(ConcordancePreferences.RIGHT_ANALYSIS_PROPERTIES));
-			this.parameters.put(ConcordancePreferences.LEFT_VIEW_PROPERTIES, this.getStringParameterValue(ConcordancePreferences.LEFT_VIEW_PROPERTIES));
-			this.parameters.put(ConcordancePreferences.KEYWORD_VIEW_PROPERTIES, this.getStringParameterValue(ConcordancePreferences.KEYWORD_VIEW_PROPERTIES));
-			this.parameters.put(ConcordancePreferences.RIGHT_VIEW_PROPERTIES, this.getStringParameterValue(ConcordancePreferences.RIGHT_VIEW_PROPERTIES));
-
-			this.parameters.put(ConcordancePreferences.LEFT_CONTEXT_SIZE, this.getIntParameterValue(ConcordancePreferences.LEFT_CONTEXT_SIZE));
-			this.parameters.put(ConcordancePreferences.RIGHT_CONTEXT_SIZE, this.getIntParameterValue(ConcordancePreferences.RIGHT_CONTEXT_SIZE));
-
-			Property ref = corpus.getProperty("ref");
-			if (ref != null) {
-				this.parameters.put(ConcordancePreferences.VIEW_REFERENCEPATTERN, ref);
-				this.parameters.put(ConcordancePreferences.ANALYSIS_REFERENCEPATTERN, ref);
-			} else {
-				this.parameters.put(ConcordancePreferences.VIEW_REFERENCEPATTERN, "text_id");
-				this.parameters.put(ConcordancePreferences.ANALYSIS_REFERENCEPATTERN, "text_id");
-			}
-
-			this.setParameters(this.parameters);
-		} catch (CqiClientException e) {
-			// TODO Auto-generated catch block
-			e.printStackTrace();
-		}
+//		try {
+//			this.parameters = new TXMParameters();
+//			this.parameters.put(ConcordancePreferences.QUERY, this.getStringParameterValue(ConcordancePreferences.QUERY));
+//			this.parameters.put(ConcordancePreferences.LEFT_ANALYSIS_PROPERTIES, this.getStringParameterValue(ConcordancePreferences.LEFT_ANALYSIS_PROPERTIES));
+//			this.parameters.put(ConcordancePreferences.KEYWORD_ANALYSIS_PROPERTIES, this.getStringParameterValue(ConcordancePreferences.KEYWORD_ANALYSIS_PROPERTIES));
+//			this.parameters.put(ConcordancePreferences.RIGHT_ANALYSIS_PROPERTIES, this.getStringParameterValue(ConcordancePreferences.RIGHT_ANALYSIS_PROPERTIES));
+//			this.parameters.put(ConcordancePreferences.LEFT_VIEW_PROPERTIES, this.getStringParameterValue(ConcordancePreferences.LEFT_VIEW_PROPERTIES));
+//			this.parameters.put(ConcordancePreferences.KEYWORD_VIEW_PROPERTIES, this.getStringParameterValue(ConcordancePreferences.KEYWORD_VIEW_PROPERTIES));
+//			this.parameters.put(ConcordancePreferences.RIGHT_VIEW_PROPERTIES, this.getStringParameterValue(ConcordancePreferences.RIGHT_VIEW_PROPERTIES));
+//
+//			this.parameters.put(ConcordancePreferences.LEFT_CONTEXT_SIZE, this.getIntParameterValue(ConcordancePreferences.LEFT_CONTEXT_SIZE));
+//			this.parameters.put(ConcordancePreferences.RIGHT_CONTEXT_SIZE, this.getIntParameterValue(ConcordancePreferences.RIGHT_CONTEXT_SIZE));
+//
+//			Property ref = corpus.getProperty("ref");
+//			if (ref != null) {
+//				this.parameters.put(ConcordancePreferences.VIEW_REFERENCEPATTERN, ref);
+//				this.parameters.put(ConcordancePreferences.ANALYSIS_REFERENCEPATTERN, ref);
+//			} else {
+//				this.parameters.put(ConcordancePreferences.VIEW_REFERENCEPATTERN, "text_id");
+//				this.parameters.put(ConcordancePreferences.ANALYSIS_REFERENCEPATTERN, "text_id");
+//			}
+//
+//			this.setParameters(this.parameters);
+//		} catch (CqiClientException e) {
+//			// TODO Auto-generated catch block
+//			e.printStackTrace();
+//		}
 	}
 
 	public void setParameters(Query query,
@@ -1051,7 +1051,6 @@
 
 	@Override
 	public boolean setParameters(TXMParameters parameters) {
-		this.parameters = parameters;
 
 		Object p = parameters.get(ConcordancePreferences.QUERY);
 		if (p != null) {
Index: tmp/org.txm.chartsengine.svgbatik.rcp/src/org/txm/chartsengine/svgbatik/rcp/swt/SVGComposite.java
===================================================================
--- tmp/org.txm.chartsengine.svgbatik.rcp/src/org/txm/chartsengine/svgbatik/rcp/swt/SVGComposite.java	(revision 536)
+++ tmp/org.txm.chartsengine.svgbatik.rcp/src/org/txm/chartsengine/svgbatik/rcp/swt/SVGComposite.java	(revision 537)
@@ -1,5 +1,6 @@
 package org.txm.chartsengine.svgbatik.rcp.swt;
 import java.awt.BorderLayout;
+import java.awt.Component;
 import java.awt.EventQueue;
 import java.awt.Frame;
 import java.awt.Graphics2D;
@@ -13,8 +14,11 @@
 import java.io.IOException;
 import java.net.MalformedURLException;
 
+import javax.swing.JPanel;
+
 import org.eclipse.swt.awt.SWT_AWT;
 import org.eclipse.swt.widgets.Composite;
+import org.txm.chartsengine.rcp.IChartComponent;
 import org.txm.chartsengine.rcp.editors.ChartEditorPart;
 import org.txm.chartsengine.rcp.events.EventCallBackHandler;
 import org.txm.chartsengine.rcp.swt.ChartComposite;
@@ -43,8 +47,11 @@
 	 */
 	protected File file;
 	
-
+	protected Frame frame;
 	
+	protected JPanel rootPanel;
+	
+	
 	/**
 	 * Creates a Batik SVG composite.
 	 * @param parent
@@ -55,14 +62,15 @@
 	
 		this.file = null;
 		
-		Frame frame = SWT_AWT.new_Frame(this);
+		this.frame = SWT_AWT.new_Frame(this);
+		// Need to add an AWT Panel to fix mouse events and mouse cursors changes on Swing JPanel
+		this.rootPanel = new JPanel(new BorderLayout());
 		
-		// Need to add an AWT Panel to fix mouse events and mouse cursors changes on Swing JPanel
-		Panel rootPanel = new Panel(new BorderLayout());
-		this.chartComponent = new SVGPanel(chartEditor, frame);
-		rootPanel.add(this.getPanel());
-		frame.add(rootPanel);
-		frame.pack();
+		this.frame.add(this.rootPanel);
+
+		//this.frame.pack();
+		this.frame.setVisible(true);
+		
 	}
 
 
@@ -118,8 +126,29 @@
 	
 	@Override
 	public void loadChart()	{
-		this.file = (File) this.chartEditor.getEditorInput().getChartContainer();
-		this.loadSVGDocument(this.file);
+		if(!this.chartEditor.getResultData().isChartDirty())	{
+			// creates components if they not exist
+			if(this.chartComponent == null)	{
+				
+				this.chartEditor.getSWTChartsComponentsProvider().createChartContainer(this.chartEditor.getEditorInput());
+				this.chartComponent = (IChartComponent) this.chartEditor.getEditorInput().getChartContainer();
+				
+				this.rootPanel.add((Component) this.chartComponent);
+
+				this.frame.setVisible(true);
+			}
+			// loads the chart from the result
+			Object chart = this.chartEditor.getEditorInput().getChart();
+			// recreates the chart if not of right type
+			if(!(chart instanceof File))	{
+				this.file = this.chartEditor.getSWTChartsComponentsProvider().getChartsEngine().getChartCreator(this.chartEditor.getResultData()).createChartFile(this.chartEditor.getResultData());
+			}
+			else	{
+				this.file = (File) chart;	
+			}
+			
+			this.loadSVGDocument(this.file);
+		}
 	}
 	
 	
Index: tmp/org.txm.chartsengine.svgbatik.rcp/src/org/txm/chartsengine/svgbatik/rcp/SVGSWTChartsComponentsProvider.java
===================================================================
--- tmp/org.txm.chartsengine.svgbatik.rcp/src/org/txm/chartsengine/svgbatik/rcp/SVGSWTChartsComponentsProvider.java	(revision 536)
+++ tmp/org.txm.chartsengine.svgbatik.rcp/src/org/txm/chartsengine/svgbatik/rcp/SVGSWTChartsComponentsProvider.java	(revision 537)
@@ -22,6 +22,7 @@
 import org.txm.chartsengine.rcp.editors.ChartEditorInput;
 import org.txm.chartsengine.rcp.editors.ChartEditorPart;
 import org.txm.chartsengine.rcp.swt.ChartComposite;
+import org.txm.chartsengine.svgbatik.rcp.swing.SVGPanel;
 import org.txm.chartsengine.svgbatik.rcp.swt.SVGComposite;
 import org.w3c.dom.Element;
 
@@ -50,21 +51,16 @@
 	@Override
 	public boolean createChartContainer(ChartsEngine chartsEngine, ChartEditorInput chartEditorInput)	{
 
-		Object chart = chartEditorInput.getChart();
+		if (!chartEditorInput.getResult().isChartDirty()) {
 		
-		//if(chart != null)	{
-			chartEditorInput.setChartContainer(chart);
+			chartEditorInput.setChartContainer(new SVGPanel());
 			
 			// sets and updates the local preferences node qualifier from the result data
 			chartEditorInput.syncLocalPreferencesNode();
-
-
 			
 			return true;
-		//}
-		
-		
-		//return false;
+		}
+		return false;
 	}
 
 
Index: tmp/org.txm.chartsengine.svgbatik.rcp/src/org/txm/chartsengine/svgbatik/rcp/swing/SVGPanel.java
===================================================================
--- tmp/org.txm.chartsengine.svgbatik.rcp/src/org/txm/chartsengine/svgbatik/rcp/swing/SVGPanel.java	(revision 536)
+++ tmp/org.txm.chartsengine.svgbatik.rcp/src/org/txm/chartsengine/svgbatik/rcp/swing/SVGPanel.java	(revision 537)
@@ -29,7 +29,6 @@
 
 
 import java.awt.BorderLayout;
-import java.awt.Frame;
 import java.awt.event.InputEvent;
 import java.awt.event.MouseEvent;
 import java.awt.event.MouseWheelEvent;
@@ -49,7 +48,6 @@
 import org.txm.chartsengine.rcp.SWTChartsComponentsProvider;
 import org.txm.chartsengine.rcp.editors.ChartEditorPart;
 import org.txm.chartsengine.rcp.events.ChartKeyListener;
-import org.txm.utils.logger.Log;
 import org.w3c.dom.svg.SVGDocument;
 
 /**
@@ -91,7 +89,7 @@
 	 *
 	 * @param frame the frame
 	 */
-	public SVGPanel(ChartEditorPart editor, Frame frame)	{
+	public SVGPanel()	{
 		super(new BorderLayout());
 
 		this.svgCanvas = new JSVGCanvas(null, true, false);
@@ -209,7 +207,7 @@
 		// add default chart key listener
 		this.addKeyListener(new ChartKeyListener(SWTChartsComponentsProvider.getCurrent(), this, 10.5));
 		
-		this.setChartEditor(editor);
+		//this.setChartEditor(editor);
 		
 
 	}
Index: tmp/org.txm.chartsengine.jfreechart.core/src/org/txm/chartsengine/jfreechart/core/JFCChartsEngine.java
===================================================================
--- tmp/org.txm.chartsengine.jfreechart.core/src/org/txm/chartsengine/jfreechart/core/JFCChartsEngine.java	(revision 536)
+++ tmp/org.txm.chartsengine.jfreechart.core/src/org/txm/chartsengine/jfreechart/core/JFCChartsEngine.java	(revision 537)
@@ -927,11 +927,11 @@
 	 */
 	public static File export(Object chart, File file, String outputFormat, int imageWidth, int imageHeight, int drawingAreaX, int drawingAreaY, int drawingAreaWidth, int drawingAreaHeight)	{
 		// SVG
-		if(outputFormat == OUTPUT_FORMAT_SVG)	{
+		if(outputFormat.equals(OUTPUT_FORMAT_SVG))	{
 			return JFCChartsEngine.exportSVG((JFreeChart) chart, file, imageWidth, imageHeight, drawingAreaX, drawingAreaY, drawingAreaWidth, drawingAreaHeight);
 		}
 		// PDF
-		else if(outputFormat == OUTPUT_FORMAT_PDF)	{
+		else if(outputFormat.equals(OUTPUT_FORMAT_PDF))	{
 			return JFCChartsEngine.exportPDF((JFreeChart) chart, file, imageWidth, imageHeight, drawingAreaX, drawingAreaY, drawingAreaWidth, drawingAreaHeight);
 		}
 		// Raster
Index: tmp/org.txm.wordcloud.core/src/org/txm/wordcloud/core/functions/WordCloud.java
===================================================================
--- tmp/org.txm.wordcloud.core/src/org/txm/wordcloud/core/functions/WordCloud.java	(revision 536)
+++ tmp/org.txm.wordcloud.core/src/org/txm/wordcloud/core/functions/WordCloud.java	(revision 537)
@@ -211,7 +211,18 @@
 		return this.getSimpleName();
 	}
 
+	
 	@Override
+	public boolean canCompute() {
+		return source != null;
+	}
+
+	@Override
+	public boolean setParameters(TXMParameters parameters) {
+		return false;
+	}
+
+	@Override
 	protected boolean _compute(boolean update) {
 		// from corpus
 		if (source instanceof Corpus)	{// TODO: source must always be an Index because the corpus source produces an Index 
@@ -262,13 +273,5 @@
 		return true;
 	}
 
-	@Override
-	public boolean canCompute() {
-		return source != null;
-	}
 
-	@Override
-	public boolean setParameters(TXMParameters parameters) {
-		return false;
-	}
 }
Index: tmp/org.txm.progression.rcp/src/org/txm/progression/rcp/editors/___ProgressionEditorInput.java
===================================================================
--- tmp/org.txm.progression.rcp/src/org/txm/progression/rcp/editors/___ProgressionEditorInput.java	(revision 536)
+++ tmp/org.txm.progression.rcp/src/org/txm/progression/rcp/editors/___ProgressionEditorInput.java	(revision 537)
@@ -1,136 +0,0 @@
-// Copyright © 2010-2013 ENS de Lyon.
-// Copyright © 2007-2010 ENS de Lyon, CNRS, INRP, University of
-// Lyon 2, University of Franche-Comté, University of Nice
-// Sophia Antipolis, University of Paris 3.
-// 
-// The TXM platform is free software: you can redistribute it
-// and/or modify it under the terms of the GNU General Public
-// License as published by the Free Software Foundation,
-// either version 2 of the License, or (at your option) any
-// later version.
-// 
-// The TXM platform is distributed in the hope that it will be
-// useful, but WITHOUT ANY WARRANTY; without even the implied
-// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
-// PURPOSE. See the GNU General Public License for more
-// details.
-// 
-// You should have received a copy of the GNU General
-// Public License along with the TXM platform. If not, see
-// http://www.gnu.org/licenses.
-// 
-// 
-// 
-// $LastChangedDate:$
-// $LastChangedRevision:$
-// $LastChangedBy:$ 
-//
-package org.txm.progression.rcp.editors;
-
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.ui.IEditorInput;
-import org.eclipse.ui.IPersistableElement;
-import org.eclipse.ui.plugin.AbstractUIPlugin;
-import org.txm.progression.core.functions.Progression;
-import org.txm.rcp.Application;
-import org.txm.rcp.IImageKeys;
-import org.txm.rcp.RCPMessages;
-// TODO: Auto-generated Javadoc
-/**
- * The Class ProgressionEditorInput.
- *
- * @author mdecorde
- */
-public class ___ProgressionEditorInput implements IEditorInput {
-	
-	/** The progression. */
-	private Progression progression;
-
-	/**
-	 * Instantiates a new progression editor input.
-	 *
-	 * @param progression the progression
-	 */
-	public ___ProgressionEditorInput(Progression progression) {
-		super();
-		this.progression = progression;
-	}
-
-	/**
-	 * Exists.
-	 *
-	 * @return true, if successful
-	 * @see org.eclipse.ui.IEditorInput#exists()
-	 */
-	@Override
-	public boolean exists() {
-		return false;
-	}
-
-	/**
-	 * Gets the image descriptor.
-	 *
-	 * @return the image descriptor
-	 * @see org.eclipse.ui.IEditorInput#getImageDescriptor()
-	 */
-	@Override
-	public ImageDescriptor getImageDescriptor() {
-		return AbstractUIPlugin.imageDescriptorFromPlugin(
-				Application.PLUGIN_ID, IImageKeys.ACTION_PROGRESSION);
-	}
-
-	/**
-	 * Gets the name.
-	 *
-	 * @return the name
-	 * @see org.eclipse.ui.IEditorInput#getName()
-	 */
-	@Override
-	public String getName() {
-		return RCPMessages.ProgressionEditorInput_0;
-	}
-
-	/**
-	 * Gets the persistable.
-	 *
-	 * @return the persistable
-	 * @see org.eclipse.ui.IEditorInput#getPersistable()
-	 */
-	@Override
-	public IPersistableElement getPersistable() {
-		return null;
-	}
-
-	/**
-	 * Gets the tool tip text.
-	 *
-	 * @return the tool tip text
-	 * @see org.eclipse.ui.IEditorInput#getToolTipText()
-	 */
-	@Override
-	public String getToolTipText() {
-		return this.progression.getQueries().toString();
-	}
-
-	/**
-	 * Gets the adapter.
-	 *
-	 * @param arg0 the arg0
-	 * @return the adapter
-	 * @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class)
-	 */
-	@Override
-	@SuppressWarnings("unchecked") //$NON-NLS-1$
-	public Object getAdapter(Class arg0) {
-		return null;
-	}
-
-	/**
-	 * Gets the progression.
-	 *
-	 * @return the progression
-	 */
-	public Progression getProgression() {
-		return progression;
-	}
-}
Index: tmp/org.txm.progression.rcp/src/org/txm/progression/rcp/editors/ProgressionEditor.java
===================================================================
--- tmp/org.txm.progression.rcp/src/org/txm/progression/rcp/editors/ProgressionEditor.java	(revision 536)
+++ tmp/org.txm.progression.rcp/src/org/txm/progression/rcp/editors/ProgressionEditor.java	(revision 537)
@@ -3,10 +3,42 @@
  */
 package org.txm.progression.rcp.editors;
 
+import java.util.ArrayList;
+import java.util.List;
+import java.util.regex.Pattern;
+import java.util.regex.PatternSyntaxException;
+
 import org.eclipse.swt.SWT;
+import org.eclipse.swt.custom.ScrolledComposite;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.layout.FormAttachment;
+import org.eclipse.swt.layout.FormData;
+import org.eclipse.swt.layout.FormLayout;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Combo;
 import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.Group;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Listener;
+import org.eclipse.swt.widgets.Text;
+import org.txm.chartsengine.r.core.themes.DefaultTheme;
 import org.txm.chartsengine.rcp.editors.ChartEditorPart;
-import org.txm.progression.rcp.forms.ProgressionParametersComposite;
+import org.txm.core.messages.TXMCoreMessages;
+import org.txm.progression.core.functions.Progression;
+import org.txm.progression.core.preferences.ProgressionPreferences;
+import org.txm.progression.rcp.dialogs.ProgressionDialog;
+import org.txm.rcp.RCPMessages;
+import org.txm.rcp.StatusLine;
+import org.txm.rcp.swt.widget.AssistedQueryWidget;
+import org.txm.searchengine.cqp.corpus.Corpus;
+import org.txm.searchengine.cqp.corpus.StructuralUnit;
+import org.txm.searchengine.cqp.corpus.StructuralUnitProperty;
+import org.txm.searchengine.cqp.corpus.query.Query;
+import org.txm.utils.logger.Log;
 
 /**
  * Progression command chart editor.
@@ -14,15 +46,97 @@
  *
  */
 public class ProgressionEditor extends ChartEditorPart {
+
 	
+	/** The query widgets. */
+	protected List<AssistedQueryWidget> queryWidgets = new ArrayList<AssistedQueryWidget>();
+	
+	/** The queries. */
+	List<Query> queries;
+	
+	/** The corpus. */
+	private Corpus corpus;
+	
+	/** The selected structural unit. */
+	private StructuralUnit selectedStructuralUnit;
+	
+	/** The selected structural unit property. */
+	private StructuralUnitProperty selectedStructuralUnitProperty;
+	
+	/** The regexproperty value. */
+	private String regexpropertyValue;
+	
+	/** The graphtype. */
+	private boolean cumulative = true;
+	
+	private boolean blackAndWhite = true;
+	
+	/** The monostyle. */
+	private boolean monostyle = true;
+	
+	/** The repeatvalues. */
+	private boolean repeatvalues = false;
+	
+	/** The linewidth. */
+	private int linewidth = 2;
+	
+	/** The bandemultiplier. */
+	private float bandemultiplier = 2;
+
+	
+	/** The structural units combo. */
+	Combo structuralUnitsCombo;
+	
+	/** The structural units. */
+	List<StructuralUnit> structuralUnits;
+	
+	/** The structural units properties. */
+	List<StructuralUnitProperty> structuralUnitsProperties;
+	
+	/** The property combo. */
+	private Combo propertyCombo;
+	
+	/** The regex value. */
+	private Text regexValue;
+
+	/** The focus composite. */
+	Composite queriesFocusComposite;
+	
+	/** The main panel. */
+	Composite mainPanel;
+	
+	/** The bande field. */
+	Text bandeField;
+	
+	/** The cumu button. */
+	Button cumuButton;
+	
+	/** The repeat button. */
+	Button repeatButton;
+	
+	/** The style button. */
+	Button styleButton;
+	
+	/** The colors. */
+	String[] colors = DefaultTheme.colors;
+	
+	/** The self. */
+	ProgressionDialog self;
+	
+	/** The parent. */
+	private Composite parent;
+
+	private ScrolledComposite sc1;
+
+	
 	@Override
 	public void createPartControl(Composite parent) {
 		super.createPartControl(parent);
 		
 		
 		// FIXME: tests parameters composite extension
-		new ProgressionParametersComposite(this.getCommandParametersGroup(), SWT.NONE);
-		this.getCommandParametersGroup().pack();
+//		new ProgressionParametersComposite(this.getCommandParametersGroup(), SWT.NONE);
+//		this.getCommandParametersGroup().pack();
 
 		// FIXME: tests to use Fields editor and ScopedPreferenceStore for command parameters
 //		BooleanFieldEditor field = new BooleanFieldEditor(ChartsEnginePreferences.SHOW_TITLE, "test2 show title store", editor.getParametersComposite());
@@ -60,7 +174,361 @@
 //	    sendToCoorccurrence.setImage(IImageKeys.getImage(IImageKeys.ACTION_COOCCURRENCE));
 //	    sendToCoorccurrence.addSelectionListener(new ProgressionSelectionListener(editor, BaseSelectionListener.SEND_TO_COOCCURRENCE));
 //	    //*****************************************************
+	
 		
+		try {
+
+			monostyle = this.getBooleanParameterValue(ProgressionPreferences.CHART_MONO_STYLE);
+			cumulative = this.getBooleanParameterValue(ProgressionPreferences.CHART_CUMULATIVE);
+			repeatvalues = this.getBooleanParameterValue(ProgressionPreferences.CHART_REPEAT_VALUES);
+			bandemultiplier = this.getFloatParameterValue(ProgressionPreferences.CHART_BANDE_MULTIPLIER);
+
+			// System.out.println(parent.getLayout());
+			FormLayout mainlayout = new FormLayout();
+			Composite mainPanel = this.getCommandParametersGroup();
+			mainPanel.setLayout(mainlayout);
+			GridData gridData = new GridData(GridData.FILL, GridData.FILL, true, true);
+			mainPanel.setLayoutData(gridData);
+
+			Composite paramPanel = new Composite(mainPanel, SWT.NONE);
+
+			FormData paramPanelData = new FormData();
+			paramPanelData.top = new FormAttachment(0);
+			paramPanelData.left = new FormAttachment(0);
+			paramPanelData.right = new FormAttachment(100);
+			paramPanel.setLayoutData(paramPanelData);
+
+
+			paramPanel.setLayout(new GridLayout(3, true));
+			
+			// controls
+			// graph param
+			Label typeLabel = new Label(paramPanel, SWT.NONE);
+			typeLabel.setText(RCPMessages.ProgressionDialog_1);
+			typeLabel.setAlignment(SWT.CENTER);
+
+			cumuButton = new Button(paramPanel, SWT.RADIO);
+			cumuButton.setText(RCPMessages.ProgressionDialog_2);
+			cumuButton.setSelection(cumulative);
+
+			Button densityButton = new Button(paramPanel, SWT.RADIO);
+			densityButton.setText(RCPMessages.ProgressionDialog_3);
+			densityButton.setSelection(!cumulative);
+
+			//Bande size
+			typeLabel = new Label(paramPanel, SWT.NONE);
+			typeLabel.setText(RCPMessages.ProgressionDialog_11);
+			typeLabel.setAlignment(SWT.CENTER);
+
+			bandeField = new Text(paramPanel, SWT.BORDER);
+			bandeField.setText("" + bandemultiplier); //$NON-NLS-1$
+			bandeField.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, true, 2, 1));
+			
+			// Structural units
+//			Group displayParam = new Group(paramPanel, SWT.BORDER);
+//			displayParam.setText(RCPMessages.ProgressionDialog_13);
+//			displayParam.setLayout(new GridLayout(3, true));
+//			displayParam.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, true, 3, 1));
+
+			Label structLabel = new Label(paramPanel, SWT.NONE);
+			structLabel.setText(RCPMessages.ProgressionDialog_4);
+			structLabel.setAlignment(SWT.CENTER);
+
+			structuralUnitsCombo = new Combo(paramPanel, SWT.READ_ONLY);
+			structuralUnitsCombo.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, true, 2, 1));
+
+			structuralUnitsCombo.addSelectionListener(new SelectionListener() {
+				@Override
+				public void widgetDefaultSelected(SelectionEvent e) {
+				}
+
+				@Override
+				public void widgetSelected(SelectionEvent event) {
+					getSite().getShell().getDisplay().syncExec(new Runnable() {
+						@Override
+						public void run() {
+							reloadSUProperties();
+							getResultData().setStructuralUnit(structuralUnits.get(structuralUnitsCombo.getSelectionIndex() - 1));
+							getResultData().setDirty();
+							computeChart(true);
+						}
+					});
+				}
+			});
+
+			
+			int selectedSUIndex = 0;
+			// get
+			try {
+				structuralUnitsCombo.add("    "); //$NON-NLS-1$
+				structuralUnits = this.getResultData().getCorpus().getOrderedStructuralUnits();
+				for(int i = 0; i < structuralUnits.size(); i++) {
+					structuralUnitsCombo.add(structuralUnits.get(i).getName());
+					if(getResultData().getStructure() == structuralUnits.get(i))	{
+						selectedSUIndex = (i + 1);
+					}
+				}
+			} catch (Exception e) {
+				Log.severe(RCPMessages.ObjectExplorer_9 + Log.toString(e));
+				e.printStackTrace();
+			}
+			structuralUnitsCombo.select(selectedSUIndex);
+			
+			// Structural unit properties
+			Label propLabel = new Label(paramPanel, SWT.NONE);
+			propLabel.setText(TXMCoreMessages.PROPERTY_1);
+			propLabel.setAlignment(SWT.CENTER);
+
+			propertyCombo = new Combo(paramPanel, SWT.READ_ONLY);
+			propertyCombo.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, true, 2, 1));
+			reloadSUProperties();
+			
+			propertyCombo.addSelectionListener(new SelectionListener() {
+				@Override
+				public void widgetDefaultSelected(SelectionEvent e) {
+				}
+
+				@Override
+				public void widgetSelected(SelectionEvent event) {
+					getSite().getShell().getDisplay().syncExec(new Runnable() {
+						@Override
+						public void run() {
+							getResultData().setStructuralUnitProperty(structuralUnitsProperties.get(propertyCombo.getSelectionIndex() - 1));
+							getResultData().setDirty();
+							computeChart(true);
+						}
+					});
+				}
+			});
+			
+			
+			
+			// property value field
+			Label regexLabel = new Label(paramPanel, SWT.NONE);
+			regexLabel.setText(RCPMessages.ProgressionDialog_7);
+			regexLabel.setAlignment(SWT.CENTER);
+
+			regexValue = new Text(paramPanel, SWT.SINGLE | SWT.BORDER);
+			regexValue.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, true, 2, 1));
+			if(this.getResultData().getPropertyRegex() != null)	{
+				regexValue.setText(getResultData().getPropertyRegex());
+			}
+			
+			//spacer
+			styleButton = new Button(paramPanel, SWT.CHECK);
+			styleButton.setText(RCPMessages.ProgressionDialog_14);
+			styleButton.setSelection(monostyle);
+
+			//Repeat options
+			repeatButton = new Button(paramPanel, SWT.CHECK);
+			repeatButton.setText(RCPMessages.ProgressionDialog_15);
+			repeatButton.setSelection(repeatvalues);
+
+			
+			
+			// Queries
+			sc1 = new ScrolledComposite(mainPanel, SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER);
+			sc1.setLayout(new GridLayout(1, true));
+			sc1.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, true));
+			sc1.setExpandHorizontal(true);
+			sc1.setExpandVertical(true);
+			sc1.setMinSize(0, 120);
+			
+			FormData queriesPanelData = new FormData();
+			queriesPanelData.top = new FormAttachment(paramPanel);
+			queriesPanelData.left = new FormAttachment(0);
+			queriesPanelData.right = new FormAttachment(100);
+			queriesPanelData.bottom = new FormAttachment(100);
+			sc1.setLayoutData(queriesPanelData);
+
+			queriesFocusComposite = new Composite(sc1, SWT.NONE);
+			queriesFocusComposite.setLayout(new GridLayout(1, true));
+			sc1.setContent(queriesFocusComposite);
+			
+			// queries parameters
+			Label focusLabel = new Label(queriesFocusComposite, SWT.NONE);
+			focusLabel.setText(RCPMessages.ProgressionDialog_8);
+			focusLabel.setAlignment(SWT.CENTER);
+
+			// add query button
+			Button plusButton = new Button(queriesFocusComposite, SWT.NONE);
+			plusButton.setLayoutData(new GridData(GridData.FILL, GridData.FILL,
+					true, true));
+			plusButton.setText(RCPMessages.ProgressionDialog_9);
+			
+			plusButton.addListener(SWT.Selection, new Listener() {
+				@Override
+				public void handleEvent(Event event) {
+					if (colors.length > queryWidgets.size()) {
+						Log.info("add query field");
+						addFocusQueryField();
+						sc1.layout(true);
+						queriesFocusComposite.layout(true);
+						sc1.setMinSize(queriesFocusComposite.computeSize(SWT.DEFAULT, SWT.DEFAULT));
+					}
+				}
+			});
+
+			// delete query button
+			Button minusButton = new Button(queriesFocusComposite, SWT.NONE);
+			minusButton.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, true));
+			minusButton.setText(RCPMessages.ProgressionDialog_5);
+			minusButton.addListener(SWT.Selection, new Listener() {
+				@Override
+				public void handleEvent(Event event) {
+					if (queryWidgets.size() > 0) {
+						// System.out.println("remove field");
+						AssistedQueryWidget lastwidget = queryWidgets.get(queryWidgets.size() - 1);
+						lastwidget.setSize(200, 30);
+						queryWidgets.remove(queryWidgets.size() - 1);
+						lastwidget.dispose();
+						sc1.layout(true);
+						queriesFocusComposite.layout(true);
+						sc1.setMinSize(queriesFocusComposite.computeSize(SWT.DEFAULT, SWT.DEFAULT));
+					}
+				}
+			});
+
+			// fill fields from result data
+			queries = this.getResultData().getQueries();
+			if (queries == null) {
+				addFocusQueryField();
+			}
+			else {
+				for (Query q : queries) {
+					addFocusQueryField().setText(q.getQueryString());
+				}
+			}
+			
+			
+			// Compute button
+			Button computeButton = new Button(paramPanel, SWT.NONE);
+			computeButton.setText("Compute");
+			computeButton.addSelectionListener(new SelectionListener() {
+				
+				@Override
+				public void widgetSelected(SelectionEvent evt) {
+					// TODO Auto-generated method stub
+					queries = new ArrayList<Query>();
+					for (AssistedQueryWidget wid : queryWidgets) {
+						if (!wid.getQueryString().equals("\"\"")) { //$NON-NLS-1$
+							queries.add(new Query(wid.getQueryString()));
+							wid.memorize();
+						}
+					}
+
+					if (propertyCombo.getSelectionIndex() > 0) {
+						selectedStructuralUnitProperty = structuralUnitsProperties.get(propertyCombo.getSelectionIndex() - 1);
+					}
+					else {
+						selectedStructuralUnitProperty = null;
+					}
+					if (structuralUnitsCombo.getSelectionIndex() > 0) {
+						selectedStructuralUnit = structuralUnits.get(structuralUnitsCombo.getSelectionIndex() - 1);
+					}
+					else {
+						selectedStructuralUnit = null;
+						selectedStructuralUnitProperty = null;// need a structuralunit
+					}
+
+					try {
+						Pattern.compile(regexValue.getText());
+						regexpropertyValue = regexValue.getText();
+
+						if (regexpropertyValue.length() == 0) {
+							regexpropertyValue = null;
+						}
+					} catch (PatternSyntaxException e) {
+						System.out.println(RCPMessages.ProgressionDialog_10 + e);
+					}
+
+					cumulative = cumuButton.getSelection();
+					monostyle = styleButton.getSelection();
+					repeatvalues = repeatButton.getSelection();
+					String smultibande = bandeField.getText();
+					if (smultibande != null && smultibande.length() > 0) {
+						try {
+							bandemultiplier = Float.parseFloat(smultibande);
+						} catch(Exception e) {
+							bandemultiplier = 1.0f;
+							System.out.println(RCPMessages.ProgressionDialog_17+e);
+							StatusLine.error(RCPMessages.ProgressionDialog_17+e);
+						}
+					}
+					else	{
+						bandemultiplier = 1.0f;
+					}
+
+					((Progression)getResultData()).setParameters(queries, selectedStructuralUnit, selectedStructuralUnitProperty, regexpropertyValue, cumulative, linewidth, repeatvalues, bandemultiplier);
+					computeChart(false);
+					
+				}
+				
+				@Override
+				public void widgetDefaultSelected(SelectionEvent e) {
+					// TODO Auto-generated method stub
+					
+				}
+			});
+			
+		} catch (Exception e) {
+			Log.printStackTrace(e);
+		}
+		
+		
 	}
 	
+	/**
+	 * Reloads the properties of the current selected structural unit.
+	 */
+	private void reloadSUProperties() {
+		
+		propertyCombo.removeAll();
+		propertyCombo.add("    "); //$NON-NLS-1$
+
+		int selectedSUPIndex = 0;
+		
+		if (structuralUnitsCombo.getSelectionIndex() > 0) {
+			selectedStructuralUnit = structuralUnits.get(structuralUnitsCombo.getSelectionIndex() - 1);
+			structuralUnitsProperties = selectedStructuralUnit.getOrderedProperties();
+			
+			for(int i = 0; i < structuralUnitsProperties.size(); i++) {
+				propertyCombo.add(structuralUnitsProperties.get(i).getName());
+				if(getResultData().getProperty() == structuralUnitsProperties.get(i))	{
+					selectedSUPIndex = (i + 1);
+				}
+			}
+		}
+		if (propertyCombo.getItemCount() > 0) {
+			propertyCombo.select(selectedSUPIndex);
+		}
+	}
+	
+	/**
+	 * Adds a query field.
+	 *
+	 * @return the assisted query widget
+	 */
+	private AssistedQueryWidget addFocusQueryField(String text) {
+		AssistedQueryWidget focusTextBox = new AssistedQueryWidget(queriesFocusComposite, SWT.BORDER, this.getResultData().getCorpus());
+		GridData gridData = new GridData(GridData.FILL, GridData.FILL, true, false);
+		focusTextBox.setLayoutData(gridData);
+		focusTextBox.setFocus();
+		queryWidgets.add(focusTextBox);
+		return focusTextBox;
+	}
+
+	/**
+	 * Adds an empty query field.
+	 * @return
+	 */
+	private AssistedQueryWidget addFocusQueryField() {
+		return this.addFocusQueryField("");
+	}
+
+	
+	@Override
+	public Progression getResultData() {
+		return (Progression) super.getResultData();
+	}
 }
Index: tmp/org.txm.progression.rcp/src/org/txm/progression/rcp/handlers/ComputeProgression.java
===================================================================
--- tmp/org.txm.progression.rcp/src/org/txm/progression/rcp/handlers/ComputeProgression.java	(revision 536)
+++ tmp/org.txm.progression.rcp/src/org/txm/progression/rcp/handlers/ComputeProgression.java	(revision 537)
@@ -29,32 +29,17 @@
 
 import org.eclipse.core.commands.ExecutionEvent;
 import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.core.runtime.jobs.Job;
-import org.eclipse.jface.window.Window;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.handlers.HandlerUtil;
 import org.txm.chartsengine.core.ChartsEngine;
-import org.txm.chartsengine.core.preferences.ChartsEnginePreferences;
 import org.txm.chartsengine.r.core.RChartsEngine;
 import org.txm.chartsengine.rcp.SWTChartsComponentsProvider;
 import org.txm.chartsengine.rcp.editors.ChartEditorPart;
 import org.txm.chartsengine.svgbatik.rcp.SVGSWTChartsComponentsProvider;
-import org.txm.core.preferences.TXMPreferences;
 import org.txm.progression.core.functions.Progression;
 import org.txm.progression.core.messages.ProgressionCoreMessages;
 import org.txm.progression.core.preferences.ProgressionPreferences;
 import org.txm.progression.rcp.dialogs.ProgressionDialog;
-import org.txm.rcp.JobsTimer;
-import org.txm.rcp.RCPMessages;
-import org.txm.rcp.StatusLine;
 import org.txm.rcp.handlers.BaseAbstractHandler;
-import org.txm.rcp.utils.JobHandler;
 import org.txm.rcp.views.corpora.CorporaView;
-import org.txm.searchengine.cqp.CQPEngine;
 import org.txm.searchengine.cqp.corpus.Corpus;
 import org.txm.utils.logger.Log;
 
@@ -99,17 +84,24 @@
 				return null;
 			}
 
+			// FIXME: old code with Dialog box parameters
+//			Shell shell = HandlerUtil.getActiveWorkbenchWindowChecked(event).getShell();
+//			ProgressionDialog d = new ProgressionDialog(shell, corpus);
+//			
+//			int code = d.open();
+//			if (code == Window.OK) {
+//				//computeProgression(d);
+//				
+//				progression = new Progression(d.getCorpus(), d.getQueries(), d.getStructuralUnit(), d.getStructuralProperty(), d.getPropertyregex(),
+//						d.isCumulativeType(), d.getLineWidth(), d.isRepeatvalues(), d.getBandeMultiplier());
+//				
+//				
+//				progression = new Progression(d.getCorpus());
+//				
+//			}
 			
-			Shell shell = HandlerUtil.getActiveWorkbenchWindowChecked(event).getShell();
-			ProgressionDialog d = new ProgressionDialog(shell, corpus);
+			progression = new Progression(corpus);
 			
-			int code = d.open();
-			if (code == Window.OK) {
-				//computeProgression(d);
-				
-				progression = new Progression(d.getCorpus(), d.getQueries(), d.getStructuralUnit(), d.getStructuralProperty(), d.getPropertyregex(),
-						d.isCumulativeType(), d.getLineWidth(), d.isRepeatvalues(), d.getBandeMultiplier());
-			}
 
 		}
 		// Reopens a progression result with default preferences
@@ -118,28 +110,6 @@
 		}
 		
 		
-		openEditor(progression);
-		
-		return null;
-	}
-
-	
-	
-	
-	/**
-	 * 
-	 * @param progression
-	 * @param blackAndWhite
-	 * @param monoStyle
-	 * @param cumulative
-	 * @return
-	 */
-	public static ChartEditorPart openEditor(Progression progression) {
-		
-		
-		
-		ChartEditorPart editor = null;
-		
 		// FIXME: temporary force R/SVG version because the Progression density chart is not yet implemented in JFC mode
 		if(!progression.getBooleanParameterValue(ProgressionPreferences.CHART_CUMULATIVE))	{
 			SVGSWTChartsComponentsProvider tmpSWTComponentsProvider = (SVGSWTChartsComponentsProvider) SWTChartsComponentsProvider.getComponentsProvider(SVGSWTChartsComponentsProvider.class);
@@ -147,20 +117,19 @@
 			tmpSWTComponentsProvider.setChartsEngine(tmpChartsEngine);
 			
 			// Create and open the chart editor
-			editor = tmpSWTComponentsProvider.openEditor(progression);
+			ChartEditorPart.compute(progression, tmpSWTComponentsProvider);
+			
 		}
 		else	{
 			// Create and open the chart editor
-			editor = SWTChartsComponentsProvider.getCurrent().openEditor(progression);
-
+			ChartEditorPart.compute(progression);
 		}
+
 		
-		return editor;
+		return null;
 	}
+
 	
-	
-	
-	
 	/**
 	 * Computes progression and open the result editor.
 	 *
@@ -168,103 +137,103 @@
 	 */
 	@Deprecated
 	public Object computeProgression(final ProgressionDialog dialog) {
-		if (!this.checkCorpusEngine())	{
-			return false;
-		}
-
-		
-
-		
-		JobHandler job = new JobHandler(NLS.bind(ProgressionCoreMessages.ComputeProgression_2, dialog.getQueries(), dialog.getCorpus().getName())) {
-			@Override
-			protected IStatus run(IProgressMonitor monitor) {
-				
-				final Progression progression = new Progression(dialog.getCorpus(), dialog.getQueries(), dialog.getStructuralUnit(), dialog.getStructuralProperty(), dialog.getPropertyregex(),
-						dialog.isCumulativeType(), dialog.getLineWidth(), dialog.isRepeatvalues(), dialog.getBandeMultiplier());
-				
-				monitor = progression;
-				
-				this.runInit(monitor);
-				JobsTimer.start();
-				try {
-					final Corpus corpus = dialog.getCorpus();
-					if (dialog.getQueries().size() == 0) {
-						Log.severe(ProgressionCoreMessages.ComputeProgression_6);
-						return Status.CANCEL_STATUS;
-					}
-
-					
-
-					
-					// persistence
-					if(dialog.isBlackAndWhite())	{
-						TXMPreferences.putLocal(progression, ChartsEnginePreferences.RENDERING_COLORS_MODE, ChartsEngine.RENDERING_BLACK_AND_WHITE_MODE);	
-					}
-					TXMPreferences.putLocal(progression, ProgressionPreferences.CHART_MONO_STYLE, dialog.isMonoStyle());
-					TXMPreferences.putLocal(progression, ProgressionPreferences.CHART_CUMULATIVE, dialog.isCumulativeType());
-					
-					
-					
-					Log.info(NLS.bind(ProgressionCoreMessages.ComputeProgression_4, 
-							new Object[]{dialog.getCorpus(), dialog.getQueries(), dialog.getStructuralUnit(), dialog.getStructuralProperty(), dialog.isCumulativeType()}));
-					
-					monitor.worked(50);
-					
-					
-					if (monitor.isCanceled())	{
-						return Status.CANCEL_STATUS;
-					}
-					
-					boolean success = progression.compute(false, monitor);
-
-					
-					
-					
-					
-					// System.out.println("success : "+success);
-					if (success) {
-						syncExec(new Runnable() {
-							@Override
-							public void run() {
-								
-								openEditor(progression);
-									
-								StatusLine.setMessage(ProgressionCoreMessages.ComputeProgression_10);
-								
-							}
-						});
-					}
-					monitor.worked(45);
-
-					monitor.subTask(RCPMessages.RefreshingCorporaView);
-					//CorporaView.storeResult(corpus, progression);
-					
-					monitor.worked(5);
-					System.out.println(NLS.bind(ProgressionCoreMessages.ComputeProgression_12, progression.getPositionsCounts()));
-				} catch (ThreadDeath td) { 
-					return Status.CANCEL_STATUS;
-				} catch (Exception e) {
-					e.printStackTrace();
-					System.out.println(NLS.bind(ProgressionCoreMessages.ComputeProgression_13, e));
-					Log.severe(ProgressionCoreMessages.ComputeProgression_13 + Log.toString(e));
-					try {
-						System.out.println(RCPMessages.LastCQPError + CQPEngine.getCqiClient().getLastCQPError());
-					} catch (Exception e1) {
-						System.out.println(ProgressionCoreMessages.ComputeProgression_1 + e1);
-						Log.printStackTrace(e1);
-					}
-				} finally {
-					monitor.done();
-					JobsTimer.stopAndPrint();
-				}
-				return Status.OK_STATUS;
-			}
-		};
-		//jobhandler.setCurrentMonitor(progression);
-		//jobhandler.startJob();
-		job.setPriority(Job.DECORATE);
-		job.setUser(true);
-		job.schedule();
+//		if (!this.checkCorpusEngine())	{
+//			return false;
+//		}
+//
+//		
+//
+//		
+//		JobHandler job = new JobHandler(NLS.bind(ProgressionCoreMessages.ComputeProgression_2, dialog.getQueries(), dialog.getCorpus().getName())) {
+//			@Override
+//			protected IStatus run(IProgressMonitor monitor) {
+//				
+//				final Progression progression = new Progression(dialog.getCorpus(), dialog.getQueries(), dialog.getStructuralUnit(), dialog.getStructuralProperty(), dialog.getPropertyregex(),
+//						dialog.isCumulativeType(), dialog.getLineWidth(), dialog.isRepeatvalues(), dialog.getBandeMultiplier());
+//				
+//				monitor = progression;
+//				
+//				this.runInit(monitor);
+//				JobsTimer.start();
+//				try {
+//					final Corpus corpus = dialog.getCorpus();
+//					if (dialog.getQueries().size() == 0) {
+//						Log.severe(ProgressionCoreMessages.ComputeProgression_6);
+//						return Status.CANCEL_STATUS;
+//					}
+//
+//					
+//
+//					
+//					// persistence
+//					if(dialog.isBlackAndWhite())	{
+//						TXMPreferences.putLocal(progression, ChartsEnginePreferences.RENDERING_COLORS_MODE, ChartsEngine.RENDERING_BLACK_AND_WHITE_MODE);	
+//					}
+//					TXMPreferences.putLocal(progression, ProgressionPreferences.CHART_MONO_STYLE, dialog.isMonoStyle());
+//					TXMPreferences.putLocal(progression, ProgressionPreferences.CHART_CUMULATIVE, dialog.isCumulativeType());
+//					
+//					
+//					
+//					Log.info(NLS.bind(ProgressionCoreMessages.ComputeProgression_4, 
+//							new Object[]{dialog.getCorpus(), dialog.getQueries(), dialog.getStructuralUnit(), dialog.getStructuralProperty(), dialog.isCumulativeType()}));
+//					
+//					monitor.worked(50);
+//					
+//					
+//					if (monitor.isCanceled())	{
+//						return Status.CANCEL_STATUS;
+//					}
+//					
+//					boolean success = progression.compute(false, monitor);
+//
+//					
+//					
+//					
+//					
+//					// System.out.println("success : "+success);
+//					if (success) {
+//						syncExec(new Runnable() {
+//							@Override
+//							public void run() {
+//								
+//								openEditor(progression);
+//									
+//								StatusLine.setMessage(ProgressionCoreMessages.ComputeProgression_10);
+//								
+//							}
+//						});
+//					}
+//					monitor.worked(45);
+//
+//					monitor.subTask(RCPMessages.RefreshingCorporaView);
+//					//CorporaView.storeResult(corpus, progression);
+//					
+//					monitor.worked(5);
+//					System.out.println(NLS.bind(ProgressionCoreMessages.ComputeProgression_12, progression.getPositionsCounts()));
+//				} catch (ThreadDeath td) { 
+//					return Status.CANCEL_STATUS;
+//				} catch (Exception e) {
+//					e.printStackTrace();
+//					System.out.println(NLS.bind(ProgressionCoreMessages.ComputeProgression_13, e));
+//					Log.severe(ProgressionCoreMessages.ComputeProgression_13 + Log.toString(e));
+//					try {
+//						System.out.println(RCPMessages.LastCQPError + CQPEngine.getCqiClient().getLastCQPError());
+//					} catch (Exception e1) {
+//						System.out.println(ProgressionCoreMessages.ComputeProgression_1 + e1);
+//						Log.printStackTrace(e1);
+//					}
+//				} finally {
+//					monitor.done();
+//					JobsTimer.stopAndPrint();
+//				}
+//				return Status.OK_STATUS;
+//			}
+//		};
+//		//jobhandler.setCurrentMonitor(progression);
+//		//jobhandler.startJob();
+//		job.setPriority(Job.DECORATE);
+//		job.setUser(true);
+//		job.schedule();
 		return null;
 	}
 }
Index: tmp/org.txm.ca.rcp/.classpath
===================================================================
--- tmp/org.txm.ca.rcp/.classpath	(revision 536)
+++ tmp/org.txm.ca.rcp/.classpath	(revision 537)
@@ -1,11 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <classpath>
 	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
-	<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins">
-		<accessrules>
-			<accessrule kind="accessible" pattern="*"/>
-		</accessrules>
-	</classpathentry>
+	<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
 	<classpathentry kind="src" path="src"/>
 	<classpathentry kind="output" path="bin"/>
 </classpath>
Index: tmp/org.txm.ca.rcp/src/org/txm/ca/rcp/editors/CAEditor.java
===================================================================
--- tmp/org.txm.ca.rcp/src/org/txm/ca/rcp/editors/CAEditor.java	(revision 536)
+++ tmp/org.txm.ca.rcp/src/org/txm/ca/rcp/editors/CAEditor.java	(revision 537)
@@ -326,7 +326,7 @@
 
 		// FIXME: need to create ChartResult for CASingularValues + some ChartCreators 
 		// Editor part
-		EditorPart caSingularValuesEditorPart = new ChartEditorPart(SWTChartsComponentsProvider.getCurrent().createChartEditorInput(ca)); //$NON-NLS-1$ 
+		EditorPart caSingularValuesEditorPart = new ChartEditorPart(SWTChartsComponentsProvider.getCurrent().createChartEditorInput(ca, "Singular Values")); //$NON-NLS-1$ 
 		editors.add(caSingularValuesEditorPart);
 
 		// Editor input
Index: tmp/org.txm.chartsengine.jfreechart.rcp/src/org/txm/chartsengine/jfreechart/rcp/events/DefaultChartMouseListener.java
===================================================================
--- tmp/org.txm.chartsengine.jfreechart.rcp/src/org/txm/chartsengine/jfreechart/rcp/events/DefaultChartMouseListener.java	(revision 536)
+++ tmp/org.txm.chartsengine.jfreechart.rcp/src/org/txm/chartsengine/jfreechart/rcp/events/DefaultChartMouseListener.java	(revision 537)
@@ -288,7 +288,7 @@
 
 
 		}
-		if(renderer.getItemsSelector() != null)	{
+		if(renderer != null && renderer.getItemsSelector() != null)	{
 			renderer.getItemsSelector().setMouseOverItem(series, item);
 		}
 
Index: tmp/org.txm.chartsengine.jfreechart.rcp/src/org/txm/chartsengine/jfreechart/rcp/JFCSWTChartsComponentsProvider.java
===================================================================
--- tmp/org.txm.chartsengine.jfreechart.rcp/src/org/txm/chartsengine/jfreechart/rcp/JFCSWTChartsComponentsProvider.java	(revision 536)
+++ tmp/org.txm.chartsengine.jfreechart.rcp/src/org/txm/chartsengine/jfreechart/rcp/JFCSWTChartsComponentsProvider.java	(revision 537)
@@ -61,13 +61,12 @@
 	@Override
 	public boolean createChartContainer(ChartsEngine chartsEngine, ChartEditorInput chartEditorInput)	{
 
-		JFreeChart chart = (JFreeChart) chartEditorInput.getChart();
-			
-//		if(chart != null)	{
+		if(!chartEditorInput.getResult().isChartDirty())	{
 
+			JFreeChart chart = (JFreeChart) chartEditorInput.getChart();
+
 			ChartPanel chartPanel = ((JFCChartsEngine) chartsEngine).getJFCTheme().createChartPanel(this, chart);
 			
-			
 			chartEditorInput.setChartContainer(chartPanel);
 			
 
@@ -86,9 +85,9 @@
 			chartEditorInput.syncLocalPreferencesNode();
 			
 			return true;
-	//	}
+		}
 		
-		//return false;
+		return false;
 	}
 	
 	
Index: tmp/org.txm.chartsengine.jfreechart.rcp/src/org/txm/chartsengine/jfreechart/rcp/swt/JFCComposite.java
===================================================================
--- tmp/org.txm.chartsengine.jfreechart.rcp/src/org/txm/chartsengine/jfreechart/rcp/swt/JFCComposite.java	(revision 536)
+++ tmp/org.txm.chartsengine.jfreechart.rcp/src/org/txm/chartsengine/jfreechart/rcp/swt/JFCComposite.java	(revision 537)
@@ -4,25 +4,22 @@
 import java.awt.Component;
 import java.awt.EventQueue;
 import java.awt.Frame;
-import java.awt.Insets;
-import java.awt.Panel;
-import java.awt.Toolkit;
-import java.awt.datatransfer.Clipboard;
+import java.io.File;
 import java.util.EventListener;
 
+import javax.swing.JPanel;
+
 import org.eclipse.swt.SWT;
 import org.eclipse.swt.awt.SWT_AWT;
 import org.eclipse.swt.widgets.Composite;
 import org.jfree.chart.ChartMouseListener;
 import org.jfree.chart.ChartPanel;
-import org.jfree.chart.ChartTransferable;
 import org.jfree.chart.JFreeChart;
 import org.jfree.chart.plot.CategoryPlot;
 import org.jfree.chart.plot.XYPlot;
-import org.txm.ca.core.chartsengine.jfreechart.themes.highcharts.renderers.FCAItemSelectionRenderer;
+import org.txm.chartsengine.jfreechart.core.JFCChartsEngine;
 import org.txm.chartsengine.jfreechart.core.renderers.MultipleItemsSelector;
 import org.txm.chartsengine.jfreechart.core.renderers.interfaces.IRendererWithItemSelection;
-import org.txm.chartsengine.jfreechart.rcp.themes.base.swing.ItemSelectionJFCChartPanel;
 import org.txm.chartsengine.rcp.IChartComponent;
 import org.txm.chartsengine.rcp.editors.ChartEditorPart;
 import org.txm.chartsengine.rcp.events.EventCallBackHandler;
@@ -49,7 +46,10 @@
 
 	protected Frame frame;
 	
-	protected Panel rootPanel;
+	//FIXME: tests
+	//protected Panel rootPanel;
+	//protected JRootPane rootPanel;
+	protected JPanel rootPanel;
 	
 
 	/**
@@ -58,21 +58,35 @@
 	 * @param panel
 	 */
 	public JFCComposite(ChartEditorPart chartEditor, Composite parent) {
-		super(chartEditor, parent, SWT.EMBEDDED | SWT.NO_BACKGROUND);
+		//super(chartEditor, parent, SWT.EMBEDDED | SWT.NO_BACKGROUND);
+		super(chartEditor, parent, SWT.EMBEDDED);
 		//super(parent, SWT.EMBEDDED | SWT.NO_MERGE_PAINTS | SWT.NO_BACKGROUND); // do not fix the transparency problem
 
 		//this.chartComponent = (IChartComponent) panel;
-
 		// FIXME : transparency doesn't work with tool tips
 		// The problem here is that we normally need a JFrame but it seems to be impossible to embed a JFrame
 //		this.setBackgroundMode(SWT.INHERIT_FORCE); // do not fix
-//		panel.setOpaque(false); // do not fix
 //		ToolTipManager.sharedInstance().setLightWeightPopupEnabled(true); // do not fix
 
 		this.frame = SWT_AWT.new_Frame(this);
+		// Need to add an AWT Panel to fix mouse events and mouse cursors changes on Swing JPanel
+		//this.rootPanel = new Panel(new BorderLayout());
+		//this.rootPanel = new JRootPane();
+		this.rootPanel = new JPanel(new BorderLayout());
+		
+		
+		
+		this.frame.add(this.rootPanel);
 
 
-
+		
+		this.frame.setVisible(true);
+//		this.frame.pack();
+//		this.pack(true);
+//		parent.pack();
+//		this.layout(true);
+//		parent.layout(true);
+		
 		// To fix MAC OS X + Java 1.7/1.8 SWT_AWT BUG
 		// see: https://bugs.eclipse.org/bugs/show_bug.cgi?id=418245#c12
 //		SwingUtilities.invokeLater(new Runnable() {
@@ -253,6 +267,9 @@
 	public void loadChart(Object data) {
 		this.getChartPanel().setChart((JFreeChart) data);
 
+		// FIXME: for updating chart. The problem here is the theme is applied twice? one time at the creation and onn time at the update?
+		((JFCChartsEngine) this.chartEditor.getChartsEngine()).getJFCTheme().applyThemeToChart((JFreeChart) data, this.chartEditor.getResultData());
+		
 		// FIXME: tests, restore the zoom from local node
 		//this.zoom(x, y, zoomIn);
 		// FIXME: tests, restoring current zoom from result node
@@ -267,23 +284,31 @@
 
 	@Override
 	public void loadChart()	{
-		
-		// creates components if they not exist
-		if(this.chartComponent == null)	{
-			this.chartComponent = (IChartComponent) this.chartEditor.getEditorInput().getChartContainer();
+		if(!this.chartEditor.getResultData().isChartDirty())	{
+			// creates components if they not exist
+			if(this.chartComponent == null)	{
+				
+				this.chartEditor.getSWTChartsComponentsProvider().createChartContainer(this.chartEditor.getEditorInput());
+				this.chartComponent = (IChartComponent) this.chartEditor.getEditorInput().getChartContainer();
+				
+				this.rootPanel.add((Component) this.chartComponent);
+
+				this.frame.setVisible(true);
+			}
+
+			// loads the chart from the result
+			Object chart = this.chartEditor.getChart();
+			// recreates the chart if not of right type
+			// FIXME: does not work? step to reproduce : create a chart with R/SVG, close the editor, select JFC/Java2d as chart engine, double click on the result 
+			if(!(chart instanceof JFreeChart))	{
+				this.loadChart(this.chartEditor.getSWTChartsComponentsProvider().getChartsEngine().getChartCreator(this.chartEditor.getResultData()).createChart(this.chartEditor.getResultData()));
+			}
+			else	{
+				this.loadChart(this.chartEditor.getChart());
+			}
 			
-			// Need to add an AWT Panel to fix mouse events and mouse cursors changes on Swing JPanel
-			this.rootPanel = new Panel(new BorderLayout());
-			
-			this.rootPanel.add((Component) this.chartComponent);
-			this.frame.add(this.rootPanel);
-			this.frame.setVisible(true);
+			this.forceFocus();
 		}
-		
-		// loads the chart from the result
-		this.loadChart(this.chartEditor.getChart());
-		
-		this.forceFocus();
 	}
 
 	
Index: tmp/org.txm.cah.rcp/src/org/txm/cah/rcp/editors/AHCChartEditor.java
===================================================================
--- tmp/org.txm.cah.rcp/src/org/txm/cah/rcp/editors/AHCChartEditor.java	(revision 536)
+++ tmp/org.txm.cah.rcp/src/org/txm/cah/rcp/editors/AHCChartEditor.java	(revision 537)
@@ -7,7 +7,6 @@
 import org.eclipse.swt.custom.CLabel;
 import org.eclipse.swt.events.SelectionEvent;
 import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.graphics.Image;
 import org.eclipse.swt.widgets.Combo;
 import org.eclipse.swt.widgets.Composite;
 import org.eclipse.swt.widgets.Spinner;
@@ -17,9 +16,7 @@
 import org.txm.cah.core.preferences.AHCPreferences;
 import org.txm.cah.rcp.messages.AHCUIMessages;
 import org.txm.chartsengine.rcp.editors.ChartEditorPart;
-import org.txm.chartsengine.rcp.messages.SWTComponentsProviderMessages;
 import org.txm.core.preferences.TXMPreferences;
-import org.txm.core.results.TXMResult;
 import org.txm.rcp.IImageKeys;
 import org.txm.rcp.JobsTimer;
 import org.txm.rcp.utils.JobHandler;
Index: tmp/org.txm.cah.rcp/src/org/txm/cah/rcp/handlers/ComputeAHC.java
===================================================================
--- tmp/org.txm.cah.rcp/src/org/txm/cah/rcp/handlers/ComputeAHC.java	(revision 536)
+++ tmp/org.txm.cah.rcp/src/org/txm/cah/rcp/handlers/ComputeAHC.java	(revision 537)
@@ -148,14 +148,8 @@
 			} 
 		}
 
-		ChartEditorPart editor = ChartEditorPart.openEditor(ahc);
+		ChartEditorPart.compute(ahc);
 
-		// FIXME: obsolete? 
-		// computes if not reopening a result
-//		if(!(selection instanceof AHC))	{
-//			editor.computeResult();
-//		}
-		
 
 		return null;
 	}
Index: tmp/org.txm.cah.core/src/org/txm/cah/core/functions/AHC.java
===================================================================
--- tmp/org.txm.cah.core/src/org/txm/cah/core/functions/AHC.java	(revision 536)
+++ tmp/org.txm.cah.core/src/org/txm/cah/core/functions/AHC.java	(revision 537)
@@ -124,6 +124,7 @@
 		this.target = ca.getSymbol();
 	}
 
+	
 	public void setParameters(Boolean columns, String metric, Integer nCluster, String method) {
 		if (columns != null) this.pColumns = columns;
 		if (metric != null) this.pMetric = metric;
@@ -134,8 +135,6 @@
 
 	@Override
 	public boolean setParameters(TXMParameters parameters) {
-		this.parameters = parameters;
-		
 		try {
 			Boolean columns = this.getBooleanParameterValue(AHCPreferences.COLUMNS_COMPUTING);
 			String metric = this.getStringParameterValue(AHCPreferences.METRIC);
@@ -149,6 +148,25 @@
 		return true;
 	}
 
+//	@Override
+//	public void loadParameters() {
+//		this.setParameters(
+//				this.getBooleanParameterValue(AHCPreferences.COLUMNS_COMPUTING),
+//				this.getStringParameterValue(AHCPreferences.METRIC),
+//				this.getIntParameterValue(AHCPreferences.N_CLUSTERS),
+//				this.getStringParameterValue(AHCPreferences.METHOD)
+//				);
+//	}
+
+	
+	@Override
+	public boolean canCompute() {
+		return ca != null 
+				&& Arrays.binarySearch(AHC.getMethods(), pMethod) >= 0 
+				&& Arrays.binarySearch(AHC.getMetrics(), pMetric) >= 0
+				&& pNCluster >= 2;
+	}
+	
 	/**
 	 * Resets the cached data so the next getter calls will request the values from R.
 	 */
@@ -592,12 +610,6 @@
 		return this.getName();
 	}
 
-	@Override
-	public boolean canCompute() {
 
-		return ca != null 
-				&& Arrays.binarySearch(AHC.getMethods(), pMethod) >= 0 
-				&& Arrays.binarySearch(AHC.getMetrics(), pMetric) >= 0
-				&& pNCluster >= 2;
-	}
+
 }
Index: tmp/org.txm.rcp/src/main/java/org/txm/rcp/views/corpora/CorporaView.java
===================================================================
--- tmp/org.txm.rcp/src/main/java/org/txm/rcp/views/corpora/CorporaView.java	(revision 536)
+++ tmp/org.txm.rcp/src/main/java/org/txm/rcp/views/corpora/CorporaView.java	(revision 537)
@@ -64,6 +64,7 @@
 import org.eclipse.ui.internal.Workbench;
 import org.eclipse.ui.part.ViewPart;
 import org.txm.Toolbox;
+import org.txm.chartsengine.core.results.ChartResult;
 import org.txm.core.results.TXMResult;
 import org.txm.objects.Project;
 import org.txm.objects.SavedQuery;
@@ -234,8 +235,12 @@
 				
 				StatusLine.setMessage(mess);
 				// FIXME: Debug:
+				// FIXME: à repasser dans TXMResult.toString();
 				System.err.println("CorporaView.createPartControl(...).new SelectionListener() {...}.widgetSelected(): ********************************************************************************");
 				System.err.println("CorporaView.createPartControl(...).new SelectionListener() {...}.widgetSelected(): selected object = " + selectedItem);
+				if (selectedItem instanceof ChartResult) 	{
+					System.err.println("CorporaView.createPartControl(...).new SelectionListener() {...}.widgetSelected(): chart object = " + ((ChartResult)selectedItem).getChart());
+				}
 				System.err.println("CorporaView.createPartControl(...).new SelectionListener() {...}.widgetSelected(): selection full path name = " + ((TXMResult)selectedItem).getFullPathSimpleName() + " - " + ((TXMResult)selectedItem).getName());
 				System.err.println("CorporaView.createPartControl(...).new SelectionListener() {...}.widgetSelected(): direct children count = " + ((TXMResult)selectedItem).getResults().size());
 				System.err.println("CorporaView.createPartControl(...).new SelectionListener() {...}.widgetSelected(): direct visible children count = " + ((TXMResult)selectedItem).getResults(true).size());
@@ -301,6 +306,12 @@
 							@Override
 							protected IStatus run(IProgressMonitor monitor) {
 								DeleteObject.delete(sel);
+								this.syncExec(new Runnable() {
+									@Override
+									public void run() {
+										refresh();
+									}
+								});
 								return Status.OK_STATUS;
 							}
 						};
Index: tmp/org.txm.rcp/src/main/java/org/txm/rcp/utils/JobHandler.java
===================================================================
--- tmp/org.txm.rcp/src/main/java/org/txm/rcp/utils/JobHandler.java	(revision 536)
+++ tmp/org.txm.rcp/src/main/java/org/txm/rcp/utils/JobHandler.java	(revision 537)
@@ -30,24 +30,21 @@
 import java.util.concurrent.Semaphore;
 
 import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
 import org.eclipse.core.runtime.jobs.Job;
 import org.eclipse.swt.widgets.Composite;
 import org.eclipse.swt.widgets.Display;
-import org.eclipse.core.runtime.IProgressMonitor;
 import org.txm.rcp.RCPMessages;
 import org.txm.rcp.StatusLine;
 import org.txm.utils.logger.Log;
 
-// TODO: Auto-generated Javadoc
 /**
- * Simplified RCP Job that implements the Toolbox IProgressMonitor class to allow TBX functions to manager the Job monitor.
+ * Simplified RCP Job that implements the Toolbox IProgressMonitor class to allow TBX functions to manage the Job monitor.
+ * The implemented run method returns a Status.OK_STATUS or Status.CANCEL_STATUS that can be tested with the getResult() after the join method is called.
+ * It also must call the runInit method to allow the user to force to stop the JobThread.
  * 
- * the implemented run methods returns a Status.OK_STATUS or Status.CANCEL_STATUS that can be tested with the getResult() after the join method is called.
+ * @author nkredens
+ * @author mdecorde
  * 
- * it must also call the runInit method to allow the user to force stop the JobThread
- * 
- * @author mdecorde, nkredens
  */
 public abstract class JobHandler extends Job implements IProgressMonitor {
 
Index: tmp/org.txm.rcp/src/main/java/org/txm/rcp/commands/base/DeleteObject.java
===================================================================
--- tmp/org.txm.rcp/src/main/java/org/txm/rcp/commands/base/DeleteObject.java	(revision 536)
+++ tmp/org.txm.rcp/src/main/java/org/txm/rcp/commands/base/DeleteObject.java	(revision 537)
@@ -185,7 +185,7 @@
 				@Override
 				public void run() {
 					try {
-						RestartTXM.reloadViews();
+//						RestartTXM.reloadViews();
 						
 						//close corresponding editors
 						for(Object obj : allObjectDeleted) {
Index: tmp/org.txm.rcp/src/main/java/org/txm/rcp/editors/TXMEditorToolBar.java
===================================================================
--- tmp/org.txm.rcp/src/main/java/org/txm/rcp/editors/TXMEditorToolBar.java	(revision 536)
+++ tmp/org.txm.rcp/src/main/java/org/txm/rcp/editors/TXMEditorToolBar.java	(revision 537)
@@ -80,7 +80,17 @@
 		editorPart.parent.layout(true);
 	}
 	
+
 	/**
+	 * Shows/hides the command parameters group.
+	 * @param visible
+	 */
+	public void setComputingParametersVisible(boolean visible)	{
+		this.getItems()[0].setSelection(visible);
+		this.setVisible(((Group) this.editorPart.getParametersGroupsComposite().getChildren()[0]), visible);
+	}
+	
+	/**
 	 * Creates a <code>Group</code> with some configuration to make it visible/invisible and a <code>ToolItem</code> attached to the specified tool bar to show/hide this group.
 	 * 
 	 * @param composite
@@ -93,11 +103,11 @@
 	 */
 	public Group installGroup(String groupTitle, String buttonToolTip, String iconFilePath, boolean showGroup)	{
 
-		if (groups.containsKey(groupTitle)) {
-			return groups.get(groupTitle);
+		if (this.groups.containsKey(groupTitle)) {
+			return this.groups.get(groupTitle);
 		}
 		
-		final Group group = new Group(editorPart.getParametersGroupsComposite(), SWT.NONE);
+		final Group group = new Group(this.editorPart.getParametersGroupsComposite(), SWT.NONE);
 		group.setText(groupTitle);
 		
 		RowLayout layout = new RowLayout();
@@ -143,7 +153,7 @@
 			public void widgetDefaultSelected(SelectionEvent e) { }
 		});
 		
-		groups.put(groupTitle, group);
+		this.groups.put(groupTitle, group);
 		return group;
 	}
 }
Index: tmp/org.txm.rcp/src/main/java/org/txm/rcp/editors/TXMEditorPart.java
===================================================================
--- tmp/org.txm.rcp/src/main/java/org/txm/rcp/editors/TXMEditorPart.java	(revision 536)
+++ tmp/org.txm.rcp/src/main/java/org/txm/rcp/editors/TXMEditorPart.java	(revision 537)
@@ -13,6 +13,7 @@
 import org.eclipse.swt.widgets.Button;
 import org.eclipse.swt.widgets.Composite;
 import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.IEditorPart;
 import org.eclipse.ui.IEditorSite;
 import org.eclipse.ui.IWorkbenchPage;
 import org.eclipse.ui.IWorkbenchWindow;
@@ -368,9 +369,11 @@
 	protected abstract void initializeFields();
 	
 	/**
-	 * Synchronizes the editor with the result and refreshes the corpus view. 
+	 * Synchronizes the editor with the result and refreshes the corpus view.
+	 * Also fires a dirty property change.
 	 */
 	public void refresh()	{
+		this.firePropertyChange(IEditorPart.PROP_DIRTY);
 		this.synchronize();
 		CorporaView.refreshObject(this);
 	}
@@ -408,7 +411,7 @@
 	 */
 	public void close(final boolean deleteResult)	{
 		final EditorPart self = this;
-		getSite().getShell().getDisplay().syncExec(new Runnable() {
+		this.getSite().getShell().getDisplay().syncExec(new Runnable() {
 			@Override
 			public void run() {
 				getSite().getPage().closeEditor(self, false);
Index: tmp/org.txm.wordcloud.rcp/src/org/txm/wordcloud/rcp/editors/WordCloudEditor.java
===================================================================
--- tmp/org.txm.wordcloud.rcp/src/org/txm/wordcloud/rcp/editors/WordCloudEditor.java	(revision 536)
+++ tmp/org.txm.wordcloud.rcp/src/org/txm/wordcloud/rcp/editors/WordCloudEditor.java	(revision 537)
@@ -97,7 +97,7 @@
 				TXMPreferences.putLocalFloat(getResultData(), WordCloudPreferences.ROT, rotPerSpinner.getSelection());
 				TXMPreferences.putLocalBoolean(getResultData(), WordCloudPreferences.RANDOM_POSITION, randomOrderButton.getSelection());
 
-				computeChart("Compute Wordcloud", true, true);
+				computeChart(true, true, true);
 			}
 
 
@@ -110,7 +110,7 @@
 		p.pack();
 
 		this.computeResult();
-		this.computeChart("Compute Wordcloud", false);
+		this.computeChart(false);
 
 		Log.info(WordCloudUIMessages.Log_WordCloud_ready + this.getResultData());
 
Index: tmp/org.txm.partition.rcp/META-INF/MANIFEST.MF
===================================================================
--- tmp/org.txm.partition.rcp/META-INF/MANIFEST.MF	(revision 536)
+++ tmp/org.txm.partition.rcp/META-INF/MANIFEST.MF	(revision 537)
@@ -3,7 +3,8 @@
 Bundle-Name: %Bundle-Name
 Bundle-SymbolicName: org.txm.partition.rcp;singleton:=true
 Bundle-Version: 1.0.0.qualifier
-Require-Bundle: org.txm.utils;bundle-version="1.0.0",
+Require-Bundle: org.txm.chartsengine.core,
+ org.txm.utils;bundle-version="1.0.0",
  org.eclipse.osgi;bundle-version="3.10.2",
  org.eclipse.core.runtime;bundle-version="3.10.0",
  org.eclipse.ui,
@@ -12,7 +13,6 @@
  org.txm.chartsengine.rcp,
  org.txm.partition.core,
  org.txm.rcp;bundle-version="0.7.8",
- org.txm.chartsengine.core,
  org.eclipse.core.expressions;bundle-version="3.4.600"
 Bundle-RequiredExecutionEnvironment: JavaSE-1.6
 Bundle-ActivationPolicy: lazy
Index: tmp/org.txm.partition.rcp/src/org/txm/partition/rcp/handlers/ComputePartitionDimensionsBarChart.java
===================================================================
--- tmp/org.txm.partition.rcp/src/org/txm/partition/rcp/handlers/ComputePartitionDimensionsBarChart.java	(revision 536)
+++ tmp/org.txm.partition.rcp/src/org/txm/partition/rcp/handlers/ComputePartitionDimensionsBarChart.java	(revision 537)
@@ -71,7 +71,6 @@
 		Object selection = this.getSelection(event);
 		PartitionDimensions partitionDimensions = null;
 		
-		
 		// Creating from Partition
 		if (selection instanceof Partition) {
 			Partition partition = (Partition) selection;
@@ -87,15 +86,12 @@
 			partitionDimensions = (PartitionDimensions) selection;
 		}
 
-//		final ChartEditorPart editor = SWTChartsComponentsProvider.getCurrent().openEditor(partitionDimensions, "Partition Dimensions Bar Chart"); //$NON-NLS-1$
 		
-		final ChartEditorPart editor = ChartEditorPart.openEditor(partitionDimensions); //$NON-NLS-1$
-		
 		// FIXME: Pie chart tests
-		//final ChartEditorPart editor2 = SWTChartsComponentsProvider.getCurrent().openEditor(partitionDimensions, "Partition Dimensions Pie Chart");
-
+//		partitionDimensions.setChartType("Partition Dimensions Pie Chart"); //$NON-NLS-1$
 		
-			
+		ChartEditorPart.compute(partitionDimensions); //$NON-NLS-1$
+
 		return null;
 	}
 	
Index: tmp/org.txm.partition.rcp/src/org/txm/partition/rcp/editors/PartitionDimensionsEditor.java
===================================================================
--- tmp/org.txm.partition.rcp/src/org/txm/partition/rcp/editors/PartitionDimensionsEditor.java	(revision 536)
+++ tmp/org.txm.partition.rcp/src/org/txm/partition/rcp/editors/PartitionDimensionsEditor.java	(revision 537)
@@ -9,9 +9,8 @@
 import org.eclipse.swt.widgets.Composite;
 import org.eclipse.swt.widgets.ToolItem;
 import org.txm.chartsengine.rcp.editors.ChartEditorPart;
-import org.txm.core.preferences.TXMPreferences;
+import org.txm.partition.core.functions.PartitionDimensions;
 import org.txm.partition.core.preferences.PartitionDimensionsPreferences;
-import org.txm.partition.rcp.handlers.ComputePartitionDimensionsBarChart;
 import org.txm.partition.rcp.messages.PartitionUIMessages;
 import org.txm.rcp.IImageKeys;
 
@@ -33,7 +32,7 @@
 		// extend the tool bar
 		new ToolItem(this.getToolBar(), SWT.SEPARATOR);
 		final ToolItem sortByPartSize = new ToolItem(this.getToolBar(), SWT.CHECK);
-		sortByPartSize.setImage(IImageKeys.getImage(ComputePartitionDimensionsBarChart.class, "icons/silk_sort_by_size.png"));
+		sortByPartSize.setImage(IImageKeys.getImage(this.getClass(), "icons/silk_sort_by_size.png"));
 		sortByPartSize.setToolTipText(PartitionUIMessages.PreferencesPage_DIMENSIONS_SORT_BY_PARTS_SIZE);
 		sortByPartSize.setSelection(this.getBooleanParameterValue(PartitionDimensionsPreferences.CHART_DIMENSIONS_SORTED_BY_SIZE));
 		
@@ -41,7 +40,7 @@
 			
 			@Override
 			public void widgetSelected(SelectionEvent e) {
-				TXMPreferences.putLocal(getResultData(), PartitionDimensionsPreferences.CHART_DIMENSIONS_SORTED_BY_SIZE, sortByPartSize.getSelection());
+				((PartitionDimensions)getResultData()).setParameters(sortByPartSize.getSelection());
 				computeChart(true, false, true);
 			}
 			
Index: tmp/org.txm.chartsengine.raster.rcp/src/org/txm/chartsengine/raster/rcp/RasterImageChartsComponentProvider.java
===================================================================
--- tmp/org.txm.chartsengine.raster.rcp/src/org/txm/chartsengine/raster/rcp/RasterImageChartsComponentProvider.java	(revision 536)
+++ tmp/org.txm.chartsengine.raster.rcp/src/org/txm/chartsengine/raster/rcp/RasterImageChartsComponentProvider.java	(revision 537)
@@ -44,7 +44,7 @@
 
 	@Override
 	public ChartEditorInput createChartEditorInput(ChartResult result) {
-		ChartCreator chartCreator = this.getChartsEngine().getChartCreator(result.getClass(), result.getChartType());
+		ChartCreator chartCreator = this.getChartsEngine().getChartCreator(result);
 		File file = chartCreator.createChartFile(result);
 		// FIXME : to temporary restore the PS and PDF formats : need to be recoded if we decide to keep the PDF and PS view else to remove if we decide to keep only the feature as export
 		if(this.chartsEngine.getOutputFormat() == ChartsEngine.OUTPUT_FORMAT_PS || this.chartsEngine.getOutputFormat() == ChartsEngine.OUTPUT_FORMAT_PDF)	{
Index: tmp/org.txm.cooccurrence.core/src/org/txm/cooccurrence/core/functions/Cooccurrence.java
===================================================================
--- tmp/org.txm.cooccurrence.core/src/org/txm/cooccurrence/core/functions/Cooccurrence.java	(revision 536)
+++ tmp/org.txm.cooccurrence.core/src/org/txm/cooccurrence/core/functions/Cooccurrence.java	(revision 537)
@@ -953,15 +953,14 @@
 
 	@Override
 	public boolean setParameters(TXMParameters parameters) {
-		this.parameters = parameters;
 		try {
 			Corpus corpus = this.getCorpus();
 			boolean includeXpivot = (Boolean) this.getBooleanParameterValue(CooccurrencePreferences.INCLUDE_X_PIVOT);
-			Query query = new Query(this.parameters.get(CooccurrencePreferences.QUERY).toString());
+			Query query = new Query(parameters.get(CooccurrencePreferences.QUERY).toString());
 
 			StructuralUnit limit = corpus.getStructuralUnit(this.getStringParameterValue(CooccurrencePreferences.LIMIT));
 
-			List<Property> properties = (List<Property>)this.parameters.get(CooccurrencePreferences.PROPERTIES);
+			List<Property> properties = (List<Property>)parameters.get(CooccurrencePreferences.PROPERTIES);
 
 			int maxLeft = this.getIntParameterValue(CooccurrencePreferences.MAX_LEFT);
 			int minLeft = this.getIntParameterValue(CooccurrencePreferences.MIN_LEFT);
Index: tmp/org.txm.chartsengine.r.core/src/org/txm/chartsengine/r/core/themes/DefaultTheme.java
===================================================================
--- tmp/org.txm.chartsengine.r.core/src/org/txm/chartsengine/r/core/themes/DefaultTheme.java	(revision 536)
+++ tmp/org.txm.chartsengine.r.core/src/org/txm/chartsengine/r/core/themes/DefaultTheme.java	(revision 537)
@@ -50,7 +50,7 @@
 		1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3 }; 
 
 	/** The monowidths. */
-	public static int[] monowidths = {
+	public static int[] monoWidths = {
 		1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 }; 
 
 	public DefaultTheme() {
Index: tmp/org.txm.textsbalance.core/src/org/txm/textsbalance/core/functions/TextsBalance.java
===================================================================
--- tmp/org.txm.textsbalance.core/src/org/txm/textsbalance/core/functions/TextsBalance.java	(revision 536)
+++ tmp/org.txm.textsbalance.core/src/org/txm/textsbalance/core/functions/TextsBalance.java	(revision 537)
@@ -60,9 +60,42 @@
 		this.fMax = 0;
 	}
 
+	
+//	@Override
+//	public void loadParameters() {
+//		// TODO Auto-generated method stub
+//		try {
+//			StructuralUnit su = this.getCorpus().getStructuralUnit(this.getStringParameterValue(TextsBalancePreferences.STRUCTURAL_UNIT));
+//			String prop = su.getProperties().get(this.getIntParameterValue(TextsBalancePreferences.STRUCTURAL_UNIT_PROPERTY_INDEX)).getName();
+//			this.setParameters(this.getIntParameterValue(TextsBalancePreferences.METHOD), su, prop, this.getBooleanParameterValue(TextsBalancePreferences.GROUP_BY_WORDS));
+//		}
+//		catch(CqiClientException e) {
+//			// TODO Auto-generated catch block
+//			e.printStackTrace();
+//		}
+//	}
+
+	/**
+	 * 
+	 * @param method
+	 * @param su
+	 * @param suPropertyName
+	 * @param groupByTexts
+	 */
+	public void setParameters(int method, StructuralUnit su, String suPropertyName, boolean groupByTexts) {
+		this.su = su;
+		this.suPropertyName = suPropertyName;
+		this.groupByTexts = groupByTexts;
+		this.method = method;
+		
+		this.setDirty();
+		this.setChartDirty();
+	}
+	
+	
+	
 	@Override
 	public boolean setParameters(TXMParameters parameters) {
-		this.parameters = parameters;
 		try {
 			StructuralUnit su = this.getCorpus().getStructuralUnit((String) parameters.get(TextsBalancePreferences.STRUCTURAL_UNIT));
 			int method = (Integer)parameters.get(TextsBalancePreferences.METHOD);
@@ -78,14 +111,6 @@
 		}
 		return true;
 	}
-	
-	public void setParameters(int method, StructuralUnit su, String suPropertyName, boolean groupByTexts) {
-		this.su = su;
-		this.suPropertyName = suPropertyName;
-		this.groupByTexts = groupByTexts;
-		this.method = method;
-	}
-	
 
 	/**
 	 * @param method 1: use CQL to solve matches, 2 uses corpus struct indexes, 2 is faster !
@@ -306,4 +331,6 @@
 	public boolean canCompute() {
 		return getCorpus() != null;
 	}
+
+
 }
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 536)
+++ tmp/org.txm.index.core/src/org/txm/index/core/functions/Index.java	(revision 537)
@@ -848,8 +848,6 @@
 
 	@Override
 	public boolean setParameters(TXMParameters parameters) {
-		this.parameters = parameters;
-
 		try {
 			List<Property> props = (List<Property>) parameters.get("props");
 			Query query = (Query) parameters.get("query");
Index: tmp/org.txm.chartsengine.core/src/org/txm/chartsengine/core/results/ChartResult.java
===================================================================
--- tmp/org.txm.chartsengine.core/src/org/txm/chartsengine/core/results/ChartResult.java	(revision 536)
+++ tmp/org.txm.chartsengine.core/src/org/txm/chartsengine/core/results/ChartResult.java	(revision 537)
@@ -25,59 +25,78 @@
 	protected String chartType;
 	
 	/**
+	 * The chart dirty state.
+	 */
+	protected boolean chartDirty;
+	
+	/**
 	 * 
 	 * @param parent
 	 */
 	public ChartResult(TXMResult parent) {
 		super(parent);
+		this.chartDirty = true;
 	}
 	
 	
-	@Override
-	public Object clone() {
-		ChartResult clone = null;
-	    try {
-			clone = (ChartResult) super.clone();
-		}
-		catch(Exception e) {
-		}
-	    return clone;
+	public ChartResult() {
+		this(null);
 	}
 	
-	/**
-	 * 
-	 * @param update
-	 * @return
-	 * @throws Exception
-	 */
+
 	public boolean computeChart(boolean update) throws Exception {
 
-		ChartCreator chartCreator = ChartsEngine.getCurrent().getChartCreator(this.getClass(), chartType);
+		this.subTask("computing chart");
+
+		// FIXME: Debug
+		System.err.println("ChartResult.computeChart(): computing chart of type " + this.getClass() + "...");
+
+		if(!this.chartDirty)	{
+			
+			// FIXME: Debug
+			System.err.println("ChartResult.computeChart(): chart is not dirty, computing aborted.");
+
+			return false;
+		}
+
+		
+		ChartCreator chartCreator = ChartsEngine.getCurrent().getChartCreator(this);
 		if(chartCreator != null)	{
 			
 			if(update)	{
 				// FIXME: debug
-				System.err.println("ChartResult._compute(): updating chart.");
+				System.err.println("ChartResult.computeChart(): updating chart.");
 				
 				chartCreator.updateChart(this.chart, this);
 			}
 			else	{
 				
 				// FIXME: debug
-				System.err.println("ChartResult._compute(): creating chart.");
+				System.err.println("ChartResult.computeChart(): creating chart.");
 				
 				this.chart =  chartCreator.createChart(this);				
 			}
 			
-			this.dirty = false;
+			this.chartDirty = false;
 			return true;
 			
 		}
 		return false;
 	}
 	
+	@Override
+	public Object clone() {
+		ChartResult clone = null;
+	    try {
+			clone = (ChartResult) super.clone();
+			clone.chart = null;
+			clone.chartDirty = true;
+		}
+		catch(Exception e) {
+		}
+	    return clone;
+	}
 	
-	
 	/**
 	 * @return the chart
 	 */
@@ -104,6 +123,27 @@
 		}
 		this.chartType = chartType;
 	}
+
+
+	/**
+	 * @return the chartDirty
+	 */
+	public boolean isChartDirty() {
+		return chartDirty;
+	}
+
+	@Override
+	public void setDirty() {
+		super.setDirty();
+		this.setChartDirty();
+	}
+
+	/**
+	 * 
+	 */
+	public void setChartDirty() {
+		this.chartDirty = true;
+	}
 	
 	
 
Index: tmp/org.txm.chartsengine.core/src/org/txm/chartsengine/core/ChartsEngine.java
===================================================================
--- tmp/org.txm.chartsengine.core/src/org/txm/chartsengine/core/ChartsEngine.java	(revision 536)
+++ tmp/org.txm.chartsengine.core/src/org/txm/chartsengine/core/ChartsEngine.java	(revision 537)
@@ -93,6 +93,7 @@
 	/**
 	 * UI related, this preference can be used to tell if the chart must be updated directly after editing a widget value or only after pressed a "Compute" button.
 	 */
+	//FIXME: this preference is not used at this time, see if it's useless or not.
 	protected boolean directComputing; 
 
 	/**
@@ -107,38 +108,49 @@
 		this.description = description;
 		this.outputFormat = outputFormat;
 		this.theme = new Theme();
+		//FIXME: this preference is not used at this time, see if it's useless or not.
 		this.directComputing = true;
 		Log.warning("Starting Charts Engine: " + this);
 	}
 
 	/**
-	 * Gets a chart creator for the specified result data type and chart type.
+	 * Gets a chart creator for the specified result.
 	 * @param resultDataType
 	 * @param chartType
 	 * @return A chart creator if it exists otherwise <code>null</code>
 	 */
-	public ChartCreator getChartCreator(Class resultDataType, String chartType)	{
+	public ChartCreator getChartCreator(ChartResult result, String chartType)	{
 		ChartCreator chartCreator = null;
-		HashMap<String, ChartCreator> map = this.chartCreators.get(resultDataType);
+		HashMap<String, ChartCreator> map = this.chartCreators.get(result.getClass());
 		if(map != null)	{
 			chartCreator = map.get(chartType);
 		}
 		
 		if(chartCreator == null)	{
-			Log.warning(this.name + ": No chart creator can be found for result: " + resultDataType + " and chart type: " + chartType);
+			Log.warning(this.name + ": No chart creator can be found for result: " + result.getClass() + " and chart type: " + chartType);
 		}
 		return chartCreator;
 	}
 	
 	/**
-	 * Gets a chart creator for the specified result data type.
+	 * Gets a chart creator for the specified result.
 	 * @param resultDataType
 	 * @return A chart creator if it exists otherwise <code>null</code>
 	 */
+	public ChartCreator getChartCreator(ChartResult result)	{
+		return this.getChartCreator(result, result.getChartType());
+	}
+
+	/**
+	 *  Gets a chart creator for the specified result data type.
+	 * @param resultDataType
+	 * @return
+	 */
 	public ChartCreator getChartCreator(Class resultDataType)	{
-		return this.getChartCreator(resultDataType, null);
+		return this.getChartCreator(resultDataType);
 	}
 
+	
 	/**
 	 * Gets a list of all installed chart creators for the specified result. 
 	 * @param resultDataType
@@ -181,7 +193,7 @@
 		
 		log +=".";
 		
-		Log.warning(log);
+		Log.info(log);
 		
 	}
 
@@ -191,8 +203,8 @@
 	 * @param chartType
 	 * @return <code>True</code> if a chart creator can be found, otherwise <code>false</code>
 	 */
-	public boolean canCreateChart(Class resultDataType, String chartType)	{
-		return this.getChartCreator(resultDataType, chartType) != null;
+	public boolean canCreateChart(ChartResult result, String chartType)	{
+		return this.getChartCreator(result, chartType) != null;
 	}
 
 	/**
@@ -200,8 +212,8 @@
 	 * @param resultDataType
 	 * @return <code>True</code> if a chart creator can be found, otherwise <code>false</code>
 	 */
-	public boolean canCreateChart(Class resultDataType)	{
-		return this.getChartCreator(resultDataType) != null;
+	public boolean canCreateChart(ChartResult result)	{
+		return this.getChartCreator(result) != null;
 	}
 	
 	/**
@@ -563,7 +575,7 @@
 	 */
 	public Object createChart(ChartResult result, String chartType)	{
 		Object chart = null;
-		ChartCreator chartCreator = this.getChartCreator(result.getClass(), chartType);
+		ChartCreator chartCreator = this.getChartCreator(result, chartType);
 		if(chartCreator != null)	{
 			chart = chartCreator.createChart(result);
 		}
@@ -588,7 +600,7 @@
 	 * @param result
 	 */
 	public void updateChart(Object chart, ChartResult result)	{
-		ChartCreator chartCreator = this.getChartCreator(result.getClass(), result.getChartType());
+		ChartCreator chartCreator = this.getChartCreator(result, result.getChartType());
 		if(chartCreator != null)	{
 			chartCreator.updateChart(chart, result);
 		}
Index: tmp/org.txm.searchengine.cqp.core/src/org/txm/functions/diagnostic/Diagnostic.java
===================================================================
--- tmp/org.txm.searchengine.cqp.core/src/org/txm/functions/diagnostic/Diagnostic.java	(revision 536)
+++ tmp/org.txm.searchengine.cqp.core/src/org/txm/functions/diagnostic/Diagnostic.java	(revision 537)
@@ -143,7 +143,6 @@
 	
 	@Override
 	public boolean setParameters(TXMParameters parameters) {
-		this.parameters = parameters;
 		try {
 			Integer max = null;
 			Object o = parameters.get(CQPPreferences.MAXVALUE);
Index: tmp/org.txm.core/src/java/org/txm/core/preferences/TXMPreferences.java
===================================================================
--- tmp/org.txm.core/src/java/org/txm/core/preferences/TXMPreferences.java	(revision 536)
+++ tmp/org.txm.core/src/java/org/txm/core/preferences/TXMPreferences.java	(revision 537)
@@ -1078,6 +1078,7 @@
 					//FIXME: Debug
 					System.err.println("TXMPreferences.putLocal(): error, can't find a put method that matches the value type: " + value.getClass() + "=" + value + ".");
 				}
+		
 	}
 
 	private static void putLocalSerializable(TXMResult result, String key, Serializable value) {
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 536)
+++ tmp/org.txm.core/src/java/org/txm/core/results/TXMResult.java	(revision 537)
@@ -1,6 +1,3 @@
-/**
- * 
- */
 package org.txm.core.results;
 
 import java.io.File;
@@ -65,8 +62,6 @@
 	 */
 	protected boolean visible;
 
-	protected TXMParameters parameters = null;
-
 	/**
 	 * The command preferences node qualifier.
 	 */
@@ -92,19 +87,6 @@
 	 * @param parent
 	 */
 	public TXMResult(TXMResult parent) {
-		this(parent, null);
-	}
-
-	/**
-	 * Creates a new TXMResult, child of the specified parent.
-	 * 
-	 * @param parent
-	 * @param parameters
-	 */
-	public TXMResult(TXMResult parent, TXMParameters parameters) {
-
-		// FIXME: discuss about this method and validate it. Also discuss about
-		// a getInternalName() method that should also return an unique ID.
 		this.parent = parent;
 		this.createUUID();
 
@@ -115,16 +97,27 @@
 		}
 		this.children = new ArrayList<TXMResult>(1);
 		this.preferencesNodeQualifier = FrameworkUtil.getBundle(getClass()).getSymbolicName();
-		this.parameters = parameters;
 
 		this.constructorCalled = true; // if not set the compute method will
 										// always return false
 		// FIXME: Debug
 		// System.out.println("TXMResult.TXMResult(): default preferences node qualifier = "
 		// + this.preferencesNodeQualifier + ", class = " + getClass());
+
+		this.dirty = true;
 	}
 
 	/**
+	 * Creates a new TXMResult, child of the specified parent.
+	 * 
+	 * @param parent
+	 * @param parameters
+	 */
+	public TXMResult(TXMResult parent, TXMParameters parameters) {
+
+	}
+
+	/**
 	 * Creates and stores an UUID dedicated to persistence for this result.
 	 */
 	protected void createUUID() {
@@ -187,7 +180,7 @@
 	 * @return
 	 */
 	public int getIntParameterValue(String key) {
-		return TXMPreferences.getInt(key, this.parameters, this, this.preferencesNodeQualifier);
+		return TXMPreferences.getInt(key, this, this.preferencesNodeQualifier);
 	}
 
 	/**
@@ -198,7 +191,7 @@
 	 * @return
 	 */
 	public float getFloatParameterValue(String key) {
-		return TXMPreferences.getFloat(key, this.parameters, this, this.preferencesNodeQualifier);
+		return TXMPreferences.getFloat(key, this, this.preferencesNodeQualifier);
 	}
 
 	/**
@@ -209,7 +202,7 @@
 	 * @return
 	 */
 	public double getDoubleParameterValue(String key) {
-		return TXMPreferences.getDouble(key, this.parameters, this, this.preferencesNodeQualifier);
+		return TXMPreferences.getDouble(key, this, this.preferencesNodeQualifier);
 	}
 
 	/**
@@ -220,7 +213,7 @@
 	 * @return
 	 */
 	public boolean getBooleanParameterValue(String key) {
-		return TXMPreferences.getBoolean(key, this.parameters, this, this.preferencesNodeQualifier);
+		return TXMPreferences.getBoolean(key, this, this.preferencesNodeQualifier);
 	}
 
 	/**
@@ -231,7 +224,7 @@
 	 * @return
 	 */
 	public long getLongParameterValue(String key) {
-		return TXMPreferences.getLong(key, this.parameters, this, this.preferencesNodeQualifier);
+		return TXMPreferences.getLong(key, this, this.preferencesNodeQualifier);
 	}
 
 	/**
@@ -242,17 +235,14 @@
 	 * @return
 	 */
 	public String getStringParameterValue(String key) {
-		return TXMPreferences.getString(key, this.parameters, this, this.preferencesNodeQualifier);
+		return TXMPreferences.getString(key, this, this.preferencesNodeQualifier);
 	}
 
 	/**
-	 * Read the parameter stored in the Java class membres : the pXXXXX named
-	 * members
+	 * Copies the parameters stored in the Java class members : the pXXXXX named members to the local preferences node.
+	 * Commands must define this method to persist their parameters.
+	 * Just returns <b>true</b> if you don't want to bother with this.
 	 * 
-	 * Commands must define this method to persist their parameters
-	 * 
-	 * just return 'true' if you don't want to bother with this
-	 * 
 	 * @return
 	 */
 	public boolean saveParameters() {
@@ -288,7 +278,7 @@
 			this.parent = null;
 			return true;
 		} catch (NullPointerException e) {
-			// do nothing
+			// does nothing
 		} catch (Exception e) {
 			e.printStackTrace();
 		}
@@ -727,15 +717,31 @@
 		// FIXME: Debug
 		System.err.println("TXMResult.compute(): computing result of type " + this.getClass() + "...");
 
-		if (!hasBeenConstructorCalled()) {
+		if(!this.isDirty())	{
+			
+			// FIXME: Debug
+			System.err.println("TXMResult.compute(): result is not dirty, computing skipped.");
+
+			return true;
+		}
+		
+		
+		if(!hasBeenConstructorCalled())	{
 			return false;
 		}
 
 		if (!canCompute()) {
+			// FIXME: Debug
+			System.err.println("TXMResult.compute(): missing or wrong parameters, computing aborted.");
+
 			return false;
 		}
 
 		if (!_compute(update)) {
+			
+			// FIXME: Debug
+			System.err.println("TXMResult.compute(): computing failed.");
+			
 			return false;
 		}
 
@@ -783,14 +789,12 @@
 		return constructorCalled;
 	}
 
-	// /**
-	// * Copy the parameters from the local preference node if exists. Also
-	// fills the non existent parameters with the command default preferences.
-	// * @return
-	// */
-	// public abstract boolean loadParameters();
-
 	/**
+	 * Copies the parameters from the local preference node if exists. Also fills the non existent parameters with the command default preferences.
+	 */
+	//public abstract void loadParameters();
+	
+	/**
 	 * 
 	 * @return the array of extensions to show in the FileDialog SWT widget
 	 */
Index: tmp/org.txm.core/src/java/org/txm/objects/Partition.java
===================================================================
--- tmp/org.txm.core/src/java/org/txm/objects/Partition.java	(revision 536)
+++ tmp/org.txm.core/src/java/org/txm/objects/Partition.java	(revision 537)
@@ -61,4 +61,6 @@
 		return false;
 	}
 
+
+
 }
Index: tmp/org.txm.core/src/java/org/txm/objects/TxmObject.java
===================================================================
--- tmp/org.txm.core/src/java/org/txm/objects/TxmObject.java	(revision 536)
+++ tmp/org.txm.core/src/java/org/txm/objects/TxmObject.java	(revision 537)
@@ -70,6 +70,7 @@
 		metadatas = new HashMap<String, Property>();
 	}
 
+	
 	/**
 	 * Gets the name.
 	 *
Index: tmp/org.txm.chartsengine.rcp/src/org/txm/chartsengine/rcp/SWTChartsComponentsProvider.java
===================================================================
--- tmp/org.txm.chartsengine.rcp/src/org/txm/chartsengine/rcp/SWTChartsComponentsProvider.java	(revision 536)
+++ tmp/org.txm.chartsengine.rcp/src/org/txm/chartsengine/rcp/SWTChartsComponentsProvider.java	(revision 537)
@@ -211,7 +211,8 @@
 	public boolean updateChart(ChartEditorPart editor)	{
 		try {
 			return editor.getResultData().compute(true);
-		} catch(Exception e) {
+		}
+		catch(Exception e) {
 			// TODO Auto-generated catch block
 			e.printStackTrace();
 		}
@@ -602,7 +603,7 @@
 		Log.info("SWTChartsComponentsProvider.openEditor(): opening editor with id " + editorPartId);
 		
 		// if the editor is already open or the charts engine can create the specified chart type
-		if(isAlreadyOpened || this.chartsEngine.canCreateChart(chartEditorInput.getResult().getClass(), chartEditorInput.getChartType()))	{
+		if(isAlreadyOpened || this.chartsEngine.canCreateChart(chartEditorInput.getResult()))	{
 			
 			//Log.info(this.name + " - Opening editor for result data type " + chartEditorInput.getResultData().getClass() + " and editor id " + editorPartId);
 
@@ -650,7 +651,7 @@
 			for(int i = 0; i < ChartsEngine.getChartsEngines().size() && !canCreate; i++) {
 				if(ChartsEngine.getChartsEngines().get(i) != this.chartsEngine)	{
 					ChartsEngine chartsEngine = ChartsEngine.getChartsEngines().get(i);
-					canCreate = chartsEngine.canCreateChart(chartEditorInput.getResult().getClass(), chartEditorInput.getChartType());
+					canCreate = chartsEngine.canCreateChart(chartEditorInput.getResult());
 					// get a provider that can manage the charts engine
 					if(canCreate)	{
 						SWTChartsComponentsProvider provider = SWTChartsComponentsProvider.getComponentsProvider(chartsEngine);
Index: tmp/org.txm.chartsengine.rcp/src/org/txm/chartsengine/rcp/editors/ChartEditorPart.java
===================================================================
--- tmp/org.txm.chartsengine.rcp/src/org/txm/chartsengine/rcp/editors/ChartEditorPart.java	(revision 536)
+++ tmp/org.txm.chartsengine.rcp/src/org/txm/chartsengine/rcp/editors/ChartEditorPart.java	(revision 537)
@@ -132,97 +132,11 @@
 	public void createPartControl(Composite parent) {
 		super.createPartControl(parent);
 		
-//		// to hide and display the command and rendering parameters composite
-//		this.initParentLayout(parent, 2);
-//		
-//		this.topToolBar = new TXMEditorToolBar(parent, SWT.FLAT, "top", this);
-//		
-//		
-//		GridData gd2 = new GridData();
-//		gd2.grabExcessHorizontalSpace = false;
-//		this.topToolBar.setLayoutData(gd2);
-//		//this.toolBar.setBackground(parent.getDisplay().getSystemColor(SWT.COLOR_WHITE));
-//		
-		
 		// Toolbar
 		this.chartToolBar = new ChartEditorToolBar(this.getTopToolBarContainer(), SWT.FLAT | SWT.RIGHT, this);
 		//this.chartToolBar = new ChartEditorToolBar(this.topToolBar, SWT.FLAT | SWT.RIGHT, this);
 		//this.chartToolBar.setBackground(parent.getDisplay().getSystemColor(SWT.COLOR_RED));
 
-		
-		// Tests with groups instead of tabs 
-		// FIXME: command parameters composite
-//		this.computingParametersGroup = new Composite(parent, SWT.NONE);
-//		this.commandParametersGroup = this.initCommandParametersGroup(2);
-//		this.commandParametersGroup.pack();
-
-		
-//		// FIXME: Tab folder tests
-//		final TabFolder tabFolder = new TabFolder(parent, SWT.TOP);
-//		GridData gd1 = new GridData();
-//		tabFolder.setLayoutData(gd1);
-//		gd1.exclude = true;
-//		tabFolder.setVisible(false);
-//		
-//		// Command parameters
-//		TabItem tabItem2 = new TabItem(tabFolder, SWT.NULL);
-//		tabItem2.setText("Command parameters");
-//		this.commandParametersComposite = new Composite(tabFolder, SWT.NONE);
-//		RowLayout layout2 = new RowLayout();
-//		layout2.marginLeft = 10;
-//		layout2.marginTop = 10;
-//		layout2.spacing = 8;
-//		layout2.wrap = true;
-//		layout2.center = true;
-//		this.commandParametersComposite.setLayout(layout2);
-//		tabItem2.setControl(this.commandParametersComposite);
-//
-//		// Charts rendering advanced tool bar
-//		TabItem tabItem = new TabItem(tabFolder, SWT.NULL);
-//		tabItem.setText("Charts rendering");
-//		this.advancedToolBar = new AdvancedChartEditorToolBar(tabFolder, SWT.FLAT, this);
-//		tabItem.setControl(this.advancedToolBar);
-////		this.advancedToolBar.setBackground(parent.getDisplay().getSystemColor(SWT.COLOR_WHITE));
-//		
-//		
-//		// FIXME: tests show/hide computing parameters
-//		final ToolItem showParameters = new ToolItem(this.toolBar, SWT.CHECK);
-//		showParameters.setImage(IImageKeys.getImage(this, "platform:/plugin/org.txm.rcp/icons/add.png"));
-//		showParameters.setToolTipText("Show/hide advanced parameters");
-//		showParameters.setSelection(false);
-//		
-//		showParameters.addSelectionListener(new SelectionListener() {
-//			
-//			@Override
-//			public void widgetSelected(SelectionEvent e) {
-//				
-//				
-//				((GridData)tabFolder.getLayoutData()).exclude = !showParameters.getSelection();
-//				tabFolder.setVisible(showParameters.getSelection());
-//				tabFolder.getParent().layout(true);
-//			}
-//			
-//			@Override
-//			public void widgetDefaultSelected(SelectionEvent e) {
-//				// TODO Auto-generated method stub
-//				
-//			}
-//		});
-//		
-//		// adapt the height of the tab folder to current tab height
-//		tabFolder.addSelectionListener(new SelectionAdapter() {
-//			@Override
-//			public void widgetSelected(SelectionEvent event) {
-//				tabFolder.getSelection()[0].getControl().pack(true);
-//				System.out.println("ChartEditorPart.createPartControl(...).new SelectionAdapter() {...}.widgetSelected(): current tab bounds " + tabFolder.getSelection()[0].getControl().getBounds());
-//				//tabFolder.setBounds(tabFolder.getBounds().x, tabFolder.getBounds().y, tabFolder.getBounds().width, tabFolder.getSelection()[0].getControl().getBounds().height * 2);
-//				//tabFolder.layout(true);
-//				//tabFolder.pack();
-//			}
-//		});
-
-		//new ToolItem(this.chartToolBar, SWT.SEPARATOR);
-		
 		// Advanced tool bar
 		//this.advancedToolBarComposite = new Composite(parent, SWT.NONE);
 		Group group = this.topToolBar.installGroup("Rendering parameters", "Show/Hide rendering parameters", "platform:/plugin/org.txm.chartsengine.rcp/icons/show_rendering_parameters.png", false);
@@ -255,13 +169,202 @@
 		//this.composite.setBackground(parent.getDisplay().getSystemColor(SWT.COLOR_WHITE));
 		//parent.setBackground(parent.getDisplay().getSystemColor(SWT.COLOR_WHITE));
 
+//		// FIXME: tests
+//		if(!this.getResultData().isChartDirty())	{
+//
+//			loadChart();
+//			
+//			// Initialize Swing/AWT events delegation.
+//			this.getSite().getShell().getDisplay().syncExec(new Runnable() {
+//				@Override
+//				public void run() {
+//					// initialize the default shared context menus as Export, etc.
+//					initDefaultContextMenus();;
+//	
+//					
+//					// registers user entries event call back extensions
+//					registerEventCallBackExtensions();
+//					
+//					//FIXME: test to contribute to menu only in some context
+//					// create chart editor part context
+//	//				IContextService contextService = (IContextService)getSite().getService(IContextService.class);
+//	//				contextService.activateContext(ChartEditorPart.class.getName());
+//	//				// create chart composite context
+//	//				contextService.activateContext(this.chartComposite.getClass().getName());
+//					
+//					//FIXME: description test
+//					//this.setContentDescription("details");
+//					//this.setContentDescription(this.getResultData().getDetails());
+//	
+//					initializeAWTDelegationListeners();
+//				}
+//			});
+//			
+//			this.refresh();
+//
+//		}
 		
-		this.computeChart(false);
+	}
+
+
+	/**
+	 * Initializes the default context menus.
+	 */
+	public void initDefaultContextMenus()	{
+		SWTChartsComponentsProvider.initDefaultContextMenus(this.chartComposite);
+	}
+	
+	
+	/**
+	 * Computes and creates or updates the char (from the linked editor input data)t.
+	 * @param update set if it's an update of an existing chart or a creation of a new chart
+	 */
+	public void computeChart(boolean update) {
+		this.computeChart(update, false, false);
+	}
+	
+	
+	/**
+	 * Computes and creates or updates the chart (from the linked editor input data).
+	 * @param jobName
+	 * @param update set if it's an update of an existing chart or a creation of a new chart
+	 * @param setUser if true, the progression bar dialog will be visible otherwise it will be reduced at bottom right status bar area.
+	 * @param resetView
+	 * @param clearChartItemsSelection
+	 */
+	public void computeChart(final boolean update, final boolean resetView, final boolean clearChartItemsSelection) {
+		compute(this.getResultData(), update, this, SWTChartsComponentsProvider.getCurrent(), resetView, clearChartItemsSelection);
+	}
+
+
+	
+	public static void compute(final ChartResult result)	{
+		compute(result, SWTChartsComponentsProvider.getCurrent());
+	}
+	
+	public static void compute(final ChartResult result, SWTChartsComponentsProvider chartsComponentsProvider)	{
+		compute(result, false, null, chartsComponentsProvider, false, false);
+	}
+	
+	/**
+	 * 
+	 * @param result
+	 * @param update
+	 * @param editor
+	 * @param chartsComponentsProvider
+	 * @param resetView
+	 * @param clearChartItemsSelection
+	 */
+	public static void compute(final ChartResult result, final boolean update, final ChartEditorPart editor, final SWTChartsComponentsProvider chartsComponentsProvider, final boolean resetView, final boolean clearChartItemsSelection)	{
 		
-		
-		
+		JobHandler job = new JobHandler("Computing result") {
+
+			ChartEditorPart editor2 = editor;
+			
+		    @Override
+		    protected IStatus run(IProgressMonitor monitor) {
+
+		    	this.runInit(monitor);
+		    	
+		    	try {
+
+		    		// computing result
+					monitor.beginTask("Computing", 100);
+
+					// FIXME: to restore when implemented
+//					if(!update)	{
+//						result.loadParameters();
+//					}
+					
+					if(result.compute(update, monitor))	{
+						monitor.worked(25);
+						
+						// creating/updating chart
+						result.computeChart(update);
+						monitor.worked(50);
+					}
+
+					// cancel
+					if(monitor.isCanceled())	{
+						return Status.CANCEL_STATUS;
+					}
+
+					// opening editor if not exists
+					if(editor2 == null)	{
+						this.syncExec(new Runnable() {
+							@Override
+							public void run() {
+								editor2 = chartsComponentsProvider.openEditor(result);
+							}
+						});
+					}
+					
+					// loading chart
+					monitor.subTask("loading chart");
+					editor2.loadChart(resetView, clearChartItemsSelection);
+
+					// if editor wasn't exist:
+					// hiding command parameters, updating tool bar buttons states, registering context menus and event user callbacks 
+					if(!update && !editor2.getResultData().isChartDirty())	{
+						this.syncExec(new Runnable() {
+							@Override
+							public void run() {
+								// FIXME: decide if we automatically hide or not the parameter area
+								//editor2.getTopToolbar().setComputingParametersVisible(false);
+								
+								// FIXME: tests to disable command if the chart is null and reenable it when the chart is computed 
+								//editor2.getChartToolBar().synchronize();
+								
+								// initialize the default shared context menus as Export, etc.
+								editor2.initDefaultContextMenus();
+						
+								// registers user entries event call back extensions
+								editor2.registerEventCallBackExtensions();
+								
+								//FIXME: test to contribute to menu only in some context
+								// create chart editor part context
+				//				IContextService contextService = (IContextService)getSite().getService(IContextService.class);
+				//				contextService.activateContext(ChartEditorPart.class.getName());
+				//				// create chart composite context
+				//				contextService.activateContext(this.chartComposite.getClass().getName());
+								
+								//FIXME: description test
+								//editor2..setContentDescription("details");
+								//editor2..setContentDescription(this.getResultData().getDetails());
+				
+								editor2.initializeAWTDelegationListeners();
+							}
+						});
+					}
+						
+
+					// refreshing the tree node
+					if(editor2 != null)	{
+						editor2.refresh();
+					}
+					
+					// done
+					monitor.done();
+				}
+		    	// for user direct canceling
+		    	catch(ThreadDeath td) {
+		    		// FIXME should clean() and/or set the result as dirty?
+		    		return Status.CANCEL_STATUS;
+		    	}
+				catch(Exception e) {
+					// TODO Auto-generated catch block
+					e.printStackTrace();
+				} 
+				return Status.OK_STATUS;
+		    }
+
+		};
+		job.setPriority(Job.DECORATE);
+		job.setUser(false);
+		job.schedule();
 	}
 
+	
 
 	/**
 	 * Registers user entries event call back extensions.
@@ -366,165 +469,9 @@
 	}
 
 	
-
 	
-	/**
-	 * Computes and creates or updates the char (from the linked editor input data)t.
-	 * @param update set if it's an update of an existing chart or a creation of a new chart
-	 */
-	public void computeChart(boolean update) {
-		this.computeChart(update, false, false);
-	}
-	
-	
-	/**
-	 * Computes and creates or updates the chart (from the linked editor input data).
-	 * @param jobName
-	 * @param update set if it's an update of an existing chart or a creation of a new chart
-	 */
-	public void computeChart(String jobName, boolean update) {
-		this.computeChart(jobName, update, false, false, false);
-	}
 
-	
 	/**
-	 * Computes and creates or updates the chart (from the linked editor input data).
-	 * @param update set if it's an update of an existing chart or a creation of a new chart
-	 * @param resetView
-	 * @param clearChartItemsSelection
-	 */
-	public void computeChart(boolean update, boolean resetView, boolean clearChartItemsSelection) {
-		this.computeChart("Computing chart", update, false, resetView, clearChartItemsSelection);
-	}
-	
-	/**
-	 * Computes and creates or updates the chart (from the linked editor input data).
-	 * @param jobName
-	 * @param update set if it's an update of an existing chart or a creation of a new chart
-	 * @param setUser
-	 */
-	public void computeChart(String jobName, boolean update, boolean setUser) {
-		this.computeChart(jobName, update, setUser, true, true);
-	}
-	
-	/**
-	 * Computes and creates or updates the chart (from the linked editor input data).
-	 * @param jobName
-	 * @param update set if it's an update of an existing chart or a creation of a new chart
-	 * @param setUser if true, the progression bar dialog will be visible otherwise it will be reduced at bottom right status bar area.
-	 * @param resetView
-	 * @param clearChartItemsSelection
-	 */
-	public void computeChart(String jobName, final boolean update, boolean setUser, final boolean resetView, final boolean clearChartItemsSelection) {
-		
-		
-		JobHandler job = new JobHandler(jobName) {
-
-		    @Override
-		    protected IStatus run(IProgressMonitor monitor) {
-
-		    	this.runInit(monitor);
-		    	
-		    	try {
-
-		    		// computing result
-					monitor.beginTask("Computing", 100);
-
-		    		// FIXME: temporary solution, should call super.computeResult() ?
-					if(getResultData().isDirty())	{
-						getResultData().compute(update, monitor);
-					}
-		    		
-					
-					// creating/updating chart
-					monitor.subTask("computing chart");
-
-					getResultData().computeChart(update);
-
-					if(!update)	{
-						createChartContainer();
-					}
-
-					// FIXME: long process test
-//					for(long i = 0; i < 9000000000L; i++)	{
-//						;
-//					}
-
-					monitor.worked(25);
-					
-					// cancel
-					if(monitor.isCanceled())	{
-						close(true);
-						return Status.CANCEL_STATUS;
-					}
-					
-					// loading
-					monitor.subTask("loading chart");
-					loadChart(resetView, clearChartItemsSelection);
-
-					if(!update)	{
-						// Initialize Swing/AWT events delegation.
-						this.syncExec(new Runnable() {
-							@Override
-							public void run() {
-								// initialize the default shared context menus as Export, etc.
-								SWTChartsComponentsProvider.initDefaultContextMenus(chartComposite);
-
-								
-								// registers user entries event call back extensions
-								registerEventCallBackExtensions();
-								
-								//FIXME: test to contribute to menu only in some context
-								// create chart editor part context
-//								IContextService contextService = (IContextService)getSite().getService(IContextService.class);
-//								contextService.activateContext(ChartEditorPart.class.getName());
-//								// create chart composite context
-//								contextService.activateContext(this.chartComposite.getClass().getName());
-								
-								//FIXME: description test
-								//this.setContentDescription("details");
-								//this.setContentDescription(this.getResultData().getDetails());
-
-								initializeAWTDelegationListeners();
-							}
-						});
-					}
-
-					
-					// FIXME: refresh the tree node
-//				getSite().getShell().getDisplay().syncExec(new Runnable() {
-//					@Override
-//					public void run() {
-							refresh();
-//					}
-//				});
-
-					
-					// done
-					monitor.done();
-				}
-		    	// for user direct canceling
-		    	catch(ThreadDeath td) {
-		    		// FIXME should clean() and/or set the result as dirty?
-		    		close(true);
-		    		return Status.CANCEL_STATUS;
-		    	}
-				catch(Exception e) {
-					// TODO Auto-generated catch block
-					e.printStackTrace();
-				} 
-				return Status.OK_STATUS;
-		    }
-
-		};
-		job.setPriority(Job.DECORATE);
-		job.setUser(setUser);
-		job.schedule();
-	}
-
-
-
-	/**
 	 * Initialize Swing/AWT events delegation.
 	 * @param swingComponent
 	 */
@@ -897,16 +844,6 @@
 
 
 	/**
-	 * Opens an editor for the specified result.
-	 * @param result
-	 * @return
-	 */
-	public static ChartEditorPart openEditor(ChartResult result)	{
-		return SWTChartsComponentsProvider.getCurrent().openEditor(result);
-	}
-	
-
-	/**
 	 * Checks whatever the chart composite has the focus or not.
 	 * @return <code>true</code> if the chart composite has the focus otherwise <code>false</code>
 	 */
@@ -934,4 +871,13 @@
 	public ChartComposite getChartComposite() {
 		return chartComposite;
 	}
+
+
+
+	/**
+	 * @return the chartToolBar
+	 */
+	public ChartEditorToolBar getChartToolBar() {
+		return chartToolBar;
+	}
 }
Index: tmp/org.txm.chartsengine.rcp/src/org/txm/chartsengine/rcp/swt/ChartEditorToolBar.java
===================================================================
--- tmp/org.txm.chartsengine.rcp/src/org/txm/chartsengine/rcp/swt/ChartEditorToolBar.java	(revision 536)
+++ tmp/org.txm.chartsengine.rcp/src/org/txm/chartsengine/rcp/swt/ChartEditorToolBar.java	(revision 537)
@@ -1,7 +1,12 @@
 package org.txm.chartsengine.rcp.swt;
 
+import org.eclipse.core.commands.Command;
 import org.eclipse.swt.widgets.Composite;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.commands.ICommandService;
+import org.eclipse.ui.handlers.IHandlerService;
 import org.txm.chartsengine.rcp.editors.ChartEditorPart;
+import org.txm.chartsengine.rcp.handlers.ExportChartEditorView;
 import org.txm.rcp.editors.TXMEditorToolBar;
 
 /**
@@ -36,6 +41,7 @@
 	public ChartEditorToolBar(Composite parent, int style, ChartEditorPart chartEditorPart) {
 		this(parent, style, "ChartEditorToolBar", chartEditorPart); //$NON-NLS-1$
 
+		
 		//FIXME: tests
 //		new ToolItem(this, SWT.SEPARATOR);
 //		
@@ -171,7 +177,35 @@
 //		showGrid.addSelectionListener(listener);
 	}
 
+	
+	/**
+	 * Synchronizes the tool bar with the chart result states.
+	 * Enables/disables button according to the chart result states.
+	 * 
+	 */
+	// FIXME: tests to disable command if the chart is null and reenable it when the chart is computed 
+//	public void synchronize()	{
+//		boolean enable = (this.getEditorPart().getResultData().getChart() != null);
+////		HandledContributionItem t = (HandledContributionItem) this.getItem(0).getData();
+//		System.out.println("ChartEditorToolBar.synchronize()");
+//		
+//		IHandlerService handlerService = (IHandlerService) PlatformUI.getWorkbench().getService(IHandlerService.class);
+//        ICommandService commandService = (ICommandService) PlatformUI.getWorkbench().getService(ICommandService.class);
+//        if (handlerService != null && commandService != null) {
+//                try {
+//                        Command command = commandService.getCommand(ExportChartEditorView.ID);
+//                        command.setEnabled(null);
+//                        //command.setEnabled(new Boolean(enable));
+//                } catch (Exception e) {
+//                	e.printStackTrace();
+//                }
+//        }
+//        else	{
+//        	System.err.println("ChartEditorToolBar.synchronize() can't get handler service");
+//        }
+//	}
 
+
 	@Override
 	public ChartEditorPart getEditorPart() {
 		return (ChartEditorPart) editorPart;
Index: tmp/org.txm.chartsengine.rcp/src/org/txm/chartsengine/rcp/swt/AdvancedChartEditorToolBar.java
===================================================================
--- tmp/org.txm.chartsengine.rcp/src/org/txm/chartsengine/rcp/swt/AdvancedChartEditorToolBar.java	(revision 536)
+++ tmp/org.txm.chartsengine.rcp/src/org/txm/chartsengine/rcp/swt/AdvancedChartEditorToolBar.java	(revision 537)
@@ -238,9 +238,10 @@
 					update = false;
 				}
 
+				chartEditorPart.getResultData().setChartDirty();
 				
-				// updates existing chart
-				chartEditorPart.computeChart("Update chart", update);
+				// updates or creates chart
+				chartEditorPart.computeChart(update);
 			}
 			
 			@Override
@@ -259,6 +260,4 @@
 	}
 
 
-
-
 }
Index: tmp/org.txm.chartsengine.rcp/src/org/txm/chartsengine/rcp/handlers/ExportChartEditorView.java
===================================================================
--- tmp/org.txm.chartsengine.rcp/src/org/txm/chartsengine/rcp/handlers/ExportChartEditorView.java	(revision 536)
+++ tmp/org.txm.chartsengine.rcp/src/org/txm/chartsengine/rcp/handlers/ExportChartEditorView.java	(revision 537)
@@ -31,9 +31,12 @@
 import java.io.IOException;
 //import java.nio.file.Files;
 
+
+
 import org.eclipse.core.commands.AbstractHandler;
 import org.eclipse.core.commands.ExecutionEvent;
 import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.commands.IHandler2;
 import org.eclipse.core.runtime.IProgressMonitor;
 import org.eclipse.core.runtime.IStatus;
 import org.eclipse.core.runtime.Status;
@@ -63,11 +66,19 @@
  * @author sjacquot
  *
  */
-public class ExportChartEditorView extends AbstractHandler {
+public class ExportChartEditorView extends AbstractHandler implements IHandler2 {
 
 	public static final String ID = "org.txm.chartsengine.rcp.handlers.ExportChartEditorView"; //$NON-NLS-1$
 
-
+	// FIXME: tests to disable command if the chart is null and reenable it when the chart is computed 
+//	public boolean isEnabled() {
+//		return false;
+//	}
+//	public void setEnabled(Object evaluationContext) {
+//		System.out.println("ExportChartEditorView.setEnabled()");
+//		//System.out.println("ExportChartEditorView.setEnabled(): " + evaluationContext);
+//		this.setBaseEnabled(false);
+//	}
 	
 	@Override
 	public Object execute(ExecutionEvent event) throws ExecutionException {
Index: tmp/org.txm.chartsengine.rcp/META-INF/MANIFEST.MF
===================================================================
--- tmp/org.txm.chartsengine.rcp/META-INF/MANIFEST.MF	(revision 536)
+++ tmp/org.txm.chartsengine.rcp/META-INF/MANIFEST.MF	(revision 537)
@@ -12,7 +12,8 @@
  org.txm.rcp;bundle-version="0.7.8",
  org.eclipse.core.resources,
  org.eclipse.swt,
- org.eclipse.core.expressions;bundle-version="3.4.600"
+ org.eclipse.core.expressions;bundle-version="3.4.600",
+ org.eclipse.e4.ui.workbench.renderers.swt
 Export-Package: org.txm.chartsengine.rcp,
  org.txm.chartsengine.rcp.editors,
  org.txm.chartsengine.rcp.events,
