Index: tmp/org.txm.index.core/src/org/txm/index/core/preferences/IndexPreferences.java
===================================================================
--- tmp/org.txm.index.core/src/org/txm/index/core/preferences/IndexPreferences.java	(revision 2730)
+++ tmp/org.txm.index.core/src/org/txm/index/core/preferences/IndexPreferences.java	(revision 2731)
@@ -24,6 +24,11 @@
 	public static final String N_TOP_INDEX = "n_top_index"; //$NON-NLS-1$
 	
 	/**
+	 * if true the links from index will create a subcorpus of the index occurrences
+	 */
+	public static final String LINK_USING_SUBCORPUS = "link_using_subcorpus";
+	
+	/**
 	 * Gets the instance.
 	 * 
 	 * @return the instance
@@ -49,6 +54,6 @@
 		preferences.putInt(F_MAX, Integer.MAX_VALUE);
 		preferences.putInt(V_MAX, Integer.MAX_VALUE);
 		preferences.putInt(N_LINES_PER_PAGE, 100);
-		
+		preferences.putBoolean(LINK_USING_SUBCORPUS, false);
 	}
 }
Index: tmp/org.txm.index.rcp/src/org/txm/index/rcp/editors/IndexEditor.java
===================================================================
--- tmp/org.txm.index.rcp/src/org/txm/index/rcp/editors/IndexEditor.java	(revision 2730)
+++ tmp/org.txm.index.rcp/src/org/txm/index/rcp/editors/IndexEditor.java	(revision 2731)
@@ -38,7 +38,6 @@
 import org.eclipse.swt.graphics.FontData;
 import org.eclipse.swt.layout.GridData;
 import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.layout.RowLayout;
 import org.eclipse.swt.widgets.Composite;
 import org.eclipse.swt.widgets.Display;
 import org.eclipse.swt.widgets.Label;
@@ -535,7 +534,6 @@
 	 */
 	@Override
 	public void _setFocus() {
-		super.setFocus();
 		if (this.queryWidget != null && !this.queryWidget.isDisposed()) {
 			this.queryWidget.setFocus();
 		}
Index: tmp/org.txm.index.rcp/src/org/txm/index/rcp/handlers/SendIndexTo.java
===================================================================
--- tmp/org.txm.index.rcp/src/org/txm/index/rcp/handlers/SendIndexTo.java	(revision 2730)
+++ tmp/org.txm.index.rcp/src/org/txm/index/rcp/handlers/SendIndexTo.java	(revision 2731)
@@ -33,10 +33,12 @@
 import org.eclipse.ui.handlers.HandlerUtil;
 import org.txm.core.results.TXMResult;
 import org.txm.index.core.functions.Index;
+import org.txm.index.core.preferences.IndexPreferences;
 import org.txm.links.rcp.handlers.SendSelectionToQueryable;
 import org.txm.rcp.editors.TXMEditor;
 import org.txm.searchengine.cqp.clientExceptions.CqiClientException;
 import org.txm.searchengine.cqp.corpus.CQPCorpus;
+import org.txm.searchengine.cqp.corpus.Subcorpus;
 import org.txm.searchengine.cqp.corpus.query.CQLQuery;
 
 /**
@@ -75,25 +77,36 @@
 		CQPCorpus corpus = CQPCorpus.getFirstParentCorpus(index);
 		
 		
-		// TODO enable subcorpus from index query when the hidden subcorpus deletion will be managed
-		// if (index.getQuery() instanceof CQLQuery) {
-		// CQLQuery cqlQuery = (CQLQuery) index.getQuery();
-		// CQPCorpus subcorpus;
-		// try {
-		// subcorpus = corpus.createSubcorpus(cqlQuery, cqlQuery.getQueryString());
-		// subcorpus.setVisible(false);
-		// }
-		// catch (CqiClientException e) {
-		// // TODO Auto-generated catch block
-		// e.printStackTrace();
-		// return null;
-		// }
-		//
-		// return subcorpus;
-		// }
-		// else {
-		// return corpus;
-		// }
+		// TODO enable subcorpus from index query when the hidden subcorpus deletion will be managed or another system implemented (eg new SubCorpus(TXMResult result)
+		if (index.getQuery() instanceof CQLQuery && IndexPreferences.getInstance().getBoolean(IndexPreferences.LINK_USING_SUBCORPUS)) {
+			CQLQuery cqlQuery = (CQLQuery) index.getQuery();
+			if (cqlQuery == null || cqlQuery.isEmpty() || // no query
+					cqlQuery.getQueryString().equals("[]")) { // don't bother creating a subcorpus use the parent corpus
+				return corpus;
+			}
+			
+			CQPCorpus subcorpus = null;
+			try {
+				for (Subcorpus c : corpus.getChildren(Subcorpus.class)) {
+					if (c.getQuery().equals(cqlQuery) && !c.isAltered()) {
+						subcorpus = c;
+						break;
+					}
+				}
+				if (subcorpus == null) {
+					subcorpus = corpus.createSubcorpus(cqlQuery, cqlQuery.getQueryString());
+					subcorpus.setVisible(true);
+				}
+			}
+			catch (CqiClientException e) {
+				// TODO Auto-generated catch block
+				e.printStackTrace();
+				return null;
+			}
+			
+			return subcorpus;
+		}
+		
 		return corpus;
 	}
 }
Index: tmp/org.txm.index.rcp/src/org/txm/index/rcp/preferences/IndexPreferencesPage.java
===================================================================
--- tmp/org.txm.index.rcp/src/org/txm/index/rcp/preferences/IndexPreferencesPage.java	(revision 2730)
+++ tmp/org.txm.index.rcp/src/org/txm/index/rcp/preferences/IndexPreferencesPage.java	(revision 2731)
@@ -1,5 +1,6 @@
 package org.txm.index.rcp.preferences;
 
+import org.eclipse.jface.preference.BooleanFieldEditor;
 import org.eclipse.jface.preference.IntegerFieldEditor;
 import org.eclipse.ui.IWorkbench;
 import org.txm.core.preferences.TXMPreferences;
@@ -28,5 +29,7 @@
 	@Override
 	protected void createFieldEditors() {
 		this.addField(new IntegerFieldEditor(TXMPreferences.N_LINES_PER_PAGE, IndexUIMessages.numberOfLinesPerResultPage, this.getFieldEditorParent()));
+		
+		this.addField(new BooleanFieldEditor(IndexPreferences.LINK_USING_SUBCORPUS, "Experimental: create a subcorpus when calling a command from an index", this.getFieldEditorParent()));
 	}
 }
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 2730)
+++ tmp/org.txm.progression.rcp/src/org/txm/progression/rcp/editors/ProgressionEditor.java	(revision 2731)
@@ -568,9 +568,6 @@
 				queryWidget.setFocus();
 			}
 		}
-		else {
-			super.setFocus();
-		}
 	}
 	
 	/**
Index: tmp/org.txm.progression.rcp/src/org/txm/progression/rcp/chartsengine/events/ProgressionEventCallBack.java
===================================================================
--- tmp/org.txm.progression.rcp/src/org/txm/progression/rcp/chartsengine/events/ProgressionEventCallBack.java	(revision 2730)
+++ tmp/org.txm.progression.rcp/src/org/txm/progression/rcp/chartsengine/events/ProgressionEventCallBack.java	(revision 2731)
@@ -211,13 +211,13 @@
 		
 		
 		
-		final TXMResultEditorInput editorInput;
+		final TXMResultEditorInput<Concordance> editorInput;
 		boolean newEditor = false;
 		// Create the linked editor input if needed
 		if (linkedEditor == null) {
 			Concordance concordance = new Concordance(((Progression) chartEditor.getResult()).getCorpus());
 			concordance.setQuery(query);
-			editorInput = new TXMResultEditorInput(concordance);
+			editorInput = new TXMResultEditorInput<>(concordance);
 			newEditor = true;
 		}
 		else {
@@ -412,7 +412,7 @@
 				return;
 			}
 			
-			Edition edition = text.getEdition(corpus.getProject().getDefaultEdition());
+			Edition edition = text.getEdition(corpus.getProject().getDefaultEditionName());
 			
 			if (edition == null) {
 				Log.severe(ProgressionUIMessages.defaultEditionIsMissing);
Index: tmp/org.txm.searchengine.cqp.core/src/org/txm/searchengine/cqp/corpus/MainCorpus.java
===================================================================
--- tmp/org.txm.searchengine.cqp.core/src/org/txm/searchengine/cqp/corpus/MainCorpus.java	(revision 2730)
+++ tmp/org.txm.searchengine.cqp.core/src/org/txm/searchengine/cqp/corpus/MainCorpus.java	(revision 2731)
@@ -84,7 +84,7 @@
 	 * 
 	 * @param partition the parent partition -> only used for subcorpus
 	 */
-	// FIXME: SJ: not used anymore?
+	// FIXME: SJ: not used anymore? MD: this is a temporary solution to build Parts using a Partition (a Part is a CQPCorpus, etc.)
 	public MainCorpus(Partition partition) {
 		super(partition);
 		throw new IllegalArgumentException("Maincorpus parent must not be a Partition");
Index: tmp/org.txm.groovy.core/src/groovy/org/txm/macro/edition/RebuildTRSEditionMacro.groovy
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/macro/edition/RebuildTRSEditionMacro.groovy	(revision 2730)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/macro/edition/RebuildTRSEditionMacro.groovy	(revision 2731)
@@ -124,7 +124,7 @@
 		//                                    en trouver plusieurs !
 		File sonFichier=new File(fichierSonAbsolu)
 		if (sonFichier.exists()){
-			println "   OK, fichierSon trouvé";
+			println "   OK, fichier Son trouvé";
 			found = true;
 		}
 		else{
Index: tmp/org.txm.edition.rcp/src/org/txm/edition/rcp/handlers/OpenEdition.java
===================================================================
--- tmp/org.txm.edition.rcp/src/org/txm/edition/rcp/handlers/OpenEdition.java	(revision 2730)
+++ tmp/org.txm.edition.rcp/src/org/txm/edition/rcp/handlers/OpenEdition.java	(revision 2731)
@@ -124,7 +124,7 @@
 	}
 	
 	public static String[] getDefaultEditions(Project p) {
-		return p.getDefaultEdition().split(","); //$NON-NLS-1$
+		return p.getDefaultEditionName().split(","); //$NON-NLS-1$
 	}
 	
 	public static String[] getDefaultEditions(CQPCorpus c) {
Index: tmp/org.txm.edition.rcp/src/org/txm/edition/rcp/handlers/BackToText.java
===================================================================
--- tmp/org.txm.edition.rcp/src/org/txm/edition/rcp/handlers/BackToText.java	(revision 2730)
+++ tmp/org.txm.edition.rcp/src/org/txm/edition/rcp/handlers/BackToText.java	(revision 2731)
@@ -47,6 +47,7 @@
 import org.txm.concordance.core.functions.Concordance;
 import org.txm.concordance.rcp.editors.ConcordanceEditor;
 import org.txm.concordance.rcp.handlers.BackToTextCommand;
+import org.txm.core.results.TXMResult;
 import org.txm.edition.rcp.editors.RGBA;
 import org.txm.edition.rcp.editors.SynopticEditionEditor;
 import org.txm.edition.rcp.messages.EditionUIMessages;
@@ -54,6 +55,7 @@
 import org.txm.objects.Match;
 import org.txm.objects.Text;
 import org.txm.rcp.StatusLine;
+import org.txm.rcp.editors.TXMEditor;
 import org.txm.rcp.utils.SWTEditorsUtils;
 import org.txm.searchengine.core.SearchEngine;
 import org.txm.searchengine.cqp.AbstractCqiClient;
@@ -66,29 +68,34 @@
 import org.txm.utils.logger.Log;
 
 /**
- * Open a text edition from: a concordance Line 
+ * Open a text edition from: a concordance Line
  * 
  * Or Open a text edition from command parameters see plugin.xml
  * 
  * @author mdecorde.
  */
 public class BackToText extends BackToTextCommand {
-
+	
 	/** The Constant ID. */
 	public final static String ID = "org.txm.synopticedition.rcp.handlers.BackToText"; //$NON-NLS-1$
-	public final static RGBA lightred = new RGBA(249,208,208);
+	
+	public final static RGBA lightred = new RGBA(249, 208, 208);
+	
 	public final static RGBA red = new RGBA(249, 160, 160);
-	//TODO: this kind of link associations must be transfered to a TXMEditor class
-	//private static HashMap<ConcordanceEditor, SynopticEditionEditor> associatedEditors = new HashMap<ConcordanceEditor, SynopticEditionEditor>();
-	private static HashMap<ConcordanceEditor, List<String>> associatedEditorsPreviousOtherWordIDs = new HashMap<ConcordanceEditor, List<String>>();
-	private static HashMap<ConcordanceEditor, List<String>> associatedEditorsPreviousLineids = new HashMap<ConcordanceEditor, List<String>>();
-
-	/* (non-Javadoc)
+	
+	// TODO: this kind of link associations must be transfered to a TXMEditor class
+	// private static HashMap<ConcordanceEditor, SynopticEditionEditor> associatedEditors = new HashMap<ConcordanceEditor, SynopticEditionEditor>();
+	private static HashMap<ConcordanceEditor, List<String>> associatedEditorsPreviousOtherWordIDs = new HashMap<>();
+	
+	private static HashMap<ConcordanceEditor, List<String>> associatedEditorsPreviousLineids = new HashMap<>();
+	
+	/*
+	 * (non-Javadoc)
 	 * @see org.eclipse.core.commands.AbstractHandler#execute(org.eclipse.core.commands.ExecutionEvent)
 	 */
 	@Override
 	public Object execute(ExecutionEvent event) throws ExecutionException {
-
+		
 		String wordid = event
 				.getParameter("org.txm.edition.rcp.handlers.BackToText.wordid");
 		String textid = event
@@ -101,82 +108,85 @@
 			try {
 				IWorkbenchWindow wb = HandlerUtil.getActiveWorkbenchWindow(event);
 				IEditorPart ieditor = wb.getActivePage().getActiveEditor();
-
+				
 				if (!backToText(ieditor, corpusid, Arrays.asList(editionid.split("|")), textid, wordid)) {
-					System.out.println("Could not open edition for wordid="+wordid+" textid="+textid+" edition="+editionid);
+					System.out.println("Could not open edition for wordid=" + wordid + " textid=" + textid + " edition=" + editionid);
 				}
-			} catch (Exception e) {
+			}
+			catch (Exception e) {
 				// TODO Auto-generated catch block
 				e.printStackTrace();
 			}
 			return null;
 		}
-
+		
 		IWorkbenchWindow wb = HandlerUtil.getActiveWorkbenchWindow(event);
 		IEditorPart ieditor = wb.getActivePage().getActiveEditor();
 		if (!(ieditor instanceof ConcordanceEditor)) {
 			return null;
 		}
-		ConcordanceEditor concordanceEditor = (ConcordanceEditor)ieditor;
+		ConcordanceEditor concordanceEditor = (ConcordanceEditor) ieditor;
 		// FIXME: SJ: new version
 		concordanceEditor.backToText();
 		// FIXME: SJ: old version
-//		ISelection sel = wb.getSelectionService().getSelection();
-//		if (sel instanceof IStructuredSelection) {
-//			IStructuredSelection selection = (IStructuredSelection) sel;
-//			if (selection.getFirstElement() instanceof Match) {
-//				backToText(concordanceEditor, (Match)(selection.getFirstElement()));
-//			} else {
-//				System.out.println(SynopticEditionUIMessages.BackToText_1+selection);
-//			}
-//		} else {
-//			System.out.println(SynopticEditionUIMessages.BackToText_2);
-//		}
+		// ISelection sel = wb.getSelectionService().getSelection();
+		// if (sel instanceof IStructuredSelection) {
+		// IStructuredSelection selection = (IStructuredSelection) sel;
+		// if (selection.getFirstElement() instanceof Match) {
+		// backToText(concordanceEditor, (Match)(selection.getFirstElement()));
+		// } else {
+		// System.out.println(SynopticEditionUIMessages.BackToText_1+selection);
+		// }
+		// } else {
+		// System.out.println(SynopticEditionUIMessages.BackToText_2);
+		// }
 		return null;
 	}
-
+	
 	private boolean backToText(IEditorPart ieditor, String corpusid, List<String> editions, String textid, String wordid) throws Exception {
 		MainCorpus corpus = CorpusManager.getCorpusManager().getCorpus(corpusid);
-
+		
 		if (corpus == null) {
-			System.out.println("Error: no corpus with ID="+corpusid);
+			System.out.println("Error: no corpus with ID=" + corpusid);
 		}
-
+		
 		if (editions != null && !corpus.getProject().getBuiltEditionNames().containsAll(editions)) {
-			System.out.println("Warning: corpus has no edition with id="+editions);
+			System.out.println("Warning: corpus has no edition with id=" + editions);
 			editions = Arrays.asList("default");
 		}
-
+		
 		if (!corpus.getProject().getBuiltEditionNames().containsAll(editions)) {
 			System.out.println("Error: corpus has no default edition.");
-			System.out.println("Availables: "+corpus.getProject().getEditionNames());
+			System.out.println("Availables: " + corpus.getProject().getEditionNames());
 			return false;
 		}
-
+		
 		SynopticEditionEditor editor = null;
 		boolean newEditor = false;
 		if (ieditor != null && ieditor instanceof SynopticEditionEditor) {
-			editor = (SynopticEditionEditor)ieditor;
-		} else {
+			editor = (SynopticEditionEditor) ieditor;
+		}
+		else {
 			editor = OpenEdition.openEdition(corpus, editions);
 			newEditor = true;
 		}
-
+		
 		Text text = null;
 		if (textid != null) {
 			text = corpus.getProject().getText(textid);
 			if (text == null) {
-				System.out.println("Error: corpus has no text with id="+textid);
+				System.out.println("Error: corpus has no text with id=" + textid);
 				return false;
 			}
-		} else {
+		}
+		else {
 			text = corpus.getProject().getFirstText();
 			if (text == null) {
 				System.out.println("Error: corpus has no text.");
 				return false;
 			}
 		}
-
+		
 		editor.backToText(text, wordid);
 		if (wordid != null) {
 			editor.addHighlightWordsById(red, wordid);
@@ -184,7 +194,7 @@
 		editor.updateWordStyles();
 		return false;
 	}
-
+	
 	/**
 	 * Open edition.
 	 *
@@ -199,13 +209,13 @@
 		
 		try {
 			if (match == null) return false;
-
+			
 			StructuralUnit textS = null;
 			String textid = ""; //$NON-NLS-1$
 			String baseid = ""; //$NON-NLS-1$
-
+			
 			Property xProperty = corpus.getProperty("x"), yProperty, wProperty, hProperty;
-			String x="0",y="0",w="0",h="0";
+			String x = "0", y = "0", w = "0", h = "0";
 			int[] pos = null;
 			if (xProperty != null) {
 				yProperty = corpus.getProperty("y");
@@ -213,14 +223,14 @@
 					wProperty = corpus.getProperty("w");
 					if (wProperty != null) {
 						AbstractCqiClient CQI = CQPSearchEngine.getCqiClient();
-						int[] cpos = {match.getStart()};
+						int[] cpos = { match.getStart() };
 						hProperty = corpus.getProperty("h");
 						if (hProperty != null) {
 							x = CQI.cpos2Str(xProperty.getQualifiedName(), cpos)[0];
 							y = CQI.cpos2Str(yProperty.getQualifiedName(), cpos)[0];
 							w = CQI.cpos2Str(wProperty.getQualifiedName(), cpos)[0];
 							h = CQI.cpos2Str(hProperty.getQualifiedName(), cpos)[0];
-
+							
 							pos = new int[4];
 							pos[0] = Integer.parseInt(x);
 							pos[1] = Integer.parseInt(y);
@@ -230,130 +240,135 @@
 					}
 				}
 			}
-
-
+			
+			
 			String projectid = ""; //$NON-NLS-1$
 			try {
 				textS = corpus.getStructuralUnit("text"); //$NON-NLS-1$
 				Property textP = textS.getProperty("id"); //$NON-NLS-1$
-				textid = org.txm.searchengine.cqp.corpus.query.Match.getValueForProperty(textP, match.getStart()); //$NON-NLS-1$
-			} catch (Exception e2) {
+				textid = org.txm.searchengine.cqp.corpus.query.Match.getValueForProperty(textP, match.getStart());
+			}
+			catch (Exception e2) {
 				System.out.println("The corpus has no text_id property" + e2); //$NON-NLS-1$
 				org.txm.utils.logger.Log.printStackTrace(e2);
 				return false;
 			}
-
+			
 			Log.fine("Loading line informations...");
-
-			EditorPart l_editor = editor.getLinkedEditor(SynopticEditionEditor.class);
+			
+			SynopticEditionEditor l_editor = editor.getLinkedEditor(SynopticEditionEditor.class);
 			SynopticEditionEditor attachedBrowserEditor = null;
 			if (l_editor != null) {
-				attachedBrowserEditor = (SynopticEditionEditor) l_editor;//associatedEditors.get(editor);
+				attachedBrowserEditor = l_editor;// associatedEditors.get(editor);
 			}
 			
-			if (attachedBrowserEditor!= null && attachedBrowserEditor.isDisposed()) {
+			if (attachedBrowserEditor != null && attachedBrowserEditor.isDisposed()) {
 				associatedEditorsPreviousOtherWordIDs.put(editor, new ArrayList<String>());
 				associatedEditorsPreviousLineids.put(editor, new ArrayList<String>());
 			}
 			List<String> previousOtherWordIDs = associatedEditorsPreviousOtherWordIDs.get(editor);
 			List<String> previousLineids = associatedEditorsPreviousLineids.get(editor);
-
+			
 			if (attachedBrowserEditor == null || attachedBrowserEditor.isDisposed()) {
 				String[] editionsToOpen = OpenEdition.getDefaultEditions(corpus);
-
+				
 				if (editionsToOpen.length == 0) { // the defaultEdition parameter is not set
 					List<String> editionNames = corpus.getProject().getEditionNames();
 					if (editionNames.size() > 0) { // use the first edition declared
 						editionsToOpen = new String[1];
 						editionsToOpen[0] = editionNames.get(0);
 						Log.info(NLS.bind(EditionUIMessages.openingWithFirstEditionNoDefaultEditionSetColonP0, editionNames.get(0)));
-					} else { // no edition in the corpus
+					}
+					else { // no edition in the corpus
 						Log.info(EditionUIMessages.noEditionToOpen);
 						editionsToOpen = new String[0];
 						return false;
 					}
-				} else {
+				}
+				else {
 					Log.fine(NLS.bind(EditionUIMessages.openingDefaultEditionsColonP0, StringUtils.join(editionsToOpen, ", ")));
 				}
-
+				
 				attachedBrowserEditor = OpenEdition.openEdition(corpus, editionsToOpen);
 				editor.addLinkedEditor(attachedBrowserEditor);
 				
 				int position = SynopticEditionPreferences.getInstance().getInt(SynopticEditionPreferences.BACKTOTEXT_POSITION);
 				SWTEditorsUtils.addEditor(editor, attachedBrowserEditor, position);
 			}
-
+			
 			// remove previous highlighted words
 			if (previousOtherWordIDs != null) {
-				//System.out.println("remove previousOtherWordIDs="+previousOtherWordIDs);
+				// System.out.println("remove previousOtherWordIDs="+previousOtherWordIDs);
 				attachedBrowserEditor.removeHighlightWordsById(lightred, previousOtherWordIDs);
 				associatedEditorsPreviousOtherWordIDs.remove(editor); // free mem
 			}
 			if (previousLineids != null) {
-				//System.out.println("remove previousLineids="+previousLineids);
+				// System.out.println("remove previousLineids="+previousLineids);
 				attachedBrowserEditor.removeHighlightWordsById(red, previousLineids);
 				associatedEditorsPreviousLineids.remove(editor); // free mem
 			}
-
-			//System.out.println("getKeywordsId from "+editor.getTopLine()+" to "+editor.getBottomLine() + 1);
+			
+			// System.out.println("getKeywordsId from "+editor.getTopLine()+" to "+editor.getBottomLine() + 1);
 			List<String> otherWordIDs = conc.getKeywordsId(textid, editor.getTopLine(), editor.getBottomLine() + 1);
-			//System.out.println("getKeywordsId="+otherWordIDs);
+			// System.out.println("getKeywordsId="+otherWordIDs);
 			List<String> lineids = null;
 			try {
 				lineids = org.txm.searchengine.cqp.corpus.query.Match.getValuesForProperty(corpus.getProperty("id"), match); //$NON-NLS-1$
-			} catch (Exception e1) {
+			}
+			catch (Exception e1) {
 				org.txm.utils.logger.Log.printStackTrace(e1);
 				return false;
 			}
 			Log.fine(NLS.bind("Project id {0} Corpus (Base) id {1} Text id {2}",  //$NON-NLS-1$
-					new Object[]{projectid, baseid, textid}));
-
-			otherWordIDs.removeAll(lineids); // remove the pivot from others words 
-
+					new Object[] { projectid, baseid, textid }));
+			
+			otherWordIDs.removeAll(lineids); // remove the pivot from others words
+			
 			Text text = corpus.getProject().getText(textid);
 			if (text == null) {
 				StatusLine.setMessage(NLS.bind("BackToText: Text {0} is missing", textid)); //$NON-NLS-1$
 				Log.severe(NLS.bind("BackToText: Text {0} is missing", textid)); //$NON-NLS-1$
 				return false;
 			}
-
+			
 			String line_wordid = lineids.get(0);
 			if (line_wordid == null) {
 				Log.severe(EditionUIMessages.errorColonCouldNotRetrieveLineWordIdsAbortingBackToText);
-				return false;				
+				return false;
 			}
-
-
+			
+			
 			String focusid = null;
 			if (lineids.size() > 0) focusid = lineids.get(0);
-
-			//System.out.println("add otherWordIDs="+otherWordIDs);
+			
+			// System.out.println("add otherWordIDs="+otherWordIDs);
 			attachedBrowserEditor.addHighlightWordsById(lightred, otherWordIDs);
-
-			//System.out.println("add linesids="+lineids);
+			
+			// System.out.println("add linesids="+lineids);
 			attachedBrowserEditor.addHighlightWordsById(red, lineids);
-
+			
 			associatedEditorsPreviousOtherWordIDs.put(editor, otherWordIDs);
 			associatedEditorsPreviousLineids.put(editor, lineids);
-
-			HashSet<int[]> posses = new HashSet<int[]>();
+			
+			HashSet<int[]> posses = new HashSet<>();
 			posses.add(pos);
 			attachedBrowserEditor.setHighlightedArea(posses);
-
+			
 			attachedBrowserEditor.setFocusedWordID(focusid);
-
+			
 			// reload the page and styles
 			attachedBrowserEditor.backToText(text, line_wordid);// open the page(S) containing the word with id=line_wordid
-
+			
 			IWorkbenchPage attachedPage = attachedBrowserEditor.getEditorSite().getPage();
 			attachedPage.activate(attachedBrowserEditor);
-
+			
 			return true;
-
-		} catch (Exception err) {
+			
+		}
+		catch (Exception err) {
 			Log.severe(NLS.bind("** Text display failed: {0}", err)); //$NON-NLS-1$
 			Log.printStackTrace(err);
 		}
 		return false;
 	}
-}
\ No newline at end of file
+}
Index: tmp/org.txm.edition.rcp/src/org/txm/edition/rcp/editors/EditionPanel.java
===================================================================
--- tmp/org.txm.edition.rcp/src/org/txm/edition/rcp/editors/EditionPanel.java	(revision 2730)
+++ tmp/org.txm.edition.rcp/src/org/txm/edition/rcp/editors/EditionPanel.java	(revision 2731)
@@ -47,57 +47,92 @@
 	
 	
 	private ProgressListener progresslistener;
-	//	private List<String> wordids;
-	//	private List<String> lineids;
+	
+	// private List<String> wordids;
+	// private List<String> lineids;
 	/** The edition. */
 	Text currentText;
+	
 	Edition currentEdition;
+	
 	Page currentPage;
+	
 	protected SynopticEditionEditor synopticEditionEditor;
+	
 	private ISelectionProvider selProvider;
+	
 	private MenuManager menuManager;
 	
 	private HashSet<int[]> highlightedAreas = null;
 	
-	//HashMap<String, ArrayList<RGBA>> highlightedColorSpans = new HashMap<String, ArrayList<RGBA>>(); // background color
+	// HashMap<String, ArrayList<RGBA>> highlightedColorSpans = new HashMap<String, ArrayList<RGBA>>(); // background color
 	
-	HashMap<String, ArrayList<RGBA>> highlightedColorPerWordIDS = new HashMap<String, ArrayList<RGBA>>(); // background color
+	HashMap<String, ArrayList<RGBA>> highlightedColorPerWordIDS = new HashMap<>(); // background color
+	
 	public static final String STYLE_NORMAL = "normal"; //$NON-NLS-1$
+	
 	public static final String STYLE_ITALIC = "italic"; //$NON-NLS-1$
+	
 	public static final String STYLE_OBLIQUE = "oblique"; //$NON-NLS-1$
-	HashMap<String, String> fontStylePerWordIDS = new HashMap<String, String>();
+	
+	HashMap<String, String> fontStylePerWordIDS = new HashMap<>();
+	
 	public static final String WEIGHT_NORMAL = "normal"; //$NON-NLS-1$
+	
 	public static final String WEIGHT_BOLD = "bold"; //$NON-NLS-1$
-	HashMap<String, String> fontWeightPerWordIDS = new HashMap<String, String>();
-	HashMap<String, ArrayList<RGBA>> fontColorPerWordIDS = new HashMap<String, ArrayList<RGBA>>();
+	
+	HashMap<String, String> fontWeightPerWordIDS = new HashMap<>();
+	
+	HashMap<String, ArrayList<RGBA>> fontColorPerWordIDS = new HashMap<>();
+	
 	public static final String SIZE_SMALL = "small"; //$NON-NLS-1$
+	
 	public static final String SIZE_MEDIUM = "medium"; //$NON-NLS-1$
+	
 	public static final String SIZE_LARGE = "larger"; //$NON-NLS-1$
+	
 	public static final String SIZE_SMALLER = "smaller"; //$NON-NLS-1$
+	
 	public static final String SIZE_LARGER = "larger"; //$NON-NLS-1$
-	HashMap<String, String> fontSizePerWordIDS = new HashMap<String, String>();
+	
+	HashMap<String, String> fontSizePerWordIDS = new HashMap<>();
+	
 	public static final String FAMILLY_TIMES = "\"Times New Roman\", Times"; //$NON-NLS-1$
+	
 	public static final String FAMILLY_ARIAL = "Arial"; //$NON-NLS-1$
+	
 	public static final String FAMILLY_COURIER = "\"Courier New\", Courier"; //$NON-NLS-1$
-	HashMap<String, String> fontFamillyPerWordIDS = new HashMap<String, String>();
+	
+	HashMap<String, String> fontFamillyPerWordIDS = new HashMap<>();
+	
 	public static final String VARIANT_NORMAL = "normal"; //$NON-NLS-1$
+	
 	public static final String VARIANT_SMALLCAPS = "small-caps"; //$NON-NLS-1$
-	HashMap<String, String> fontVariantPerWordIDS = new HashMap<String, String>();
+	
+	HashMap<String, String> fontVariantPerWordIDS = new HashMap<>();
+	
 	String focusedWordID = null;
 	
-	public static final String highlightscript = "try { var elt = document.getElementById(\"%s\");" + //$NON-NLS-1$ //$NON-NLS-2$
+	public static final String highlightscript = "try { var elt = document.getElementById(\"%s\");" + //$NON-NLS-1$
 			"elt.style.backgroundColor=\"rgb(%s,%s,%s)\";" + //$NON-NLS-1$
-			//"elt.style.paddingLeft=\"3px\";" + //$NON-NLS-1$
-			//"elt.style.paddingRight=\"3px\";" + //$NON-NLS-1$
-			//"elt.style.paddingTop=\"1px\";" + //$NON-NLS-1$
-			//"elt.style.paddingBottom=\"1px\";" + //$NON-NLS-1$
+			// "elt.style.paddingLeft=\"3px\";" + //$NON-NLS-1$
+			// "elt.style.paddingRight=\"3px\";" + //$NON-NLS-1$
+			// "elt.style.paddingTop=\"1px\";" + //$NON-NLS-1$
+			// "elt.style.paddingBottom=\"1px\";" + //$NON-NLS-1$
 			"} catch (e) { };"; //$NON-NLS-1$
+			
 	public static final String highlightscriptRuleFast = "sheet.insertRule(\"#%s {background-color:rgba(%s,%s,%s,%s);}\", 0);"; //$NON-NLS-1$
+	
 	public static final String colorscriptRuleFast = "sheet.insertRule(\"#%s {color:rgba(%s,%s,%s,%s);}\", 0);"; //$NON-NLS-1$
+	
 	public static final String sizescriptRuleFast = "sheet.insertRule(\"#%s {font-size:%s;}\", 0);"; //$NON-NLS-1$
+	
 	public static final String stylescriptRuleFast = "sheet.insertRule(\"#%s {font-style:%s;}\", 0);"; //$NON-NLS-1$
+	
 	public static final String variantscriptRuleFast = "sheet.insertRule(\"#%s {font-variant:%s;}\", 0);"; //$NON-NLS-1$
+	
 	public static final String famillyscriptRuleFast = "sheet.insertRule(\"#%s {font-familly:%s;}\", 0);"; //$NON-NLS-1$
+	
 	public static final String weightscriptRuleFast = "sheet.insertRule(\"#%s {font-weight:%s;}\", 0);"; //$NON-NLS-1$
 	
 	public static final String highlightscriptRule = "sheet.insertRule(\"span[id=\\\"%s\\\"] {background-color:rgba(%s,%s,%s,%s); }\", 0);"; //$NON-NLS-1$
@@ -105,136 +140,142 @@
 	public static final String clearhighlightscript = "try { var elt = document.getElementById(\"%s\"); elt.style.backgroundColor=\"white\";elt.style.fontWeight=\"\";" + //$NON-NLS-1$
 			"} catch (e) { };"; //$NON-NLS-1$
 	
-	public String functions = 
-			""//"alert(\"loading functions\");" //$NON-NLS-1$
-			+"\nfunction getNodeText(node) {" //$NON-NLS-1$
-			+"\n	if (typeof node == 'string') return node;" //$NON-NLS-1$
-			+"\n	else if (typeof  node.innerText != 'undefined') return node.innerText;" //$NON-NLS-1$
-			+"\n	else if (typeof  node.InnerText != 'undefined') return node.InnerText;" //$NON-NLS-1$
-			+"\n	else if (typeof  node.textContent != 'undefined') return node.textContent;" //$NON-NLS-1$
-			+"\n	else return null;" //$NON-NLS-1$
-			+"\n}" //$NON-NLS-1$
-			+"\nfunction txmGetParent(node) {" //$NON-NLS-1$
-			+"\n	if (typeof  node.parentNode != 'undefined') return node.parentNode;" //$NON-NLS-1$
-			+"\n	else return null;" //$NON-NLS-1$
-			+"\n}" //$NON-NLS-1$
-			+"\nfunction txmGetChildren(node) {" //$NON-NLS-1$
-			+"\n	if (typeof node == 'string') return 'STRING HTML';" //$NON-NLS-1$
-			+"\n	else if (typeof  node.children != 'undefined') return node.children;" //$NON-NLS-1$
-			+"\n	else if (typeof  node.ChildNodes != 'undefined') return node.ChildNodes;" //$NON-NLS-1$
-			+"\n	else if (typeof  node.childNodes != 'undefined') return node.childNodes;" //$NON-NLS-1$
-			+"\n	else return null;" //$NON-NLS-1$
-			+"\n}" //$NON-NLS-1$
-			+"\nfunction txmGetSelection() {" //$NON-NLS-1$
-			+"\n	if (typeof window.getSelection != 'undefined') {return window.getSelection();}" //$NON-NLS-1$
-			+"\n	else if (typeof document.selection != 'undefined') { return document.selection;}" //$NON-NLS-1$
-			+"\n	else return 'NO SELECTION';" //$NON-NLS-1$
-			+"\n}" //$NON-NLS-1$
-			+"\nfunction txmGetRangeSize(selection) {" //$NON-NLS-1$
-			+"\n	if (typeof selection.rangeCount != 'undefined') {return selection.rangeCount;}" //$NON-NLS-1$
-			+"\n	else if (typeof selection.createRangeCollection != 'undefined') { return selection.createRangeCollection().length();} // IE5 has no multiple selection" //$NON-NLS-1$
-			+"\n}" //$NON-NLS-1$
-			+"\nfunction txmGetRange(selection, i) {" //$NON-NLS-1$
-			+"\n	if (typeof selection.getRangeAt != 'undefined') {return selection.getRangeAt(i);}" //$NON-NLS-1$
-			+"\n	else if (typeof selection.createRangeCollection != 'undefined') {return selection.createRangeCollection().item(i);}" // IE > IE5  //$NON-NLS-1$
-			+"\n	else if (typeof selection.createRange != 'undefined') { return selection.createRange();} // IE5 has no multiple selection" //$NON-NLS-1$
-			+"\n	else return 'NO RANGE';" //$NON-NLS-1$
-			+"\n}" //$NON-NLS-1$
-			+"\nfunction txmGetParentElementRange(range) {" //$NON-NLS-1$
-			+"\n	if (typeof range.parentElement != 'undefined') {return range.parentElement();}" //$NON-NLS-1$
-			+"\n	else if (typeof range.startContainer != 'undefined') { return range.startContainer.parentNode;}" //$NON-NLS-1$
-			+"\n	else return 'NO PARENT';" //$NON-NLS-1$
-			+"\n}" //$NON-NLS-1$
-			+"\nfunction txmGetFragment(range) {" //$NON-NLS-1$
-			+"\n	if (typeof range.cloneContents != 'undefined') { return range.cloneContents();}" //$NON-NLS-1$
-			+"\n	else if (typeof range.htmlText != 'undefined') {var node = document.createElement('sel'); node.innerHTML = range.htmlText; 		return node;" //$NON-NLS-1$
-			+"\n	} else return 'NO FRAG';" //$NON-NLS-1$
-			+"\n}" //$NON-NLS-1$
-			+"\nfunction txmGetTagName(node) {" //$NON-NLS-1$
-			+"\n	if (typeof node.tagName != 'undefined') {return node.tagName;}" //$NON-NLS-1$
-			+"\n	else if (typeof node.nodeName != 'undefined') { return node.nodeName;}" //$NON-NLS-1$
-			+"\n	else if (typeof node.name != 'undefined') { return node.name;}" //$NON-NLS-1$
-			+"\n	else return 'NO TAGNAME';" //$NON-NLS-1$
-			+"\n}" //$NON-NLS-1$
-			+"\nfunction findSpans(children, all) {" //$NON-NLS-1$
-			+"\n    for (var i = 0 ; i < children.length ; i++) {" //$NON-NLS-1$
-			+"\n    	var node = children.item(i);" //$NON-NLS-1$
-			+"\n		if (node.nodeType == 1) {" //$NON-NLS-1$
-			+"\n    	var id = node.getAttribute('id');" //$NON-NLS-1$
-			+"\n       		if (node.tagName == 'SPAN' && id != null && id.indexOf('w_') == 0 && getNodeText(node).length > 0) {" //$NON-NLS-1$
-			+"\n            	if (id != null) all.push(id);" //$NON-NLS-1$
-			+"\n        	} else {" //$NON-NLS-1$
-			+"\n        		findSpans(txmGetChildren(node), all)" //$NON-NLS-1$
-			+"\n        	}" //$NON-NLS-1$
-			+"\n		}" //$NON-NLS-1$
-			+"\n	}" //$NON-NLS-1$
-			+"\n}" //$NON-NLS-1$
-			+"\nfunction findIdsInString(str, all) {" //$NON-NLS-1$
-			+"\n    for (var i = 0 ; i < children.length ; i++) {" //$NON-NLS-1$
-			+"\n    	var node = children.item(i);" //$NON-NLS-1$
-			+"\n		if (node.nodeType == 1) {" //$NON-NLS-1$
-			+"\n    	var id = node.getAttribute('id');" //$NON-NLS-1$
-			+"\n       		if (node.tagName == 'SPAN' && id != null && id.indexOf('w_') == 0 && getNodeText(node).length > 0) {" //$NON-NLS-1$
-			+"\n            	if (id != null) all.push(id);" //$NON-NLS-1$
-			+"\n        	} else {" //$NON-NLS-1$
-			+"\n        		findSpans(txmGetChildren(node), all)" //$NON-NLS-1$
-			+"\n        	}" //$NON-NLS-1$
-			+"\n		}" //$NON-NLS-1$
-			+"\n	}" //$NON-NLS-1$
-			+"\n}" //$NON-NLS-1$
-			+"\nfunction get_type(thing){if(thing===null)return \"[object Null]\";  return Object.prototype.toString.call(thing);}\n" //$NON-NLS-1$
-			+"\nfunction getDetailedObject(inputObject) { var detailedObject = {}; var properties; \n   do {        properties = Object.getOwnPropertyNames( inputObject );        for (var o in properties) {detailedObject[properties[o]] = inputObject[properties[o]];}} while ( inputObject = Object.getPrototypeOf(inputObject) );return detailedObject;}\n" //$NON-NLS-1$
-			+"\nvar sheet = null;" //$NON-NLS-1$
-			+"\ntry{" //$NON-NLS-1$
-			+"\n	var style = document.createElement(\"style\");" //$NON-NLS-1$
-			+"\n	try { style.appendChild(document.createTextNode(\"\")); } catch (e) {};"//webkit hack //$NON-NLS-1$
-			+"\n	document.body.appendChild(style);" //$NON-NLS-1$
-			+"\n	sheet = style.sheet;" //$NON-NLS-1$
-			+"\n} catch(e) {sheet='error'}" //$NON-NLS-1$
-			+"\ntry{" //$NON-NLS-1$
-			+"\n" // define scrollIntoViewIfNeeded if absent //$NON-NLS-1$
-			+"\nif (!Element.prototype.scrollIntoViewIfNeeded) {" //$NON-NLS-1$
-			+"\n	Element.prototype.scrollIntoViewIfNeeded = function (centerIfNeeded) {" //$NON-NLS-1$
-			+"\n		centerIfNeeded = arguments.length === 0 ? true : !!centerIfNeeded;" //$NON-NLS-1$
-			+"\n		var parent = this.parentNode," //$NON-NLS-1$
-			+"\n		parentComputedStyle = window.getComputedStyle(parent, null)," //$NON-NLS-1$
-			+"\n		parentBorderTopWidth = parseInt(parentComputedStyle.getPropertyValue('border-top-width'))," //$NON-NLS-1$
-			+"\n		parentBorderLeftWidth = parseInt(parentComputedStyle.getPropertyValue('border-left-width'))," //$NON-NLS-1$
-			+"\n		overTop = this.offsetTop - parent.offsetTop < parent.scrollTop," //$NON-NLS-1$
-			+"\n		overBottom = (this.offsetTop - parent.offsetTop + this.clientHeight - parentBorderTopWidth) > (parent.scrollTop + parent.clientHeight)," //$NON-NLS-1$
-			+"\n		overLeft = this.offsetLeft - parent.offsetLeft < parent.scrollLeft," //$NON-NLS-1$
-			+"\n		overRight = (this.offsetLeft - parent.offsetLeft + this.clientWidth - parentBorderLeftWidth) > (parent.scrollLeft + parent.clientWidth)," //$NON-NLS-1$
-			+"\n		alignWithTop = overTop && !overBottom;" //$NON-NLS-1$
-			+"\n		if ((overTop || overBottom) && centerIfNeeded) {" //$NON-NLS-1$
-			+"\n			parent.scrollTop = this.offsetTop - parent.offsetTop - parent.clientHeight / 2 - parentBorderTopWidth + this.clientHeight / 2;" //$NON-NLS-1$
-			+"\n		}" //$NON-NLS-1$
-			+"\n		if ((overLeft || overRight) && centerIfNeeded) {" //$NON-NLS-1$
-			+"\n			parent.scrollLeft = this.offsetLeft - parent.offsetLeft - parent.clientWidth / 2 - parentBorderLeftWidth + this.clientWidth / 2;" //$NON-NLS-1$
-			+"\n		}" //$NON-NLS-1$
-			+"\n		if ((overTop || overBottom || overLeft || overRight) && !centerIfNeeded) {" //$NON-NLS-1$
-			+"\n			this.scrollIntoView(alignWithTop);" //$NON-NLS-1$
-			+"\n		}" //$NON-NLS-1$
-			+"\n	};" //$NON-NLS-1$
-			+"\n}" //$NON-NLS-1$
-			+"\n} catch(e) {Element.prototype.scrollIntoViewIfNeeded = Element.prototype.scrollIntoView}"; //$NON-NLS-1$
+	public String functions = ""// "alert(\"loading functions\");" //$NON-NLS-1$
+			+ "\nfunction getNodeText(node) {" //$NON-NLS-1$
+			+ "\n	if (typeof node == 'string') return node;" //$NON-NLS-1$
+			+ "\n	else if (typeof  node.innerText != 'undefined') return node.innerText;" //$NON-NLS-1$
+			+ "\n	else if (typeof  node.InnerText != 'undefined') return node.InnerText;" //$NON-NLS-1$
+			+ "\n	else if (typeof  node.textContent != 'undefined') return node.textContent;" //$NON-NLS-1$
+			+ "\n	else return null;" //$NON-NLS-1$
+			+ "\n}" //$NON-NLS-1$
+			+ "\nfunction txmGetParent(node) {" //$NON-NLS-1$
+			+ "\n	if (typeof  node.parentNode != 'undefined') return node.parentNode;" //$NON-NLS-1$
+			+ "\n	else return null;" //$NON-NLS-1$
+			+ "\n}" //$NON-NLS-1$
+			+ "\nfunction txmGetChildren(node) {" //$NON-NLS-1$
+			+ "\n	if (typeof node == 'string') return 'STRING HTML';" //$NON-NLS-1$
+			+ "\n	else if (typeof  node.children != 'undefined') return node.children;" //$NON-NLS-1$
+			+ "\n	else if (typeof  node.ChildNodes != 'undefined') return node.ChildNodes;" //$NON-NLS-1$
+			+ "\n	else if (typeof  node.childNodes != 'undefined') return node.childNodes;" //$NON-NLS-1$
+			+ "\n	else return null;" //$NON-NLS-1$
+			+ "\n}" //$NON-NLS-1$
+			+ "\nfunction txmGetSelection() {" //$NON-NLS-1$
+			+ "\n	if (typeof window.getSelection != 'undefined') {return window.getSelection();}" //$NON-NLS-1$
+			+ "\n	else if (typeof document.selection != 'undefined') { return document.selection;}" //$NON-NLS-1$
+			+ "\n	else return 'NO SELECTION';" //$NON-NLS-1$
+			+ "\n}" //$NON-NLS-1$
+			+ "\nfunction txmGetRangeSize(selection) {" //$NON-NLS-1$
+			+ "\n	if (typeof selection.rangeCount != 'undefined') {return selection.rangeCount;}" //$NON-NLS-1$
+			+ "\n	else if (typeof selection.createRangeCollection != 'undefined') { return selection.createRangeCollection().length();} // IE5 has no multiple selection" //$NON-NLS-1$
+			+ "\n}" //$NON-NLS-1$
+			+ "\nfunction txmGetRange(selection, i) {" //$NON-NLS-1$
+			+ "\n	if (typeof selection.getRangeAt != 'undefined') {return selection.getRangeAt(i);}" //$NON-NLS-1$
+			+ "\n	else if (typeof selection.createRangeCollection != 'undefined') {return selection.createRangeCollection().item(i);}" // IE > IE5 //$NON-NLS-1$
+			+ "\n	else if (typeof selection.createRange != 'undefined') { return selection.createRange();} // IE5 has no multiple selection" //$NON-NLS-1$
+			+ "\n	else return 'NO RANGE';" //$NON-NLS-1$
+			+ "\n}" //$NON-NLS-1$
+			+ "\nfunction txmGetParentElementRange(range) {" //$NON-NLS-1$
+			+ "\n	if (typeof range.parentElement != 'undefined') {return range.parentElement();}" //$NON-NLS-1$
+			+ "\n	else if (typeof range.startContainer != 'undefined') { return range.startContainer.parentNode;}" //$NON-NLS-1$
+			+ "\n	else return 'NO PARENT';" //$NON-NLS-1$
+			+ "\n}" //$NON-NLS-1$
+			+ "\nfunction txmGetFragment(range) {" //$NON-NLS-1$
+			+ "\n	if (typeof range.cloneContents != 'undefined') { return range.cloneContents();}" //$NON-NLS-1$
+			+ "\n	else if (typeof range.htmlText != 'undefined') {var node = document.createElement('sel'); node.innerHTML = range.htmlText; 		return node;" //$NON-NLS-1$
+			+ "\n	} else return 'NO FRAG';" //$NON-NLS-1$
+			+ "\n}" //$NON-NLS-1$
+			+ "\nfunction txmGetTagName(node) {" //$NON-NLS-1$
+			+ "\n	if (typeof node.tagName != 'undefined') {return node.tagName;}" //$NON-NLS-1$
+			+ "\n	else if (typeof node.nodeName != 'undefined') { return node.nodeName;}" //$NON-NLS-1$
+			+ "\n	else if (typeof node.name != 'undefined') { return node.name;}" //$NON-NLS-1$
+			+ "\n	else return 'NO TAGNAME';" //$NON-NLS-1$
+			+ "\n}" //$NON-NLS-1$
+			+ "\nfunction findSpans(children, all) {" //$NON-NLS-1$
+			+ "\n    for (var i = 0 ; i < children.length ; i++) {" //$NON-NLS-1$
+			+ "\n    	var node = children.item(i);" //$NON-NLS-1$
+			+ "\n		if (node.nodeType == 1) {" //$NON-NLS-1$
+			+ "\n    	var id = node.getAttribute('id');" //$NON-NLS-1$
+			+ "\n       		if (node.tagName == 'SPAN' && id != null && id.indexOf('w_') == 0 && getNodeText(node).length > 0) {" //$NON-NLS-1$
+			+ "\n            	if (id != null) all.push(id);" //$NON-NLS-1$
+			+ "\n        	} else {" //$NON-NLS-1$
+			+ "\n        		findSpans(txmGetChildren(node), all)" //$NON-NLS-1$
+			+ "\n        	}" //$NON-NLS-1$
+			+ "\n		}" //$NON-NLS-1$
+			+ "\n	}" //$NON-NLS-1$
+			+ "\n}" //$NON-NLS-1$
+			+ "\nfunction findIdsInString(str, all) {" //$NON-NLS-1$
+			+ "\n    for (var i = 0 ; i < children.length ; i++) {" //$NON-NLS-1$
+			+ "\n    	var node = children.item(i);" //$NON-NLS-1$
+			+ "\n		if (node.nodeType == 1) {" //$NON-NLS-1$
+			+ "\n    	var id = node.getAttribute('id');" //$NON-NLS-1$
+			+ "\n       		if (node.tagName == 'SPAN' && id != null && id.indexOf('w_') == 0 && getNodeText(node).length > 0) {" //$NON-NLS-1$
+			+ "\n            	if (id != null) all.push(id);" //$NON-NLS-1$
+			+ "\n        	} else {" //$NON-NLS-1$
+			+ "\n        		findSpans(txmGetChildren(node), all)" //$NON-NLS-1$
+			+ "\n        	}" //$NON-NLS-1$
+			+ "\n		}" //$NON-NLS-1$
+			+ "\n	}" //$NON-NLS-1$
+			+ "\n}" //$NON-NLS-1$
+			+ "\nfunction get_type(thing){if(thing===null)return \"[object Null]\";  return Object.prototype.toString.call(thing);}\n" //$NON-NLS-1$
+			+ "\nfunction getDetailedObject(inputObject) { var detailedObject = {}; var properties; \n   do {        properties = Object.getOwnPropertyNames( inputObject );        for (var o in properties) {detailedObject[properties[o]] = inputObject[properties[o]];}} while ( inputObject = Object.getPrototypeOf(inputObject) );return detailedObject;}\n" //$NON-NLS-1$
+			+ "\nvar sheet = null;" //$NON-NLS-1$
+			+ "\ntry{" //$NON-NLS-1$
+			+ "\n	var style = document.createElement(\"style\");" //$NON-NLS-1$
+			+ "\n	try { style.appendChild(document.createTextNode(\"\")); } catch (e) {};"// webkit hack //$NON-NLS-1$
+			+ "\n	document.body.appendChild(style);" //$NON-NLS-1$
+			+ "\n	sheet = style.sheet;" //$NON-NLS-1$
+			+ "\n} catch(e) {sheet='error'}" //$NON-NLS-1$
+			+ "\ntry{" //$NON-NLS-1$
+			+ "\n" // define scrollIntoViewIfNeeded if absent //$NON-NLS-1$
+			+ "\nif (!Element.prototype.scrollIntoViewIfNeeded) {" //$NON-NLS-1$
+			+ "\n	Element.prototype.scrollIntoViewIfNeeded = function (centerIfNeeded) {" //$NON-NLS-1$
+			+ "\n		centerIfNeeded = arguments.length === 0 ? true : !!centerIfNeeded;" //$NON-NLS-1$
+			+ "\n		var parent = this.parentNode," //$NON-NLS-1$
+			+ "\n		parentComputedStyle = window.getComputedStyle(parent, null)," //$NON-NLS-1$
+			+ "\n		parentBorderTopWidth = parseInt(parentComputedStyle.getPropertyValue('border-top-width'))," //$NON-NLS-1$
+			+ "\n		parentBorderLeftWidth = parseInt(parentComputedStyle.getPropertyValue('border-left-width'))," //$NON-NLS-1$
+			+ "\n		overTop = this.offsetTop - parent.offsetTop < parent.scrollTop," //$NON-NLS-1$
+			+ "\n		overBottom = (this.offsetTop - parent.offsetTop + this.clientHeight - parentBorderTopWidth) > (parent.scrollTop + parent.clientHeight)," //$NON-NLS-1$
+			+ "\n		overLeft = this.offsetLeft - parent.offsetLeft < parent.scrollLeft," //$NON-NLS-1$
+			+ "\n		overRight = (this.offsetLeft - parent.offsetLeft + this.clientWidth - parentBorderLeftWidth) > (parent.scrollLeft + parent.clientWidth)," //$NON-NLS-1$
+			+ "\n		alignWithTop = overTop && !overBottom;" //$NON-NLS-1$
+			+ "\n		if ((overTop || overBottom) && centerIfNeeded) {" //$NON-NLS-1$
+			+ "\n			parent.scrollTop = this.offsetTop - parent.offsetTop - parent.clientHeight / 2 - parentBorderTopWidth + this.clientHeight / 2;" //$NON-NLS-1$
+			+ "\n		}" //$NON-NLS-1$
+			+ "\n		if ((overLeft || overRight) && centerIfNeeded) {" //$NON-NLS-1$
+			+ "\n			parent.scrollLeft = this.offsetLeft - parent.offsetLeft - parent.clientWidth / 2 - parentBorderLeftWidth + this.clientWidth / 2;" //$NON-NLS-1$
+			+ "\n		}" //$NON-NLS-1$
+			+ "\n		if ((overTop || overBottom || overLeft || overRight) && !centerIfNeeded) {" //$NON-NLS-1$
+			+ "\n			this.scrollIntoView(alignWithTop);" //$NON-NLS-1$
+			+ "\n		}" //$NON-NLS-1$
+			+ "\n	};" //$NON-NLS-1$
+			+ "\n}" //$NON-NLS-1$
+			+ "\n} catch(e) {Element.prototype.scrollIntoViewIfNeeded = Element.prototype.scrollIntoView}"; //$NON-NLS-1$
 	
 	protected boolean fastWordHighLight = SynopticEditionPreferences.getInstance().getBoolean(SynopticEditionPreferences.FAST_HIGHLIGHT);
+	
 	private ArrayList<ProgressListener> beforeHighlighListeners;
+	
 	public ArrayList<ProgressListener> getBeforeHighlighListeners() {
 		return beforeHighlighListeners;
 	}
+	
 	private ArrayList<ProgressListener> afterHighlighListeners;
+	
 	public ArrayList<ProgressListener> getAfterHighlighListeners() {
 		return beforeHighlighListeners;
 	}
+	
 	public Object evaluate(String code) {
 		if (Log.getLevel().intValue() <= Level.FINEST.intValue()) System.out.println(code);
 		return getBrowser().evaluate(code);
 	}
+	
 	public boolean execute(String code) {
 		if (Log.getLevel().intValue() <= Level.FINEST.intValue()) System.out.println(code);
 		return getBrowser().execute(code);
 	}
+	
 	public EditionPanel(SynopticEditionEditor synopticEditionEditor, Composite parent, int style, Edition edition) {
 		super(parent, style);
 		this.synopticEditionEditor = synopticEditionEditor;
@@ -246,53 +287,58 @@
 			Bundle bundle = Platform.getBundle("org.txm.edition.rcp"); //$NON-NLS-1$
 			URL fileURL = bundle.getEntry("res/js/functions.js"); //$NON-NLS-1$
 			URL r = FileLocator.resolve(fileURL);
-			Log.fine("Load JS functions from: "+r);
+			Log.fine("Load JS functions from: " + r);
 			functions = IOUtils.getText(r, "UTF-8"); //$NON-NLS-1$
 			
-		} catch (Exception e) {
+		}
+		catch (Exception e) {
 			Log.severe(EditionUIMessages.bind(EditionUIMessages.error_while_reading, functionsFile, e.getLocalizedMessage()));
 			Log.printStackTrace(e);
 		}
 		
-		beforeHighlighListeners = new ArrayList<ProgressListener>();
-		afterHighlighListeners = new ArrayList<ProgressListener>();
+		beforeHighlighListeners = new ArrayList<>();
+		afterHighlighListeners = new ArrayList<>();
 		
 		progresslistener = new ProgressListener() {
 			
 			@Override
-			public void changed(ProgressEvent event) { }
+			public void changed(ProgressEvent event) {}
 			
 			@Override
 			public void completed(ProgressEvent event) {
 				
-				//System.out.println("EditionPanel "+currentEdition.getName()+" reload "+getCurrentPage().getName());
+				// System.out.println("EditionPanel "+currentEdition.getName()+" reload "+getCurrentPage().getName());
 				Object rez = evaluate("return typeof sheet;"); //$NON-NLS-1$
 				if ("undefined".equals(rez)) { //$NON-NLS-1$
 					if (!execute(functions)) { // build the sheet if not present in the HTML DOM
-						Log.fine("JS execution (init) error with="+functions); //$NON-NLS-1$
-					} else {
+						Log.fine("JS execution (init) error with=" + functions); //$NON-NLS-1$
+					}
+					else {
 						
 					}
 				}
 				
 				// do something before the highlight is done
-				for (ProgressListener pl : beforeHighlighListeners) { pl.completed(event);}
+				for (ProgressListener pl : beforeHighlighListeners) {
+					pl.completed(event);
+				}
 				
 				
-				//System.out.println("highlight: "+highlightedColorPerWordIDS);
+				// System.out.println("highlight: "+highlightedColorPerWordIDS);
 				StringBuilder buffer = new StringBuilder();
-				//buffer.append("alert(\"\"+sheet);\n");
+				// buffer.append("alert(\"\"+sheet);\n");
 				if (!fastWordHighLight) {
-					//					for (String wordid : highlightedColorPerWordIDS.keySet()) {
-					//						buffer.append(String.format(clearhighlightscript, wordid)+"\n");
-					//					}
-				} else {
+					// for (String wordid : highlightedColorPerWordIDS.keySet()) {
+					// buffer.append(String.format(clearhighlightscript, wordid)+"\n");
+					// }
+				}
+				else {
 					buffer.append("try { while(sheet.cssRules.length > 0) sheet.deleteRule(0); } catch (e) {};\n"); // empty style //$NON-NLS-1$
 				}
 				
 				if (buffer.length() > 0) {
 					if (!execute(buffer.toString())) {
-						Log.fine("JS execution error (delete cssRules) with="+buffer);
+						Log.fine("JS execution error (delete cssRules) with=" + buffer);
 					}
 				}
 				
@@ -304,8 +350,8 @@
 				String lastWord = "w_999999999"; //$NON-NLS-1$
 				while (nextPage != null && currentPage != nextPage) {
 					lastWord = nextPage.getWordId();
-					if (!("w_0".equals(lastWord))) { // this is a word id 
-						break; // ok 
+					if (!("w_0".equals(lastWord))) { // this is a word id
+						break; // ok
 					}
 					Page p = currentEdition.getNextPage(nextPage);
 					if (p == nextPage) { // end of pages
@@ -314,20 +360,20 @@
 					}
 					nextPage = p;
 				}
-				//System.out.println("firstWord="+firstWord+" lastWord="+lastWord);
-				//int n = 0;
-				//long start = System.currentTimeMillis();
+				// System.out.println("firstWord="+firstWord+" lastWord="+lastWord);
+				// int n = 0;
+				// long start = System.currentTimeMillis();
 				
 				for (String wordid : highlightedColorPerWordIDS.keySet()) {
-					//Log.finest("words to highlight: "+highlightedColorPerWordIDS);
+					// Log.finest("words to highlight: "+highlightedColorPerWordIDS);
 					if (highlightedColorPerWordIDS.get(wordid).size() == 0) continue; // error
 					
-					//if (!slowWordHighLight) { //TODO: this code must be replaced with word position instead of word id comparaison
+					// if (!slowWordHighLight) { //TODO: this code must be replaced with word position instead of word id comparaison
 					if (Edition.isFirstGTthanSecond(wordid, firstWord) < 0) continue; // skip the word to highlight
 					if (Edition.isFirstGTthanSecond(lastWord, wordid) < 0) continue; // skip the word to highlight
-					//}
-					//n++;
-					RGBA composite = new RGBA(0,0,0,0f);
+					// }
+					// n++;
+					RGBA composite = new RGBA(0, 0, 0, 0f);
 					int size = highlightedColorPerWordIDS.get(wordid).size();
 					
 					for (RGBA color : highlightedColorPerWordIDS.get(wordid)) {
@@ -343,54 +389,55 @@
 					
 					String s = null;
 					if (!fastWordHighLight) {
-						//s = String.format(highlightscriptRule, wordid, composite.r, composite.g, composite.b, composite.a);
-						s = "try { document.getElementById(\"" + wordid + "\").style.backgroundColor=\"rgba("+composite.r+","+composite.g+","+composite.b+","+composite.a+")\";" //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$
-								+ 
-								//								"elt.style.paddingLeft=\"3px\";" + //$NON-NLS-1$
-								//								"elt.style.paddingRight=\"3px\";" + //$NON-NLS-1$
-								//								"elt.style.paddingTop=\"1px\";" + //$NON-NLS-1$
-								//								"elt.style.paddingBottom=\"1px\";" + //$NON-NLS-1$
+						// s = String.format(highlightscriptRule, wordid, composite.r, composite.g, composite.b, composite.a);
+						s = "try { document.getElementById(\"" + wordid + "\").style.backgroundColor=\"rgba(" + composite.r + "," + composite.g + "," + composite.b + "," + composite.a + ")\";" //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$
+								+
+						// "elt.style.paddingLeft=\"3px\";" + //$NON-NLS-1$
+						// "elt.style.paddingRight=\"3px\";" + //$NON-NLS-1$
+						// "elt.style.paddingTop=\"1px\";" + //$NON-NLS-1$
+						// "elt.style.paddingBottom=\"1px\";" + //$NON-NLS-1$
 								"} catch (e) { };"; //$NON-NLS-1$
-					} else {
-						//TODO: replace this line with the next one for TXM 0.7.9
+					}
+					else {
+						// TODO: replace this line with the next one for TXM 0.7.9
 						s = String.format(highlightscriptRuleFast, wordid.replace(" ", "\\ "), composite.r, composite.g, composite.b, composite.a); //$NON-NLS-1$ //$NON-NLS-2$
-						//						s = String.format(highlightscriptRuleFast, wordid, composite.r, composite.g, composite.b, composite.a);
+						// s = String.format(highlightscriptRuleFast, wordid, composite.r, composite.g, composite.b, composite.a);
 					}
 					
-					buffer.append(s+"\n"); //$NON-NLS-1$
+					buffer.append(s + "\n"); //$NON-NLS-1$
 				}
 				
 				if (buffer.length() > 0) {
 					if (!execute(buffer.toString())) {
-						Log.fine("JS execution (highlight) error with="+buffer);
+						Log.fine("JS execution (highlight) error with=" + buffer);
 					}
 				}
 				
 				
 				buffer = new StringBuilder();
 				
-				//				for (String wordidslist : highlightedColorSpans.keySet()) {
-				//					RGBA composite = new RGBA(0,0,0,0f);
-				//					int size = highlightedColorSpans.get(wordidslist).size();
-				//					
-				//					for (RGBA color : highlightedColorSpans.get(wordidslist)) {
-				//						composite.r += color.r;
-				//						composite.g += color.g;
-				//						composite.b += color.b;
-				//						composite.a += color.a;
-				//					}
-				//					
-				//					composite.r /= size;
-				//					composite.g /= size;
-				//					composite.b /= size;
-				//					
-				//					String cmd = "var l = "+wordidslist+";\n";
-				//					cmd += "wrap(l, \""+wordidslist+"\";\n";
-				//					buffer.append(cmd+"\n");
-				//				}
+				// for (String wordidslist : highlightedColorSpans.keySet()) {
+				// RGBA composite = new RGBA(0,0,0,0f);
+				// int size = highlightedColorSpans.get(wordidslist).size();
+				//
+				// for (RGBA color : highlightedColorSpans.get(wordidslist)) {
+				// composite.r += color.r;
+				// composite.g += color.g;
+				// composite.b += color.b;
+				// composite.a += color.a;
+				// }
+				//
+				// composite.r /= size;
+				// composite.g /= size;
+				// composite.b /= size;
+				//
+				// String cmd = "var l = "+wordidslist+";\n";
+				// cmd += "wrap(l, \""+wordidslist+"\";\n";
+				// buffer.append(cmd+"\n");
+				// }
 				
 				for (String wordid : fontColorPerWordIDS.keySet()) {
-					RGBA composite = new RGBA(0,0,0,0f);
+					RGBA composite = new RGBA(0, 0, 0, 0f);
 					int size = fontColorPerWordIDS.get(wordid).size();
 					
 					for (RGBA color : fontColorPerWordIDS.get(wordid)) {
@@ -405,12 +452,12 @@
 					composite.b /= size;
 					
 					String s = String.format(colorscriptRuleFast, wordid, composite.r, composite.g, composite.b, composite.a);
-					buffer.append(s+"\n"); //$NON-NLS-1$
+					buffer.append(s + "\n"); //$NON-NLS-1$
 				}
 				
 				if (buffer.length() > 0) {
 					if (!execute(buffer.toString())) {
-						Log.fine("JS execution (color) error with="+buffer);
+						Log.fine("JS execution (color) error with=" + buffer);
 					}
 				}
 				
@@ -419,42 +466,43 @@
 				
 				for (String wordid : fontSizePerWordIDS.keySet()) {
 					String s = String.format(sizescriptRuleFast, wordid, fontSizePerWordIDS.get(wordid));
-					buffer.append(s+"\n"); //$NON-NLS-1$
+					buffer.append(s + "\n"); //$NON-NLS-1$
 				}
 				
 				for (String wordid : fontWeightPerWordIDS.keySet()) {
 					String s = null;
 					if (!fastWordHighLight) {
-						//s = String.format(highlightscriptRule, wordid, composite.r, composite.g, composite.b, composite.a);
-						s = "try { document.getElementById(\"" + wordid + "\").style.fontWeight=\""+fontWeightPerWordIDS.get(wordid)+"\";" //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
-								+ 
-								//								"elt.style.paddingLeft=\"3px\";" + //$NON-NLS-1$
-								//								"elt.style.paddingRight=\"3px\";" + //$NON-NLS-1$
-								//								"elt.style.paddingTop=\"1px\";" + //$NON-NLS-1$
-								//								"elt.style.paddingBottom=\"1px\";" + //$NON-NLS-1$
+						// s = String.format(highlightscriptRule, wordid, composite.r, composite.g, composite.b, composite.a);
+						s = "try { document.getElementById(\"" + wordid + "\").style.fontWeight=\"" + fontWeightPerWordIDS.get(wordid) + "\";" //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+								+
+						// "elt.style.paddingLeft=\"3px\";" + //$NON-NLS-1$
+						// "elt.style.paddingRight=\"3px\";" + //$NON-NLS-1$
+						// "elt.style.paddingTop=\"1px\";" + //$NON-NLS-1$
+						// "elt.style.paddingBottom=\"1px\";" + //$NON-NLS-1$
 								"} catch (e) { };"; //$NON-NLS-1$
-						//s = String.format(highlightscriptRule, wordid, composite.r, composite.g, composite.b, composite.a);
-						//						s = "try { var elt = document.getElementById(\"" + wordid + "\");" + //$NON-NLS-1$ //$NON-NLS-2$
-						//								"elt.style.fontWeight=\""+fontWeightPerWordIDS.get(wordid)+"\";" + //$NON-NLS-1$
-						////								"elt.style.paddingLeft=\"3px\";" + //$NON-NLS-1$
-						////								"elt.style.paddingRight=\"3px\";" + //$NON-NLS-1$
-						////								"elt.style.paddingTop=\"1px\";" + //$NON-NLS-1$
-						////								"elt.style.paddingBottom=\"1px\";" + //$NON-NLS-1$
-						//								"} catch (e) { };"; //$NON-NLS-1$
-					} else {
+						// s = String.format(highlightscriptRule, wordid, composite.r, composite.g, composite.b, composite.a);
+						// s = "try { var elt = document.getElementById(\"" + wordid + "\");" + //$NON-NLS-1$ //$NON-NLS-2$
+						// "elt.style.fontWeight=\""+fontWeightPerWordIDS.get(wordid)+"\";" + //$NON-NLS-1$
+						//// "elt.style.paddingLeft=\"3px\";" + //$NON-NLS-1$
+						//// "elt.style.paddingRight=\"3px\";" + //$NON-NLS-1$
+						//// "elt.style.paddingTop=\"1px\";" + //$NON-NLS-1$
+						//// "elt.style.paddingBottom=\"1px\";" + //$NON-NLS-1$
+						// "} catch (e) { };"; //$NON-NLS-1$
+					}
+					else {
 						s = String.format(weightscriptRuleFast, wordid, fontWeightPerWordIDS.get(wordid));
 					}
-					buffer.append(s+"\n"); //$NON-NLS-1$
+					buffer.append(s + "\n"); //$NON-NLS-1$
 				}
 				
 				for (String wordid : fontFamillyPerWordIDS.keySet()) {
 					String s = String.format(famillyscriptRuleFast, wordid, fontFamillyPerWordIDS.get(wordid));
-					buffer.append(s+"\n"); //$NON-NLS-1$
+					buffer.append(s + "\n"); //$NON-NLS-1$
 				}
 				
 				if (buffer.length() > 0) {
 					if (!execute(buffer.toString())) {
-						Log.fine("JS execution (font) error with="+buffer);
+						Log.fine("JS execution (font) error with=" + buffer);
 					}
 				}
 				
@@ -462,17 +510,18 @@
 				buffer = new StringBuilder();
 				
 				if (focusedWordID != null) {
-					//System.out.println("Focus on: "+focusedWordID);
+					// System.out.println("Focus on: "+focusedWordID);
 					String s = "try { showElementIfNeeded(document.getElementById(\"" + focusedWordID + "\")); } catch (e) {document.getElementById(\"" + focusedWordID + "\").scrollIntoView();};"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
-					buffer.append(s+"\n"); //$NON-NLS-1$
+					buffer.append(s + "\n"); //$NON-NLS-1$
 				}
 				
 				if (buffer.length() > 0) {
 					if (execute(buffer.toString())) {
 						focusedWordID = null; // focus one time
-					} else {
-						Log.fine("JS execution (focus) error with="+buffer);
 					}
+					else {
+						Log.fine("JS execution (focus) error with=" + buffer);
+					}
 				}
 				
 				
@@ -481,35 +530,39 @@
 				if (highlightedAreas != null) {
 					for (int[] pos : highlightedAreas) {
 						if (pos == null || pos.length != 4) continue;
-						String s = "try {v.setFocusOn("+pos[0]+", "+pos[1]+", "+pos[2]+", "+pos[3]+");} catch (e) { };"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$
-						buffer.append(s+"\n"); //$NON-NLS-1$
+						String s = "try {v.setFocusOn(" + pos[0] + ", " + pos[1] + ", " + pos[2] + ", " + pos[3] + ");} catch (e) { };"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$
+						buffer.append(s + "\n"); //$NON-NLS-1$
 						break;// one word only for now
 					}
 				}
 				
-				//System.out.println(buffer);
+				// System.out.println(buffer);
 				if (buffer.length() > 0) {
 					if (!execute(buffer.toString())) {
-						Log.fine("JS execution (area focus) error with="+buffer);
+						Log.fine("JS execution (area focus) error with=" + buffer);
 					}
 				}
-				//System.out.println("n="+n+" time="+(System.currentTimeMillis()-start));
+				// System.out.println("n="+n+" time="+(System.currentTimeMillis()-start));
 				
 				// do something after the highlight is done
-				for (ProgressListener pl : afterHighlighListeners) { pl.completed(event);}
+				for (ProgressListener pl : afterHighlighListeners) {
+					pl.completed(event);
+				}
 			}
 		};
 		
 		getBrowser().addMouseListener(new MouseListener() {
 			
 			boolean dblClick = false;
+			
 			boolean debug = false;
-			private int t,x,y;
 			
+			private int t, x, y;
+			
 			@Override
 			public void mouseDoubleClick(MouseEvent e) {
 				if (debug) System.out.println("DOUBLE CLICK"); //$NON-NLS-1$
-				dblClick= true;
+				dblClick = true;
 			}
 			
 			@Override
@@ -531,18 +584,18 @@
 				EditionPanel panel = EditionPanel.this;
 				
 				// filter click that are not a left simple click (no drag)
-				//System.out.println("click count="+e.count+" button="+e.button+" time="+e.time+" diff="+(e.time-t)+" dist="+(Math.abs(e.x - x) + Math.abs(e.y - y)));
+				// System.out.println("click count="+e.count+" button="+e.button+" time="+e.time+" diff="+(e.time-t)+" dist="+(Math.abs(e.x - x) + Math.abs(e.y - y)));
 				if (e.count > 1) {
 					if (debug) System.out.println(" DOUBLE CLICK"); //$NON-NLS-1$
-					//System.out.println("not a simple click");
+					// System.out.println("not a simple click");
 					return;
 				}
 				
 				int dist = Math.abs(e.x - x) + Math.abs(e.y - y);
-				int deltat = (e.time-t);
-				//System.out.println("deltat ="+deltat);
+				int deltat = (e.time - t);
+				// System.out.println("deltat ="+deltat);
 				if (dist >= 0 && (deltat > 0 || dist > 0)) {
-					//System.out.println(" DRAG dist="+dist+" deltat="+deltat);
+					// System.out.println(" DRAG dist="+dist+" deltat="+deltat);
 					String[] ids = panel.getWordSelection(); // may be null
 					
 					panel.expandSelectionTo(ids);
@@ -552,13 +605,14 @@
 		});
 		
 		getBrowser().addProgressListener(progresslistener);
-		new CommandLink (synopticEditionEditor, getBrowser());
-		new EditionLink (synopticEditionEditor, getBrowser());
+		new CommandLink(synopticEditionEditor, getBrowser());
+		new EditionLink(synopticEditionEditor, getBrowser());
 	}
 	
 	/**
 	 * Bypass BrowserViewer restriction on the getBrowser method
 	 */
+	@Override
 	public Browser getBrowser() {
 		return super.getBrowser();
 	}
@@ -567,7 +621,7 @@
 	 * Bypass BrowserViewer restriction on the getBrowser method
 	 */
 	public String getDOM() {
-		return "";//execute("return document.innerHTML"; //$NON-NLS-1$
+		return "";// execute("return document.innerHTML"; //$NON-NLS-1$
 	}
 	
 	public ISelectionProvider getSelectionProvider() {
@@ -579,7 +633,7 @@
 			if (this.highlightedColorPerWordIDS.get(wordid) != null) {
 				removeHighlightWordsById(color, wordid);
 			}
-			ArrayList<RGBA> hs = new ArrayList<RGBA>();
+			ArrayList<RGBA> hs = new ArrayList<>();
 			this.highlightedColorPerWordIDS.put(wordid, hs);
 			hs.add(color);
 		}
@@ -606,12 +660,12 @@
 	}
 	
 	public void removeHighlightWordsById(RGBA color, Collection<String> wordids) {
-		//System.out.println("Call removeHighlightWordsById: "+wordids+" color="+color);
+		// System.out.println("Call removeHighlightWordsById: "+wordids+" color="+color);
 		StringBuffer buffer = new StringBuffer();
 		for (String wordid : wordids) {
 			removeHighlightWordsById(color, wordid);
 			if (!fastWordHighLight) {
-				buffer.append(String.format(clearhighlightscript, wordid)+"\n"); //$NON-NLS-1$
+				buffer.append(String.format(clearhighlightscript, wordid) + "\n"); //$NON-NLS-1$
 			}
 		}
 		
@@ -621,7 +675,7 @@
 	public void removeHighlightWordsById(RGBA color, String wordid) {
 		if (highlightedColorPerWordIDS.get(wordid) == null) return; // nothing to do
 		
-		//System.out.println("remove color="+color+" from id="+wordid);
+		// System.out.println("remove color="+color+" from id="+wordid);
 		this.highlightedColorPerWordIDS.get(wordid).remove(color);
 		
 		if (this.highlightedColorPerWordIDS.get(wordid).size() == 0) {
@@ -631,6 +685,7 @@
 	
 	/**
 	 * Open the page containing the word with ID=$line_wordid
+	 * 
 	 * @param line_wordid
 	 * @return true if the page changed
 	 */
@@ -644,11 +699,13 @@
 			System.out.println(s);
 			StatusLine.setMessage(s);
 			Log.severe(s);
-		} else {
+		}
+		else {
 			Page openedPage = null;
 			if (line_wordid != null && line_wordid.length() > 0) {
 				openedPage = edition.getPageForWordId(line_wordid);
-			} else {
+			}
+			else {
 				openedPage = edition.getFirstPage();
 			}
 			if (openedPage != null && openedPage != currentPage) {
@@ -674,9 +731,10 @@
 		
 		this.setURL(currentPage.toURL());
 		
-		//page_label.setText(makePageLabel());
+		// page_label.setText(makePageLabel());
 	}
 	
+	@Override
 	public void setURL(String url) {
 		if (!this.browser.isDisposed()) {
 			super.setURL(url);
@@ -707,15 +765,17 @@
 			
 			if (previous == currentPage) {
 				previousText(true);
-			} else {
+			}
+			else {
 				currentPage = previous;
 				this.setURL(currentPage.toURL());
 			}
 			currentText = currentEdition.getText();
-		} else {
+		}
+		else {
 			firstPage();
 		}
-		//page_label.setText(makePageLabel());
+		// page_label.setText(makePageLabel());
 	}
 	
 	
@@ -729,25 +789,28 @@
 			Page next = currentEdition.getNextPage(currentPage);
 			if (next == currentPage) {
 				nextText();
-			} else {
+			}
+			else {
 				currentPage = next;
 				this.setURL(currentPage.toURL());
 			}
 			currentText = currentEdition.getText();
-		} else {
+		}
+		else {
 			firstPage();
 		}
-		//page_label.setText(makePageLabel());
+		// page_label.setText(makePageLabel());
 	}
 	
 	
 	public void firstText() {
-		//Text current = this.currentPage.getEdition().getText();
+		// Text current = this.currentPage.getEdition().getText();
 		Project project = currentText.getProject();
 		String id;
 		try {
 			id = this.synopticEditionEditor.getCorpus().getCorpusTextIdsList()[0];
-		} catch (Exception e) {
+		}
+		catch (Exception e) {
 			Log.printStackTrace(e);
 			return;
 		}
@@ -761,7 +824,7 @@
 				return;
 			}
 			currentEdition = tmp;
-			currentPage = currentEdition.getFirstPage(); 
+			currentPage = currentEdition.getFirstPage();
 			currentText = firstText;
 			if (currentPage == null) {
 				StatusLine.setMessage("No previous text"); //$NON-NLS-1$
@@ -775,13 +838,14 @@
 	 * Next text.
 	 */
 	public void lastText() {
-		//Text current = this.currentPage.getEdition().getText();
+		// Text current = this.currentPage.getEdition().getText();
 		Project project = currentText.getProject();
 		String id;
 		try {
 			String[] ids = this.synopticEditionEditor.getCorpus().getCorpusTextIdsList();
-			id = ids[ids.length-1];
-		} catch (Exception e) {
+			id = ids[ids.length - 1];
+		}
+		catch (Exception e) {
 			Log.printStackTrace(e);
 			return;
 		}
@@ -796,7 +860,7 @@
 			}
 			
 			currentEdition = tmp;
-			currentPage = currentEdition.getFirstPage(); 
+			currentPage = currentEdition.getFirstPage();
 			currentText = lastText;
 			if (currentPage == null) {
 				StatusLine.setMessage("No text next"); //$NON-NLS-1$
@@ -804,14 +868,15 @@
 			}
 			
 			this.setURL(currentPage.toURL());
-			//page_label.setText(makePageLabel());
+			// page_label.setText(makePageLabel());
 		}
 		// System.out.println("Next texts "+nextText);
 	}
 	
 	/**
 	 * Previous text.
-	 * @param fromNextText if true  it means the user was reading the next text and then we show the last page of the previous text
+	 * 
+	 * @param fromNextText if true it means the user was reading the next text and then we show the last page of the previous text
 	 */
 	public void previousText(boolean fromNextText) {
 		
@@ -821,7 +886,7 @@
 			String[] ids = this.synopticEditionEditor.getCorpus().getCorpusTextIdsList();
 			String currentId = currentText.getName();
 			int idx = 0;
-			for (int i = 0 ; i < ids.length ;i++) {
+			for (int i = 0; i < ids.length; i++) {
 				if (currentId.equals(ids[i])) {
 					idx = i;
 					break;
@@ -829,7 +894,8 @@
 			}
 			if (idx > 0) idx--;
 			id = ids[idx];
-		} catch (Exception e) {
+		}
+		catch (Exception e) {
 			e.printStackTrace();
 			return;
 		}
@@ -846,10 +912,11 @@
 			currentEdition = tmp;
 			currentText = previousText;
 			if (fromNextText) {
-				currentPage = currentEdition.getLastPage(); 
-			} else {
-				currentPage = currentEdition.getFirstPage(); 
+				currentPage = currentEdition.getLastPage();
 			}
+			else {
+				currentPage = currentEdition.getFirstPage();
+			}
 			
 			if (currentPage == null) {
 				StatusLine.setMessage("No previous text"); //$NON-NLS-1$
@@ -864,14 +931,14 @@
 	 * Next text.
 	 */
 	public void nextText() {
-		//Text current = this.currentPage.getEdition().getText();
+		// Text current = this.currentPage.getEdition().getText();
 		Project project = currentText.getProject();
 		String id;
 		try {
 			String[] ids = this.synopticEditionEditor.getCorpus().getCorpusTextIdsList();
 			String currentId = currentText.getName();
 			int idx = 0;
-			for (int i = 0 ; i < ids.length ;i++) {
+			for (int i = 0; i < ids.length; i++) {
 				if (currentId.equals(ids[i])) {
 					idx = i;
 					break;
@@ -879,7 +946,8 @@
 			}
 			if (idx < ids.length - 1) idx++;
 			id = ids[idx];
-		} catch (Exception e) {
+		}
+		catch (Exception e) {
 			e.printStackTrace();
 			return;
 		}
@@ -894,7 +962,7 @@
 			}
 			currentEdition = tmp;
 			
-			currentPage = currentEdition.getFirstPage(); 
+			currentPage = currentEdition.getFirstPage();
 			currentText = nextText;
 			if (currentPage == null) {
 				StatusLine.setMessage("No text next"); //$NON-NLS-1$
@@ -902,7 +970,7 @@
 			}
 			
 			this.setURL(currentPage.toURL());
-			//page_label.setText(makePageLabel());
+			// page_label.setText(makePageLabel());
 		}
 		// System.out.println("Next texts "+nextText);
 	}
@@ -917,7 +985,7 @@
 		}
 		
 		currentEdition = tmp;
-		currentPage = currentEdition.getFirstPage(); 
+		currentPage = currentEdition.getFirstPage();
 		currentText = text;
 		if (currentPage == null) {
 			StatusLine.setMessage("No text next"); //$NON-NLS-1$
@@ -927,7 +995,7 @@
 		if (refresh) {
 			this.setURL(currentPage.toURL());
 		}
-		//page_label.setText(makePageLabel());
+		// page_label.setText(makePageLabel());
 	}
 	
 	/**
@@ -963,7 +1031,7 @@
 	 * @param page the page
 	 */
 	public void showPage(Page page) {
-		//System.out.println("SHOW PAGE "+page);
+		// System.out.println("SHOW PAGE "+page);
 		currentEdition = page.getEdition();
 		currentText = currentEdition.getText();
 		currentPage = page;
@@ -974,30 +1042,30 @@
 		this.setURL(currentPage.toURL());
 	}
 	
-	//	/**
-	//	 * Sets the edition.
-	//	 *
-	//	 * @param edition the new edition
-	//	 */
-	//	public void setEdition(Edition edition) {
-	//		this.currentEdition = edition;
-	//	}
+	// /**
+	// * Sets the edition.
+	// *
+	// * @param edition the new edition
+	// */
+	// public void setEdition(Edition edition) {
+	// this.currentEdition = edition;
+	// }
 	
-	static String SCRIPT01 = "var html = \"\";"+ //$NON-NLS-1$
-			"if (typeof window.getSelection != \"undefined\") {"+ // modern Web browsers //$NON-NLS-1$
-			"var sel = window.getSelection();"+ //$NON-NLS-1$
-			"if (sel.rangeCount) {"+ //$NON-NLS-1$
-			"var container = document.createElement(\"div\");"+ //$NON-NLS-1$
-			"for (var i = 0, len = sel.rangeCount; i < len; ++i) {"+ //$NON-NLS-1$
-			"container.appendChild(sel.getRangeAt(i).cloneContents());"+ //$NON-NLS-1$
-			"}"+ //$NON-NLS-1$
-			"html = container.innerHTML;"+ //$NON-NLS-1$
-			"}"+ //$NON-NLS-1$
-			"} else if (typeof document.selection != \"undefined\") {"+ // for IE < 11 //$NON-NLS-1$
-			"if (document.selection.type == \"Text\") {"+ //$NON-NLS-1$
-			"html = document.selection.createRange().htmlText;"+ //$NON-NLS-1$
+	static String SCRIPT01 = "var html = \"\";" + //$NON-NLS-1$
+			"if (typeof window.getSelection != \"undefined\") {" + // modern Web browsers //$NON-NLS-1$
+			"var sel = window.getSelection();" + //$NON-NLS-1$
+			"if (sel.rangeCount) {" + //$NON-NLS-1$
+			"var container = document.createElement(\"div\");" + //$NON-NLS-1$
+			"for (var i = 0, len = sel.rangeCount; i < len; ++i) {" + //$NON-NLS-1$
+			"container.appendChild(sel.getRangeAt(i).cloneContents());" + //$NON-NLS-1$
 			"}" + //$NON-NLS-1$
+			"html = container.innerHTML;" + //$NON-NLS-1$
 			"}" + //$NON-NLS-1$
+			"} else if (typeof document.selection != \"undefined\") {" + // for IE < 11 //$NON-NLS-1$
+			"if (document.selection.type == \"Text\") {" + //$NON-NLS-1$
+			"html = document.selection.createRange().htmlText;" + //$NON-NLS-1$
+			"}" + //$NON-NLS-1$
+			"}" + //$NON-NLS-1$
 			"return html"; //$NON-NLS-1$
 	
 	public String getTextSelectionDOM() {
@@ -1010,74 +1078,77 @@
 	 */
 	public String[] getWordSelection() {
 		
-		//System.out.println("getWordSelection");
-		String SCRIPT02_getspans = ""//functions //$NON-NLS-1$
-				+"var all = [];" //$NON-NLS-1$
-				+"\nvar sel = txmGetSelection();" //$NON-NLS-1$
-				+"\nif (sel.rangeCount == 0) {return all;}" //$NON-NLS-1$
-				//+"\nalert('sel='+sel);"
-				+"\nvar range = txmGetRange(sel, 0);" //$NON-NLS-1$
-				//+"\nalert('range='+range);"
-				+"\nvar frag = txmGetFragment(range);" //$NON-NLS-1$
-				//+"\nalert('frag='+frag);"
-				+"\nvar children = txmGetChildren(frag);" //$NON-NLS-1$
-				//+"\nalert('children='+children);"
-				//+"\nalert('children.length='+children.length);"
-				+"\nif ((children.length == 0) || (children.length == 1 && children.item(0).nodeType == 3)) {" //$NON-NLS-1$
-				+"\n	var parent = txmGetParentElementRange(range);" //$NON-NLS-1$
-				//+"\n	if (parent instanceof HTMLHtmlElement) {alert('HTMLHtmlElement parent='+parent);return findIdsInString(parent, all);}"
-				+"\n	if (typeof parent.getAttribute == 'undefined') {return all}" //$NON-NLS-1$
-				+"\n	var id = parent.getAttribute('id');" //$NON-NLS-1$
-				+"\n	if (txmGetTagName(parent) == 'SPAN' && id != null && id.indexOf('w_') == 0) {" //$NON-NLS-1$
-				+"\n		all.push(id);" //$NON-NLS-1$
-				+"\n	} else {" // try with the parent's parent  //$NON-NLS-1$
-				+"\n		var parent = txmGetParent(parent);" //$NON-NLS-1$
-				//+"\n		alert('text selection, parent='+txmGetTagName(parent))"
-				+"\n	if (typeof parent.getAttribute == 'undefined') {return all}" //$NON-NLS-1$
-				+"\n		var id = parent.getAttribute('id');" //$NON-NLS-1$
-				+"\n		if (txmGetTagName(parent) == 'SPAN' && id != null && id.indexOf('w_') == 0) {" //$NON-NLS-1$
-				+"\n			all.push(id);" //$NON-NLS-1$
-				+"\n		}" //$NON-NLS-1$
-				+"\n	}" //$NON-NLS-1$
-				+"\n} else {" //$NON-NLS-1$
-				+"\n	findSpans(children, all);" //$NON-NLS-1$
-				+"\n}" //$NON-NLS-1$
-				//+"alert('result='+all)"
-				+"\nreturn all;"; //$NON-NLS-1$
+		// System.out.println("getWordSelection");
+		String SCRIPT02_getspans = ""// functions //$NON-NLS-1$
+				+ "var all = [];" //$NON-NLS-1$
+				+ "\nvar sel = txmGetSelection();" //$NON-NLS-1$
+				+ "\nif (sel.rangeCount == 0) {return all;}" //$NON-NLS-1$
+				// +"\nalert('sel='+sel);"
+				+ "\nvar range = txmGetRange(sel, 0);" //$NON-NLS-1$
+				// +"\nalert('range='+range);"
+				+ "\nvar frag = txmGetFragment(range);" //$NON-NLS-1$
+				// +"\nalert('frag='+frag);"
+				+ "\nvar children = txmGetChildren(frag);" //$NON-NLS-1$
+				// +"\nalert('children='+children);"
+				// +"\nalert('children.length='+children.length);"
+				+ "\nif ((children.length == 0) || (children.length == 1 && children.item(0).nodeType == 3)) {" //$NON-NLS-1$
+				+ "\n	var parent = txmGetParentElementRange(range);" //$NON-NLS-1$
+				// +"\n if (parent instanceof HTMLHtmlElement) {alert('HTMLHtmlElement parent='+parent);return findIdsInString(parent, all);}"
+				+ "\n	if (typeof parent.getAttribute == 'undefined') {return all}" //$NON-NLS-1$
+				+ "\n	var id = parent.getAttribute('id');" //$NON-NLS-1$
+				+ "\n	if (txmGetTagName(parent) == 'SPAN' && id != null && id.indexOf('w_') == 0) {" //$NON-NLS-1$
+				+ "\n		all.push(id);" //$NON-NLS-1$
+				+ "\n	} else {" // try with the parent's parent //$NON-NLS-1$
+				+ "\n		var parent = txmGetParent(parent);" //$NON-NLS-1$
+				// +"\n alert('text selection, parent='+txmGetTagName(parent))"
+				+ "\n	if (typeof parent.getAttribute == 'undefined') {return all}" //$NON-NLS-1$
+				+ "\n		var id = parent.getAttribute('id');" //$NON-NLS-1$
+				+ "\n		if (txmGetTagName(parent) == 'SPAN' && id != null && id.indexOf('w_') == 0) {" //$NON-NLS-1$
+				+ "\n			all.push(id);" //$NON-NLS-1$
+				+ "\n		}" //$NON-NLS-1$
+				+ "\n	}" //$NON-NLS-1$
+				+ "\n} else {" //$NON-NLS-1$
+				+ "\n	findSpans(children, all);" //$NON-NLS-1$
+				+ "\n}" //$NON-NLS-1$
+				// +"alert('result='+all)"
+				+ "\nreturn all;"; //$NON-NLS-1$
+				
+		// System.out.println(functions);
+		// System.out.println(SCRIPT02_getspans);
 		
-		//		System.out.println(functions);
-		//		System.out.println(SCRIPT02_getspans);
-		
 		Object ret = evaluate(SCRIPT02_getspans);
 		if (ret instanceof Object[]) {
-			Log.finer("selection word ids="+Arrays.toString((Object[])ret)); //$NON-NLS-1$
-			Object[] array = (Object[])ret;
+			Log.finer("selection word ids=" + Arrays.toString((Object[]) ret)); //$NON-NLS-1$
+			Object[] array = (Object[]) ret;
 			String[] sel = new String[2];
 			if (array.length == 0) {
 				return null;
-			} else if (array.length == 1) {
+			}
+			else if (array.length == 1) {
 				sel[0] = array[0].toString();
 				return sel;
-			} else {
+			}
+			else {
 				sel[0] = array[0].toString();
-				sel[1] = array[array.length-1].toString();
+				sel[1] = array[array.length - 1].toString();
 				return sel;
 			}
-		} else { 
+		}
+		else {
 			Log.severe(EditionUIMessages.bind(EditionUIMessages.sCRIPTRETURNEDEqualsP0, ret));
 			return null;
 		}
 	}
 	
 	public String getTextSelection() {
-		//System.out.println("DOM="+getTextSelectionDOM());
-		String rez =  getTextSelectionDOM().replaceAll("<[^>]+>", ""); //$NON-NLS-1$ //$NON-NLS-2$
-		//System.out.println("STR="+rez);
+		// System.out.println("DOM="+getTextSelectionDOM());
+		String rez = getTextSelectionDOM().replaceAll("<[^>]+>", ""); //$NON-NLS-1$ //$NON-NLS-2$
+		// System.out.println("STR="+rez);
 		return rez;
 	}
 	
 	@Override
-	public void addSelectionChangedListener(ISelectionChangedListener listener) {	}
+	public void addSelectionChangedListener(ISelectionChangedListener listener) {}
 	
 	@Override
 	public ISelection getSelection() {
@@ -1086,13 +1157,15 @@
 	
 	@Override
 	public void removeSelectionChangedListener(
-			ISelectionChangedListener listener) {	}
+			ISelectionChangedListener listener) {}
 	
 	@Override
-	public void setSelection(ISelection selection) {	}
+	public void setSelection(ISelection selection) {}
 	
-	static public class SynopticTextSelection implements ISelection  {
+	static public class SynopticTextSelection implements ISelection {
+		
 		String str;
+		
 		public SynopticTextSelection(EditionPanel panel) {
 			this.str = panel.getTextSelection();
 		}
@@ -1111,13 +1184,13 @@
 		return currentEdition;
 	}
 	
-	public MenuManager getMenuManager() {	
+	public MenuManager getMenuManager() {
 		return menuManager;
 	}
 	
 	public void initMenu() {
-		// create a new menu	
-		menuManager = new MenuManager(); //$NON-NLS-1$
+		// create a new menu
+		menuManager = new MenuManager();
 		
 		Menu menu = menuManager.createContextMenu(this.getBrowser());
 		
@@ -1142,7 +1215,7 @@
 					}
 					
 					@Override
-					public void widgetDefaultSelected(SelectionEvent e) { }
+					public void widgetDefaultSelected(SelectionEvent e) {}
 				});
 				String text = EditionPanel.this.getTextSelection();
 				copyItem.setEnabled(text != null && text.length() > 0);
@@ -1157,7 +1230,7 @@
 					}
 					
 					@Override
-					public void widgetDefaultSelected(SelectionEvent e) { }
+					public void widgetDefaultSelected(SelectionEvent e) {}
 				});
 				MenuItem backItem = new MenuItem(menu, SWT.NONE);
 				backItem.setText(EditionUIMessages.back);
@@ -1169,7 +1242,7 @@
 					}
 					
 					@Override
-					public void widgetDefaultSelected(SelectionEvent e) { }
+					public void widgetDefaultSelected(SelectionEvent e) {}
 				});
 				MenuItem forwardItem = new MenuItem(menu, SWT.NONE);
 				forwardItem.setText(EditionUIMessages.forward);
@@ -1181,7 +1254,7 @@
 					}
 					
 					@Override
-					public void widgetDefaultSelected(SelectionEvent e) { }
+					public void widgetDefaultSelected(SelectionEvent e) {}
 				});
 			}
 			
