Index: tmp/org.txm.properties.rcp/plugin.xml
===================================================================
--- tmp/org.txm.properties.rcp/plugin.xml	(revision 2246)
+++ tmp/org.txm.properties.rcp/plugin.xml	(revision 2247)
@@ -28,6 +28,13 @@
             id="org.txm.properties.rcp.editors.PropertiesEditor"
             name="%command.name">
       </editor>
+      <editor
+            class="org.txm.properties.rcp.editors.PropertiesPagedEditor"
+            default="false"
+            icon="icons/functions/properties.png"
+            id="org.txm.properties.rcp.editors.PropertiesPagedEditor"
+            name="%command.name">
+      </editor>
    </extension>
    <extension
          point="org.eclipse.core.runtime.adapters">
@@ -55,7 +62,7 @@
                   checkEnabled="false">
                <or>
                   <reference
-                        definitionId="OneCorpusSelected">
+                        definitionId="OneTXMResultSelected">
                   </reference>
                </or>
             </visibleWhen>
@@ -70,7 +77,7 @@
             <visibleWhen
                   checkEnabled="false">
                <reference
-                     definitionId="OneCorpusSelected">
+                     definitionId="OneTXMResultSelected">
                </reference>
             </visibleWhen>
          </command>
@@ -84,7 +91,7 @@
             <visibleWhen
                   checkEnabled="false">
                <reference
-                     definitionId="OneCorpusSelected">
+                     definitionId="OneTXMResultSelected">
                </reference>
             </visibleWhen>
          </command>
Index: tmp/org.txm.properties.rcp/src/org/txm/properties/rcp/handlers/ComputeProperties.java
===================================================================
--- tmp/org.txm.properties.rcp/src/org/txm/properties/rcp/handlers/ComputeProperties.java	(revision 2246)
+++ tmp/org.txm.properties.rcp/src/org/txm/properties/rcp/handlers/ComputeProperties.java	(revision 2247)
@@ -33,10 +33,9 @@
 import org.eclipse.core.commands.ExecutionException;
 import org.txm.core.results.TXMResult;
 import org.txm.properties.core.functions.Properties;
-import org.txm.properties.rcp.editors.PropertiesEditor;
+import org.txm.properties.rcp.editors.PropertiesPagedEditor;
 import org.txm.rcp.editors.TXMEditor;
 import org.txm.rcp.handlers.BaseAbstractHandler;
-import org.txm.rcp.views.corpora.CorporaView;
 import org.txm.searchengine.cqp.corpus.CQPCorpus;
 
 /**
@@ -47,39 +46,36 @@
  * @author sjacquot
  */
 public class ComputeProperties extends BaseAbstractHandler {
-	
-	
+
+
 	@Override
 	public Object execute(ExecutionEvent event) throws ExecutionException {
 
 		if (!this.checkCorpusEngine())	{
 			return false;
 		}
-		
+
 		Object selection = this.getCorporaViewSelectedObject(event);
 		Properties information = null;
-		
+
 		// Creating from Corpus
-		if (selection instanceof CQPCorpus) {
-			List<Properties> informations = (List<Properties>) ((CQPCorpus)selection).getChildren(Properties.class);
-			// only one instance
-			if (informations.size() > 0) {
+		if(selection instanceof Properties)	{
+			information = (Properties) selection;
+		} else if (selection instanceof TXMResult) {
+			List<Properties> informations = (List<Properties>) ((TXMResult)selection).getChildren(Properties.class);
+			if (informations.size() > 0) { // we want only one instance of Properties per TXMResult
 				information = informations.get(0);
 			}
 			else {
-				information = new Properties((CQPCorpus) selection);
+				information = new Properties((TXMResult) selection);
 			}
 		}
 		// Reopening from existing result
-		else if(selection instanceof Properties)	{
-			information = (Properties) selection;
-		}
-		// Error
-		else	{
+		else 	{
 			return super.logCanNotExecuteCommand(selection);
 		}
-		
-		TXMEditor.openEditor(information, PropertiesEditor.class.getName());
+
+		TXMEditor.openEditor(information, PropertiesPagedEditor.class.getName());
 		return null;
 	}
 }
Index: tmp/org.txm.properties.rcp/src/org/txm/properties/rcp/editors/PropertiesTXMResultTab.java
===================================================================
--- tmp/org.txm.properties.rcp/src/org/txm/properties/rcp/editors/PropertiesTXMResultTab.java	(revision 0)
+++ tmp/org.txm.properties.rcp/src/org/txm/properties/rcp/editors/PropertiesTXMResultTab.java	(revision 2247)
@@ -0,0 +1,64 @@
+package org.txm.properties.rcp.editors;
+
+import java.io.File;
+import java.net.MalformedURLException;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.browser.Browser;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.TabFolder;
+import org.eclipse.swt.widgets.TabItem;
+import org.txm.core.results.TXMResult;
+import org.txm.rcp.swt.GLComposite;
+import org.txm.utils.logger.Log;
+
+/**
+ * Page displayed if Properties parent is a Corpus
+ * 
+ * @author mdecorde
+ *
+ */
+public class PropertiesTXMResultTab extends PropertiesTab {
+
+	TXMResult result;
+	protected Browser browser;
+	
+	public PropertiesTXMResultTab(TabFolder folder, PropertiesPagedEditor editor) {
+		super(folder, editor);
+		
+		this.result = editor.getResult().getParent();
+		tab.setText(result.getResultType());
+		
+		buildContent(parent);
+	}
+	
+	protected void buildContent(GLComposite parent) {
+		this.browser = new Browser(parent, SWT.NONE);
+		this.browser.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, true));
+	}
+
+	@Override
+	public void updateResultFromEditor(boolean update) throws Exception {
+		
+	}
+
+	@Override
+	public void updateEditorFromResult() {
+		File file = this.editor.getResult().getHTMLFile();
+		if (file != null && file.exists()) {
+			try {
+				this.browser.setUrl(file.toURI().toURL().toString());
+			} catch (MalformedURLException e) {
+				// TODO Auto-generated catch block
+				e.printStackTrace();
+			}
+		} else {
+			Log.severe("Information HTML file doesn't exist."); //$NON-NLS-1$
+		}
+	}
+
+	public TabItem getTab() {
+		return tab;
+	}
+}

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

Index: tmp/org.txm.properties.rcp/src/org/txm/properties/rcp/editors/PropertiesGeneralTab.java
===================================================================
--- tmp/org.txm.properties.rcp/src/org/txm/properties/rcp/editors/PropertiesGeneralTab.java	(revision 0)
+++ tmp/org.txm.properties.rcp/src/org/txm/properties/rcp/editors/PropertiesGeneralTab.java	(revision 2247)
@@ -0,0 +1,155 @@
+package org.txm.properties.rcp.editors;
+
+import java.util.Date;
+
+import org.eclipse.jface.viewers.DecoratingLabelProvider;
+import org.eclipse.jface.viewers.IBaseLabelProvider;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.KeyEvent;
+import org.eclipse.swt.events.KeyListener;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.TabFolder;
+import org.eclipse.swt.widgets.Text;
+import org.txm.core.results.TXMResult;
+import org.txm.rcp.IImageKeys;
+import org.txm.rcp.views.corpora.CorporaView;
+
+public class PropertiesGeneralTab extends PropertiesTab {
+
+	private Text nameField;
+
+	public PropertiesGeneralTab(TabFolder folder, PropertiesPagedEditor editor2) {
+		super(folder, editor2);
+		tab.setText("General");
+		
+		parent.getLayout().numColumns = 3;
+		parent.getLayout().verticalSpacing = 10;
+		parent.getLayout().horizontalSpacing = 10;
+		parent.getLayout().marginTop = 10;
+		parent.getLayout().marginLeft = 10;
+		
+		Label image = new Label(parent, SWT.NONE);
+		//image.setImage(IImageKeys.getImage(""));
+		IBaseLabelProvider lp = CorporaView.getInstance().getTreeViewer().getLabelProvider();
+		if (lp instanceof DecoratingLabelProvider) {
+			Image img = ((DecoratingLabelProvider)lp).getImage(editor.getResult().getParent());
+			if (img != null) {
+				image.setImage(img);
+			} else {
+				image.setImage(IImageKeys.getImage(IImageKeys.FILE));
+			}
+		}
+		image.setLayoutData(new GridData(GridData.BEGINNING, GridData.BEGINNING, false, true, 1, 7));
+		
+		
+		Label l = new Label(parent, SWT.NONE);
+		l.setText("Name");
+		
+		nameField = new Text(parent, SWT.BORDER);
+		nameField.setLayoutData(new GridData(GridData.BEGINNING, GridData.BEGINNING, true, false));
+		nameField.setText(editor.getResult().getParent().getUserName());
+		nameField.addKeyListener(new KeyListener() {
+			
+			@Override
+			public void keyReleased(KeyEvent e) {
+				if (e.keyCode == SWT.CR || e.keyCode == SWT.KEYPAD_CR && nameField.getText().length() > 0 && !nameField.getText().equals(editor.getResult().getParent().getUserName())) {
+					editor.getResult().getParent().setUserName(nameField.getText());
+					System.out.println("Name updated with "+nameField.getText());
+					CorporaView.refreshObject(editor.getResult().getParent());
+				}
+			}
+			
+			@Override
+			public void keyPressed(KeyEvent e) { }
+		});
+		new Label(parent, SWT.NONE).setText("Type");
+		l = new Label(parent, SWT.NONE);
+		l.setLayoutData(new GridData(GridData.BEGINNING, GridData.BEGINNING, true, false));
+		l.setText(editor.getResult().getParent().getResultType());
+		
+//		new Label(parent, SWT.NONE).setText("Size");
+//		l = new Label(parent, SWT.NONE);
+//		l.setLayoutData(new GridData(GridData.BEGINNING, GridData.BEGINNING, true, false));
+//		l.setText(""+editor.getResult().getParent().getChildren().size());
+		
+		new Label(parent, SWT.NONE).setText("Parent");
+		l = new Label(parent, SWT.NONE);
+		l.setLayoutData(new GridData(GridData.BEGINNING, GridData.BEGINNING, true, false));
+		l.setText(""+editor.getResult().getParent().getParent().getUserName());
+		
+		new Label(parent, SWT.NONE).setText("Creation date");
+		l = new Label(parent, SWT.NONE);
+		l.setLayoutData(new GridData(GridData.BEGINNING, GridData.BEGINNING, true, false));
+		Date d = editor.getResult().getParent().getCreationDate();
+		if (d != null) {
+			l.setText(""+TXMResult.PRETTY_LOCALIZED_TIME_FORMAT.format(d));
+		}
+		
+		new Label(parent, SWT.NONE).setText("Last update date");
+		l = new Label(parent, SWT.NONE);
+		l.setLayoutData(new GridData(GridData.BEGINNING, GridData.BEGINNING, true, false));
+		d = editor.getResult().getParent().getLastComputingDate();
+		if (d != null) {
+			l.setText(""+TXMResult.PRETTY_LOCALIZED_TIME_FORMAT.format(d));
+		} else {
+			l.setText("(not computed)");
+		}
+		
+		new Label(parent, SWT.NONE);
+		
+		Button clipButton = new Button(parent, SWT.PUSH);
+		clipButton.setLayoutData(new GridData(GridData.END, GridData.END, false, false));
+		clipButton.setText("Copy");
+		clipButton.addSelectionListener(new SelectionListener() {
+			
+			@Override
+			public void widgetSelected(SelectionEvent e) {
+				toClipboard();
+			}
+			
+			@Override
+			public void widgetDefaultSelected(SelectionEvent e) { }
+		});
+	}
+	
+	public void toClipboard() {
+		StringBuffer buffer = new StringBuffer();
+		buffer.append("Name: "+ editor.getResult().getParent().getUserName());
+		buffer.append("\n");
+		buffer.append("Type: "+editor.getResult().getParent().getResultType());
+		buffer.append("\n");
+//		buffer.append("Size: "+editor.getResult().getParent().getChildren().size());
+//		buffer.append("\n");
+		buffer.append("Parent: "+editor.getResult().getParent().getParent().getUserName());
+		buffer.append("\n");
+		Date d = editor.getResult().getParent().getCreationDate();
+		if (d != null) {
+			buffer.append("Creation date: "+TXMResult.PRETTY_LOCALIZED_TIME_FORMAT.format(d));
+		}
+		
+		buffer.append("\n");
+		d = editor.getResult().getParent().getCreationDate();
+		if (d != null) {
+			buffer.append("Last update date: "+TXMResult.PRETTY_LOCALIZED_TIME_FORMAT.format(d));
+		} else {
+			buffer.append("Last update date: (never computed)");
+		}
+		
+		org.txm.rcp.utils.IOClipboard.write(buffer.toString());
+	}
+	
+	@Override
+	public void updateResultFromEditor(boolean update) {
+		// TODO Auto-generated method stub
+	}
+
+	@Override
+	public void updateEditorFromResult() {
+		// TODO Auto-generated method stub
+	}
+}

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

Index: tmp/org.txm.properties.rcp/src/org/txm/properties/rcp/editors/PropertiesTab.java
===================================================================
--- tmp/org.txm.properties.rcp/src/org/txm/properties/rcp/editors/PropertiesTab.java	(revision 0)
+++ tmp/org.txm.properties.rcp/src/org/txm/properties/rcp/editors/PropertiesTab.java	(revision 2247)
@@ -0,0 +1,28 @@
+package org.txm.properties.rcp.editors;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.TabFolder;
+import org.eclipse.swt.widgets.TabItem;
+import org.txm.rcp.swt.GLComposite;
+
+public abstract class PropertiesTab {
+	
+	protected TabFolder folder;
+	protected TabItem tab;
+	protected GLComposite parent;
+	
+	protected PropertiesPagedEditor editor;
+
+	public PropertiesTab(TabFolder folder, PropertiesPagedEditor editor) {
+		tab = new TabItem(folder, SWT.NONE);
+		parent = new GLComposite(folder, SWT.NONE, "tab");
+		tab.setControl(parent);
+		
+		this.folder = folder;
+		this.editor = editor;
+	}
+	
+	public abstract void updateResultFromEditor(boolean update) throws Exception;
+	
+	public abstract void updateEditorFromResult();
+}

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

Index: tmp/org.txm.properties.rcp/src/org/txm/properties/rcp/editors/PropertiesPagedEditor.java
===================================================================
--- tmp/org.txm.properties.rcp/src/org/txm/properties/rcp/editors/PropertiesPagedEditor.java	(revision 0)
+++ tmp/org.txm.properties.rcp/src/org/txm/properties/rcp/editors/PropertiesPagedEditor.java	(revision 2247)
@@ -0,0 +1,70 @@
+package org.txm.properties.rcp.editors;
+
+import java.util.ArrayList;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Spinner;
+import org.eclipse.swt.widgets.TabFolder;
+import org.eclipse.swt.widgets.TabItem;
+import org.txm.properties.core.functions.Properties;
+import org.txm.properties.core.preferences.PropertiesPreferences;
+import org.txm.properties.rcp.messages.PropertiesUIMessages;
+import org.txm.rcp.editors.TXMEditor;
+import org.txm.rcp.swt.GLComposite;
+import org.txm.rcp.swt.widget.LabeledSpinner;
+import org.txm.searchengine.cqp.corpus.CQPCorpus;
+import org.txm.core.results.Parameter;
+import org.txm.core.results.TXMResult;
+
+public class PropertiesPagedEditor extends TXMEditor<Properties> {
+
+	private TabFolder tabFolder;
+	protected ArrayList<PropertiesTab> tabs = new ArrayList<PropertiesTab>();
+
+	/**
+	 * The maximum number of word property values to display.
+	 */
+	@Parameter(key = PropertiesPreferences.MAX_PROPERTIES_TO_DISPLAY)
+	protected Spinner maxPropertiesToDisplay;
+	
+	@Override
+	public void _createPartControl() throws Exception {
+		
+		Composite extendedParametersArea = this.getExtendedParametersGroup();
+		LabeledSpinner fMax = new LabeledSpinner(extendedParametersArea, this, PropertiesUIMessages.vMax);
+		this.maxPropertiesToDisplay = fMax.getSpinner();
+		this.maxPropertiesToDisplay.setToolTipText(PropertiesUIMessages.theMaximumNumberOfWordPropertyValuesToShow);
+		this.maxPropertiesToDisplay.setMinimum(0);
+		this.maxPropertiesToDisplay.setMaximum(1000);
+		
+		
+		GLComposite parent = getResultArea();
+		tabFolder = new TabFolder (parent, SWT.BORDER);
+		tabFolder.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, true));
+		
+		tabs.add(new PropertiesGeneralTab(tabFolder, this));
+		PropertiesTXMResultTab resultTab = new PropertiesTXMResultTab(tabFolder, this);
+		tabs.add(resultTab);
+		tabs.add(new PropertiesParametersTab(tabFolder, this));
+		
+		tabFolder.setSelection(resultTab.getTab());
+	}
+
+	@Override
+	public void updateResultFromEditor() {
+		for (PropertiesTab tab : tabs) {
+			tab.updateEditorFromResult();
+		}
+	}
+
+	@Override
+	public void updateEditorFromResult(boolean update) throws Exception {
+		for (PropertiesTab tab : tabs) {
+			tab.updateEditorFromResult();
+		}
+	}
+
+
+}

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