@@ -1190,52 +1263,73 @@
 				// TODO Auto-generated method stub
 			}
 		});
-		//		// restore old listeners
-		//		Menu origMenu = this.browser.getMenu();
-		//		if (origMenu != null) {
-		//			if (origMenu.getListeners(SWT.Hide) != null)
-		//				for (Listener listener : origMenu.getListeners(SWT.Hide)) menu.addListener(SWT.Hide, listener);
-		//			if (origMenu.getListeners(SWT.Show) != null)
-		//				for (Listener listener : origMenu.getListeners(SWT.Show)) menu.addListener(SWT.Show, listener);
-		//			for (MenuItem origItem : origMenu.getItems()) { // restore old menu items
-		//				MenuItem item = new MenuItem(menu, origItem.getStyle());
-		//				item.setText(origItem.getText());
-		//				item.setImage(origItem.getImage());
-		//				if (origItem.getListeners(SWT.Selection) != null && origItem.getListeners(SWT.Selection).length > 0)
-		//					item.addListener(SWT.Selection, origItem.getListeners(SWT.Selection)[0]);
-		//			}
-		//		}
+		// // restore old listeners
+		// Menu origMenu = this.browser.getMenu();
+		// if (origMenu != null) {
+		// if (origMenu.getListeners(SWT.Hide) != null)
+		// for (Listener listener : origMenu.getListeners(SWT.Hide)) menu.addListener(SWT.Hide, listener);
+		// if (origMenu.getListeners(SWT.Show) != null)
+		// for (Listener listener : origMenu.getListeners(SWT.Show)) menu.addListener(SWT.Show, listener);
+		// for (MenuItem origItem : origMenu.getItems()) { // restore old menu items
+		// MenuItem item = new MenuItem(menu, origItem.getStyle());
+		// item.setText(origItem.getText());
+		// item.setImage(origItem.getImage());
+		// if (origItem.getListeners(SWT.Selection) != null && origItem.getListeners(SWT.Selection).length > 0)
+		// item.addListener(SWT.Selection, origItem.getListeners(SWT.Selection)[0]);
+		// }
+		// }
 		// replace the menu
-		this.getBrowser().setMenu(menu); 
+		this.getBrowser().setMenu(menu);
 	}
 	
 	public void initSelectionProvider() {
 		selProvider = new ISelectionProvider() {
+			
 			@Override
-			public void setSelection(ISelection selection) { }
+			public void setSelection(ISelection selection) {}
+			
 			@Override
-			public void removeSelectionChangedListener(ISelectionChangedListener listener) { }
+			public void removeSelectionChangedListener(ISelectionChangedListener listener) {}
+			
 			@Override
 			public ISelection getSelection() {
 				ITextSelection sel = new ITextSelection() {
+					
 					@Override
-					public boolean isEmpty() {return EditionPanel.this.getTextSelection().length() == 0;}
+					public boolean isEmpty() {
+						return EditionPanel.this.getTextSelection().length() == 0;
+					}
+					
 					@Override
-					public String getText() {return EditionPanel.this.getTextSelection();}
+					public String getText() {
+						return EditionPanel.this.getTextSelection();
+					}
+					
 					@Override
-					public int getStartLine() {	return 0;}
+					public int getStartLine() {
+						return 0;
+					}
+					
 					@Override
-					public int getOffset() {return 0;}
+					public int getOffset() {
+						return 0;
+					}
+					
 					@Override
-					public int getLength() {return 0;}
+					public int getLength() {
+						return 0;
+					}
+					
 					@Override
-					public int getEndLine() {return 0;}
+					public int getEndLine() {
+						return 0;
+					}
 				};
 				return sel;
 			}
 			
 			@Override
-			public void addSelectionChangedListener(ISelectionChangedListener listener) { }
+			public void addSelectionChangedListener(ISelectionChangedListener listener) {}
 		};
 	}
 	