Index: tmp/org.txm.properties.rcp/src/org/txm/properties/rcp/editors/PropertiesParametersTab.java
===================================================================
--- tmp/org.txm.properties.rcp/src/org/txm/properties/rcp/editors/PropertiesParametersTab.java	(revision 0)
+++ tmp/org.txm.properties.rcp/src/org/txm/properties/rcp/editors/PropertiesParametersTab.java	(revision 2247)
@@ -0,0 +1,37 @@
+package org.txm.properties.rcp.editors;
+
+import org.eclipse.jface.layout.GridDataFactory;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.widgets.TabFolder;
+import org.txm.rcp.views.cmdparameters.ParametersComposite;
+
+/**
+ * Display the Properties parent parameters stored in the preferences 
+ * @author mdecorde
+ *
+ */
+public class PropertiesParametersTab extends PropertiesTab {
+	private ParametersComposite parametersComposite;
+
+	public PropertiesParametersTab(TabFolder folder, PropertiesPagedEditor editor) {
+		super(folder, editor);
+		tab.setText("Parameters");
+		
+		parametersComposite = new ParametersComposite(parent, SWT.NONE);
+		parametersComposite.setLayoutData(GridDataFactory.fillDefaults().align(GridData.FILL, GridData.FILL).grab(true, true).create());
+		parametersComposite.updateEditorParameters(editor.getResult().getParent());
+		
+		folder.layout();
+	}
+	
+	@Override
+	public void updateResultFromEditor(boolean update) {
+		
+	}
+
+	@Override
+	public void updateEditorFromResult() {
+		parametersComposite.refresh();
+	}
+}

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

Index: tmp/org.txm.properties.core/src/org/txm/properties/core/messages/messages_fr.properties
===================================================================
--- tmp/org.txm.properties.core/src/org/txm/properties/core/messages/messages_fr.properties	(revision 2246)
+++ tmp/org.txm.properties.core/src/org/txm/properties/core/messages/messages_fr.properties	(revision 2247)
@@ -38,6 +38,6 @@
 
 t = - T 
 
-updatedTheP0 = <p>Dernière modification : {0}.</p>
+updatedTheP0 = <p>Dernière modification : {0}</p>
 
 wordProperties = - Propriétés de mot 
Index: tmp/org.txm.properties.core/src/org/txm/properties/core/functions/CorpusPropertiesComputer.java
===================================================================
--- tmp/org.txm.properties.core/src/org/txm/properties/core/functions/CorpusPropertiesComputer.java	(revision 0)
+++ tmp/org.txm.properties.core/src/org/txm/properties/core/functions/CorpusPropertiesComputer.java	(revision 2247)
@@ -0,0 +1,468 @@
+package org.txm.properties.core.functions;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.LinkedHashMap;
+import java.util.LinkedHashSet;
+import java.util.List;
+import java.util.Locale;
+
+import org.apache.commons.lang.StringUtils;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.osgi.util.NLS;
+import org.txm.core.messages.TXMCoreMessages;
+import org.txm.core.results.TXMResult;
+import org.txm.objects.Project;
+import org.txm.properties.core.messages.PropertiesCoreMessages;
+import org.txm.searchengine.cqp.AbstractCqiClient;
+import org.txm.searchengine.cqp.clientExceptions.CqiClientException;
+import org.txm.searchengine.cqp.corpus.CQPCorpus;
+import org.txm.searchengine.cqp.corpus.CorpusManager;
+import org.txm.searchengine.cqp.corpus.MainCorpus;
+import org.txm.searchengine.cqp.corpus.Property;
+import org.txm.searchengine.cqp.corpus.StructuralUnit;
+import org.txm.searchengine.cqp.corpus.StructuralUnitProperty;
+import org.txm.searchengine.cqp.corpus.WordProperty;
+import org.txm.utils.logger.Log;
+
+public class CorpusPropertiesComputer extends PropertiesComputer<CQPCorpus>{
+
+	public CorpusPropertiesComputer(Properties props, CQPCorpus result) {
+		super(props, result);
+	}
+
+	@Override
+	public List<String> getComputableInformations() {
+		return Arrays.asList("all");
+	}
+
+	@Override
+	public LinkedHashMap<String, String> getInformation(String name) {
+		LinkedHashMap<String, String> data = new LinkedHashMap<String, String>();
+		data.put("all", dump(props.pMaxPropertiesToDisplay));
+		return data;
+	}
+
+	@Override
+	public String getInformationHTML(String info) {
+		return htmlDump();
+	}
+
+	// Numbers
+	/** The T. */
+	int numberOfWords = 0; // number of word
+
+	/** The N properties. */
+	int NProperties = 0; // number of word properties
+	// HashMap<String, Integer> propertiesCounts = new HashMap<String, Integer>();
+	// // properties counts
+	/** The properties values. */
+	HashMap<String, List<String>> propertiesValues = new HashMap<String, List<String>>(); // properties values
+
+	/** The N structures. */
+	int NStructures = 0; // number of structures
+
+	/** The structures counts. */
+	HashMap<String, Integer> structuresCounts = new HashMap<String, Integer>(); // structures counts
+
+	/** The internal architecture. */
+	List<String> internalArchitecture = new ArrayList<String>(); // cqp structures = propertiesCounts keys but ordered
+
+	/** The hierarchie counts. */
+	HashMap<String, Integer> hierarchieCounts = new HashMap<String, Integer>(); // hierarchic structures counts
+
+	/** The internal architecture properties. */
+	HashMap<String, HashMap<String, List<String>>> internalArchitectureProperties = new HashMap<String, HashMap<String, List<String>>>(); // hierarchic structures counts
+
+	/** The internal architecture properties counts. */
+	HashMap<String, HashMap<String, Integer>> internalArchitecturePropertiesCounts = new HashMap<String, HashMap<String, Integer>>(); // hierarchic structures counts
+
+	// Annotations description
+	/** The annotations types. */
+	HashMap<String, Integer> annotationsTypes = new HashMap<String, Integer>(); // for each annotation its description
+
+	/** The annotations origins. */
+	HashMap<String, Integer> annotationsOrigins = new HashMap<String, Integer>(); // for each annoation its origin description
+
+	/** The properties. */
+	List<WordProperty> properties;
+
+	/** The structures. */
+	List<StructuralUnit> structures;
+	
+	public String getName() {
+		String filename = result.getMainCorpus() + "-" + result.getName(); //$NON-NLS-1$
+		if (result instanceof MainCorpus) {
+			filename = result.getID(); // $NON-NLS-1$
+		}
+		return filename;
+	}
+	
+	/**
+	 * Step general infos.
+	 */
+	public void stepGeneralInfos() {
+		try {
+			properties = result.getProperties();
+			List<WordProperty> pproperties = new ArrayList<WordProperty>(properties);
+			for (WordProperty p : properties) {
+				if (p.getName().equals("id")) {
+					pproperties.remove(p);
+				}
+			}
+			properties = pproperties;
+			NProperties = properties.size();
+		} catch (CqiClientException e) {
+			Log.severe(TXMCoreMessages.bind(PropertiesCoreMessages.error_failedToAccessPropertieOfCorpusP0, result.getName()));
+			Log.printStackTrace(e);
+			return;
+		}
+
+		try {
+			numberOfWords = result.getSize();// corpus.getLexicon(corpus.getProperty("id")).nbrOfToken();
+		} catch (CqiClientException e) {
+			Log.severe(TXMCoreMessages.bind(PropertiesCoreMessages.error_failedToAccessLexiconOfCorpusP0, result.getName()));
+			Log.printStackTrace(e);
+			return;
+		}
+	}
+
+	/**
+	 * step2. randomly position are choose
+	 */
+	public void stepLexicalProperties() {
+		propertiesValues.clear();
+
+		AbstractCqiClient cqiClient = CorpusManager.getCorpusManager().getCqiClient();
+		for (Property p : properties) {
+			// int size;
+			try {
+				// size =
+				// CorpusManager.getCorpusManager().getCqiClient().lexiconSize(p.getQualifiedName());
+				// propertiesCounts.put(p.getName(), size);
+				// List<String> list =
+				// Arrays.asList(corpus.getLexicon(p).getForms(this.maxvalue));
+
+				int[] positions = new int[Math.min(props.pMaxPropertiesToDisplay, numberOfWords)];
+				for (int i = 0; i < Math.min(props.pMaxPropertiesToDisplay, numberOfWords); i++) {
+					positions[i] = i;
+				}
+
+				// ArrayList<String> values = new ArrayList<String>();
+				LinkedHashSet<String> values = new LinkedHashSet<String>(cqiClient.getSingleData(p, positions));
+				propertiesValues.put(p.getName(), new ArrayList<String>(values));
+			} catch (Exception e) {
+				Log.printStackTrace(e);
+			}
+		}
+	}
+
+	/**
+	 * Step structural units.
+	 */
+	public void stepStructuralUnits() {
+		try {
+			structures = result.getOrderedStructuralUnits();
+
+			List<StructuralUnit> sstructures = new ArrayList<StructuralUnit>(structures);
+			for (StructuralUnit su : structures) {
+				if (su.getName().equals("txmcorpus")) {
+					sstructures.remove(su);
+				}
+			}
+			structures = sstructures;
+		} catch (CqiClientException e) {
+			Log.severe(TXMCoreMessages.bind(PropertiesCoreMessages.error_failedToAccessStructuresOfCorpusP0, result.getName()));
+			Log.printStackTrace(e);
+			return;
+		}
+		NStructures = structures.size();
+		internalArchitecture.clear();
+		for (StructuralUnit su : structures) { // for each structural unit
+			internalArchitecture.add(su.getName());
+			hierarchieCounts.put(su.getName(), -1);
+			internalArchitectureProperties.put(su.getName(), new HashMap<String, List<String>>());
+			internalArchitecturePropertiesCounts.put(su.getName(), new HashMap<String, Integer>());
+
+			if (su.getProperties().size() > 0) {
+				for (StructuralUnitProperty sup : su.getProperties()) {// for each of its property
+					try {
+						List<String> allvalues = sup.getValues(result);
+						internalArchitectureProperties.get(su.getName()).put(sup.getName(), allvalues.subList(0, Math.min(allvalues.size(), props.pMaxPropertiesToDisplay)));
+						internalArchitecturePropertiesCounts.get(su.getName()).put(sup.getName(), allvalues.size());
+					} catch (Exception e) {
+						ArrayList<String> list = new ArrayList<String>(1);
+						list.add(PropertiesCoreMessages.error);
+						internalArchitectureProperties.get(su.getName()).put(sup.getName(), list);
+						internalArchitecturePropertiesCounts.get(su.getName()).put(sup.getName(), -1);
+					}
+				}
+			}
+		}
+	}
+	
+	/**
+	 * dump the results of the diagnostic in a String containing HTML code.
+	 *
+	 * @return the string
+	 */
+	public String htmlDump() {
+		StringBuffer buff = new StringBuffer();
+
+		buff.append("<? version=\"1.0\" encoding=\"UTF-8\"?>\n" + //$NON-NLS-1$
+				"<html>" + //$NON-NLS-1$
+				"<head>" + //$NON-NLS-1$
+				"<meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\"/>" + //$NON-NLS-1$
+				"</head>" + //$NON-NLS-1$
+				"<body>\n"); //$NON-NLS-1$
+		buff.append("<h2 style'font-family:\"Arial\";'>" + PropertiesCoreMessages.descriptionOf + this.result.getName() + " (id=" + this.result.getID() + ")</h2>\n"); //$NON-NLS-2$ //$NON-NLS-1$
+
+		Project projet = this.result.getProject();
+		if (projet.getCreationDate() != null) {
+			buff.append(NLS.bind(PropertiesCoreMessages.createdTheP0, TXMResult.PRETTY_LOCALIZED_TIME_FORMAT.format(projet.getCreationDate())));
+		}
+		if (projet.getLastComputingDate() != null) {
+			buff.append(NLS.bind(PropertiesCoreMessages.updatedTheP0, TXMResult.PRETTY_LOCALIZED_TIME_FORMAT.format(projet.getLastComputingDate())));
+		}
+		
+		if (projet.getDescription() != null && projet.getDescription().length() > 0) {
+			buff.append("<p><h3>Description</h3>" + projet.getDescription() + "</p>"); //$NON-NLS-1$ //$NON-NLS-2$
+		}
+
+		buff.append("<h3 style'font-family:\"Arial\";'>" + PropertiesCoreMessages.generalStatistics_2 + "</h3>\n"); //$NON-NLS-1$ //$NON-NLS-2$
+
+		// counts
+		buff.append("<ul>\n"); //$NON-NLS-1$
+		buff.append("<li>" + NLS.bind(PropertiesCoreMessages.numberOfWordsP0, numberOfWords) + "</li>\n"); //$NON-NLS-1$ //$NON-NLS-2$
+
+		buff.append("<li>" + PropertiesCoreMessages.numberOfWordProperties + (properties.size()) + " ("+StringUtils.join(properties, ", ")+")</li>\n"); //$NON-NLS-2$ //$NON-NLS-1$
+		buff.append("<li>" + PropertiesCoreMessages.numberOfStructuralUnits + (structures.size()) + " ("+StringUtils.join(structures, ", ")+")</li>\n"); //$NON-NLS-2$ //$NON-NLS-1$
+		buff.append("</ul>\n"); //$NON-NLS-1$
+
+		// Propriétés d'occurrences
+		buff.append("<h3 style'font-family:\"Arial\";'>" + NLS.bind(PropertiesCoreMessages.lexicalUnitsPropertiesMaxP0Values, props.pMaxPropertiesToDisplay) + "</h3>\n"); //$NON-NLS-1$ //$NON-NLS-2$
+		ArrayList<String> properties = new ArrayList<String>(propertiesValues.keySet());
+		Collections.sort(properties);
+		buff.append("<ul>\n"); //$NON-NLS-1$
+		for (String s : properties) {
+			if (!s.equals("id")) { //$NON-NLS-1$
+				// buff.append("<li> " + s + " (" + propertiesCounts.get(s) + ") : ");
+				// //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+				buff.append("<li> " + s + " : "); //$NON-NLS-1$ //$NON-NLS-2$
+				for (String v : propertiesValues.get(s))
+					buff.append(v + ", "); //$NON-NLS-1$
+				if (propertiesValues.get(s).size() >= this.props.pMaxPropertiesToDisplay) {
+					buff.append("..."); //$NON-NLS-1$
+				}
+				buff.append("</li>\n"); //$NON-NLS-1$
+			}
+		}
+		buff.append("</ul>\n"); //$NON-NLS-1$
+
+		// Propriété de structures
+		buff.append("<h3 style'font-family:\"Arial\";'>" + NLS.bind(PropertiesCoreMessages.structuralUnitsPropertiesMaxP0Values, props.pMaxPropertiesToDisplay) + "</h3>\n"); //$NON-NLS-1$ //$NON-NLS-2$
+		buff.append("<ul>\n"); //$NON-NLS-1$
+		for (String s : internalArchitecture) {
+			StringBuffer subbuffer = new StringBuffer();
+			if (s.equals("txmcorpus")) //$NON-NLS-1$
+				continue;// ignore the txmcorpus structure
+
+			properties = new ArrayList<String>(internalArchitectureProperties.get(s).keySet());
+
+			subbuffer.append("<li> " + s + "\n<ul>\n"); //$NON-NLS-1$ //$NON-NLS-2$
+			if (internalArchitectureProperties.get(s).keySet().size() == 0)
+				subbuffer.append("<li>" + PropertiesCoreMessages.noProperty + "</li>\n"); //$NON-NLS-1$ //$NON-NLS-2$
+
+			// System.out.println("struct: "+s+" >> "+properties);
+			Collections.sort(properties);
+			// System.out.println("struct: "+s+" >sort> "+properties);
+			int nbOfValues = 0;
+			for (String ps : properties) {
+				if (!ps.equals("project") && !ps.equals("base")) //$NON-NLS-1$ //$NON-NLS-2$
+				{
+					// System.out.println("struct: "+s+" >> "+ps);
+					int valuecount = internalArchitecturePropertiesCounts.get(s).get(ps);
+					ArrayList<String> values = new ArrayList<String>(internalArchitectureProperties.get(s).get(ps));
+					subbuffer.append("<li> " + ps + " (" + valuecount + ") = "); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+					// System.out.println("VALUES: "+values);
+					Collections.sort(values);
+					for (int i = 0; i < values.size(); i++) {
+						nbOfValues++;
+						String psv = values.get(i);
+						if (psv != null && psv.length() > 0)
+							subbuffer.append(psv.replace("<", "&lt;")); //$NON-NLS-1$ //$NON-NLS-2$
+						else
+							subbuffer.append("\"\""); //$NON-NLS-1$
+
+						if (i == values.size() - 1)
+							subbuffer.append("."); //$NON-NLS-1$
+						else
+							subbuffer.append(", "); //$NON-NLS-1$
+
+						if (i >= props.pMaxPropertiesToDisplay) {
+							subbuffer.append("..."); //$NON-NLS-1$
+							break;
+						}
+					}
+					subbuffer.append("</li>\n"); //$NON-NLS-1$
+				}
+			}
+			
+			if (properties.size() == 0) {
+				subbuffer.append("<p>--</p>\n"); //$NON-NLS-1$
+			}
+			
+			subbuffer.append("</ul>\n</li>\n"); //$NON-NLS-1$
+			if (nbOfValues > 0) {
+				buff.append(subbuffer);
+			}
+		}
+		buff.append("</ul>\n"); //$NON-NLS-1$
+		buff.append("</body>\n"); //$NON-NLS-1$
+		buff.append("</html>\n"); //$NON-NLS-1$
+
+		return buff.toString();
+	}
+
+	/**
+	 * dump the result in the console.
+	 *
+	 * @param maxvalue
+	 *            the maxvalue
+	 * @return the string
+	 */
+	public String dump(int maxvalue) {
+		StringBuffer buff = new StringBuffer();
+
+		buff.append(PropertiesCoreMessages.generalStatistics);
+		buff.append(PropertiesCoreMessages.t + String.format(Locale.FRANCE, "%,d", numberOfWords) + "\n"); //$NON-NLS-1$
+		buff.append(PropertiesCoreMessages.wordProperties + String.format("%,d", NProperties) + "\n"); //$NON-NLS-1$
+		/*
+		 * for (String s : propertiesCounts.keySet()) if (!s.equals("id")) //$NON-NLS-1$
+		 * buff.append(" - " + s + " " + propertiesCounts.get(s) + "\n"); //$NON-NLS-1$
+		 * //$NON-NLS-2$ //$NON-NLS-3$
+		 */
+		buff.append(PropertiesCoreMessages.s + String.format("%,d", NStructures) + "\n"); //$NON-NLS-1$
+		for (String s : structuresCounts.keySet())
+			buff.append(" - " + s + "\n");// +structuresCounts.get(s)+"\n"); //$NON-NLS-1$ //$NON-NLS-2$
+
+		/*
+		 * buff.append("* Structural Units counts\n"); for(String s :
+		 * internalArchitecture) buff.append(" - "+s+" "+hierarchieCounts.get(s)+"\n");
+		 */
+		buff.append(PropertiesCoreMessages.structuralUnitsProperties);
+		for (String s : internalArchitecture) {
+			buff.append(" - " + s + "\n"); //$NON-NLS-1$ //$NON-NLS-2$
+			for (String ps : internalArchitectureProperties.get(s).keySet()) {
+				if (!(s.equals("text") && (ps.equals("project") || ps.equals("base") || ps.equals("id")))) //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
+				{
+					buff.append("   - " + ps + "(" + internalArchitectureProperties.get(s).get(ps).size() + ") = "); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+
+					int valuecount = 0;
+					for (String psv : internalArchitectureProperties.get(s).get(ps)) {
+						buff.append(psv);
+						if (valuecount++ >= maxvalue) {
+							buff.append("..."); //$NON-NLS-1$
+							break;
+						}
+						if (valuecount < internalArchitectureProperties.get(s).get(ps).size())
+							buff.append(", "); //$NON-NLS-1$
+					}
+
+					buff.append("\n"); //$NON-NLS-1$
+				}
+			}
+		}
+
+		return buff.toString();
+	}
+	
+
+	/**
+	 * Gets the t.
+	 *
+	 * @return the t
+	 */
+	public int getT() {
+		return numberOfWords;
+	}
+
+	/**
+	 * Gets the n properties.
+	 *
+	 * @return the n properties
+	 */
+	public int getNProperties() {
+		return NProperties;
+	}
+
+	/**
+	 * Gets the internal architecture.
+	 *
+	 * @return the internal architecture
+	 */
+	public List<String> getInternalArchitecture() {
+		return internalArchitecture;
+	}
+
+	/**
+	 * Gets the n structures.
+	 *
+	 * @return the n structures
+	 */
+	public int getNStructures() {
+		return NStructures;
+	}
+
+	/**
+	 * Gets the structures counts.
+	 *
+	 * @return the structures counts
+	 */
+	public HashMap<String, Integer> getStructuresCounts() {
+		return structuresCounts;
+	}
+
+	/**
+	 * Gets the annotations types.
+	 *
+	 * @return the annotations types
+	 */
+	public HashMap<String, Integer> getAnnotationsTypes() {
+		return annotationsTypes;
+	}
+
+	/**
+	 * Gets the annotations origins.
+	 *
+	 * @return the annotations origins
+	 */
+	public HashMap<String, Integer> getAnnotationsOrigins() {
+		return annotationsOrigins;
+	}
+
+	@Override
+	public boolean _compute(IProgressMonitor monitor) throws Exception {
+
+		if (monitor != null) monitor.beginTask(props.getComputingStartMessage(), 3);
+		this.stepGeneralInfos();
+		if (monitor != null) monitor.worked(1);
+
+		this.stepLexicalProperties();
+		if (monitor != null) monitor.worked(1);
+
+		this.stepStructuralUnits();
+		if (monitor != null) monitor.worked(1);
+		return true;
+	}
+	
+	public String getDetails() {
+		if (numberOfWords >= 0) {
+			return NLS.bind(PropertiesCoreMessages.numberOfWordsP0, numberOfWords);
+		} else {
+			return "";
+		}
+	}
+}