@@ -1243,12 +1337,13 @@
 	
 	public void goToPage(String name) {
 		
-		Page next = currentEdition.get(name);
+		Page next = currentEdition.getPageForName(name);
 		// System.out.println(Messages.TxmBrowser_4+currentPage);
 		if (next != null) {
 			currentPage = next;
 			this.setURL(currentPage.toURL());
-		} else {
+		}
+		else {
 			System.out.println(EditionUIMessages.bind(EditionUIMessages.pageNotFoundP0, name));
 		}
 	}
@@ -1265,34 +1360,34 @@
 		// expand selection
 		if (ids == null) return;
 		if (ids.length == 0) return;
-		//TODO: enable the feature for Windows computers
-		//if (System.getProperty("os.name").toLowerCase().contains("windows")) return; 
+		// TODO: enable the feature for Windows computers
+		// if (System.getProperty("os.name").toLowerCase().contains("windows")) return;
 		
-		//this.getBrowser().evaluate("alert('expand selection');");
-		//System.out.println("EXPAND SELECTION TO "+Arrays.toString(ids));
+		// this.getBrowser().evaluate("alert('expand selection');");
+		// System.out.println("EXPAND SELECTION TO "+Arrays.toString(ids));
 		String id1 = ids[0];
 		String id2 = ids[1];
 		if (id2 == null) id2 = id1;
 		String SCRIPT02_expand = ""
-				+ "var elt = document.getElementById(\""+id1+"\");\n" //$NON-NLS-1$ //$NON-NLS-2$
-				+ "var elt2 = document.getElementById(\""+id2+"\");\n" //$NON-NLS-1$ //$NON-NLS-2$
-				//+ "alert(\"elt=\"+elt);\n"
+				+ "var elt = document.getElementById(\"" + id1 + "\");\n" //$NON-NLS-1$ //$NON-NLS-2$
+				+ "var elt2 = document.getElementById(\"" + id2 + "\");\n" //$NON-NLS-1$ //$NON-NLS-2$
+				// + "alert(\"elt=\"+elt);\n"
 				+ "var sel = txmGetSelection();\n" //$NON-NLS-1$
-				//+ "alert(\"sel=\"+sel.extentNode);\n"
-				//+ "alert(\"typeof sel=\"+Object.getOwnPropertyNames(sel));\n"
-				//+ "alert(\"get_type sel=\"+get_type(sel));\n"
+				// + "alert(\"sel=\"+sel.extentNode);\n"
+				// + "alert(\"typeof sel=\"+Object.getOwnPropertyNames(sel));\n"
+				// + "alert(\"get_type sel=\"+get_type(sel));\n"
 				+ "var range = txmGetRange(sel, 0);\n" //$NON-NLS-1$
-				//+ "alert(\"range=\"+range);\n"
-				//+ "alert(\"typeof range=\"+Object.getOwnPropertyNames(range));\n"
-				//+ "alert(\"get_type range=\"+get_type(range));\n"
-				+"range.setStart(elt, 0);\n" //$NON-NLS-1$
-				+"range.setEndAfter(elt2, 0);\n" //$NON-NLS-1$
-				+"sel.removeAllRanges();\n" //$NON-NLS-1$
-				+"sel.addRange(range);\n" //$NON-NLS-1$
+				// + "alert(\"range=\"+range);\n"
+				// + "alert(\"typeof range=\"+Object.getOwnPropertyNames(range));\n"
+				// + "alert(\"get_type range=\"+get_type(range));\n"
+				+ "range.setStart(elt, 0);\n" //$NON-NLS-1$
+				+ "range.setEndAfter(elt2, 0);\n" //$NON-NLS-1$
+				+ "sel.removeAllRanges();\n" //$NON-NLS-1$
+				+ "sel.addRange(range);\n" //$NON-NLS-1$
 				+ "\n" //$NON-NLS-1$
 				+ "return null;"; //$NON-NLS-1$
-		
-		//System.out.println("Eval...\n"+SCRIPT02_expand);
+				
+		// System.out.println("Eval...\n"+SCRIPT02_expand);
 		evaluate(SCRIPT02_expand);
 		return;
 	}
@@ -1323,10 +1418,10 @@
 	public void removeHighlightWords() {
 		
 		// FIXME: SJ: this code leads to a concurrency modification exception on Windows
-		//		Set<String> keys = highlightedColorPerWordIDS.keySet();
-		//		for (String key : keys) {
-		//			highlightedColorPerWordIDS.remove(key);
-		//		}
+		// Set<String> keys = highlightedColorPerWordIDS.keySet();
+		// for (String key : keys) {
+		// highlightedColorPerWordIDS.remove(key);
+		// }
 		
 		// SJ: new version tests
 		highlightedColorPerWordIDS.clear();
@@ -1334,4 +1429,4 @@
 		
 		
 	}
-}
\ No newline at end of file
+}
Index: tmp/org.txm.edition.rcp/src/org/txm/edition/rcp/editors/SynopticEditionEditor.java
===================================================================
--- tmp/org.txm.edition.rcp/src/org/txm/edition/rcp/editors/SynopticEditionEditor.java	(revision 2730)
+++ tmp/org.txm.edition.rcp/src/org/txm/edition/rcp/editors/SynopticEditionEditor.java	(revision 2731)
@@ -72,12 +72,14 @@
 import org.eclipse.ui.PlatformUI;
 import org.eclipse.ui.commands.ICommandService;
 import org.eclipse.ui.handlers.IHandlerService;
+import org.txm.core.results.TXMResult;
 import org.txm.edition.rcp.messages.EditionUIMessages;
 import org.txm.objects.Edition;
 import org.txm.objects.Page;
 import org.txm.objects.Text;
 import org.txm.rcp.IImageKeys;
 import org.txm.rcp.editors.IEditionEditor;
+import org.txm.rcp.editors.ITXMResultEditor;
 import org.txm.rcp.editors.TXMEditor;
 import org.txm.rcp.swt.GLComposite;
 import org.txm.searchengine.cqp.clientExceptions.CqiClientException;
Index: tmp/org.txm.edition.rcp/src/org/txm/edition/rcp/editors/EditionSelectorDialog.java
===================================================================
--- tmp/org.txm.edition.rcp/src/org/txm/edition/rcp/editors/EditionSelectorDialog.java	(revision 2730)
+++ tmp/org.txm.edition.rcp/src/org/txm/edition/rcp/editors/EditionSelectorDialog.java	(revision 2731)
@@ -12,35 +12,36 @@
 import org.txm.objects.CorpusBuild;
 
 public class EditionSelectorDialog extends ElementListSelectionDialog {
-
+	
 	public EditionSelectorDialog(Shell parent, CorpusBuild corpus, List<String> defaultSelection) {
 		super(parent, new ILabelProvider() {
+			
 			@Override
-			public void removeListener(ILabelProviderListener listener) { }
-
+			public void removeListener(ILabelProviderListener listener) {}
+			
 			@Override
 			public boolean isLabelProperty(Object element,
 					String property) {
 				return false;
 			}
-
+			
 			@Override
-			public void dispose() { }
-
+			public void dispose() {}
+			
 			@Override
-			public void addListener(ILabelProviderListener listener) { }
-
+			public void addListener(ILabelProviderListener listener) {}
+			
 			@Override
 			public Image getImage(Object element) {
 				return null;
 			}
-
+			
 			@Override
 			public String getText(Object element) {
 				return element.toString();
 			}
 		});
-
+		
 		setTitle(EditionUIMessages.editions);
 		setMessage(EditionUIMessages.selectOneOrMoreEditions);
 		setMultipleSelection(true);
@@ -49,8 +50,8 @@
 		setFilter("*"); //$NON-NLS-1$
 		
 		if (defaultSelection == null) {
-			defaultSelection = Arrays.asList(corpus.getProject().getDefaultEdition());
+			defaultSelection = Arrays.asList(corpus.getProject().getDefaultEditionName());
 		}
 		this.setInitialSelections(defaultSelection.toArray());
 	}
-}
\ No newline at end of file
+}
Index: tmp/org.txm.edition.rcp/src/org/txm/edition/rcp/editors/SynopticEditorInput.java
===================================================================
--- tmp/org.txm.edition.rcp/src/org/txm/edition/rcp/editors/SynopticEditorInput.java	(revision 2730)
+++ tmp/org.txm.edition.rcp/src/org/txm/edition/rcp/editors/SynopticEditorInput.java	(revision 2731)
@@ -15,10 +15,11 @@
 import org.txm.searchengine.cqp.corpus.CQPCorpus;
 
 public class SynopticEditorInput extends TXMResultEditorInput<Text> implements IEditorInput {
-
+	
 	private CQPCorpus corpus;
+	
 	private List<String> editions;
-
+	
 	/**
 	 * Instantiates a new SynopticEditorInput
 	 *
@@ -32,19 +33,20 @@
 		this.corpus = corpus;
 		this.editions = editions;
 		
-//		if (text == null) {
-//			this.text = corpus.getProject().getFirstText();
-//		} else {
-//			this.text = corpus.getProject().getText(text);
-//		}
+		// if (text == null) {
+		// this.text = corpus.getProject().getFirstText();
+		// } else {
+		// this.text = corpus.getProject().getText(text);
+		// }
 		
 		if (editions == null) {
-			String[] defaultEditions = {corpus.getProject().getDefaultEdition()};
+			String[] defaultEditions = { corpus.getProject().getDefaultEditionName() };
 			this.editions = Arrays.asList(defaultEditions);
 		}
 	}
-
-	/* (non-Javadoc)
+	
+	/*
+	 * (non-Javadoc)
 	 * @see org.eclipse.ui.IEditorInput#getImageDescriptor()
 	 */
 	@Override
@@ -52,39 +54,43 @@
 		return AbstractUIPlugin.imageDescriptorFromPlugin(
 				Application.PLUGIN_ID, IImageKeys.EDITION);
 	}