Property changes on: tmp/org.txm.properties.core/src/org/txm/properties/core/functions/CorpusPropertiesComputer.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/org.txm.properties.core/src/org/txm/properties/core/functions/PropertiesComputer.java
===================================================================
--- tmp/org.txm.properties.core/src/org/txm/properties/core/functions/PropertiesComputer.java	(revision 0)
+++ tmp/org.txm.properties.core/src/org/txm/properties/core/functions/PropertiesComputer.java	(revision 2247)
@@ -0,0 +1,52 @@
+package org.txm.properties.core.functions;
+
+import java.util.LinkedHashMap;
+import java.util.List;
+
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.txm.core.results.TXMResult;
+
+/**
+ * Properties use this existing class implementations to retrieve informations to show
+ * @author mdecorde
+ *
+ */
+public abstract class PropertiesComputer<T extends TXMResult> {
+	
+	protected T result;
+	protected Properties props;
+	
+	public PropertiesComputer(Properties props, T result) {
+		this.result = result;
+		this.props = props;
+	}
+	
+	/**
+	 * The ordered list of informations to display
+	 * @return
+	 */
+	public abstract List<String> getComputableInformations();
+	
+	/**
+	 * raw informations
+	 * @param name
+	 * @return
+	 */
+	public abstract LinkedHashMap<String, String> getInformation(String name);
+
+	/**
+	 * HTML formated informations to insert a HTML element
+	 * @return
+	 */
+	public abstract String getInformationHTML(String info);
+	
+	/**
+	 * if the PropertiesComputer needs to prepare informations or the compute the available informations
+	 * @return
+	 */
+	public abstract boolean _compute(IProgressMonitor monitor) throws Exception;
+
+	public String getName() {
+		return result.getClass().getSimpleName()+"-"+result.getName();
+	}
+}

Property changes on: tmp/org.txm.properties.core/src/org/txm/properties/core/functions/PropertiesComputer.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/org.txm.properties.core/src/org/txm/properties/core/functions/Properties.java
===================================================================
--- tmp/org.txm.properties.core/src/org/txm/properties/core/functions/Properties.java	(revision 2246)
+++ tmp/org.txm.properties.core/src/org/txm/properties/core/functions/Properties.java	(revision 2247)
@@ -30,35 +30,21 @@
 import java.io.File;
 import java.io.IOException;
 import java.io.PrintWriter;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.LinkedHashSet;
+import java.util.Arrays;
+import java.util.LinkedHashMap;
 import java.util.List;
-import java.util.Locale;
 
-import org.apache.commons.lang.StringUtils;
-import org.eclipse.osgi.util.NLS;
+import org.eclipse.core.runtime.IProgressMonitor;
 import org.txm.Toolbox;
 import org.txm.core.messages.TXMCoreMessages;
 import org.txm.core.results.Parameter;
 import org.txm.core.results.TXMParameters;
 import org.txm.core.results.TXMResult;
-import org.txm.objects.Project;
 import org.txm.properties.core.messages.PropertiesCoreMessages;
 import org.txm.properties.core.preferences.PropertiesPreferences;
-import org.txm.searchengine.cqp.AbstractCqiClient;
-import org.txm.searchengine.cqp.clientExceptions.CqiClientException;
 import org.txm.searchengine.cqp.corpus.CQPCorpus;
-import org.txm.searchengine.cqp.corpus.CorpusManager;
-import org.txm.searchengine.cqp.corpus.MainCorpus;
-import org.txm.searchengine.cqp.corpus.Property;
-import org.txm.searchengine.cqp.corpus.StructuralUnit;
-import org.txm.searchengine.cqp.corpus.StructuralUnitProperty;
-import org.txm.searchengine.cqp.corpus.WordProperty;
 import org.txm.utils.AsciiUtils;
 import org.txm.utils.io.IOUtils;