-
-	/* (non-Javadoc)
+	
+	/*
+	 * (non-Javadoc)
 	 * @see org.eclipse.ui.IEditorInput#getName()
 	 */
 	@Override
 	public String getName() {
-		return corpus.getName()+ " - "+getResult()+ " - "+editions;  //$NON-NLS-1$ //$NON-NLS-2$
+		return corpus.getName() + " - " + getResult() + " - " + editions;  //$NON-NLS-1$ //$NON-NLS-2$
 	}
-
-	/* (non-Javadoc)
+	
+	/*
+	 * (non-Javadoc)
 	 * @see org.eclipse.ui.IEditorInput#getPersistable()
 	 */
 	@Override
 	public IPersistableElement getPersistable() {
 		return null;
 	}
-
-	/* (non-Javadoc)
+	
+	/*
+	 * (non-Javadoc)
 	 * @see org.eclipse.ui.IEditorInput#getToolTipText()
 	 */
 	@Override
 	public String getToolTipText() {
 		return getName();
 	}
-
-	/* (non-Javadoc)
+	
+	/*
+	 * (non-Javadoc)
 	 * @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class)
 	 */
 	@Override
 	public Object getAdapter(Class adapter) {
 		return null;
 	}
-
+	
 	/**
 	 * Gets the corpus.
 	 *
@@ -93,7 +99,7 @@
 	public CQPCorpus getCorpus() {
 		return corpus;
 	}
-
+	
 	public Text getText() {
 		return getResult();
 	}
@@ -101,8 +107,9 @@
 	public List<String> getEditions() {
 		return editions;
 	}
-
-	/* (non-Javadoc)
+	
+	/*
+	 * (non-Javadoc)
 	 * @see org.eclipse.ui.IEditorInput#exists()
 	 */
 	@Override
Index: tmp/org.txm.links.rcp/src/org/txm/links/rcp/handlers/SendSelectionToQueryable.java
===================================================================
--- tmp/org.txm.links.rcp/src/org/txm/links/rcp/handlers/SendSelectionToQueryable.java	(revision 2730)
+++ tmp/org.txm.links.rcp/src/org/txm/links/rcp/handlers/SendSelectionToQueryable.java	(revision 2731)
@@ -33,9 +33,9 @@
 import org.eclipse.ui.handlers.HandlerUtil;
 import org.txm.core.preferences.TXMPreferences;
 import org.txm.core.results.TXMResult;
+import org.txm.links.rcp.messages.Messages;
 import org.txm.rcp.handlers.BaseAbstractHandler;
 import org.txm.utils.logger.Log;