-import org.txm.utils.logger.Log;
 
 /**
  * Computes a diagnostic of Corpus or Subcorpus.
@@ -66,52 +52,9 @@
  * @author mdecorde
  */
 public class Properties extends TXMResult {
-	// Base base;
-	/** The corpus. */
-	protected CQPCorpus corpus;
 
-	// Numbers
-	/** The T. */
-	int numberOfWords = 0; // number of word
+	PropertiesComputer<? extends TXMResult> computer;
 
-	/** The N properties. */
-	int NProperties = 0; // number of word properties
-	// HashMap<String, Integer> propertiesCounts = new HashMap<String, Integer>();
-	// // properties counts
-	/** The properties values. */
-	HashMap<String, List<String>> propertiesValues = new HashMap<String, List<String>>(); // properties values
-
-	/** The N structures. */
-	int NStructures = 0; // number of structures
-
-	/** The structures counts. */
-	HashMap<String, Integer> structuresCounts = new HashMap<String, Integer>(); // structures counts
-
-	/** The internal architecture. */
-	List<String> internalArchitecture = new ArrayList<String>(); // cqp structures = propertiesCounts keys but ordered
-
-	/** The hierarchie counts. */
-	HashMap<String, Integer> hierarchieCounts = new HashMap<String, Integer>(); // hierarchic structures counts
-
-	/** The internal architecture properties. */
-	HashMap<String, HashMap<String, List<String>>> internalArchitectureProperties = new HashMap<String, HashMap<String, List<String>>>(); // hierarchic structures counts
-
-	/** The internal architecture properties counts. */
-	HashMap<String, HashMap<String, Integer>> internalArchitecturePropertiesCounts = new HashMap<String, HashMap<String, Integer>>(); // hierarchic structures counts
-
-	// Annotations description
-	/** The annotations types. */
-	HashMap<String, Integer> annotationsTypes = new HashMap<String, Integer>(); // for each annotation its description
-
-	/** The annotations origins. */
-	HashMap<String, Integer> annotationsOrigins = new HashMap<String, Integer>(); // for each annoation its origin description
-
-	/** The properties. */
-	List<WordProperty> properties;
-
-	/** The structures. */
-	List<StructuralUnit> structures;
-
 	/**
 	 * The HTML file.
 	 */
@@ -126,11 +69,40 @@
 	/**
 	 * Instantiates a new corpus Properties.
 	 *
-	 * @param corpus
+	 * @param selection
 	 *            a MainCorpus or a SubCorpus
 	 */
-	public Properties(CQPCorpus corpus) {
-		super(corpus);
+	public Properties(TXMResult selection) {
+		super(selection);
+
+		if (selection instanceof CQPCorpus) {
+			computer = new CorpusPropertiesComputer(this, (CQPCorpus)selection);
+		} else {
+			computer = new PropertiesComputer<TXMResult>(this, selection) {
+
+				@Override
+				public List getComputableInformations() {
+					return Arrays.asList("details");
+				}
+
+				@Override
+				public LinkedHashMap<String, String> getInformation(String name) {
+					LinkedHashMap<String, String> data = new LinkedHashMap<String, String>();
+					data.put("details", result.getDetails());
+					return data;
+				}
+
+				@Override
+				public String getInformationHTML(String info) {
+					return result.getDetails();
+				}
+
+				@Override
+				public boolean _compute(IProgressMonitor monitor) throws Exception{
+					return true;
+				}
+			};
+		}
 	}
 
 	/**
@@ -141,9 +113,16 @@
 		super(parametersNodePath);
 	}
 
+	/**
+	 * 
+	 * @param parametersNodePath
+	 */
+	public Properties(String parametersNodePath, TXMResult selection) {
+		super(parametersNodePath, selection);
+	}
+
 	@Override
 	public boolean loadParameters() {
-		this.corpus = (CQPCorpus) this.parent;
 		return true;
 	}
 
@@ -160,110 +139,8 @@
 		this.dirty = true;
 	}
 
-	/**
-	 * Step general infos.
-	 */
-	public void stepGeneralInfos() {
-		try {
-			properties = corpus.getProperties();
-			List<WordProperty> pproperties = new ArrayList<WordProperty>(properties);
-			for (WordProperty p : properties) {
-				if (p.getName().equals("id")) {
-					pproperties.remove(p);
-				}
-			}
-			properties = pproperties;
-			NProperties = properties.size();
-		} catch (CqiClientException e) {
-			Log.severe(TXMCoreMessages.bind(PropertiesCoreMessages.error_failedToAccessPropertieOfCorpusP0, corpus.getName()));
-			Log.printStackTrace(e);
-			return;
-		}
 
-		try {
-			numberOfWords = corpus.getSize();// corpus.getLexicon(corpus.getProperty("id")).nbrOfToken();
-		} catch (CqiClientException e) {
-			Log.severe(TXMCoreMessages.bind(PropertiesCoreMessages.error_failedToAccessLexiconOfCorpusP0, corpus.getName()));
-			Log.printStackTrace(e);
-			return;
-		}
-	}
 
-	/**
-	 * step2. randomly position are choose
-	 */
-	public void stepLexicalProperties() {
-		propertiesValues.clear();
-
-		AbstractCqiClient cqiClient = CorpusManager.getCorpusManager().getCqiClient();
-		for (Property p : properties) {
-			// int size;
-			try {
-				// size =
-				// CorpusManager.getCorpusManager().getCqiClient().lexiconSize(p.getQualifiedName());
-				// propertiesCounts.put(p.getName(), size);
-				// List<String> list =
-				// Arrays.asList(corpus.getLexicon(p).getForms(this.maxvalue));
-
-				int[] positions = new int[Math.min(pMaxPropertiesToDisplay, numberOfWords)];
-				for (int i = 0; i < Math.min(pMaxPropertiesToDisplay, numberOfWords); i++) {
-					positions[i] = i;
-				}
-
-				// ArrayList<String> values = new ArrayList<String>();
-				LinkedHashSet<String> values = new LinkedHashSet<String>(cqiClient.getSingleData(p, positions));
-				propertiesValues.put(p.getName(), new ArrayList<String>(values));
-			} catch (Exception e) {
-				Log.printStackTrace(e);
-			}
-		}
-	}
-
-	/**
-	 * Step structural units.
-	 */
-	public void stepStructuralUnits() {
-		try {
-			structures = corpus.getOrderedStructuralUnits();
-
-			List<StructuralUnit> sstructures = new ArrayList<StructuralUnit>(structures);
-			for (StructuralUnit su : structures) {
-				if (su.getName().equals("txmcorpus")) {
-					sstructures.remove(su);
-				}
-			}
-			structures = sstructures;
-			
-		} catch (CqiClientException e) {
-			Log.severe(TXMCoreMessages.bind(PropertiesCoreMessages.error_failedToAccessStructuresOfCorpusP0, corpus.getName()));
-			Log.printStackTrace(e);
-			return;
-		}
-		NStructures = structures.size();
-		internalArchitecture.clear();
-		for (StructuralUnit su : structures) { // for each structural unit
-			internalArchitecture.add(su.getName());
-			hierarchieCounts.put(su.getName(), -1);
-			internalArchitectureProperties.put(su.getName(), new HashMap<String, List<String>>());
-			internalArchitecturePropertiesCounts.put(su.getName(), new HashMap<String, Integer>());
-
-			if (su.getProperties().size() > 0) {
-				for (StructuralUnitProperty sup : su.getProperties()) {// for each of its property
-					try {
-						List<String> allvalues = sup.getValues(corpus);
-						internalArchitectureProperties.get(su.getName()).put(sup.getName(), allvalues.subList(0, Math.min(allvalues.size(), pMaxPropertiesToDisplay)));
-						internalArchitecturePropertiesCounts.get(su.getName()).put(sup.getName(), allvalues.size());
-					} catch (Exception e) {
-						ArrayList<String> list = new ArrayList<String>(1);
-						list.add(PropertiesCoreMessages.error);
-						internalArchitectureProperties.get(su.getName()).put(sup.getName(), list);
-						internalArchitecturePropertiesCounts.get(su.getName()).put(sup.getName(), -1);
-					}
-				}
-			}
-		}
-	}
-
 	// FIXME: useless?
 	// /**
 	// * Instantiates a new diagnostic.
@@ -288,180 +165,20 @@
 	// }
 	// }
 
-	/**
-	 * dump the results of the diagnostic in a String containing HTML code.
-	 *
-	 * @return the string
-	 */
 	public String htmlDump() {
-		StringBuffer buff = new StringBuffer();
-
-		buff.append("<? version=\"1.0\" encoding=\"UTF-8\"?>\n" + //$NON-NLS-1$
-				"<html>" + //$NON-NLS-1$
-				"<head>" + //$NON-NLS-1$
-				"<meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\"/>" + //$NON-NLS-1$
-				"</head>" + //$NON-NLS-1$
-				"<body>\n"); //$NON-NLS-1$
-		buff.append("<h2 style'font-family:\"Arial\";'>" + PropertiesCoreMessages.descriptionOf + this.corpus.getName() + " (id=" + this.corpus.getID() + ")</h2>\n"); //$NON-NLS-2$ //$NON-NLS-1$
-
-		Project projet = this.corpus.getProject();
-		if (projet.getCreationDate() != null) {
-			buff.append(NLS.bind(PropertiesCoreMessages.createdTheP0, TXMResult.PRETTY_LOCALIZED_TIME_FORMAT.format(projet.getCreationDate())));
+		StringBuffer buffer = new StringBuffer();
+		for (String info : computer.getComputableInformations()) {
+			buffer.append(computer.getInformationHTML(info));
 		}
-		if (projet.getLastComputingDate() != null) {
-			buff.append(NLS.bind(PropertiesCoreMessages.updatedTheP0, TXMResult.PRETTY_LOCALIZED_TIME_FORMAT.format(projet.getLastComputingDate())));
-		}
-		
-		if (projet.getDescription() != null && projet.getDescription().length() > 0) {
-			buff.append("<p><h3>Description</h3>" + projet.getDescription() + "</p>"); //$NON-NLS-1$ //$NON-NLS-2$
-		}
-
-		buff.append("<h3 style'font-family:\"Arial\";'>" + PropertiesCoreMessages.generalStatistics_2 + "</h3>\n"); //$NON-NLS-1$ //$NON-NLS-2$
-
-		// counts
-		buff.append("<ul>\n"); //$NON-NLS-1$
-		buff.append("<li>" + NLS.bind(PropertiesCoreMessages.numberOfWordsP0, numberOfWords) + "</li>\n"); //$NON-NLS-1$ //$NON-NLS-2$
-
-		buff.append("<li>" + PropertiesCoreMessages.numberOfWordProperties + (properties.size()) + " ("+StringUtils.join(properties, ", ")+")</li>\n"); //$NON-NLS-2$ //$NON-NLS-1$
-		buff.append("<li>" + PropertiesCoreMessages.numberOfStructuralUnits + (structures.size()) + " ("+StringUtils.join(structures, ", ")+")</li>\n"); //$NON-NLS-2$ //$NON-NLS-1$
-		buff.append("</ul>\n"); //$NON-NLS-1$
-
-		// Propriétés d'occurrences
-		buff.append("<h3 style'font-family:\"Arial\";'>" + NLS.bind(PropertiesCoreMessages.lexicalUnitsPropertiesMaxP0Values, pMaxPropertiesToDisplay) + "</h3>\n"); //$NON-NLS-1$ //$NON-NLS-2$
-		ArrayList<String> properties = new ArrayList<String>(propertiesValues.keySet());
-		Collections.sort(properties);
-		buff.append("<ul>\n"); //$NON-NLS-1$
-		for (String s : properties) {
-			if (!s.equals("id")) { //$NON-NLS-1$
-				// buff.append("<li> " + s + " (" + propertiesCounts.get(s) + ") : ");
-				// //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
-				buff.append("<li> " + s + " : "); //$NON-NLS-1$ //$NON-NLS-2$
-				for (String v : propertiesValues.get(s))
-					buff.append(v + ", "); //$NON-NLS-1$
-				if (propertiesValues.get(s).size() >= this.pMaxPropertiesToDisplay) {
-					buff.append("..."); //$NON-NLS-1$
-				}
-				buff.append("</li>\n"); //$NON-NLS-1$
-			}
-		}
-		buff.append("</ul>\n"); //$NON-NLS-1$
-
-		// Propriété de structures
-		buff.append("<h3 style'font-family:\"Arial\";'>" + NLS.bind(PropertiesCoreMessages.structuralUnitsPropertiesMaxP0Values, pMaxPropertiesToDisplay) + "</h3>\n"); //$NON-NLS-1$ //$NON-NLS-2$
-		buff.append("<ul>\n"); //$NON-NLS-1$
-		for (String s : internalArchitecture) {
-			StringBuffer subbuffer = new StringBuffer();
-			if (s.equals("txmcorpus")) //$NON-NLS-1$
-				continue;// ignore the txmcorpus structure
-
-			properties = new ArrayList<String>(internalArchitectureProperties.get(s).keySet());
-
-			subbuffer.append("<li> " + s + "\n<ul>\n"); //$NON-NLS-1$ //$NON-NLS-2$
-			if (internalArchitectureProperties.get(s).keySet().size() == 0)
-				subbuffer.append("<li>" + PropertiesCoreMessages.noProperty + "</li>\n"); //$NON-NLS-1$ //$NON-NLS-2$
-
-			// System.out.println("struct: "+s+" >> "+properties);
-			Collections.sort(properties);
-			// System.out.println("struct: "+s+" >sort> "+properties);
-			int nbOfValues = 0;
-			for (String ps : properties) {
-				if (!ps.equals("project") && !ps.equals("base")) //$NON-NLS-1$ //$NON-NLS-2$
-				{
-					// System.out.println("struct: "+s+" >> "+ps);
-					int valuecount = internalArchitecturePropertiesCounts.get(s).get(ps);
-					ArrayList<String> values = new ArrayList<String>(internalArchitectureProperties.get(s).get(ps));
-					subbuffer.append("<li> " + ps + " (" + valuecount + ") = "); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
-					// System.out.println("VALUES: "+values);
-					Collections.sort(values);
-					for (int i = 0; i < values.size(); i++) {
-						nbOfValues++;
-						String psv = values.get(i);
-						if (psv != null && psv.length() > 0)
-							subbuffer.append(psv.replace("<", "&lt;")); //$NON-NLS-1$ //$NON-NLS-2$
-						else
-							subbuffer.append("\"\""); //$NON-NLS-1$
-
-						if (i == values.size() - 1)
-							subbuffer.append("."); //$NON-NLS-1$
-						else
-							subbuffer.append(", "); //$NON-NLS-1$
-
-						if (i >= pMaxPropertiesToDisplay) {
-							subbuffer.append("..."); //$NON-NLS-1$
-							break;
-						}
-					}
-					subbuffer.append("</li>\n"); //$NON-NLS-1$
-				}
-			}
-			
-			if (properties.size() == 0) {
-				subbuffer.append("<p>--</p>\n"); //$NON-NLS-1$
-			}
-			
-			subbuffer.append("</ul>\n</li>\n"); //$NON-NLS-1$
-			if (nbOfValues > 0) {
-				buff.append(subbuffer);
-			}
-		}
-		buff.append("</ul>\n"); //$NON-NLS-1$
-		buff.append("</body>\n"); //$NON-NLS-1$
-		buff.append("</html>\n"); //$NON-NLS-1$
-
-		return buff.toString();
+		return buffer.toString();
 	}
 
-	/**
-	 * dump the result in the console.
-	 *
-	 * @param maxvalue
-	 *            the maxvalue
-	 * @return the string
-	 */
 	public String dump(int maxvalue) {
-		StringBuffer buff = new StringBuffer();
-
-		buff.append(PropertiesCoreMessages.generalStatistics);
-		buff.append(PropertiesCoreMessages.t + String.format(Locale.FRANCE, "%,d", numberOfWords) + "\n"); //$NON-NLS-1$
-		buff.append(PropertiesCoreMessages.wordProperties + String.format("%,d", NProperties) + "\n"); //$NON-NLS-1$
-		/*
-		 * for (String s : propertiesCounts.keySet()) if (!s.equals("id")) //$NON-NLS-1$
-		 * buff.append(" - " + s + " " + propertiesCounts.get(s) + "\n"); //$NON-NLS-1$
-		 * //$NON-NLS-2$ //$NON-NLS-3$
-		 */
-		buff.append(PropertiesCoreMessages.s + String.format("%,d", NStructures) + "\n"); //$NON-NLS-1$
-		for (String s : structuresCounts.keySet())
-			buff.append(" - " + s + "\n");// +structuresCounts.get(s)+"\n"); //$NON-NLS-1$ //$NON-NLS-2$
-
-		/*
-		 * buff.append("* Structural Units counts\n"); for(String s :
-		 * internalArchitecture) buff.append(" - "+s+" "+hierarchieCounts.get(s)+"\n");
-		 */
-		buff.append(PropertiesCoreMessages.structuralUnitsProperties);
-		for (String s : internalArchitecture) {
-			buff.append(" - " + s + "\n"); //$NON-NLS-1$ //$NON-NLS-2$
-			for (String ps : internalArchitectureProperties.get(s).keySet()) {
-				if (!(s.equals("text") && (ps.equals("project") || ps.equals("base") || ps.equals("id")))) //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
-				{
-					buff.append("   - " + ps + "(" + internalArchitectureProperties.get(s).get(ps).size() + ") = "); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
-
-					int valuecount = 0;
-					for (String psv : internalArchitectureProperties.get(s).get(ps)) {
-						buff.append(psv);
-						if (valuecount++ >= maxvalue) {
-							buff.append("..."); //$NON-NLS-1$
-							break;
-						}
-						if (valuecount < internalArchitectureProperties.get(s).get(ps).size())
-							buff.append(", "); //$NON-NLS-1$
-					}
-
-					buff.append("\n"); //$NON-NLS-1$
-				}
-			}
+		StringBuffer buffer = new StringBuffer();
+		for (String info : computer.getComputableInformations()) {
+			buffer.append(computer.getInformation(info).toString());
 		}
-
-		return buff.toString();
+		return buffer.toString();
 	}
 
 	/**
@@ -474,87 +191,6 @@
 	}
 
 	/**
-	 * Gets the name.
-	 *
-	 * @return the name
-	 */
-	public String getName() {
-		return corpus.getName();
-	}
-
-	/**
-	 * Gets the base.
-	 *
-	 * @return the base
-	 */
-	public Project getBase() {
-		return corpus.getProject();
-	}
-
-	/**
-	 * Gets the t.
-	 *
-	 * @return the t
-	 */
-	public int getT() {
-		return numberOfWords;
-	}
-
-	/**
-	 * Gets the n properties.
-	 *
-	 * @return the n properties
-	 */
-	public int getNProperties() {
-		return NProperties;
-	}
-
-	/**
-	 * Gets the internal architecture.
-	 *
-	 * @return the internal architecture
-	 */
-	public List<String> getInternalArchitecture() {
-		return internalArchitecture;
-	}
-
-	/**
-	 * Gets the n structures.
-	 *
-	 * @return the n structures
-	 */
-	public int getNStructures() {
-		return NStructures;
-	}
-
-	/**
-	 * Gets the structures counts.
-	 *
-	 * @return the structures counts
-	 */
-	public HashMap<String, Integer> getStructuresCounts() {
-		return structuresCounts;
-	}
-
-	/**
-	 * Gets the annotations types.
-	 *
-	 * @return the annotations types
-	 */
-	public HashMap<String, Integer> getAnnotationsTypes() {
-		return annotationsTypes;
-	}
-
-	/**
-	 * Gets the annotations origins.
-	 *
-	 * @return the annotations origins
-	 */
-	public HashMap<String, Integer> getAnnotationsOrigins() {
-		return annotationsOrigins;
-	}
-
-	/**
 	 * dump the diagnostic in a text file.
 	 *
 	 * @param outfile
@@ -631,11 +267,7 @@
 
 	@Override
 	public String getDetails() {
-		if (numberOfWords >= 0) {
-			return NLS.bind(PropertiesCoreMessages.numberOfWordsP0, numberOfWords);
-		} else {
-			return "";
-		}
+		return computer.getComputableInformations().toString();
 	}
 
 	@Override
@@ -645,33 +277,27 @@
 
 	@Override
 	public String getComputingStartMessage() {
-		return TXMCoreMessages.bind(PropertiesCoreMessages.computingProperties, this.getCorpus().getName());
+		return TXMCoreMessages.bind(PropertiesCoreMessages.computingProperties, this.getName());
 	}
-	
-	@Override
+
 	protected boolean _compute() throws Exception {
+		if (computer._compute(monitor)) {
 
-		this.beginTask(this.getComputingStartMessage(), 3);
-		this.stepGeneralInfos();
-		this.worked(1);
+			String txmhome = Toolbox.getTxmHomePath();
+			String filename = computer.getName();
 
-		this.stepLexicalProperties();
-		this.worked(1);
+			filename = AsciiUtils.buildId(filename);
+			file = new File(txmhome, "results/" + filename + "-infos.html"); //$NON-NLS-1$ //$NON-NLS-2$
 
-		this.stepStructuralUnits();
-		this.worked(1);
-
-		String txmhome = Toolbox.getTxmHomePath();
-		String filename = corpus.getMainCorpus() + "-" + corpus.getName(); //$NON-NLS-1$
-		if (corpus instanceof MainCorpus) {
-			filename = corpus.getID(); // $NON-NLS-1$
+			return this.toHTML(file);
 		}
 
-		filename = AsciiUtils.buildId(filename);
-		file = new File(txmhome, "results/" + filename + "-infos.html"); //$NON-NLS-1$ //$NON-NLS-2$
+		return false;
+	}
 
-		this.toHTML(file);
-		return true;
+	@Override
+	public String getName() {
+		return "Properties";
 	}
 
 	/**
@@ -700,10 +326,6 @@
 		return true;
 	}
 
-	public CQPCorpus getCorpus() {
-		return (CQPCorpus) this.parent;
-	}
-
 	@Override
 	public String getResultType() {
 		return PropertiesCoreMessages.RESULT_TYPE;