-import org.txm.links.rcp.messages.Messages;
 
 /**
  * Base command to send a selection to a command that needs one or more queries to compute the new result.
@@ -89,7 +89,7 @@
 			TXMPreferences.put(resultParametersNodePath, TXMPreferences.QUERIES, queries);
 			
 			BaseAbstractHandler.executeSendToCommand(event.getCommand().getId(), resultParametersNodePath);
-			
+			// TODO we should test if there is already a linked editor and used it. Do to it we must either A) know which editor class is must be opened B) know why a previous editor has been open
 		}
 		else {
 			this.logCanNotExecuteCommand(selection);
Index: tmp/org.txm.core/src/java/org/txm/objects/EditionDefinition.java
===================================================================
--- tmp/org.txm.core/src/java/org/txm/objects/EditionDefinition.java	(revision 2730)
+++ tmp/org.txm.core/src/java/org/txm/objects/EditionDefinition.java	(revision 2731)
@@ -11,29 +11,33 @@
  *
  */
 public class EditionDefinition {
-
+	
 	Preferences node;
+	
 	public EditionDefinition(Project project, String name) {
 		this.node = project.getPreferencesScope().getNode(EditionDefinition.class.getSimpleName()).node(name);
-		setName(name); //TODO use node.name() instead
+		setName(name); // TODO use node.name() instead
 	}
 	
-	public void delete() {
+	public boolean delete() {
 		try {
 			node.removeNode();
-		} catch (BackingStoreException e) {
+			return true;
+		}
+		catch (BackingStoreException e) {
 			e.printStackTrace();
+			return false;
 		}
 	}
-
+	
 	public String getName() {
-		return node.get(TBXPreferences.NAME, null);
+		return node.get(TBXPreferences.NAME, null); // should never return null
 	}
-
+	
 	public int getWordsPerPage() {
 		return node.getInt(TBXPreferences.EDITION_DEFINITION_WORDS_PER_PAGE, 500);
 	}
-
+	
 	public String getPageElement() {
 		return node.get(TBXPreferences.EDITION_DEFINITION_PAGE_BREAK_ELEMENT, "pb");
 	}
@@ -45,7 +49,7 @@
 	public String getImagesDirectory() {
 		return node.get(TBXPreferences.EDITION_DEFINITION_IMAGES_DIRECTORY, null);
 	}
-
+	
 	public void set(String key, String value) {
 		node.put(key, value);
 	}
@@ -53,34 +57,58 @@
 	public String get(String key) {
 		return node.get(key, null);
 	}
-
+	
+	public void copyParametersTo(EditionDefinition anotherEditionDefinition) {
+		anotherEditionDefinition.setPageBreakTag(this.getPageElement());
+		anotherEditionDefinition.setWordsPerPage(this.getWordsPerPage());
+		anotherEditionDefinition.setBuildEdition(this.getBuildEdition());
+		anotherEditionDefinition.setImagesDirectory(this.getImagesDirectory());
+	}
+	
 	public void setPageBreakTag(String page_break_tag) {
-		node.put(TBXPreferences.EDITION_DEFINITION_PAGE_BREAK_ELEMENT, page_break_tag);
+		if (page_break_tag == null) {
+			node.remove(TBXPreferences.EDITION_DEFINITION_PAGE_BREAK_ELEMENT);
+		}
+		else {
+			node.put(TBXPreferences.EDITION_DEFINITION_PAGE_BREAK_ELEMENT, page_break_tag);
+		}
 	}
-
+	
 	public void setWordsPerPage(int words_per_page) {
 		node.putInt(TBXPreferences.EDITION_DEFINITION_WORDS_PER_PAGE, words_per_page);
 	}
-
+	
 	public void setBuildEdition(boolean build) {
 		node.putBoolean(TBXPreferences.EDITION_DEFINITION_BUILD, build);
 	}
-
+	
 	public void setName(String name) {
-		node.put(TBXPreferences.NAME, name);
+		if (name == null) {
+			node.remove(TBXPreferences.NAME);
+		}
+		else {
+			node.put(TBXPreferences.NAME, name);
+		}
 	}
-
+	
 	public void setImagesDirectory(String images_directory) {
-		node.put(TBXPreferences.EDITION_DEFINITION_IMAGES_DIRECTORY, images_directory);
+		if (images_directory == null) {
+			node.remove(TBXPreferences.EDITION_DEFINITION_IMAGES_DIRECTORY);
+		}
+		else {
+			node.put(TBXPreferences.EDITION_DEFINITION_IMAGES_DIRECTORY, images_directory);
+		}
 	}
 	
+	@Override
 	public String toString() {
 		StringBuffer buffer = new StringBuffer();
 		try {
 			for (String k : node.keys()) {
-				buffer.append(k+"="+node.get(k, "")+"\t");
+				buffer.append(k + "=" + node.get(k, "") + "\t");
 			}
-		} catch (BackingStoreException e) {
+		}
+		catch (BackingStoreException e) {
 			// TODO Auto-generated catch block
 			e.printStackTrace();
 		}
Index: tmp/org.txm.core/src/java/org/txm/objects/Project.java
===================================================================
--- tmp/org.txm.core/src/java/org/txm/objects/Project.java	(revision 2730)
+++ tmp/org.txm.core/src/java/org/txm/objects/Project.java	(revision 2731)
@@ -771,10 +771,6 @@
 		return pDefaultEditionName != null;
 	}
 	
-	public String getDefaultEdition() {
-		return pDefaultEditionName;
-	}
-	
 	public List<String> getEditionNames() {
 		IEclipsePreferences node = this.getPreferencesScope().getNode(EditionDefinition.class.getSimpleName());
 		try {
Index: tmp/org.txm.core/src/java/org/txm/objects/Page.java
===================================================================
--- tmp/org.txm.core/src/java/org/txm/objects/Page.java	(revision 2730)
+++ tmp/org.txm.core/src/java/org/txm/objects/Page.java	(revision 2731)
@@ -43,40 +43,47 @@
  * The Class Page a fle to open in the Browser
  */
 public class Page {
-
+	
 	/** The htmlfile. */
-	File htmlfile;
+	protected File htmlfile;
 	
 	/** The edition. */
-	Edition edition;
+	protected Edition edition;
 	
 	/** The wordid. */
-	String firstWordId;
+	protected String firstWordId;
 	
-	String name;
-
+	protected String name;
+	
+	protected int idx;
+	
 	/**
 	 * Instantiates a new page.
 	 *
 	 * @param edition the edition
-	 * @param page the page
+	 * @param name the page name
+	 * @param wordid the page first word id
+	 * @param i the page position
+	 * 
 	 */
-	public Page(Edition edition, String name, String wordid) {
+	public Page(Edition edition, String name, String wordid, int i) {
 		this.edition = edition;
 		this.name = name;
 		this.firstWordId = wordid;
-		this.htmlfile = new File(edition.getHtmlDir(), edition.getText().getName()+"_"+name+".html");
+		this.htmlfile = new File(edition.getHtmlDir(), edition.getText().getName() + "_" + name + ".html");
+		this.idx = i;
 	}
 	
 	/**
 	 * Retro-compatibility of import.xml file
+	 * 
 	 * @param e
 	 */
 	public void _load(Element e) {
 		this.name = e.getAttribute("id");
 		this.firstWordId = e.getAttribute("wordid");
 	}
-
+	
 	/**
 	 * Gets the word id.
 	 *
@@ -85,7 +92,7 @@
 	public String getWordId() {
 		return firstWordId;
 	}
-
+	
 	/**
 	 * Gets the edition.
 	 *
@@ -94,7 +101,7 @@
 	public Edition getEdition() {
 		return edition;
 	}
-
+	
 	/**
 	 * Gets the file.
 	 *
@@ -103,7 +110,7 @@
 	public File getFile() {
 		return this.htmlfile;
 	}
-
+	
 	/**
 	 * To url.
 	 *
@@ -112,12 +119,13 @@
 	public String toURL() {
 		try {
 			return this.htmlfile.toURI().toURL().toString();
-		} catch (MalformedURLException e) {
+		}
+		catch (MalformedURLException e) {
 			System.err.println(NLS.bind(TXMCoreMessages.malformedURLFileP0, htmlfile));
 			return ""; //$NON-NLS-1$
 		}
 	}
-
+	
 	/**
 	 * Found first word id.
 	 *
@@ -128,10 +136,10 @@
 	public static String foundFirstWordId(File page) throws Exception {
 		InputStream inputData;
 		inputData = page.toURI().toURL().openStream();
-
+		
 		XMLInputFactory factory = XMLInputFactory.newInstance();
 		XMLStreamReader parser = factory.createXMLStreamReader(inputData);
-
+		
 		for (int event = parser.next(); event != XMLStreamConstants.END_DOCUMENT; event = parser.next()) {
 			if (event == XMLStreamConstants.START_ELEMENT) {
 				String localname = parser.getLocalName();
@@ -139,12 +147,12 @@
 				{
 					String idattr = parser.getAttributeValue(null, "id"); //$NON-NLS-1$
 					if (idattr != null)
-					if (idattr.startsWith("w")) //$NON-NLS-1$
-					{
+						if (idattr.startsWith("w")) //$NON-NLS-1$
+						{
 						parser.close();
 						inputData.close();
 						return idattr;
-					}
+						}
 				}
 			}
 		}
@@ -152,7 +160,7 @@
 		inputData.close();
 		return null;
 	}
-
+	
 	/**
 	 * Sets the name.
 	 *
@@ -170,16 +178,17 @@
 	public void setWordId(String wordid) {
 		this.firstWordId = wordid;
 	}
-
-	/* (non-Javadoc)
+	
+	/*
+	 * (non-Javadoc)
 	 * @see java.lang.Object#toString()
 	 */
 	@Override
 	public String toString() {
-		return "Page [name="+name+", htmlfile="+htmlfile +", firstWordId="+firstWordId+"]"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
+		return "Page [name=" + name + ", htmlfile=" + htmlfile + ", firstWordId=" + firstWordId + "]"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
 	}
-
+	
 	public String getName() {
 		return this.name;
 	}
-}
\ No newline at end of file
+}
Index: tmp/org.txm.core/src/java/org/txm/objects/Edition.java
===================================================================
--- tmp/org.txm.core/src/java/org/txm/objects/Edition.java	(revision 2730)
+++ tmp/org.txm.core/src/java/org/txm/objects/Edition.java	(revision 2731)
@@ -40,7 +40,6 @@
 import org.txm.core.results.Parameter;
 import org.txm.core.results.TXMParameters;
 import org.txm.core.results.TXMResult;
-import org.txm.utils.DeleteDir;
 import org.txm.utils.TXMProgressMonitor;
 import org.txm.utils.logger.Log;
 import org.w3c.dom.Element;
@@ -55,9 +54,6 @@
 	@Parameter(key = TBXPreferences.INDEX)
 	String pIndex;
 	
-	/** The pages. */
-	ArrayList<Page> pages = new ArrayList<>();
-	
 	@Parameter(key = TBXPreferences.NAMES)
 	ArrayList<String> pPageNames;
 	
@@ -108,7 +104,7 @@
 	 * @return the num pages
 	 */
 	public Integer getNumPages() {
-		return pages.size();
+		return pPageNames.size();
 	}
 	
 	/*
@@ -122,13 +118,25 @@
 		// System.out.println(" build edition "+name);
 		NodeList pagesList = e.getElementsByTagName("page"); //$NON-NLS-1$
 		int numpages = pagesList.getLength();
-		pages.clear();
+		if (pPageNames == null) {
+			pPageNames = new ArrayList<>();
+		}
+		else {
+			pPageNames.clear();
+		}
+		
+		if (pPageFirstWordIds == null) {
+			pPageFirstWordIds = new ArrayList<>();
+		}
+		else {
+			pPageFirstWordIds.clear();
+		}
+		
 		for (int i = 0; i < numpages; i++) {
 			Element p = (Element) pagesList.item(i);
-			Page page = new Page(this, "", "");
+			Page page = new Page(this, "", "", i);
 			page._load(p);
 			
-			pages.add(page);
 			pPageNames.add(page.getName());
 			pPageFirstWordIds.add(page.getWordId());
 		}
@@ -152,31 +160,10 @@
 		
 	}
 	
-	/**
-	 * Gets the pages.
-	 *
-	 * @return the pages
-	 */
-	public ArrayList<Page> getPages() {
-		return this.pages;
+	public int get(String id) {
+		return pPageNames.indexOf(id);
 	}
 	
-	public Page get(String id) {
-		int i = pPageNames.indexOf(id);
-		if (i < 0) return null;
-		return pages.get(i);
-	}
-	
-	/**
-	 * Gets the page.
-	 *
-	 * @param no the no
-	 * @return the page
-	 */
-	public Page getPage(int no) {
-		return pages.get(no);
-	}
-	
 	public static final Pattern findNumbersPattern = Pattern.compile("([0-9]{1,10}+)"); //$NON-NLS-1$
 	
 	/**
@@ -219,21 +206,24 @@
 	 */
 	public Page getPageForWordId(String idx) {
 		Log.fine("Page.getPageForWordId(): " + idx);
-		Page lastpage = null;
-		for (Page p : pages) {
-			String s = p.getWordId();
-			Log.fine(p.name + ": " + s + " >? " + idx);
+		int lastPage = 0;
+		
+		int i = 0;
+		for (String p : pPageNames) {
+			String s = pPageFirstWordIds.get(i);
+			Log.fine(p + ": " + s + " >? " + idx);
 			// if (getInt(s) > getInt(idx)) {
 			System.out.println();
 			if (isFirstGTthanSecond(s, idx) > 0) {
-				Log.fine("page found: " + lastpage);
-				return lastpage;
+				Log.fine("page found: " + lastPage);
+				return getPage(lastPage);
 			}
-			if (!("w_0".equals(p.getWordId()))) { // ignore the w_0 pages
-				lastpage = p;
+			if (!("w_0".equals(s))) { // ignore the w_0 pages
+				lastPage = i;
 			}
+			i++;
 		}
-		return lastpage;
+		return getPage(lastPage);
 	}
 	
 	public static int isFirstGTthanSecond(String s, String idx) {
@@ -285,20 +275,31 @@
 	 * @return the first page
 	 */
 	public Page getFirstPage() {
-		if (pages.size() > 0)
-			return pages.get(0);
-		return null;
+		return getPage(0);
 	}
 	
 	/**
+	 * Gets the page.
+	 *
+	 * @param no the no
+	 * @return the page
+	 */
+	public Page getPage(int n) {
+		if (n >= 0 && pPageNames.size() > n) {
+			return new Page(this, pPageNames.get(n), pPageFirstWordIds.get(n), n);
+		}
+		else {
+			return null;
+		}
+	}
+	
+	/**
 	 * Gets the last page.
 	 *
 	 * @return the last page
 	 */
 	public Page getLastPage() {
-		if (pages.size() > 0)
-			return pages.get(pages.size() - 1);
-		return null;
+		return getPage(pPageNames.size() - 1);
 	}
 	
 	/**
@@ -308,9 +309,9 @@
 	 * @return the next page
 	 */
 	public Page getNextPage(Page p) {
-		int idx = pages.indexOf(p);
-		if (idx < pages.size() - 1)
-			return pages.get(idx + 1);
+		int idx = p.idx;
+		if (idx < pPageNames.size() - 1)
+			return getPage(idx + 1);
 		return p;
 	}
 	
@@ -321,9 +322,9 @@
 	 * @return the previous page
 	 */
 	public Page getPreviousPage(Page p) {
-		int idx = pages.indexOf(p);
+		int idx = p.idx;
 		if (idx > 0)
-			return pages.get(idx - 1);
+			return getPage(idx - 1);
 		return p;
 	}
 	
@@ -344,7 +345,7 @@
 	public String toString() {
 		try {
 			return "Edition [name=" + userName + " index=" + pIndex + ", pages=" //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
-					+ pages.size() + "]"; //$NON-NLS-1$
+					+ pPageNames.size() + "]"; //$NON-NLS-1$
 		}
 		catch (Exception e) {
 			return "Edition";
@@ -415,8 +416,8 @@
 	
 	@Override
 	public void clean() {
-		for (Page p : this.getPages()) {
-			p.getFile().delete();
+		for (String name : this.pPageNames) {
+			new File(this.getHtmlDir(), this.getText().getName() + "_" + name + ".html").delete();
 		}
 	}
 	
@@ -427,15 +428,15 @@
 	
 	@Override
 	protected boolean _compute(TXMProgressMonitor monitor) throws Exception {
-		// System.out.println("USE THE PROJECT IMPORTMODULE TO BUILD THE EDITION="+userName);
-		pages.clear();
-		
-		if (pages.size() != pPageNames.size()) {
-			for (int i = 0; i < pPageNames.size() && i < pPageFirstWordIds.size(); i++) {
-				pages.add(new Page(this, pPageNames.get(i), pPageFirstWordIds.get(i)));
-			}
-		}
-		
+		// // System.out.println("USE THE PROJECT IMPORTMODULE TO BUILD THE EDITION="+userName);
+		// pages.clear();
+		//
+		// if (pages.size() != pPageNames.size()) {
+		// for (int i = 0; i < pPageNames.size() && i < pPageFirstWordIds.size(); i++) {
+		// pages.add(new Page(this, pPageNames.get(i), pPageFirstWordIds.get(i)));
+		// }
+		// }
+		//
 		return true;
 	}
 	
@@ -456,4 +457,13 @@
 	public void setName(String name) {
 		this.userName = name;
 	}
+	
+	public ArrayList<String> getPageNames() {
+		return pPageNames;
+	}
+	
+	public Page getPageForName(String name) {
+		int i = pPageNames.indexOf(name);
+		return getPage(i);
+	}
 }
Index: tmp/org.txm.rcp/src/main/java/org/txm/rcp/views/BasesView.java
===================================================================
--- tmp/org.txm.rcp/src/main/java/org/txm/rcp/views/BasesView.java	(revision 2730)
+++ tmp/org.txm.rcp/src/main/java/org/txm/rcp/views/BasesView.java	(revision 2731)
@@ -75,19 +75,18 @@
  * 
  */
 public class BasesView extends ViewPart {
-		
+	
 	/** The tv. */
 	TreeViewer tv;
-
+	
 	/** The ID. */
 	public static String ID = BasesView.class.getName();
-
+	
 	/**
 	 * Instantiates a new bases view.
 	 */
-	public BasesView() {
-	}
-
+	public BasesView() {}
+	
 	/**
 	 * Refresh.
 	 */
@@ -98,7 +97,7 @@
 		if (baseView != null)
 			baseView.tv.refresh();
 	}
-
+	
 	/**
 	 * Reload.
 	 */
@@ -109,7 +108,7 @@
 		if (baseView != null)
 			baseView._reload();
 	}
-
+	
 	/**
 	 * _reload.
 	 */
@@ -119,8 +118,9 @@
 		tv.setInput(Toolbox.workspace);
 		refresh();
 	}
-
-	/* (non-Javadoc)
+	
+	/*
+	 * (non-Javadoc)
 	 * @see org.eclipse.ui.part.WorkbenchPart#createPartControl(org.eclipse.swt.widgets.Composite)
 	 */
 	@Override
@@ -129,28 +129,31 @@
 		tv.setContentProvider(new TxmObjectTreeProvider());
 		tv.setLabelProvider(new TxmObjectLabelProvider());
 		tv.setInput(Toolbox.workspace);
-
+		
 		tv.addDoubleClickListener(new IDoubleClickListener() {
-
+			
 			@Override
 			public void doubleClick(DoubleClickEvent event) {
 				TreeSelection selection = (TreeSelection) tv.getSelection();
 				if (selection.getFirstElement() instanceof CQPCorpus) {
-					CQPCorpus corpus = (CQPCorpus)selection.getFirstElement();
-					File selectedItem = new File(corpus.getProjectDirectory(), "cqp/"+corpus.getID()+".cqp");
+					CQPCorpus corpus = (CQPCorpus) selection.getFirstElement();
+					File selectedItem = new File(corpus.getProjectDirectory(), "cqp/" + corpus.getID() + ".cqp");
 					if (selectedItem.exists())
 						EditFile.openfile(selectedItem.getAbsolutePath());
-				} else if (selection.getFirstElement() instanceof Text) {
+				}
+				else if (selection.getFirstElement() instanceof Text) {
 					File selectedItem = ((Text) selection.getFirstElement())
 							.getSource();
 					EditFile.openfile(selectedItem.getAbsolutePath());
-				} else if (selection.getFirstElement() instanceof Edition) {
+				}
+				else if (selection.getFirstElement() instanceof Edition) {
 					Edition edition = ((Edition) selection.getFirstElement());
 					Page firstpage = edition.getFirstPage();
 					TXMBrowser editor = OpenBrowser.openEdition(firstpage
 							.getFile().getAbsolutePath(), edition.getName());
 					editor.showPage(firstpage);
-				} else if (selection.getFirstElement() instanceof Page) {
+				}
+				else if (selection.getFirstElement() instanceof Page) {
 					Page page = ((Page) selection.getFirstElement());
 					TXMBrowser editor = OpenBrowser.openEdition(page.getFile()
 							.getAbsolutePath());
@@ -158,72 +161,74 @@
 				}
 			}
 		});
-
+		
 		tv.getTree().addKeyListener(new KeyListener() {
-
+			
 			@Override
 			public void keyReleased(KeyEvent e) {
 				if (e.keyCode == SWT.DEL) {
 					ISelection sel = tv.getSelection();
 					if (sel instanceof IStructuredSelection) {
-						if (!DeleteObject.askContinueToDelete((IStructuredSelection)sel)) return;
+						if (!DeleteObject.askContinueToDelete((IStructuredSelection) sel)) return;
 						DeleteObject.delete(sel);
 					}
 				}
 			}
-
+			
 			@Override
-			public void keyPressed(KeyEvent e) {
-			}
+			public void keyPressed(KeyEvent e) {}
 		});
-
+		
 		MenuManager menuManager = new MenuManager();
 		Menu menu = menuManager.createContextMenu(tv.getTree());
-
+		
 		// Set the MenuManager
 		tv.getTree().setMenu(menu);
 		getSite().registerContextMenu(menuManager, tv);
 		// Make the selection available
 		getSite().setSelectionProvider(tv);
-
+		
 	}
-
-	/* (non-Javadoc)
+	
+	/*
+	 * (non-Javadoc)
 	 * @see org.eclipse.ui.part.WorkbenchPart#setFocus()
 	 */
 	@Override
 	public void setFocus() {
 		// TODO Auto-generated method stub
-
+		
 	}
-
+	
 	/**
 	 * The Class TxmObjectLabelProvider.
 	 */
 	public class TxmObjectLabelProvider extends LabelProvider {
-
+		
 		/** The image table. */
-		private Map<ImageDescriptor, Image> imageTable = new HashMap<ImageDescriptor, Image>();
-
-		/* (non-Javadoc)
+		private Map<ImageDescriptor, Image> imageTable = new HashMap<>();
+		
+		/*
+		 * (non-Javadoc)
 		 * @see org.eclipse.jface.viewers.LabelProvider#getText(java.lang.Object)
 		 */
 		@Override
 		public String getText(Object element) {
 			String title = ((TXMResult) element).getName();
 			if (title.length() > 41) { // limit text length
-				title = title.substring(0, 40)+"..."; 
+				title = title.substring(0, 40) + "...";
 			}
 			return title;
 		}
-
-		/* (non-Javadoc)
+		
+		/*
+		 * (non-Javadoc)
 		 * @see org.eclipse.jface.viewers.LabelProvider#getImage(java.lang.Object)
 		 */
 		@Override
 		public final Image getImage(Object element) {
 			ImageDescriptor imageDescriptor = AbstractUIPlugin
-					.imageDescriptorFromPlugin(Application.PLUGIN_ID, 
+					.imageDescriptorFromPlugin(Application.PLUGIN_ID,
 							IImageKeys.FILE);
 			if (element instanceof Project)
 				imageDescriptor = AbstractUIPlugin.imageDescriptorFromPlugin(
@@ -240,7 +245,7 @@
 			else if (element instanceof Page)
 				imageDescriptor = AbstractUIPlugin.imageDescriptorFromPlugin(
 						Application.PLUGIN_ID, IImageKeys.FILE);
-
+			
 			Image image = imageTable.get(imageDescriptor);
 			if (image == null) {
 				image = imageDescriptor.createImage();
@@ -249,95 +254,113 @@
 			return image;
 		}
 	}
-
+	
 	/**
 	 * The Class TxmObjectTreeProvider.
 	 */
 	public class TxmObjectTreeProvider implements ITreeContentProvider {
-
-		/* (non-Javadoc)
+		
+		/*
+		 * (non-Javadoc)
 		 * @see org.eclipse.jface.viewers.ITreeContentProvider#getChildren(java.lang.Object)
 		 */
 		@Override
 		public Object[] getChildren(Object element) {
 			if (element instanceof Workspace) {
 				return ((Workspace) element).getProjects().toArray();
-			} else if (element instanceof Project) {
+			}
+			else if (element instanceof Project) {
 				return ((Project) element).getChildren(MainCorpus.class).toArray();
-			} else if (element instanceof MainCorpus) {
+			}
+			else if (element instanceof MainCorpus) {
 				return ((CQPCorpus) element).getProject().getTexts().toArray();
-			} else if (element instanceof Text) {
+			}
+			else if (element instanceof Text) {
 				return ((Text) element).getEditions().toArray();
-			} else if (element instanceof Edition) {
-				return ((Edition) element).getPages().toArray();
 			}
+			else if (element instanceof Edition) {
+				return ((Edition) element).getPageNames().toArray();
+			}
 			return null;
 		}
-
-		/* (non-Javadoc)
+		
+		/*
+		 * (non-Javadoc)
 		 * @see org.eclipse.jface.viewers.ITreeContentProvider#getParent(java.lang.Object)
 		 */
 		@Override
 		public Object getParent(Object element) {
 			if (element instanceof Workspace) {
 				return null;
-			} else if (element instanceof Project) {
+			}
+			else if (element instanceof Project) {
 				return ((Project) element).getWorkspace();
-			} else if (element instanceof MainCorpus) {
+			}
+			else if (element instanceof MainCorpus) {
 				return ((MainCorpus) element).getProject();
-			} else if (element instanceof Text) {
+			}
+			else if (element instanceof Text) {
 				return ((Text) element).getProject();
-			} else if (element instanceof Edition) {
+			}
+			else if (element instanceof Edition) {
 				return ((Edition) element).getText();
-			} else if (element instanceof Page) {
+			}
+			else if (element instanceof Page) {
 				return ((Page) element).getEdition();
 			}
 			return null;
 		}
-
-		/* (non-Javadoc)
+		
+		/*
+		 * (non-Javadoc)
 		 * @see org.eclipse.jface.viewers.ITreeContentProvider#hasChildren(java.lang.Object)
 		 */
 		@Override
 		public boolean hasChildren(Object element) {
 			if (element instanceof Workspace) {
 				return !((Workspace) element).getProjects().isEmpty();
-			} else if (element instanceof Project) {
+			}
+			else if (element instanceof Project) {
 				return !((Project) element).getChildren(MainCorpus.class).isEmpty();
-			} else if (element instanceof CQPCorpus) {
+			}
+			else if (element instanceof CQPCorpus) {
 				return !((CQPCorpus) element).getProject().getTexts().isEmpty();
-			} else if (element instanceof Text) {
+			}
+			else if (element instanceof Text) {
 				return !((Text) element).getEditions().isEmpty();
-			} else if (element instanceof Edition) {
-				return !((Edition) element).getPages().isEmpty();
-			} else if (element instanceof Page) {
+			}
+			else if (element instanceof Edition) {
+				return !((Edition) element).getPageNames().isEmpty();
+			}
+			else if (element instanceof Page) {
 				return false;
 			}
 			return false;
 		}
-
-		/* (non-Javadoc)
+		
+		/*
+		 * (non-Javadoc)
 		 * @see org.eclipse.jface.viewers.IStructuredContentProvider#getElements(java.lang.Object)
 		 */
 		@Override
 		public Object[] getElements(Object element) {
 			return getChildren(element);
 		}
-
-		/* (non-Javadoc)
+		
+		/*
+		 * (non-Javadoc)
 		 * @see org.eclipse.jface.viewers.IContentProvider#dispose()
 		 */
 		@Override
-		public void dispose() {
-		}
-
-		/* (non-Javadoc)
+		public void dispose() {}
+		
+		/*
+		 * (non-Javadoc)
 		 * @see org.eclipse.jface.viewers.IContentProvider#inputChanged(org.eclipse.jface.viewers.Viewer, java.lang.Object, java.lang.Object)
 		 */
 		@Override
-		public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
-		}
-
+		public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {}
+		
 	}
-
+	
 }
Index: tmp/org.txm.rcp/src/main/java/org/txm/rcp/utils/SWTEditorsUtils.java
===================================================================
--- tmp/org.txm.rcp/src/main/java/org/txm/rcp/utils/SWTEditorsUtils.java	(revision 2730)
+++ tmp/org.txm.rcp/src/main/java/org/txm/rcp/utils/SWTEditorsUtils.java	(revision 2731)
@@ -241,7 +241,7 @@
 	 * @param event
 	 * @return
 	 */
-	public static ITXMResultEditor getActiveEditor(ExecutionEvent event) {
+	public static ITXMResultEditor<? extends TXMResult> getActiveEditor(ExecutionEvent event) {
 		
 		IEditorPart editor = null;
 		
@@ -261,7 +261,7 @@
 			return null;
 		}
 		
-		return (ITXMResultEditor) editor;
+		return (ITXMResultEditor<? extends TXMResult>) editor;
 	}
 	
 	/**
Index: tmp/org.txm.rcp/src/main/java/org/txm/rcp/handlers/BaseAbstractHandler.java
===================================================================
--- tmp/org.txm.rcp/src/main/java/org/txm/rcp/handlers/BaseAbstractHandler.java	(revision 2730)
+++ tmp/org.txm.rcp/src/main/java/org/txm/rcp/handlers/BaseAbstractHandler.java	(revision 2731)
@@ -133,7 +133,6 @@
 		}
 	}
 	
-	
 	/**
 	 * Gets the parent of the result stored in the active editor.
 	 * This parent will be send to the target command as parent of the new result.
@@ -146,8 +145,6 @@
 		return getActiveEditorResult(event).getParent();
 	}
 	
-	
-	
 	/**
 	 * Logs a severe entry.
 	 * 
@@ -158,25 +155,23 @@
 		return false;
 	}
 	
-	
-	
 	/**
 	 * Executes a command handler specified by its id.
 	 * 
 	 * @param commandId
 	 */
-	public static void executeCommand(String commandId) {
-		executeCommand(commandId, null, null);
+	public static Object executeCommand(String commandId) {
+		return executeCommand(commandId, null, null);
 	}
 	
 	
-	public static void executeCommand(String commandId, Map<String, String> params) {
-		executeCommand(commandId, null, params);
+	public static Object executeCommand(String commandId, Map<String, String> params) {
+		return executeCommand(commandId, null, params);
 	}
 	
 	
-	public static void executeCommand(String commandId, String resultUUID) {
-		executeCommand(commandId, resultUUID, null);
+	public static Object executeCommand(String commandId, String resultUUID) {
+		return executeCommand(commandId, resultUUID, null);
 	}
 	
 	/**
@@ -184,8 +179,9 @@
 	 * 
 	 * @param commandId
 	 * @param resultUUID
+	 * @return
 	 */
-	public static void executeCommand(String commandId, String resultUUID, Map<String, String> params) {
+	public static Object executeCommand(String commandId, String resultUUID, Map<String, String> params) {
 		
 		Log.fine("BaseAbstractHandler.executeCommand(): calling command " + commandId + ".");
 		
@@ -244,12 +240,13 @@
 		// Call the command without parameters
 		else {
 			try {
-				handlerService.executeCommand(cmd.getId(), null);
+				return handlerService.executeCommand(cmd.getId(), null);
 			}
 			catch (Exception e) {
 				e.printStackTrace();
 			}
 		}
+		return null;
 	}
 	
 	
@@ -258,8 +255,8 @@
 	 * 
 	 * @param commandId
 	 */
-	public static void executeSendToCommand(String commandId) {
-		executeSendToCommand(commandId, null);
+	public static Object executeSendToCommand(String commandId) {
+		return executeSendToCommand(commandId, null);
 	}
 	
 	
@@ -270,10 +267,11 @@
 	 * @param commandId
 	 * @param resultParametersNodePath
 	 */
-	public static void executeSendToCommand(String commandId, String resultParametersNodePath) {
+	public static Object executeSendToCommand(String commandId, String resultParametersNodePath) {
 		IContextService contextService = PlatformUI.getWorkbench().getAdapter(IContextService.class);
 		IContextActivation activationToken = contextService.activateContext(SEND_SELECTION_TO_COMMAND_CONTEXT_ID);
-		executeCommand(commandId, resultParametersNodePath);
+		Object o = executeCommand(commandId, resultParametersNodePath);
 		contextService.deactivateContext(activationToken);
+		return o;
 	}
 }
Index: tmp/org.txm.rcp/src/main/java/org/txm/rcp/editors/ITXMResultEditor.java
===================================================================
--- tmp/org.txm.rcp/src/main/java/org/txm/rcp/editors/ITXMResultEditor.java	(revision 2730)
+++ tmp/org.txm.rcp/src/main/java/org/txm/rcp/editors/ITXMResultEditor.java	(revision 2731)
@@ -1,11 +1,15 @@
 package org.txm.rcp.editors;
 
+import java.util.ArrayList;
+
 import org.eclipse.swt.widgets.Composite;
 import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.part.EditorPart;
 import org.txm.core.results.TXMResult;
 import org.txm.rcp.utils.JobHandler;
 
 public interface ITXMResultEditor<T extends TXMResult> extends IEditorPart {
+	
 	public T getResult();
 	
 	/**
@@ -31,10 +35,21 @@
 	 * Closes the editor from the UI thread and deletes or not the linked result.
 	 */
 	public void close(boolean deleteResult);
-
+	
 	/**
-	 * lock/unlock the editor's result
+	 * lock/unlock the editor's result.
+	 * 
 	 * @param locked
 	 */
 	public void setLocked(boolean locked);
+	
+	public ArrayList<? extends ITXMResultEditor<TXMResult>> getLinkedEditors();
+	
+	public void removeLinkedEditor(ITXMResultEditor<TXMResult> editor);
+	
+	public void addLinkedEditor(ITXMResultEditor<T> editor);
+	
+	public <E extends ITXMResultEditor<TXMResult>> E getLinkedEditor(Class<E> editorClass);
+	
+	public <E extends ITXMResultEditor<TXMResult>> ArrayList<E> getLinkedEditors(Class<E> editorClass);
 }
Index: tmp/org.txm.rcp/src/main/java/org/txm/rcp/editors/TXMBrowser.java
===================================================================
--- tmp/org.txm.rcp/src/main/java/org/txm/rcp/editors/TXMBrowser.java	(revision 2730)
+++ tmp/org.txm.rcp/src/main/java/org/txm/rcp/editors/TXMBrowser.java	(revision 2731)
@@ -60,19 +60,22 @@
 import org.txm.rcp.messages.TXMUIMessages;
 
 /**
- * Call the internal browser of RCP specialized for TXM editions. 
+ * Call the internal browser of RCP specialized for TXM editions.
  * 
- * A Text can be set then the user can browse pages and others texts of the same corpus 
+ * A Text can be set then the user can browse pages and others texts of the same corpus
  * 
  * @author mdecorde.
  */
-@SuppressWarnings("restriction") //$NON-NLS-1$
+@SuppressWarnings("restriction")
 public class TXMBrowser extends WebBrowserEditor {
 	
 	/** The Constant ID. */
 	public final static String ID = "org.txm.rcp.editors.TXMBrowser"; //$NON-NLS-1$
+	
 	private ProgressListener progresslistener;
+	
 	private List<String> wordids;
+	
 	private List<String> lineids;
 	
 	/** The edition. */
@@ -86,14 +89,14 @@
 	
 	/** The source. */
 	private Object source;
-
+	
 	/**
 	 * Instantiates a new txm browser.
 	 */
 	public TXMBrowser() {
-
+		
 	}
-
+	
 	/**
 	 * Gets the browser.
 	 *
@@ -104,6 +107,7 @@
 		return webbrowser.getBrowser();
 	}
 	
+	@Override
 	public void setPartName(String partName) {
 		super.setPartName(partName);
 	}
@@ -119,41 +123,40 @@
 		if (progresslistener != null)
 			this.getBrowser().removeProgressListener(progresslistener);
 		progresslistener = new ProgressListener() {
+			
 			@Override
-			public void changed(ProgressEvent event) {
-			}
-
+			public void changed(ProgressEvent event) {}
+			
 			@Override
 			public void completed(ProgressEvent event) {
 				Page currentpage = getCurrentPage();
-				//System.out.println("Highlight ! "+currentpage.getEdition().getText()+" wordids ="+wordids);
-			
+				// System.out.println("Highlight ! "+currentpage.getEdition().getText()+" wordids ="+wordids);
+				
 				for (String wordid : wordids) {
 					String highlightscript = "try { var elt = document.getElementById(\"" + wordid + "\");" + //$NON-NLS-1$ //$NON-NLS-2$
-					"elt.style.backgroundColor=\"#F9D0D0\";" //$NON-NLS-1$
-					+ 
-					"elt.style.paddingLeft=\"3px\";" + //$NON-NLS-1$
-					"elt.style.paddingRight=\"3px\";" + //$NON-NLS-1$
-					"elt.style.paddingTop=\"1px\";" + //$NON-NLS-1$
-					"elt.style.paddingBottom=\"1px\";" + //$NON-NLS-1$
-					"} catch (e) { };"; //$NON-NLS-1$
-
+							"elt.style.backgroundColor=\"#F9D0D0\";" //$NON-NLS-1$
+							+
+							"elt.style.paddingLeft=\"3px\";" + //$NON-NLS-1$
+							"elt.style.paddingRight=\"3px\";" + //$NON-NLS-1$
+							"elt.style.paddingTop=\"1px\";" + //$NON-NLS-1$
+							"elt.style.paddingBottom=\"1px\";" + //$NON-NLS-1$
+							"} catch (e) { };"; //$NON-NLS-1$
+					
 					getBrowser().execute(highlightscript);
 				}
-
+				
 				for (String wordid : lineids) {
 					String highlightscript = "try { var elt = document.getElementById(\"" + wordid + "\");" + //$NON-NLS-1$ //$NON-NLS-2$
-					"elt.style.backgroundColor=\"#F9A0A0\";" + //$NON-NLS-1$
-					"elt.style.paddingLeft=\"3px\";" + //$NON-NLS-1$
-					"elt.style.paddingRight=\"3px\";" + //$NON-NLS-1$
-					"elt.style.paddingTop=\"1px\";" + //$NON-NLS-1$
-					"elt.style.paddingBottom=\"1px\";" + //$NON-NLS-1$
-					"} catch (e) { };"; //$NON-NLS-1$
-
+							"elt.style.backgroundColor=\"#F9A0A0\";" + //$NON-NLS-1$
+							"elt.style.paddingLeft=\"3px\";" + //$NON-NLS-1$
+							"elt.style.paddingRight=\"3px\";" + //$NON-NLS-1$
+							"elt.style.paddingTop=\"1px\";" + //$NON-NLS-1$
+							"elt.style.paddingBottom=\"1px\";" + //$NON-NLS-1$
+							"} catch (e) { };"; //$NON-NLS-1$
+					
 					getBrowser().execute(highlightscript);
 				}
-				if(lineids.size() > 0)
-				{
+				if (lineids.size() > 0) {
 					String script = "try { document.getElementById(\"" + lineids.get(0) + "\").scrollIntoView(true); } catch (e) { };"; //$NON-NLS-1$ //$NON-NLS-2$
 					getBrowser().execute(script);
 				}
@@ -161,7 +164,7 @@
 		};
 		getBrowser().addProgressListener(progresslistener);
 	}
-
+	
 	/**
 	 * Sets the edition.
 	 *
@@ -170,7 +173,7 @@
 	public void setEdition(Edition edition) {
 		this.edition = edition;
 	}
-
+	
 	/**
 	 * Make page label.
 	 *
@@ -180,7 +183,7 @@
 		return currentPage.getName()
 				+ " / " + currentPage.getEdition().getNumPages(); //$NON-NLS-1$
 	}
-
+	
 	/**
 	 * Show page.
 	 *
@@ -192,7 +195,7 @@
 		this.webBrowser.setURL(currentPage.toURL());
 		page_label.setText(makePageLabel());
 	}
-
+	
 	/**
 	 * First text.
 	 */
@@ -200,20 +203,20 @@
 		Text current = this.currentPage.getEdition().getText();
 		Project corpus = current.getProject();
 		Text firstText = corpus.getFirstText();
-
+		
 		if (firstText != null) {
-			String editionName = corpus.getDefaultEdition();
-			currentPage = firstText.getEdition(editionName).getFirstPage(); 
+			String editionName = corpus.getDefaultEditionName();
+			currentPage = firstText.getEdition(editionName).getFirstPage();
 			if (currentPage == null) {
 				StatusLine.setMessage(TXMUIMessages.noPreviousText);
 				return;
 			}
-			this.setEdition(firstText.getEdition(editionName)); 
+			this.setEdition(firstText.getEdition(editionName));
 			this.webBrowser.setURL(currentPage.toURL());
 			page_label.setText(makePageLabel());
 		}
 	}
-
+	
 	/**
 	 * Last text.
 	 */
@@ -221,14 +224,14 @@
 		Text current = this.currentPage.getEdition().getText();
 		Project b = current.getProject();
 		Text lastText = b.getLastText();
-
+		
 		if (lastText != null) {
-			currentPage = lastText.getEdition(b.getDefaultEdition()).getFirstPage(); 
+			currentPage = lastText.getEdition(b.getDefaultEditionName()).getFirstPage();
 			if (currentPage == null) {
 				StatusLine.setMessage(TXMUIMessages.noTextNext);
 				return;
 			}
-			this.setEdition(lastText.getEdition(b.getDefaultEdition())); 
+			this.setEdition(lastText.getEdition(b.getDefaultEditionName()));
 			this.webBrowser.setURL(currentPage.toURL());
 			page_label.setText(makePageLabel());
 		}
@@ -243,20 +246,20 @@
 		this.webBrowser.setURL(currentPage.toURL());
 		page_label.setText(makePageLabel());
 	}
-
+	
 	/**
 	 * Last page.
 	 */
 	public void lastPage() {
 		// System.out.println(Messages.TxmBrowser_2+currentPage);
-
+		
 		if (currentPage != null && currentPage.getFile().equals(edition.getLastPage().getFile()))
 			return;
 		currentPage = edition.getLastPage();
 		this.webBrowser.setURL(currentPage.toURL());
 		page_label.setText(makePageLabel());
 	}
-
+	
 	/**
 	 * Previous page.
 	 */
@@ -266,15 +269,17 @@
 			Page previous = edition.getPreviousPage(currentPage);
 			if (previous == currentPage) {
 				previousText(true);
-			} else {
-				currentPage = previous; 
+			}
+			else {
+				currentPage = previous;
 				this.webBrowser.setURL(currentPage.toURL());
 			}
-		} else
+		}
+		else
 			firstPage();
 		page_label.setText(makePageLabel());
 	}
-
+	
 	/**
 	 * Next page.
 	 */
@@ -284,44 +289,48 @@
 			Page next = edition.getNextPage(currentPage);
 			if (currentPage == next) {
 				nextText();
-			} else {
+			}
+			else {
 				currentPage = next;
 				this.webBrowser.setURL(currentPage.toURL());
 			}
-
-		} else
+			
+		}
+		else
 			firstPage();
 		page_label.setText(makePageLabel());
 	}
-
+	
 	/**
 	 * Previous text.
-	 * @param fromNextText 
+	 * 
+	 * @param fromNextText
 	 */
 	public void previousText(boolean fromNextText) {
-
+		
 		Text current = this.currentPage.getEdition().getText();
 		Project corpus = current.getProject();
 		Text previousText = corpus.getPreviousText(current);
-
+		
 		if (previousText != null) {
-			String editionName = corpus.getDefaultEdition();
+			String editionName = corpus.getDefaultEditionName();
 			if (fromNextText) {
-				currentPage = previousText.getEdition(editionName).getLastPage();	
-			} else {
+				currentPage = previousText.getEdition(editionName).getLastPage();
+			}
+			else {
 				currentPage = previousText.getEdition(editionName).getFirstPage();
 			}
 			if (currentPage == null) {
 				StatusLine.setMessage(TXMUIMessages.noPreviousText);
 				return;
 			}
-			this.setEdition(previousText.getEdition(editionName)); 
+			this.setEdition(previousText.getEdition(editionName));
 			this.webBrowser.setURL(currentPage.toURL());
 			page_label.setText(makePageLabel());
 		}
 		// System.out.println("Previous texts "+previousText);
 	}
-
+	
 	/**
 	 * Next text.
 	 */
@@ -329,28 +338,30 @@
 		Text current = this.currentPage.getEdition().getText();
 		Project b = current.getProject();
 		Text nextText = b.getNextText(current);
-
+		
 		if (nextText != null) {
-			currentPage = nextText.getEdition(b.getDefaultEdition()).getFirstPage(); 
+			currentPage = nextText.getEdition(b.getDefaultEditionName()).getFirstPage();
 			if (currentPage == null) {
 				StatusLine.setMessage(TXMUIMessages.noTextNext);
 				return;
 			}
-			this.setEdition(nextText.getEdition(b.getDefaultEdition())); 
+			this.setEdition(nextText.getEdition(b.getDefaultEditionName()));
 			this.webBrowser.setURL(currentPage.toURL());
 			page_label.setText(makePageLabel());
 		}
 		// System.out.println("Next texts "+nextText);
 	}
-
-	/* (non-Javadoc)
+	
+	/*
+	 * (non-Javadoc)
 	 * @see org.eclipse.ui.internal.browser.WebBrowserEditor#createPartControl(org.eclipse.swt.widgets.Composite)
 	 */
 	@Override
 	public void createPartControl(Composite parent) {
 		try {
 			super.createPartControl(parent);
-		} catch (Exception e) {
+		}
+		catch (Exception e) {
 			System.err.println(TXMUIMessages.couldNotLaunchTheInternalWebBrowserYouMustSetThatParameterInThePreferencesMenuColonGeneralSupWebNavigator);
 			return;
 		}
@@ -359,7 +370,7 @@
 		navigLayout.justify = true;
 		Composite panneau = new Composite(parent, SWT.NONE);
 		panneau.setLayout(navigLayout);
-
+		
 		RowLayout subLayout = new RowLayout(SWT.HORIZONTAL);
 		subLayout.pack = true;
 		subLayout.center = true;
@@ -368,17 +379,17 @@
 		Composite subPanneau = new Composite(panneau, SWT.NONE);
 		subPanneau.setLayout(subLayout);
 		subPanneau.setLayoutData(new RowData(450, 22));
-
+		
 		Button firstText = new Button(subPanneau, SWT.FLAT);
 		Button previousText = new Button(subPanneau, SWT.FLAT);
-		Button first = new Button(subPanneau, SWT.FLAT|SWT.PUSH);
-		Button previous = new Button(subPanneau, SWT.FLAT|SWT.PUSH);
+		Button first = new Button(subPanneau, SWT.FLAT | SWT.PUSH);
+		Button previous = new Button(subPanneau, SWT.FLAT | SWT.PUSH);
 		page_label = new Label(subPanneau, SWT.NONE);
-		Button next = new Button(subPanneau, SWT.FLAT|SWT.PUSH);
-		Button last = new Button(subPanneau, SWT.FLAT|SWT.PUSH);
-		Button nextText = new Button(subPanneau, SWT.FLAT|SWT.PUSH);
-		Button lastText = new Button(subPanneau, SWT.FLAT|SWT.PUSH);
-
+		Button next = new Button(subPanneau, SWT.FLAT | SWT.PUSH);
+		Button last = new Button(subPanneau, SWT.FLAT | SWT.PUSH);
+		Button nextText = new Button(subPanneau, SWT.FLAT | SWT.PUSH);
+		Button lastText = new Button(subPanneau, SWT.FLAT | SWT.PUSH);
+		
 		// set sizes
 		page_label.setLayoutData(new RowData(50, 20));
 		firstText.setLayoutData(new RowData(30, 20));
@@ -389,15 +400,15 @@
 		nextText.setLayoutData(new RowData(30, 20));
 		previousText.setLayoutData(new RowData(30, 20));
 		lastText.setLayoutData(new RowData(30, 20));
-
 		
+		
 		// set labels
 		page_label.setText(""); //$NON-NLS-1$
 		firstText.setImage(IImageKeys.getImage(IImageKeys.CTRLREWINDSTART));
 		firstText.setToolTipText("|<<");
 		previousText.setImage(IImageKeys.getImage(IImageKeys.CTRLREWIND));
 		previousText.setToolTipText(TXMUIMessages.previousText);
-		first.setImage(IImageKeys.getImage(IImageKeys.CTRLSTART)); 
+		first.setImage(IImageKeys.getImage(IImageKeys.CTRLSTART));
 		first.setToolTipText(TXMUIMessages.common_beginning);
 		previous.setImage(IImageKeys.getImage(IImageKeys.CTRLREVERSE));
 		previous.setToolTipText(TXMUIMessages.previousPage);
@@ -410,63 +421,63 @@
 		lastText.setImage(IImageKeys.getImage(IImageKeys.CTRLFASTFORWARDEND));
 		lastText.setToolTipText(">>|");
 		
-
+		
 		// set listeners
 		first.addSelectionListener(new SelectionListener() {
-
+			
 			@Override
 			public void widgetDefaultSelected(SelectionEvent e) {
 				firstPage();
 			}
-
+			
 			@Override
 			public void widgetSelected(SelectionEvent e) {
 				firstPage();
 			}
 		});
 		previous.addSelectionListener(new SelectionListener() {
-
+			
 			@Override
 			public void widgetDefaultSelected(SelectionEvent e) {
 				previousPage();
 			}
-
+			
 			@Override
 			public void widgetSelected(SelectionEvent e) {
 				previousPage();
 			}
 		});
 		next.addSelectionListener(new SelectionListener() {
-
+			
 			@Override
 			public void widgetDefaultSelected(SelectionEvent e) {
 				nextPage();
 			}
-
+			
 			@Override
 			public void widgetSelected(SelectionEvent e) {
 				nextPage();
 			}
 		});
 		last.addSelectionListener(new SelectionListener() {
-
+			
 			@Override
 			public void widgetDefaultSelected(SelectionEvent e) {
 				lastPage();
 			}
-
+			
 			@Override
 			public void widgetSelected(SelectionEvent e) {
 				lastPage();
 			}
 		});
 		nextText.addSelectionListener(new SelectionListener() {
-
+			
 			@Override
 			public void widgetDefaultSelected(SelectionEvent e) {
 				nextText();
 			}
-
+			
 			@Override
 			public void widgetSelected(SelectionEvent e) {
 				nextText();
@@ -474,24 +485,24 @@
 		});
 		// set listeners
 		previousText.addSelectionListener(new SelectionListener() {
-
+			
 			@Override
 			public void widgetDefaultSelected(SelectionEvent e) {
 				previousText(false);
 			}
-
+			
 			@Override
 			public void widgetSelected(SelectionEvent e) {
 				previousText(false);
 			}
 		});
 		lastText.addSelectionListener(new SelectionListener() {
-
+			
 			@Override
 			public void widgetDefaultSelected(SelectionEvent e) {
 				lastText();
 			}
-
+			
 			@Override
 			public void widgetSelected(SelectionEvent e) {
 				lastText();
@@ -499,51 +510,51 @@
 		});
 		// set listeners
 		firstText.addSelectionListener(new SelectionListener() {
-
+			
 			@Override
 			public void widgetDefaultSelected(SelectionEvent e) {
 				firstText();
 			}
-
+			
 			@Override
 			public void widgetSelected(SelectionEvent e) {
 				firstText();
 			}
 		});
-
+		
 		subPanneau.pack();
 		panneau.pack();
-
+		
 		FormLayout parentLayout = new FormLayout();
-
+		
 		FormData datatop = new FormData();
 		datatop.top = new FormAttachment(0, 0);
 		datatop.left = new FormAttachment(0, 0);
 		datatop.right = new FormAttachment(100, 0);
 		datatop.bottom = new FormAttachment(panneau, 0);
 		webBrowser.setLayoutData(datatop);
-
+		
 		FormData databottom = new FormData(200, 30);
 		databottom.bottom = new FormAttachment(100, 0);
 		databottom.left = new FormAttachment(30, -100);
 		databottom.right = new FormAttachment(80, 100);
 		panneau.setLayoutData(databottom);
-
+		
 		parent.setLayout(parentLayout);
 		parent.pack();
 		
 		MenuManager menuManager = new MenuManager();
 		Menu menu = menuManager.createContextMenu(getBrowser());
-
+		
 		// Set the MenuManager
 		getBrowser().setMenu(menu);
 		ISelectionProvider selProvider = new ISelectionProvider() {
 			
 			@Override
-			public void setSelection(ISelection selection) { }
+			public void setSelection(ISelection selection) {}
 			
 			@Override
-			public void removeSelectionChangedListener(ISelectionChangedListener listener) { }
+			public void removeSelectionChangedListener(ISelectionChangedListener listener) {}
 			
 			@Override
 			public ISelection getSelection() {
@@ -583,29 +594,29 @@
 			}
 			
 			@Override
-			public void addSelectionChangedListener(ISelectionChangedListener listener) { }
+			public void addSelectionChangedListener(ISelectionChangedListener listener) {}
 		};
 		getSite().registerContextMenu(menuManager, selProvider);
 		getSite().setSelectionProvider(selProvider);
 		
-		//System.out.println("Browser menu: "+getBrowser().getMenu());
+		// System.out.println("Browser menu: "+getBrowser().getMenu());
 	}
 	
-	static String SCRIPT01 = "var html = \"\";"+
-			"if (typeof window.getSelection != \"undefined\") {"+ // modern Web browsers
-			    "var sel = window.getSelection();"+
-			    "if (sel.rangeCount) {"+
-			        "var container = document.createElement(\"div\");"+
-			        "for (var i = 0, len = sel.rangeCount; i < len; ++i) {"+
-			            "container.appendChild(sel.getRangeAt(i).cloneContents());"+
-			        "}"+
-			        "html = container.innerHTML;"+
-			    "}"+
-			"} else if (typeof document.selection != \"undefined\") {"+ // for IE < 11
-			    "if (document.selection.type == \"Text\") {"+
-			        "html = document.selection.createRange().htmlText;"+
-			    "}" +
+	static String SCRIPT01 = "var html = \"\";" +
+			"if (typeof window.getSelection != \"undefined\") {" + // modern Web browsers
+			"var sel = window.getSelection();" +
+			"if (sel.rangeCount) {" +
+			"var container = document.createElement(\"div\");" +
+			"for (var i = 0, len = sel.rangeCount; i < len; ++i) {" +
+			"container.appendChild(sel.getRangeAt(i).cloneContents());" +
 			"}" +
+			"html = container.innerHTML;" +
+			"}" +
+			"} else if (typeof document.selection != \"undefined\") {" + // for IE < 11
+			"if (document.selection.type == \"Text\") {" +
+			"html = document.selection.createRange().htmlText;" +
+			"}" +
+			"}" +
 			"return html";
 	
 	// return the span@id of the current selection
@@ -615,26 +626,26 @@
 			+ "else \n"
 			+ "return node.ChildNodes;\n"
 			+ "}\n"
-			+ "function findSpans(c, a) {\n"+
-			"    for (var i = 0 ; i < c.length ; i++) {\n"+
-			"        if (c.item(i).tagName == \"SPAN\") {\n"+
-			"            var id = c.item(i).getAttribute(\"id\")\n"+
-			"            if (id.indexOf(\"w_\") == 0)\n"+
-			"                a.push(id);\n"+
-			"        } else if (c.item(i).nodeType == 1) {\n"+
-			"            findSpans(c.item(i).children, a);\n"+
-			"        }\n"+
-			"    }\n"+
-			"}\n"+
-			"    var all = [];"+
-			"    var sel = window.getSelection();"+
-			"    if (sel.rangeCount == 0){"+
-			"        return all;"+
-			"    }"+
-			"\n"+
-			"    var range = sel.getRangeAt(0);"+
-			"    var frag = range.cloneContents();alert(frag);alert(frag.children);"+
-			"    findSpans(frag.children, all);"+
+			+ "function findSpans(c, a) {\n" +
+			"    for (var i = 0 ; i < c.length ; i++) {\n" +
+			"        if (c.item(i).tagName == \"SPAN\") {\n" +
+			"            var id = c.item(i).getAttribute(\"id\")\n" +
+			"            if (id.indexOf(\"w_\") == 0)\n" +
+			"                a.push(id);\n" +
+			"        } else if (c.item(i).nodeType == 1) {\n" +
+			"            findSpans(c.item(i).children, a);\n" +
+			"        }\n" +
+			"    }\n" +
+			"}\n" +
+			"    var all = [];" +
+			"    var sel = window.getSelection();" +
+			"    if (sel.rangeCount == 0){" +
+			"        return all;" +
+			"    }" +
+			"\n" +
+			"    var range = sel.getRangeAt(0);" +
+			"    var frag = range.cloneContents();alert(frag);alert(frag.children);" +
+			"    findSpans(frag.children, all);" +
 			"    return all;";
 	
 	public String getTextSelectionDOM() {
@@ -642,17 +653,17 @@
 	}
 	
 	public Object getWordIDsSelection() {
-		System.out.println("WORDS IDS "+getBrowser().evaluate(SCRIPT02));
+		System.out.println("WORDS IDS " + getBrowser().evaluate(SCRIPT02));
 		return getBrowser().evaluate(SCRIPT02);
 	}
 	
 	public String getTextSelection() {
-		System.out.println("DOM="+getTextSelectionDOM());
-		String rez =  getTextSelectionDOM().replaceAll("<[^>]+>", "");
-		System.out.println("STR="+rez);
+		System.out.println("DOM=" + getTextSelectionDOM());
+		String rez = getTextSelectionDOM().replaceAll("<[^>]+>", "");
+		System.out.println("STR=" + rez);
 		return rez;
-	} 
-
+	}
+	
 	/**
 	 * Gets the current page.
 	 *
@@ -661,4 +672,4 @@
 	public Page getCurrentPage() {
 		return currentPage;
 	}
-}
\ No newline at end of file
+}
Index: tmp/org.txm.rcp/src/main/java/org/txm/rcp/editors/TXMEditor.java
===================================================================
--- tmp/org.txm.rcp/src/main/java/org/txm/rcp/editors/TXMEditor.java	(revision 2730)
+++ tmp/org.txm.rcp/src/main/java/org/txm/rcp/editors/TXMEditor.java	(revision 2731)
@@ -99,7 +99,7 @@
  * @author sjacquot
  *
  */
-public abstract class TXMEditor<T extends TXMResult> extends EditorPart implements ITXMResultEditor<T> {
+public abstract class TXMEditor<T extends TXMResult> extends EditorPart implements ITXMResultEditor<TXMResult> {
 	
 	/**
 	 * ID to use in plugin.xml to contribute to the top toolbar.
@@ -188,7 +188,7 @@
 	/**
 	 * Linked editors.
 	 */
-	protected ArrayList<EditorPart> linkedEditors = null;
+	protected ArrayList<ITXMResultEditor<TXMResult>> linkedEditors = null;
 	
 	/**
 	 * debug purpose variable -> easier to fetch information that the getResult() method
@@ -1776,7 +1776,8 @@
 	 * 
 	 * @param editor
 	 */
-	public void addLinkedEditor(final EditorPart editor) {
+	@Override
+	public void addLinkedEditor(final ITXMResultEditor<TXMResult> editor) {
 		
 		if (this.linkedEditors == null) {
 			this.linkedEditors = new ArrayList<>();
@@ -1835,7 +1836,8 @@
 	 * 
 	 * @param editor
 	 */
-	public void removeLinkedEditor(EditorPart editor) {
+	@Override
+	public void removeLinkedEditor(ITXMResultEditor<TXMResult> editor) {
 		if (this.linkedEditors != null) {
 			if (this.linkedEditors.remove(editor)) {
 				// Debug
@@ -1853,7 +1855,8 @@
 	 * 
 	 * @return
 	 */
-	public ArrayList<EditorPart> getLinkedEditors() {
+	@Override
+	public ArrayList<ITXMResultEditor<TXMResult>> getLinkedEditors() {
 		return this.linkedEditors;
 	}
 	
@@ -1863,12 +1866,13 @@
 	 * @param editorClass
 	 * @return
 	 */
-	public EditorPart getLinkedEditor(Class editorClass) {
-		EditorPart editor = null;
+	@Override
+	public <E extends ITXMResultEditor<TXMResult>> E getLinkedEditor(Class<E> editorClass) {
+		E editor = null;
 		if (this.linkedEditors != null) {
 			for (int i = 0; i < this.linkedEditors.size(); i++) {
-				if (this.linkedEditors.get(i).getClass().equals(editorClass)) {
-					editor = this.linkedEditors.get(i);
+				if (this.linkedEditors.get(i).getClass().equals(editorClass)) { // TODO won't work if the linkedEditor inherits E.class
+					editor = (E) this.linkedEditors.get(i);
 					break;
 				}
 			}
@@ -1882,12 +1886,13 @@
 	 * @param editorClass
 	 * @return
 	 */
-	public ArrayList<EditorPart> getLinkedEditors(Class editorClass) {
-		ArrayList<EditorPart> editors = new ArrayList<>();
+	@Override
+	public <E extends ITXMResultEditor<TXMResult>> ArrayList<E> getLinkedEditors(Class<E> editorClass) {
+		ArrayList<E> editors = new ArrayList<>();
 		if (this.linkedEditors != null) {
 			for (int i = 0; i < this.linkedEditors.size(); i++) {
 				if (this.linkedEditors.get(i).getClass().equals(editorClass)) {
-					editors.add(this.linkedEditors.get(i));
+					editors.add((E) this.linkedEditors.get(i));
 				}
 			}
 		}
