Index: tmp/org.txm.edition.rcp/build.properties
===================================================================
--- tmp/org.txm.edition.rcp/build.properties	(revision 0)
+++ tmp/org.txm.edition.rcp/build.properties	(revision 936)
@@ -0,0 +1,8 @@
+source.. = src/
+output.. = bin/
+bin.includes =  .,\
+				META-INF/,\
+               plugin.xml,\
+               icons/,\
+               res/,\
+               OSGI-INF/

Property changes on: tmp/org.txm.edition.rcp/build.properties
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/org.txm.edition.rcp/OSGI-INF/l10n/bundle.properties
===================================================================
--- tmp/org.txm.edition.rcp/OSGI-INF/l10n/bundle.properties	(revision 0)
+++ tmp/org.txm.edition.rcp/OSGI-INF/l10n/bundle.properties	(revision 936)
@@ -0,0 +1,8 @@
+command.label = Edition
+command.tooltip = Read corpus texts
+command.tooltip.0 = Read corpus texts
+command.name = Edition
+command.name.0 = Display in full text
+editor.name = Edition
+Bundle-Name = SynopticEditor
+menu.label.1 = Corpus
\ No newline at end of file

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

Index: tmp/org.txm.edition.rcp/OSGI-INF/l10n/bundle_fr.properties
===================================================================
--- tmp/org.txm.edition.rcp/OSGI-INF/l10n/bundle_fr.properties	(revision 0)
+++ tmp/org.txm.edition.rcp/OSGI-INF/l10n/bundle_fr.properties	(revision 936)
@@ -0,0 +1,16 @@
+
+Bundle-Name = SynopticEditor
+
+command.label = \u00C9dition
+
+command.name = \u00C9dition
+
+command.name.0 = Lire en plein texte
+
+command.tooltip = Lire l'\u00E9dition
+
+command.tooltip.0 = Lire l'\u00E9dition
+
+editor.name = \u00C9dition
+
+menu.label.1 = Corpus

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

Index: tmp/org.txm.edition.rcp/icons/objects/edition.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/org.txm.edition.rcp/icons/objects/edition.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/org.txm.edition.rcp/icons/objects/edition-d.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/org.txm.edition.rcp/icons/objects/edition-d.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/org.txm.edition.rcp/plugin.xml
===================================================================
--- tmp/org.txm.edition.rcp/plugin.xml	(revision 0)
+++ tmp/org.txm.edition.rcp/plugin.xml	(revision 936)
@@ -0,0 +1,173 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.4"?>
+<plugin>
+   <extension
+         point="org.eclipse.ui.menus">
+      <menuContribution
+            locationURI="menu:menu.help.plugins">
+         <command
+               commandId="org.txm.rcp.commands.OpenBrowser"
+               icon="icons/objects/edition.png"
+               label="%command.label"
+               style="push">
+            <parameter
+                  name="org.txm.rcp.commands.commandParameter2"
+                  value="https://groupes.renater.fr/wiki/txm-users/public/extensions#synoptic_editor">
+            </parameter>
+         </command>
+      </menuContribution>
+      <menuContribution
+            allPopups="true"
+            locationURI="toolbar:org.txm.rcp.toolbarcorpus?after=org.txm.rcp.toolbarcorpus.read">
+         <command
+               commandId="org.txm.edition.rcp.handlers.OpenEdition"
+               icon="icons/objects/edition.png"
+               style="push"
+               tooltip="%command.tooltip.0">
+            <visibleWhen
+                  checkEnabled="false">
+               <or>
+                  <reference
+                        definitionId="OneCorpusSelected">
+                  </reference>
+               </or>
+            </visibleWhen>
+         </command>
+      </menuContribution>
+      <menuContribution
+            locationURI="popup:org.txm.rcp.views.corpora.CorporaView?after=org.txm.rcp.corporaview.corpus.read">
+         <command
+               commandId="org.txm.edition.rcp.handlers.OpenEdition"
+               icon="icons/objects/edition.png"
+               style="push"
+               tooltip="%command.tooltip.0">
+            <visibleWhen
+                  checkEnabled="false">
+               <or>
+                  <reference
+                        definitionId="OneCorpusSelected">
+                  </reference>
+               </or>
+            </visibleWhen>
+         </command>
+      </menuContribution>
+      <menuContribution
+            locationURI="menu:menu.corpus?after=menu.corpus.read">
+         <command
+               commandId="org.txm.edition.rcp.handlers.OpenEdition"
+               icon="icons/objects/edition.png"
+               style="push"
+               tooltip="%command.tooltip.0">
+            <visibleWhen
+                  checkEnabled="false">
+               <or>
+                  <reference
+                        definitionId="OneCorpusSelected">
+                  </reference>
+               </or>
+            </visibleWhen>
+         </command>
+      </menuContribution>
+      <menuContribution
+            locationURI="popup:org.txm.concordance.rcp.editors.ConcordanceEditor">
+         <command
+               commandId="org.txm.edition.rcp.handlers.BackToText"
+               icon="icons/objects/edition.png"
+               style="push">
+         </command>
+      </menuContribution>
+   </extension>
+   <extension
+         point="org.eclipse.ui.commands">
+      <command
+            defaultHandler="org.txm.edition.rcp.handlers.OpenEdition"
+            id="org.txm.edition.rcp.handlers.OpenEdition"
+            name="%command.name">
+      </command>
+      <command
+            defaultHandler="org.txm.edition.rcp.handlers.BackToText"
+            id="org.txm.edition.rcp.handlers.BackToText"
+            name="%command.name.0">
+         <commandParameter
+               id="org.txm.edition.rcp.handlers.BackToText.wordid"
+               name="wordid"
+               optional="true">
+         </commandParameter>
+         <commandParameter
+               id="org.txm.edition.rcp.handlers.BackToText.textid"
+               name="textid"
+               optional="true">
+         </commandParameter>
+         <commandParameter
+               id="org.txm.edition.rcp.handlers.BackToText.corpusid"
+               name="corpusid"
+               optional="true">
+         </commandParameter>
+         <commandParameter
+               id="org.txm.edition.rcp.handlers.BackToText.editionid"
+               name="editionid"
+               optional="true">
+         </commandParameter>
+      </command>
+   </extension>
+   <extension
+         point="org.eclipse.ui.editors">
+      <editor
+            class="org.txm.edition.rcp.editors.SynopticEditionEditor"
+            default="false"
+            icon="icons/objects/edition.png"
+            id="org.txm.edition.rcp.editors.SynopticEditionEditor"
+            name="%editor.name">
+      </editor>
+   </extension>
+   <extension
+         point="org.eclipse.ui.bindings">
+      <key
+            commandId="org.txm.edition.rcp.handlers.BackToText"
+            contextId="org.eclipse.ui.contexts.window"
+            schemeId="org.txm.rcp.scheme"
+            sequence="M1+E">
+      </key>
+   </extension>
+   <extension
+         point="org.txm.rcp.extensionpoint.backtotext">
+      <command
+            class="org.txm.edition.rcp.handlers.BackToText"
+            name="Synoptic">
+      </command>
+   </extension>
+   <extension
+         point="org.eclipse.ui.preferencePages">
+      <page
+            category="org.txm.rcp.preferences.UserPreferencePage"
+            class="org.txm.edition.rcp.preferences.SynopticEditionPreferencePage"
+            id="org.txm.edition.rcp.preferences.SynopticEditionPreferencePage"
+            name="Edition">
+      </page>
+   </extension>
+   <extension
+         point="org.eclipse.ui.handlers">
+      <handler
+            class="org.txm.edition.rcp.handlers.SendEditionTo"
+            commandId="org.txm.concordance.rcp.commands.SendToConcordance">
+         <activeWhen>
+            <reference
+                  definitionId="EditionEditorActive">
+            </reference>
+         </activeWhen>
+      </handler>
+   </extension>
+   <extension
+         point="org.eclipse.core.expressions.definitions">
+      <definition
+            id="EditionEditorActive">
+         <with
+               variable="activePart">
+            <instanceof
+                  value="org.txm.edition.rcp.editors.SynopticEditionEditor">
+            </instanceof>
+         </with>
+      </definition>
+   </extension>
+
+</plugin>

Property changes on: tmp/org.txm.edition.rcp/plugin.xml
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/org.txm.edition.rcp/.settings/org.eclipse.jdt.core.prefs
===================================================================
--- tmp/org.txm.edition.rcp/.settings/org.eclipse.jdt.core.prefs	(revision 0)
+++ tmp/org.txm.edition.rcp/.settings/org.eclipse.jdt.core.prefs	(revision 936)
@@ -0,0 +1,7 @@
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
+org.eclipse.jdt.core.compiler.compliance=1.6
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.6

Property changes on: tmp/org.txm.edition.rcp/.settings/org.eclipse.jdt.core.prefs
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/org.txm.edition.rcp/.classpath
===================================================================
--- tmp/org.txm.edition.rcp/.classpath	(revision 0)
+++ tmp/org.txm.edition.rcp/.classpath	(revision 936)
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
+	<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins">
+		<accessrules>
+			<accessrule kind="accessible" pattern="**"/>
+		</accessrules>
+	</classpathentry>
+	<classpathentry kind="src" path="src"/>
+	<classpathentry kind="src" path="res"/>
+	<classpathentry kind="output" path="bin"/>
+</classpath>

Property changes on: tmp/org.txm.edition.rcp/.classpath
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/org.txm.edition.rcp/META-INF/MANIFEST.MF
===================================================================
--- tmp/org.txm.edition.rcp/META-INF/MANIFEST.MF	(revision 0)
+++ tmp/org.txm.edition.rcp/META-INF/MANIFEST.MF	(revision 936)
@@ -0,0 +1,15 @@
+Manifest-Version: 1.0
+Require-Bundle: org.txm.concordance.rcp;bundle-version="1.0.0";visibility:=reexport,
+ org.txm.links.rcp;bundle-version="1.0.0";visibility:=reexport
+Export-Package: org.txm.edition.rcp.editors,
+ org.txm.edition.rcp.handlers,
+ org.txm.edition.rcp.messages,
+ org.txm.edition.rcp.preferences
+Bundle-Vendor: Textometrie.org
+Bundle-ActivationPolicy: lazy
+Bundle-Version: 1.0.0.qualifier
+Bundle-Name: org.txm.edition.rcp
+Bundle-ManifestVersion: 2
+Bundle-SymbolicName: org.txm.edition.rcp;singleton:=true
+Bundle-RequiredExecutionEnvironment: JavaSE-1.7
+

Property changes on: tmp/org.txm.edition.rcp/META-INF/MANIFEST.MF
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/org.txm.edition.rcp/.project
===================================================================
--- tmp/org.txm.edition.rcp/.project	(revision 0)
+++ tmp/org.txm.edition.rcp/.project	(revision 936)
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>org.txm.edition.rcp</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>org.eclipse.jdt.core.javabuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.eclipse.pde.ManifestBuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.eclipse.pde.SchemaBuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>org.eclipse.pde.PluginNature</nature>
+		<nature>org.eclipse.jdt.core.javanature</nature>
+	</natures>
+</projectDescription>

Property changes on: tmp/org.txm.edition.rcp/.project
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/org.txm.edition.rcp/src/org/txm/edition/rcp/handlers/___TextToConcordance.java
===================================================================
--- tmp/org.txm.edition.rcp/src/org/txm/edition/rcp/handlers/___TextToConcordance.java	(revision 0)
+++ tmp/org.txm.edition.rcp/src/org/txm/edition/rcp/handlers/___TextToConcordance.java	(revision 936)
@@ -0,0 +1,100 @@
+// Copyright © 2010-2013 ENS de Lyon.
+// Copyright © 2007-2010 ENS de Lyon, CNRS, INRP, University of
+// Lyon 2, University of Franche-Comté, University of Nice
+// Sophia Antipolis, University of Paris 3.
+// 
+// The TXM platform is free software: you can redistribute it
+// and/or modify it under the terms of the GNU General Public
+// License as published by the Free Software Foundation,
+// either version 2 of the License, or (at your option) any
+// later version.
+// 
+// The TXM platform is distributed in the hope that it will be
+// useful, but WITHOUT ANY WARRANTY; without even the implied
+// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+// PURPOSE. See the GNU General Public License for more
+// details.
+// 
+// You should have received a copy of the GNU General
+// Public License along with the TXM platform. If not, see
+// http://www.gnu.org/licenses.
+// 
+// 
+// 
+// $LastChangedDate:$
+// $LastChangedRevision:$
+// $LastChangedBy:$ 
+//
+package org.txm.edition.rcp.handlers;
+
+import org.eclipse.core.commands.AbstractHandler;
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.osgi.util.NLS;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.PartInitException;
+import org.eclipse.ui.handlers.HandlerUtil;
+import org.txm.concordance.core.functions.Concordance;
+import org.txm.concordance.rcp.editors.ConcordanceEditor;
+import org.txm.rcp.editors.IEditionEditor;
+import org.txm.rcp.editors.TXMResultEditorInput;
+import org.txm.rcp.messages.TXMUIMessages;
+import org.txm.searchengine.cqp.corpus.Corpus;
+import org.txm.searchengine.cqp.corpus.query.Query;
+
+// TODO: Auto-generated Javadoc
+/**
+ * use the ITextSelection to compute a concordance
+ * 
+ * @author mdecorde.
+ */
+@Deprecated
+public class ___TextToConcordance extends AbstractHandler {
+
+	/* (non-Javadoc)
+	 * @see org.eclipse.core.commands.AbstractHandler#execute(org.eclipse.core.commands.ExecutionEvent)
+	 */
+	@Override
+	public Object execute(ExecutionEvent event) throws ExecutionException {
+		//System.out.println("Call TextToConcordance");
+		IWorkbenchWindow window;
+		TXMResultEditorInput editorInput;
+		window = HandlerUtil.getActiveWorkbenchWindow(event);
+		//selection = HandlerUtil.getCurrentSelection(event);
+		
+		IEditorPart editor = window.getActivePage().getActiveEditor();
+
+		if (editor instanceof IEditionEditor) {
+			
+			//System.out.println(((TXMBrowser)editor).getWordIDsSelection());
+			String query = ((IEditionEditor)editor).getTextSelection();
+			if (query.length() == 0) {
+				System.out.println("No text selection. Aborting.");
+				return null;
+			}
+			query = fixQuery(query);
+			
+			Corpus corpus = ((IEditionEditor)editor).getCorpus();
+			Concordance concordance = new Concordance(corpus);
+			concordance.setParameters(new Query(query), null, null, null, null, null, null, null, null, null, null);
+			editorInput = new TXMResultEditorInput(concordance);
+
+			IWorkbenchPage page = window.getActivePage();
+			try {
+				ConcordanceEditor conceditor = (ConcordanceEditor) page
+						.openEditor(editorInput, "ConcordanceEditor"); //$NON-NLS-1$
+			} catch (PartInitException e) {
+				System.err.println("Error: "+e.getLocalizedMessage());
+			}
+		}
+		return null;
+	}
+	
+	public static String fixQuery(String query) {
+		query = "\""+query.replaceAll("\"", "\\\"");//.replaceAll("("+TokenizerClasses.regPunct+")", " $1 ");
+		query = query.replaceAll(" +", "\" \"")+"\"";
+		return query;
+	}
+}

Property changes on: tmp/org.txm.edition.rcp/src/org/txm/edition/rcp/handlers/___TextToConcordance.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

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 0)
+++ tmp/org.txm.edition.rcp/src/org/txm/edition/rcp/handlers/BackToText.java	(revision 936)
@@ -0,0 +1,350 @@
+// Copyright © 2010-2013 ENS de Lyon.
+// Copyright © 2007-2010 ENS de Lyon, CNRS, INRP, University of
+// Lyon 2, University of Franche-Comté, University of Nice
+// Sophia Antipolis, University of Paris 3.
+// 
+// The TXM platform is free software: you can redistribute it
+// and/or modify it under the terms of the GNU General Public
+// License as published by the Free Software Foundation,
+// either version 2 of the License, or (at your option) any
+// later version.
+// 
+// The TXM platform is distributed in the hope that it will be
+// useful, but WITHOUT ANY WARRANTY; without even the implied
+// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+// PURPOSE. See the GNU General Public License for more
+// details.
+// 
+// You should have received a copy of the GNU General
+// Public License along with the TXM platform. If not, see
+// http://www.gnu.org/licenses.
+// 
+// 
+// 
+// $LastChangedDate:$
+// $LastChangedRevision:$
+// $LastChangedBy:$ 
+//
+package org.txm.edition.rcp.handlers;
+
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+
+import org.apache.commons.lang.StringUtils;
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.e4.ui.workbench.modeling.EModelService;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.osgi.util.NLS;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.handlers.HandlerUtil;
+import org.txm.concordance.core.functions.Concordance;
+import org.txm.concordance.rcp.editors.ConcordanceEditor;
+import org.txm.concordance.rcp.handlers.BackToTextCommand;
+import org.txm.edition.rcp.editors.RGBA;
+import org.txm.edition.rcp.editors.SynopticEditionEditor;
+import org.txm.edition.rcp.messages.SynopticEditionUIMessages;
+import org.txm.objects.Text;
+import org.txm.rcp.StatusLine;
+import org.txm.rcp.utils.SWTEditorsUtils;
+import org.txm.searchengine.cqp.AbstractCqiClient;
+import org.txm.searchengine.cqp.CQPSearchEngine;
+import org.txm.searchengine.cqp.corpus.Corpus;
+import org.txm.searchengine.cqp.corpus.CorpusManager;
+import org.txm.searchengine.cqp.corpus.MainCorpus;
+import org.txm.searchengine.cqp.corpus.Property;
+import org.txm.searchengine.cqp.corpus.StructuralUnit;
+import org.txm.searchengine.cqp.corpus.query.Match;
+import org.txm.utils.logger.Log;
+
+/**
+ * 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 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)
+	 * @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
+				.getParameter("org.txm.edition.rcp.handlers.BackToText.textid");
+		String editionid = event
+				.getParameter("org.txm.edition.rcp.handlers.BackToText.editionid");
+		String corpusid = event
+				.getParameter("org.txm.edition.rcp.handlers.BackToText.corpusid");
+		if (corpusid != null) { // minimal parameter is the corpus id
+			try {
+				IWorkbenchWindow wb = HandlerUtil.getActiveWorkbenchWindow(event);
+				IEditorPart ieditor = wb.getActivePage().getActiveEditor();
+
+				if (!backToText(ieditor, corpusid, editionid, textid, wordid)) {
+					System.out.println("Could not open edition for wordid="+wordid+" textid="+textid+" edition="+editionid);
+				}
+			} 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;
+		// 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);
+//		}
+		return null;
+	}
+
+	private boolean backToText(IEditorPart ieditor, String corpusid, String editionid, String textid, String wordid) throws Exception {
+		MainCorpus corpus = CorpusManager.getCorpusManager().getCorpus(corpusid);
+
+		if (corpus == null) {
+			System.out.println("Error: no corpus with ID="+corpusid);
+		}
+
+		if (editionid != null && !corpus.getEditionNames().contains(editionid)) {
+			System.out.println("Warning: corpus has no edition with id="+editionid);
+			editionid = "default";
+		}
+
+		if (!corpus.getEditionNames().contains(editionid)) {
+			System.out.println("Error: corpus has no default edition.");
+			System.out.println("Availables: "+corpus.getEditionNames());
+			return false;
+		}
+
+		if (editionid == null) editionid = "default";
+
+		String[] editions = {editionid};
+		SynopticEditionEditor editor = null;
+		if (ieditor != null && ieditor instanceof SynopticEditionEditor) {
+			editor = (SynopticEditionEditor)ieditor;
+		} else {
+			editor = OpenEdition.openEdition(corpus, editions);
+		}
+
+		Text text = null;
+		if (textid != null) {
+			text = corpus.getText(textid);
+			if (text == null) {
+				System.out.println("Error: corpus has no text with id="+textid);
+				return false;
+			}
+		} else {
+			text = corpus.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);
+		}
+		return false;
+	}
+
+	/**
+	 * Open edition.
+	 *
+	 * @param corpus the corpus
+	 * @return the object
+	 */
+	@Override
+	public boolean backToText(ConcordanceEditor editor, Match match) {
+		Concordance conc = editor.getConcordance();
+		Corpus corpus = editor.getCorpus();
+
+		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";
+			int[] pos = null;
+			if (xProperty != null) {
+				yProperty = corpus.getProperty("y");
+				if (yProperty != null) {
+					wProperty = corpus.getProperty("w");
+					if (wProperty != null) {
+						AbstractCqiClient CQI = CQPSearchEngine.getCqiClient();
+						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);
+							pos[2] = Integer.parseInt(w);
+							pos[3] = Integer.parseInt(h);
+						}
+					}
+				}
+			}
+
+
+			String projectid = ""; //$NON-NLS-1$
+			try {
+				textS = corpus.getStructuralUnit("text"); //$NON-NLS-1$
+				Property textP = textS.getProperty("id"); //$NON-NLS-1$
+				textid = match.getValueForProperty(textP);// get text via text struct property id
+			} catch (Exception e2) {
+				System.out.println("The corpus has no text_id property" + e2); //$NON-NLS-1$
+				org.txm.rcp.utils.Logger.printStackTrace(e2);
+				return false;
+			}
+
+			Log.info("Loading line informations..."); //$NON-NLS-1$
+
+			SynopticEditionEditor attachedBrowserEditor = associatedEditors.get(editor);
+			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
+					ArrayList<String> editionNames = corpus.getEditionNames();
+					if (editionNames.size() > 0) { // use the first edition declared
+						editionsToOpen = new String[1];
+						editionsToOpen[0] = editionNames.get(0);
+						Log.info(SynopticEditionUIMessages.BackToText_0+editionNames.get(0));
+					} else { // no edition in the corpus
+						Log.info(SynopticEditionUIMessages.BackToText_4);
+						editionsToOpen = new String[0];
+						return false;
+					}
+				} else {
+					Log.info(SynopticEditionUIMessages.BackToText_5+StringUtils.join(editionsToOpen));
+				}
+
+				attachedBrowserEditor = OpenEdition.openEdition(corpus, editionsToOpen);
+				associatedEditors.put(editor, attachedBrowserEditor);
+				SWTEditorsUtils.addEditor(editor, attachedBrowserEditor, EModelService.ABOVE);
+			}
+
+			// remove previous highlighted words
+			if (previousOtherWordIDs != null) {
+				//System.out.println("remove previousOtherWordIDs="+previousOtherWordIDs);
+				attachedBrowserEditor.removeHighlightWordsById(lightred, previousOtherWordIDs);
+				associatedEditorsPreviousOtherWordIDs.remove(editor); // free mem
+			}
+			if (previousLineids != null) {
+				//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);
+			List<String> otherWordIDs = conc.getKeywordsId(textid, editor.getTopLine(), editor.getBottomLine() + 1);
+			//System.out.println("getKeywordsId="+otherWordIDs);
+			List<String> lineids = null;
+			try {
+				lineids = match.getValuesForProperty(corpus.getProperty("id")); //$NON-NLS-1$
+			} catch (Exception e1) {
+				org.txm.rcp.utils.Logger.printStackTrace(e1);
+				return false;
+			}
+			Log.info(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 
+
+			Text text = corpus.getMainCorpus().getText(textid);
+			if (text == null) {
+				System.out.println(NLS.bind("BackToText: Text {0} is missing", textid)); //$NON-NLS-1$
+				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) {
+				System.out.println(SynopticEditionUIMessages.BackToText_3);
+				return false;				
+			}
+
+
+			String focusid = null;
+			if (lineids.size() > 0) focusid = lineids.get(0);
+
+			//System.out.println("add otherWordIDs="+otherWordIDs);
+			attachedBrowserEditor.addHighlightWordsById(lightred, otherWordIDs);
+
+			//System.out.println("add linesids="+lineids);
+			attachedBrowserEditor.addHighlightWordsById(red, lineids);
+
+			associatedEditorsPreviousOtherWordIDs.put(editor, otherWordIDs);
+			associatedEditorsPreviousLineids.put(editor, lineids);
+
+			HashSet<int[]> posses = new HashSet<int[]>();
+			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) {
+			Log.severe(NLS.bind("Full text display failed: {0}", err)); //$NON-NLS-1$
+			Log.printStackTrace(err);
+		}
+		return false;
+	}
+}

Property changes on: tmp/org.txm.edition.rcp/src/org/txm/edition/rcp/handlers/BackToText.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/org.txm.edition.rcp/src/org/txm/edition/rcp/handlers/SendEditionTo.java
===================================================================
--- tmp/org.txm.edition.rcp/src/org/txm/edition/rcp/handlers/SendEditionTo.java	(revision 0)
+++ tmp/org.txm.edition.rcp/src/org/txm/edition/rcp/handlers/SendEditionTo.java	(revision 936)
@@ -0,0 +1,60 @@
+// Copyright © 2010-2013 ENS de Lyon.
+// Copyright © 2007-2010 ENS de Lyon, CNRS, INRP, University of
+// Lyon 2, University of Franche-Comté, University of Nice
+// Sophia Antipolis, University of Paris 3.
+// 
+// The TXM platform is free software: you can redistribute it
+// and/or modify it under the terms of the GNU General Public
+// License as published by the Free Software Foundation,
+// either version 2 of the License, or (at your option) any
+// later version.
+// 
+// The TXM platform is distributed in the hope that it will be
+// useful, but WITHOUT ANY WARRANTY; without even the implied
+// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+// PURPOSE. See the GNU General Public License for more
+// details.
+// 
+// You should have received a copy of the GNU General
+// Public License along with the TXM platform. If not, see
+// http://www.gnu.org/licenses.
+// 
+// 
+// 
+// $LastChangedDate:$
+// $LastChangedRevision:$
+// $LastChangedBy:$ 
+//
+package org.txm.edition.rcp.handlers;
+
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.txm.core.results.TXMResult;
+import org.txm.links.rcp.handlers.SendSelectionToQueryable;
+import org.txm.rcp.editors.IEditionEditor;
+
+/**
+ * Sends the selected text of an edition to compute another command.
+ * 
+ * @author mdecorde
+ * @author sjacquot
+ * 
+ */
+public class SendEditionTo extends SendSelectionToQueryable {
+
+
+	@Override
+	public String createQuery(ExecutionEvent event, IStructuredSelection selection) {
+		IEditionEditor editor = (IEditionEditor) this.getActiveEditor(event);
+		String query = ((IEditionEditor)editor).getTextSelection();
+		query = "\"" + query.replaceAll("\"", "\\\"");//.replaceAll("("+TokenizerClasses.regPunct+")", " $1 ");
+		query = query.replaceAll(" +", "\" \"") + "\"";
+		return query;
+	}
+	
+	@Override
+	public TXMResult getResultParent(ExecutionEvent event) {
+		return ((IEditionEditor) this.getActiveEditor(event)).getCorpus();
+	}
+
+}

Property changes on: tmp/org.txm.edition.rcp/src/org/txm/edition/rcp/handlers/SendEditionTo.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

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 0)
+++ tmp/org.txm.edition.rcp/src/org/txm/edition/rcp/handlers/OpenEdition.java	(revision 936)
@@ -0,0 +1,186 @@
+// Copyright © 2010-2013 ENS de Lyon.
+// Copyright © 2007-2010 ENS de Lyon, CNRS, INRP, University of
+// Lyon 2, University of Franche-Comté, University of Nice
+// Sophia Antipolis, University of Paris 3.
+// 
+// The TXM platform is free software: you can redistribute it
+// and/or modify it under the terms of the GNU General Public
+// License as published by the Free Software Foundation,
+// either version 2 of the License, or (at your option) any
+// later version.
+// 
+// The TXM platform is distributed in the hope that it will be
+// useful, but WITHOUT ANY WARRANTY; without even the implied
+// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+// PURPOSE. See the GNU General Public License for more
+// details.
+// 
+// You should have received a copy of the GNU General
+// Public License along with the TXM platform. If not, see
+// http://www.gnu.org/licenses.
+// 
+// 
+// 
+// $LastChangedDate:$
+// $LastChangedRevision:$
+// $LastChangedBy:$ 
+//
+package org.txm.edition.rcp.handlers;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.commons.lang.StringUtils;
+import org.eclipse.core.commands.AbstractHandler;
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.handlers.HandlerUtil;
+import org.txm.edition.rcp.editors.SynopticEditionEditor;
+import org.txm.edition.rcp.editors.SynopticEditorInput;
+import org.txm.edition.rcp.messages.SynopticEditionUIMessages;
+import org.txm.objects.BaseParameters;
+import org.txm.objects.Text;
+import org.txm.searchengine.cqp.corpus.Corpus;
+import org.txm.searchengine.cqp.corpus.MainCorpus;
+import org.txm.searchengine.cqp.corpus.Property;
+import org.txm.searchengine.cqp.corpus.StructuralUnit;
+import org.txm.searchengine.cqp.corpus.Subcorpus;
+import org.txm.searchengine.cqp.corpus.query.Match;
+import org.txm.utils.logger.Log;
+import org.w3c.dom.Element;
+
+// TODO: Auto-generated Javadoc
+/**
+ * Open a text edition from: a main corpus : the first text of the maincorpus a
+ * sub-corpus : the first text of the subcorpus a partition : the user must
+ * choose one of the text used in the partition @ author mdecorde.
+ */
+public class OpenEdition extends AbstractHandler {
+
+	/** The Constant ID. */
+	public final static String ID = "org.txm.synopticedition.rcp.handlers.OpenEdition"; //$NON-NLS-1$
+
+	/** The lastopenedfile. */
+	public static String lastopenedfile;
+
+	/* (non-Javadoc)
+	 * @see org.eclipse.core.commands.AbstractHandler#execute(org.eclipse.core.commands.ExecutionEvent)
+	 */
+	@Override
+	public Object execute(ExecutionEvent event) throws ExecutionException {
+
+		IStructuredSelection selection = (IStructuredSelection) HandlerUtil.getCurrentSelection(event);
+		if (selection.getFirstElement() instanceof Corpus) {
+			try {
+				Corpus c = (Corpus) selection.getFirstElement();
+//				Shell shell = HandlerUtil.getActiveWorkbenchWindowChecked(event).getShell();
+
+				//EditionSelectorDialog d = new EditionSelectorDialog(shell, c, null);
+				SynopticEditionEditor editor = null;
+				//				if (c.getEditionNames().size() > 1 && d.open() == Window.OK) {
+				//					Object[] rez = d.getResult();
+				//					String[] rezS = new String[rez.length];
+				//					for (int i =0 ; i < rez.length ; i++) rezS[i] = rez[i].toString();
+				//					editor = openEdition(c, rezS);
+				//				} else 
+				String[] editionsToOpen = getDefaultEditions(c);
+
+				if (editionsToOpen.length == 0) { // the defaultEdition parameter is not set
+					ArrayList<String> editionNames = c.getEditionNames();
+					if (editionNames.size() > 0) { // use the first edition declared
+						editionsToOpen = new String[1];
+						editionsToOpen[0] = editionNames.get(0);
+						Log.info(SynopticEditionUIMessages.OpenEdition_0+editionNames.get(0));
+					} else { // no edition in the corpus
+						Log.info(SynopticEditionUIMessages.OpenEdition_1);
+						editionsToOpen = new String[0];
+						return false;
+					}
+				} else {
+					Log.info(SynopticEditionUIMessages.OpenEdition_3+StringUtils.join(editionsToOpen));
+				}
+
+				editor = openEdition(c, editionsToOpen);
+
+				if (editor != null)
+					editor.firstPage();
+
+			} catch (Exception e) {
+				System.out.println(SynopticEditionUIMessages.OpenEdition_4+e);
+				org.txm.rcp.utils.Logger.printStackTrace(e);
+			}
+		} else {
+			System.out.println(SynopticEditionUIMessages.OpenEdition_9);
+		}
+		return null;
+	}
+	public static String[] getDefaultEditions(Corpus c) {
+		BaseParameters params = c.getBase().getBaseParameters();
+		Element editionsElement = params.getEditionsElement(params.getCorpusElement());
+		return editionsElement.getAttribute("default").split(","); //$NON-NLS-1$ //$NON-NLS-2$
+	}
+
+	/**
+	 * Open edition, but don't show a page 
+	 *
+	 * @param corpus the corpus
+	 * @return the object
+	 */
+	public static SynopticEditionEditor openEdition(Corpus corpus, String[] editions) {
+		String textid = null;
+
+		System.out.println("Opening edition of "+corpus); //$NON-NLS-1$
+		try {
+			Text text = null;
+			if (corpus instanceof Subcorpus) {
+				Subcorpus sub = (Subcorpus)corpus;
+				List<Match> matches = sub.getMatches();
+				if (matches.size() > 0) {
+					StructuralUnit text_su = corpus.getStructuralUnit("text"); //$NON-NLS-1$
+					Property text_id = text_su.getProperty("id"); //$NON-NLS-1$
+
+					textid = matches.get(0).getValueForProperty(text_id);
+					if (textid != null) text = corpus.getMainCorpus().getText(textid);
+				}
+			}
+			//			QueryResult result = corpus.query(new Query("<text> []"), "get_edition", false); //$NON-NLS-1$ //$NON-NLS-2$ 
+			//			StructuralUnit text_su = corpus.getStructuralUnit("text"); //$NON-NLS-1$
+			//			Property text_id = text_su.getProperty("id"); //$NON-NLS-1$
+
+			// 			if (result.getNMatch() > 0) textid = result.getMatches(0, 1).get(0).getValueForProperty(text_id);
+			MainCorpus maincorpus = corpus.getMainCorpus();
+
+			//			if (textid != null) text = maincorpus.getText(textid);
+
+			if (text == null) {
+				text = maincorpus.getFirstText();
+
+				if (text == null) {
+					System.out.println("** Could not find first text of ID "+textid+SynopticEditionUIMessages.OpenEdition_7); //$NON-NLS-1$ //$NON-NLS-1$
+					return null;
+				}
+
+				textid = text.getName();
+			}
+
+			//String[] editions = {maincorpus.getDefaultEdition()};
+			IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
+			IWorkbenchPage page = window.getActivePage();
+
+			SynopticEditorInput editorInput = new SynopticEditorInput(corpus, text.getName(), editions);
+			SynopticEditionEditor editor = (SynopticEditionEditor) page.openEditor(editorInput,
+					SynopticEditionEditor.ID, true);
+
+			return editor;
+
+		} catch (Exception e) {
+			Log.printStackTrace(e);
+			System.out.println(SynopticEditionUIMessages.OpenEdition_10+e);
+			return null;
+		}
+	}
+}

Property changes on: tmp/org.txm.edition.rcp/src/org/txm/edition/rcp/handlers/OpenEdition.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/org.txm.edition.rcp/src/org/txm/edition/rcp/preferences/SynopticEditionPreferencePage.java
===================================================================
--- tmp/org.txm.edition.rcp/src/org/txm/edition/rcp/preferences/SynopticEditionPreferencePage.java	(revision 0)
+++ tmp/org.txm.edition.rcp/src/org/txm/edition/rcp/preferences/SynopticEditionPreferencePage.java	(revision 936)
@@ -0,0 +1,34 @@
+package org.txm.edition.rcp.preferences;
+
+import org.eclipse.jface.preference.BooleanFieldEditor;
+import org.eclipse.jface.preference.FieldEditorPreferencePage;
+import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.IWorkbenchPreferencePage;
+import org.eclipse.ui.preferences.ScopedPreferenceStore;
+import org.txm.rcp.Application;
+
+public class SynopticEditionPreferencePage  extends FieldEditorPreferencePage
+implements IWorkbenchPreferencePage {
+	ScopedPreferenceStore preferences;
+
+	private BooleanFieldEditor fast_highlight;
+	
+	
+	public SynopticEditionPreferencePage() {
+		super();
+		preferences = new ScopedPreferenceStore(org.eclipse.core.runtime.preferences.InstanceScope.INSTANCE,
+				Application.PLUGIN_ID);
+		setPreferenceStore(preferences);
+		setTitle("Edition");
+	}
+	
+	@Override
+	public void init(IWorkbench workbench) { }
+
+	@Override
+	protected void createFieldEditors() {
+		fast_highlight = new BooleanFieldEditor(SynopticEditionPreferences.FAST_HIGHLIGHT,
+				"Enable fast word highlight", getFieldEditorParent());
+		addField(fast_highlight);
+	}
+}

Property changes on: tmp/org.txm.edition.rcp/src/org/txm/edition/rcp/preferences/SynopticEditionPreferencePage.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/org.txm.edition.rcp/src/org/txm/edition/rcp/preferences/SynopticEditionPreferences.java
===================================================================
--- tmp/org.txm.edition.rcp/src/org/txm/edition/rcp/preferences/SynopticEditionPreferences.java	(revision 0)
+++ tmp/org.txm.edition.rcp/src/org/txm/edition/rcp/preferences/SynopticEditionPreferences.java	(revision 936)
@@ -0,0 +1,18 @@
+package org.txm.edition.rcp.preferences;
+
+import org.eclipse.core.runtime.preferences.DefaultScope;
+import org.osgi.service.prefs.Preferences;
+import org.txm.core.preferences.TXMPreferences;
+
+public class SynopticEditionPreferences extends TXMPreferences {
+
+	public static String PREFERENCES_NODE = "org.txm.synopticedition.rcp.synoptic";
+	
+	public static String FAST_HIGHLIGHT = "fast_highlight";
+
+	@Override
+	public void initializeDefaultPreferences() {
+		Preferences preferences = DefaultScope.INSTANCE.getNode(PREFERENCES_NODE);
+		preferences.putBoolean(FAST_HIGHLIGHT, true);
+	}
+}

Property changes on: tmp/org.txm.edition.rcp/src/org/txm/edition/rcp/preferences/SynopticEditionPreferences.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/org.txm.edition.rcp/src/org/txm/edition/rcp/messages/messages.properties
===================================================================
--- tmp/org.txm.edition.rcp/src/org/txm/edition/rcp/messages/messages.properties	(revision 0)
+++ tmp/org.txm.edition.rcp/src/org/txm/edition/rcp/messages/messages.properties	(revision 936)
@@ -0,0 +1,37 @@
+
+BackToText_0 = Opening with first edition (no default edition set): 
+BackToText_1 = Aborting: selection is not a concordance line: 
+BackToText_2 = Aborting: error during selection.
+BackToText_3 = Error: could not retrieve line word ids. Aborting back to text.
+BackToText_4 = No edition to open.
+BackToText_5 = Opening default editions: 
+
+EditionPanel_0 = No edition found for text=
+EditionPanel_1 = Fail to retrieve first page of edition 
+EditionPanel_2 = \ and text 
+EditionPanel_5 = \ edition=
+EditionPanel_6 = No edition with name 
+EditionPanel_7 = \ available for text 
+
+EditionSelectorDialog_0 = Editions
+EditionSelectorDialog_1 = Select one or more editions
+
+OpenEdition_0  = Opening with first edition (no default edition set): 
+OpenEdition_1  = No edition to open.
+OpenEdition_10 = Error while opening editor: 
+OpenEdition_3  = Opening default editions: 
+OpenEdition_4  = Error while opening edition: 
+OpenEdition_7  = \ in the corpus
+OpenEdition_9  = Aborting: selection is not a corpus
+
+SynopticEditionEditor_0  = First text of the corpus
+SynopticEditionEditor_1  = Previous text
+SynopticEditionEditor_10 = Next text
+SynopticEditionEditor_11 = Last text of the corpus
+SynopticEditionEditor_3  = First page of the text
+SynopticEditionEditor_4  = Previous page
+SynopticEditionEditor_5  = No edition found
+SynopticEditionEditor_6  = Error while getting available editions: 
+SynopticEditionEditor_7  = Next page
+SynopticEditionEditor_8  = Last page of the text
+SynopticEditionEditor_9  = Warning: could not find edition for name: 

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

Index: tmp/org.txm.edition.rcp/src/org/txm/edition/rcp/messages/messages_fr.properties
===================================================================
--- tmp/org.txm.edition.rcp/src/org/txm/edition/rcp/messages/messages_fr.properties	(revision 0)
+++ tmp/org.txm.edition.rcp/src/org/txm/edition/rcp/messages/messages_fr.properties	(revision 936)
@@ -0,0 +1,37 @@
+
+BackToText_0 = Ouverture avec la première édition (pas de défaut) : 
+BackToText_1 = Abandon : la sélection courante n'est pas une ligne de concordance : 
+BackToText_2 = Abandon : erreur de sélection
+BackToText_3 = Abandon : erreur pendant la récupération des identifiants de mot.
+BackToText_4 = Pas d'édition disponible.
+BackToText_5 = Ouverture de l'édition par défaut : 
+
+EditionPanel_0 = Pas d'édition trouvée pour le texte : 
+EditionPanel_1 = échec de la récupération de la première page d'édition
+EditionPanel_2 = \ pour le texte  
+EditionPanel_5 = \ édition=
+EditionPanel_6 = Pas d'édition nommée   
+EditionPanel_7 = \ disponible pour le texte  
+
+EditionSelectorDialog_0 = éditions
+EditionSelectorDialog_1 = Sélectionner une ou plusieurs éditions.
+
+OpenEdition_0  = Ouverture avec la première édition (pas de défaut) : 
+OpenEdition_1  = Pas d'édition disponible.
+OpenEdition_10 = Erreur lors de l'ouverture de l'éditeur : 
+OpenEdition_3  = Ouverture de l'édition par défaut : 
+OpenEdition_4  = Erreur lors de l''ouverture de l'édition : 
+OpenEdition_7  = \ dans le corpus
+OpenEdition_9  = Abandon : la sélection n'est pas un corpus
+
+SynopticEditionEditor_0  = Premier texte du corpus
+SynopticEditionEditor_1  = Texte précédent
+SynopticEditionEditor_10 = Texte suivant
+SynopticEditionEditor_11 = Dernier texte du corpus
+SynopticEditionEditor_3  = Première page du texte
+SynopticEditionEditor_4  = Page précédente
+SynopticEditionEditor_5  = Pas d'édition trouvée 
+SynopticEditionEditor_6  = Erreur lors de la récupération des éditions disponibles : 
+SynopticEditionEditor_7  = Page suivante
+SynopticEditionEditor_8  = Dernière page du texte
+SynopticEditionEditor_9  = Attention: échec de la récupération de l'édition  

Property changes on: tmp/org.txm.edition.rcp/src/org/txm/edition/rcp/messages/messages_fr.properties
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/org.txm.edition.rcp/src/org/txm/edition/rcp/messages/SynopticEditionUIMessages.java
===================================================================
--- tmp/org.txm.edition.rcp/src/org/txm/edition/rcp/messages/SynopticEditionUIMessages.java	(revision 0)
+++ tmp/org.txm.edition.rcp/src/org/txm/edition/rcp/messages/SynopticEditionUIMessages.java	(revision 936)
@@ -0,0 +1,48 @@
+package org.txm.edition.rcp.messages;
+
+import org.eclipse.osgi.util.NLS;
+import org.txm.utils.messages.Utf8NLS;
+
+public class SynopticEditionUIMessages extends NLS {
+	
+	public static String BackToText_0;
+	public static String BackToText_1;
+	public static String BackToText_2;
+	public static String BackToText_3;
+	public static String BackToText_4;
+	public static String BackToText_5;
+	public static String EditionPanel_0;
+	public static String EditionPanel_1;
+	public static String EditionPanel_2;
+	public static String EditionPanel_5;
+	public static String EditionPanel_6;
+	public static String EditionPanel_7;
+	public static String EditionSelectorDialog_0;
+	public static String EditionSelectorDialog_1;
+	public static String OpenEdition_0;
+	public static String OpenEdition_1;
+	public static String OpenEdition_10;
+	public static String OpenEdition_3;
+	public static String OpenEdition_4;
+	public static String OpenEdition_7;
+	public static String OpenEdition_9;
+	public static String SynopticEditionEditor_0;
+	public static String SynopticEditionEditor_1;
+	public static String SynopticEditionEditor_10;
+	public static String SynopticEditionEditor_11;
+	public static String SynopticEditionEditor_3;
+	public static String SynopticEditionEditor_4;
+	public static String SynopticEditionEditor_5;
+	public static String SynopticEditionEditor_6;
+	public static String SynopticEditionEditor_7;
+	public static String SynopticEditionEditor_8;
+	public static String SynopticEditionEditor_9;
+	
+	static {
+		// initialize resource bundle
+		Utf8NLS.initializeMessages(SynopticEditionUIMessages.class);
+	}
+
+	private SynopticEditionUIMessages() {
+	}
+}

Property changes on: tmp/org.txm.edition.rcp/src/org/txm/edition/rcp/messages/SynopticEditionUIMessages.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/org.txm.edition.rcp/src/org/txm/edition/rcp/editors/SashPanel.java
===================================================================
--- tmp/org.txm.edition.rcp/src/org/txm/edition/rcp/editors/SashPanel.java	(revision 0)
+++ tmp/org.txm.edition.rcp/src/org/txm/edition/rcp/editors/SashPanel.java	(revision 936)
@@ -0,0 +1,90 @@
+package org.txm.edition.rcp.editors;
+
+import java.util.ArrayList;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.FormAttachment;
+import org.eclipse.swt.layout.FormData;
+import org.eclipse.swt.layout.FormLayout;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.Listener;
+import org.eclipse.swt.widgets.Sash;
+
+public class SashPanel extends Composite {
+
+	//Composite parent;
+	ArrayList<Composite> cells;
+
+	public SashPanel(Composite parent, int style) {
+		super(parent, style);
+		//this.parent = parent;
+		this.setLayout(new FormLayout());
+	}
+
+	public void init(int ncolumns) {
+		if (cells != null) {
+			for(Control c : this.getChildren())
+				c.dispose();
+			cells.clear();
+			cells = new ArrayList<Composite>();
+		}
+
+		cells = new ArrayList<Composite>();
+		Sash sash = null;
+		FormData sashData = null;
+		for (int i = 0 ; i < ncolumns ; i++) {
+			Composite container = new Composite(this, SWT.NONE);
+			container.setLayout(new GridLayout());
+			cells.add(container);
+
+			FormData containerData = new FormData();
+			containerData.width = 100;
+			containerData.top = new FormAttachment(0, 0);
+			containerData.bottom = new FormAttachment(100, 0);
+			container.setLayoutData(containerData);// set new layout data
+
+			if (sash != null) { // attached FormData to previous sash and vice-versa
+				sashData.right = new FormAttachment(container, 0);
+				containerData.left = new FormAttachment(sash, 0);
+			} else if (i == 0) {
+				containerData.left = new FormAttachment(0, 0); // first cell
+			}
+
+			if (i == ncolumns -1 ) {
+				containerData.right = new FormAttachment(100, 0); // last cell
+			} else {
+				sash = new Sash(this, SWT.VERTICAL);
+				containerData.right = new FormAttachment(sash, 0);
+
+				sashData = new FormData();
+				sashData.left = new FormAttachment(container, 0);
+				sashData.top = new FormAttachment(0, 0);
+				sashData.bottom = new FormAttachment(100, 0);
+				sash.setLayoutData(sashData);
+			}
+			sash.addListener(SWT.Selection, new Listener() {
+				@Override
+				public void handleEvent(Event e) {
+					SashPanel.this.layout();
+					//								e.getBounds()
+					//								Rectangle sashRect = sash.getBounds();
+					//								Rectangle shellRect = SashPanel.this.getClientArea();
+					//								int right = shellRect.width - sashRect.width;
+					//								e.x = Math.max(Math.min(e.x, right), 0);
+					//								if (e.x != sashRect.x) {
+					//									sashData.left = new FormAttachment(0, e.x);
+					//									parentContainer.layout();
+					//								}
+				}
+			});
+		}
+
+	}
+
+	public Composite getContainer(int i) {
+		return cells.get(i);
+	}
+}

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

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 0)
+++ tmp/org.txm.edition.rcp/src/org/txm/edition/rcp/editors/SynopticEditorInput.java	(revision 936)
@@ -0,0 +1,112 @@
+package org.txm.edition.rcp.editors;
+
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.IPersistableElement;
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.txm.objects.Text;
+import org.txm.rcp.Application;
+import org.txm.rcp.IImageKeys;
+import org.txm.rcp.editors.TXMResultEditorInput;
+import org.txm.searchengine.cqp.corpus.Corpus;
+
+import cern.colt.Arrays;
+
+public class SynopticEditorInput extends TXMResultEditorInput implements IEditorInput {
+
+	private Corpus corpus;
+	private Text text;
+	private String[] editions;
+
+	/**
+	 * Instantiates a new SynopticEditorInput
+	 *
+	 * @param corpus, the corpus
+	 * @param text, the text to show
+	 * @param editions, the editions to show
+	 */
+	public SynopticEditorInput(Corpus corpus, String text, String[] editions) {
+		super(corpus);
+		
+		this.corpus = corpus;
+		corpus = corpus.getMainCorpus();
+		this.editions = editions;
+		
+		if (text == null) {
+			this.text = corpus.getFirstText();
+		} else {
+			this.text = corpus.getText(text);
+		}
+		
+		if (editions == null) {
+			String[] defaultEditions = {corpus.getDefaultEdition()};
+			this.editions = defaultEditions;
+		}
+	}
+
+	/* (non-Javadoc)
+	 * @see org.eclipse.ui.IEditorInput#getImageDescriptor()
+	 */
+	@Override
+	public ImageDescriptor getImageDescriptor() {
+		return AbstractUIPlugin.imageDescriptorFromPlugin(
+				Application.PLUGIN_ID, IImageKeys.EDITION);
+	}
+
+	/* (non-Javadoc)
+	 * @see org.eclipse.ui.IEditorInput#getName()
+	 */
+	@Override
+	public String getName() {
+		return corpus.getName()+ " - "+text+ " - "+Arrays.toString(editions);  //$NON-NLS-1$ //$NON-NLS-2$
+	}
+
+	/* (non-Javadoc)
+	 * @see org.eclipse.ui.IEditorInput#getPersistable()
+	 */
+	@Override
+	public IPersistableElement getPersistable() {
+		return null;
+	}
+
+	/* (non-Javadoc)
+	 * @see org.eclipse.ui.IEditorInput#getToolTipText()
+	 */
+	@Override
+	public String getToolTipText() {
+		return getName();
+	}
+
+	/* (non-Javadoc)
+	 * @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class)
+	 */
+	@Override
+	public Object getAdapter(Class adapter) {
+		return null;
+	}
+
+	/**
+	 * Gets the corpus.
+	 *
+	 * @return the corpus
+	 */
+	public Corpus getCorpus() {
+		return corpus;
+	}
+
+	public Text getText() {
+		return text;
+	}
+	
+	public String[] getEditions() {
+		return editions;
+	}
+
+	/* (non-Javadoc)
+	 * @see org.eclipse.ui.IEditorInput#exists()
+	 */
+	@Override
+	public boolean exists() {
+		return false;
+	}
+}

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

Index: tmp/org.txm.edition.rcp/src/org/txm/edition/rcp/editors/EditionLink.java
===================================================================
--- tmp/org.txm.edition.rcp/src/org/txm/edition/rcp/editors/EditionLink.java	(revision 0)
+++ tmp/org.txm.edition.rcp/src/org/txm/edition/rcp/editors/EditionLink.java	(revision 936)
@@ -0,0 +1,50 @@
+package org.txm.edition.rcp.editors;
+
+import java.util.HashMap;
+
+import org.eclipse.swt.browser.Browser;
+import org.eclipse.swt.browser.BrowserFunction;
+import org.txm.edition.rcp.handlers.BackToText;
+
+public class EditionLink extends BrowserFunction {
+		String data = "";
+		Browser browser;
+		SynopticEditionEditor synopticEditionEditor;
+		EditionLink (SynopticEditionEditor synopticEditionEditor, Browser browser) {
+			super (browser, "txmedition");
+			this.browser = browser;
+			this.synopticEditionEditor = synopticEditionEditor;
+		}
+		public Object function (Object[] arguments) { // corpus id, edition id, text id, word id
+			HashMap<String, String> params = new HashMap<String, String>();
+
+			String id = BackToText.class.getName();
+
+			if (arguments.length == 4) {
+				params.put(id+".corpusid", arguments[0].toString());
+				params.put(id+".editionid", arguments[1].toString());
+				params.put(id+".textid", arguments[2].toString());
+				params.put(id+".wordid", arguments[3].toString());
+			} else if (arguments.length == 3) {
+				params.put(id+".corpusid", arguments[0].toString());
+				params.put(id+".editionid", arguments[1].toString());
+				params.put(id+".textid", arguments[2].toString());
+				params.put(id+".wordid", null);
+			} else if (arguments.length == 2) {
+				params.put(id+".corpusid", arguments[0].toString());
+				params.put(id+".editionid", arguments[1].toString());
+				params.put(id+".textid", null);
+				params.put(id+".wordid", null);
+			} else if (arguments.length == 1) {
+				params.put(id+".corpusid", arguments[0].toString());
+				params.put(id+".editionid", null);
+				params.put(id+".textid", null);
+				params.put(id+".wordid", null);
+			} else {
+				System.out.println("Error: txmedition(corpusid, editionid?, textid?, wordid?) called with no arguments");
+				return null;
+			}
+
+			return SynopticEditionEditor.callTXMCommand(id, params);
+		}
+	}
\ No newline at end of file

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

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 0)
+++ tmp/org.txm.edition.rcp/src/org/txm/edition/rcp/editors/EditionPanel.java	(revision 936)
@@ -0,0 +1,1168 @@
+package org.txm.edition.rcp.editors;
+
+import java.io.File;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+import java.util.logging.Level;
+
+import org.eclipse.core.commands.Command;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.commands.IParameter;
+import org.eclipse.core.commands.NotEnabledException;
+import org.eclipse.core.commands.NotHandledException;
+import org.eclipse.core.commands.Parameterization;
+import org.eclipse.core.commands.ParameterizedCommand;
+import org.eclipse.core.commands.common.NotDefinedException;
+import org.eclipse.core.runtime.FileLocator;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.jface.action.MenuManager;
+import org.eclipse.jface.text.ITextSelection;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.ISelectionChangedListener;
+import org.eclipse.jface.viewers.ISelectionProvider;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.browser.Browser;
+import org.eclipse.swt.browser.BrowserFunction;
+import org.eclipse.swt.browser.ProgressEvent;
+import org.eclipse.swt.browser.ProgressListener;
+import org.eclipse.swt.events.MenuEvent;
+import org.eclipse.swt.events.MenuListener;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Menu;
+import org.eclipse.swt.widgets.MenuItem;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.commands.ICommandService;
+import org.eclipse.ui.handlers.IHandlerService;
+import org.eclipse.ui.internal.browser.BrowserViewer;
+import org.osgi.framework.Bundle;
+import org.txm.concordance.rcp.actions.BackToText;
+import org.txm.core.preferences.TXMPreferences;
+import org.txm.edition.rcp.messages.SynopticEditionUIMessages;
+import org.txm.edition.rcp.preferences.SynopticEditionPreferencePage;
+import org.txm.edition.rcp.preferences.SynopticEditionPreferences;
+import org.txm.objects.Corpus;
+import org.txm.objects.Edition;
+import org.txm.objects.Page;
+import org.txm.objects.Text;
+import org.txm.rcp.StatusLine;
+import org.txm.rcp.utils.IOClipboard;
+import org.txm.utils.io.IOUtils;
+import org.txm.utils.logger.Log;
+
+public class EditionPanel extends BrowserViewer implements ISelectionProvider {
+
+
+	private ProgressListener progresslistener;
+	//	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>> highlightedColorPerWordIDS = new HashMap<String, ArrayList<RGBA>>(); // background color
+	public static final String STYLE_NORMAL = "normal";
+	public static final String STYLE_ITALIC = "italic";
+	public static final String STYLE_OBLIQUE = "oblique";
+	HashMap<String, String> fontStylePerWordIDS = new HashMap<String, String>();
+	public static final String WEIGHT_NORMAL = "normal";
+	public static final String WEIGHT_BOLD = "bold";
+	HashMap<String, String> fontWeightPerWordIDS = new HashMap<String, String>();
+	HashMap<String, ArrayList<RGBA>> fontColorPerWordIDS = new HashMap<String, ArrayList<RGBA>>();
+	public static final String SIZE_SMALL = "small";
+	public static final String SIZE_MEDIUM = "medium";
+	public static final String SIZE_LARGE = "larger";
+	public static final String SIZE_SMALLER = "smaller";
+	public static final String SIZE_LARGER = "larger";
+	HashMap<String, String> fontSizePerWordIDS = new HashMap<String, String>();
+	public static final String FAMILLY_TIMES = "\"Times New Roman\", Times";
+	public static final String FAMILLY_ARIAL = "Arial";
+	public static final String FAMILLY_COURIER = "\"Courier New\", Courier";
+	HashMap<String, String> fontFamillyPerWordIDS = new HashMap<String, String>();
+	public static final String VARIANT_NORMAL = "normal";
+	public static final String VARIANT_SMALLCAPS = "small-caps";
+	HashMap<String, String> fontVariantPerWordIDS = new HashMap<String, String>();
+	String focusedWordID = null;
+
+	public static final String highlightscript = "try { var elt = document.getElementById(\"%s\");" + //$NON-NLS-1$ //$NON-NLS-2$
+			"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$
+			"} catch (e) { };"; //$NON-NLS-1$
+	public static final String highlightscriptRuleFast = "sheet.insertRule(\"#%s {background-color:rgba(%s,%s,%s,%s);}\", 0);";
+	public static final String colorscriptRuleFast = "sheet.insertRule(\"#%s {color:rgba(%s,%s,%s,%s);}\", 0);";
+	public static final String sizescriptRuleFast = "sheet.insertRule(\"#%s {font-size:%s;}\", 0);";
+	public static final String stylescriptRuleFast = "sheet.insertRule(\"#%s {font-style:%s;}\", 0);";
+	public static final String variantscriptRuleFast = "sheet.insertRule(\"#%s {font-variant:%s;}\", 0);";
+	public static final String famillyscriptRuleFast = "sheet.insertRule(\"#%s {font-familly:%s;}\", 0);";
+	public static final String weightscriptRuleFast = "sheet.insertRule(\"#%s {font-weight:%s;}\", 0);";
+
+	public static final String highlightscriptRule = "sheet.insertRule(\"span[id=\\\"%s\\\"] {background-color:rgba(%s,%s,%s,%s); }\", 0);";
+
+	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\");"
+					+"\nfunction getNodeText(node) {"
+					+"\n	if (typeof node == 'string') return node;"
+					+"\n	else if (typeof  node.innerText != 'undefined') return node.innerText;"
+					+"\n	else if (typeof  node.InnerText != 'undefined') return node.InnerText;"
+					+"\n	else if (typeof  node.textContent != 'undefined') return node.textContent;"
+					+"\n	else return null;"
+					+"\n}"
+					+"\nfunction txmGetParent(node) {"
+					+"\n	if (typeof  node.parentNode != 'undefined') return node.parentNode;"
+					+"\n	else return null;"
+					+"\n}"
+					+"\nfunction txmGetChildren(node) {"
+					+"\n	if (typeof node == 'string') return 'STRING HTML';"
+					+"\n	else if (typeof  node.children != 'undefined') return node.children;"
+					+"\n	else if (typeof  node.ChildNodes != 'undefined') return node.ChildNodes;"
+					+"\n	else if (typeof  node.childNodes != 'undefined') return node.childNodes;"
+					+"\n	else return null;"
+					+"\n}"
+					+"\nfunction txmGetSelection() {"
+					+"\n	if (typeof window.getSelection != 'undefined') {return window.getSelection();}"
+					+"\n	else if (typeof document.selection != 'undefined') { return document.selection;}"
+					+"\n	else return 'NO SELECTION';"
+					+"\n}"
+					+"\nfunction txmGetRangeSize(selection) {"
+					+"\n	if (typeof selection.rangeCount != 'undefined') {return selection.rangeCount;}"
+					+"\n	else if (typeof selection.createRangeCollection != 'undefined') { return selection.createRangeCollection().length();} // IE5 has no multiple selection"
+					+"\n}"
+					+"\nfunction txmGetRange(selection, i) {"
+					+"\n	if (typeof selection.getRangeAt != 'undefined') {return selection.getRangeAt(i);}"
+					+"\n	else if (typeof selection.createRangeCollection != 'undefined') {return selection.createRangeCollection().item(i);}" // IE > IE5 
+					+"\n	else if (typeof selection.createRange != 'undefined') { return selection.createRange();} // IE5 has no multiple selection"
+					+"\n	else return 'NO RANGE';"
+					+"\n}"
+					+"\nfunction txmGetParentElementRange(range) {"
+					+"\n	if (typeof range.parentElement != 'undefined') {return range.parentElement();}"
+					+"\n	else if (typeof range.startContainer != 'undefined') { return range.startContainer.parentNode;}"
+					+"\n	else return 'NO PARENT';"
+					+"\n}"
+					+"\nfunction txmGetFragment(range) {"
+					+"\n	if (typeof range.cloneContents != 'undefined') { return range.cloneContents();}"
+					+"\n	else if (typeof range.htmlText != 'undefined') {var node = document.createElement('sel'); node.innerHTML = range.htmlText; 		return node;"
+					+"\n	} else return 'NO FRAG';"
+					+"\n}"
+					+"\nfunction txmGetTagName(node) {"
+					+"\n	if (typeof node.tagName != 'undefined') {return node.tagName;}"
+					+"\n	else if (typeof node.nodeName != 'undefined') { return node.nodeName;}"
+					+"\n	else if (typeof node.name != 'undefined') { return node.name;}"
+					+"\n	else return 'NO TAGNAME';"
+					+"\n}"
+					+"\nfunction findSpans(children, all) {"
+					+"\n    for (var i = 0 ; i < children.length ; i++) {"
+					+"\n    	var node = children.item(i);"
+					+"\n		if (node.nodeType == 1) {"
+					+"\n    	var id = node.getAttribute('id');"
+					+"\n       		if (node.tagName == 'SPAN' && id != null && id.indexOf('w_') == 0 && getNodeText(node).length > 0) {"
+					+"\n            	if (id != null) all.push(id);"
+					+"\n        	} else {"
+					+"\n        		findSpans(txmGetChildren(node), all)"
+					+"\n        	}"
+					+"\n		}"
+					+"\n	}"
+					+"\n}"
+					+"\nfunction findIdsInString(str, all) {"
+					+"\n    for (var i = 0 ; i < children.length ; i++) {"
+					+"\n    	var node = children.item(i);"
+					+"\n		if (node.nodeType == 1) {"
+					+"\n    	var id = node.getAttribute('id');"
+					+"\n       		if (node.tagName == 'SPAN' && id != null && id.indexOf('w_') == 0 && getNodeText(node).length > 0) {"
+					+"\n            	if (id != null) all.push(id);"
+					+"\n        	} else {"
+					+"\n        		findSpans(txmGetChildren(node), all)"
+					+"\n        	}"
+					+"\n		}"
+					+"\n	}"
+					+"\n}"
+					+"\nfunction get_type(thing){if(thing===null)return \"[object Null]\";  return Object.prototype.toString.call(thing);}\n"
+					+"\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"
+					+"\nvar sheet = null;"
+					+"\ntry{"
+					+"\n	var style = document.createElement(\"style\");"
+					+"\n	style.appendChild(document.createTextNode(\"\"));"//webkit hack
+					+"\n	document.head.appendChild(style);"
+					+"\n	sheet = style.sheet;"
+					+"\n} catch(e) {sheet='error'}"
+					+"\ntry{"
+					+"\n" // define scrollIntoViewIfNeeded if absent
+					+"\nif (!Element.prototype.scrollIntoViewIfNeeded) {"
+					+"\n	Element.prototype.scrollIntoViewIfNeeded = function (centerIfNeeded) {"
+					+"\n		centerIfNeeded = arguments.length === 0 ? true : !!centerIfNeeded;"
+					+"\n		var parent = this.parentNode,"
+					+"\n		parentComputedStyle = window.getComputedStyle(parent, null),"
+					+"\n		parentBorderTopWidth = parseInt(parentComputedStyle.getPropertyValue('border-top-width')),"
+					+"\n		parentBorderLeftWidth = parseInt(parentComputedStyle.getPropertyValue('border-left-width')),"
+					+"\n		overTop = this.offsetTop - parent.offsetTop < parent.scrollTop,"
+					+"\n		overBottom = (this.offsetTop - parent.offsetTop + this.clientHeight - parentBorderTopWidth) > (parent.scrollTop + parent.clientHeight),"
+					+"\n		overLeft = this.offsetLeft - parent.offsetLeft < parent.scrollLeft,"
+					+"\n		overRight = (this.offsetLeft - parent.offsetLeft + this.clientWidth - parentBorderLeftWidth) > (parent.scrollLeft + parent.clientWidth),"
+					+"\n		alignWithTop = overTop && !overBottom;"
+					+"\n		if ((overTop || overBottom) && centerIfNeeded) {"
+					+"\n			parent.scrollTop = this.offsetTop - parent.offsetTop - parent.clientHeight / 2 - parentBorderTopWidth + this.clientHeight / 2;"
+					+"\n		}"
+					+"\n		if ((overLeft || overRight) && centerIfNeeded) {"
+					+"\n			parent.scrollLeft = this.offsetLeft - parent.offsetLeft - parent.clientWidth / 2 - parentBorderLeftWidth + this.clientWidth / 2;"
+					+"\n		}"
+					+"\n		if ((overTop || overBottom || overLeft || overRight) && !centerIfNeeded) {"
+					+"\n			this.scrollIntoView(alignWithTop);"
+					+"\n		}"
+					+"\n	};"
+					+"\n}"
+					+"\n} catch(e) {Element.prototype.scrollIntoViewIfNeeded = Element.prototype.scrollIntoView}";
+	protected boolean fastWordHighLight = TXMPreferences.getBoolean(SynopticEditionPreferences.FAST_HIGHLIGHT, SynopticEditionPreferences.PREFERENCES_NODE);
+
+	public Object evaluate(String code) {
+		if (Log.getLevel().intValue() <= Level.FINEST.intValue()) System.out.println(code);
+		return getBrowser().evaluate(code);
+	}
+	public Object 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;
+		this.currentEdition = edition;
+		this.currentText = currentEdition.getText();
+
+		File functionsFile = null;
+		try {
+
+			Bundle bundle = Platform.getBundle("org.txm.edition.rcp");
+			URL fileURL = bundle.getEntry("res/js/functions.js");
+			URL r = FileLocator.resolve(fileURL);
+			Log.info("Load JS functions from: "+r);
+			functions = IOUtils.getText(r, "UTF-8");
+
+		} catch (Exception e) {
+			System.out.println("Error while reading "+functionsFile+": "+e.getLocalizedMessage());
+			Log.printStackTrace(e);
+		}
+
+		progresslistener = new ProgressListener() {
+
+			@Override
+			public void changed(ProgressEvent event) { }
+
+			@Override
+			public void completed(ProgressEvent event) {
+				//				System.out.println("EditionPanel "+currentEdition.getName()+" reload "+getCurrentPage().getName());
+				Object rez = evaluate("return typeof sheet");
+				if ("undefined".equals(rez)) execute(functions); // build the sheet if not present in the HTML DOM
+
+				//System.out.println("highlight: "+highlightedColorPerWordIDS);
+				StringBuilder buffer = new StringBuilder();
+				//buffer.append("alert(\"\"+sheet);\n");
+				if (!fastWordHighLight) {
+					//					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
+				}
+
+				if (buffer.length() > 0) execute(buffer.toString());
+				buffer = new StringBuilder();
+
+				String firstWord = currentPage.getWordId();
+				Page nextPage = currentEdition.getNextPage(currentPage);
+				String lastWord = "w_999999999";
+				if (nextPage != null && currentPage != nextPage) lastWord = nextPage.getWordId();
+				//System.out.println("firstWord="+firstWord+" lastWord="+lastWord);
+				//int n = 0;
+				//long start = System.currentTimeMillis();
+				//System.out.println(highlightedColorPerWordIDS);
+				for (String wordid : highlightedColorPerWordIDS.keySet()) {
+					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 (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);
+					int size = highlightedColorPerWordIDS.get(wordid).size();
+
+					for (RGBA color : highlightedColorPerWordIDS.get(wordid)) {
+						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 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$
+								+ 
+								//								"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
+						s = String.format(highlightscriptRuleFast, wordid.replace(" ", "\\ "), 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");
+				}
+
+				if (buffer.length() > 0) execute(buffer.toString());
+				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 wordid : fontColorPerWordIDS.keySet()) {
+					RGBA composite = new RGBA(0,0,0,0f);
+					int size = fontColorPerWordIDS.get(wordid).size();
+
+					for (RGBA color : fontColorPerWordIDS.get(wordid)) {
+						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 s = String.format(colorscriptRuleFast, wordid, composite.r, composite.g, composite.b, composite.a);
+					buffer.append(s+"\n");
+				}
+
+				if (buffer.length() > 0) execute(buffer.toString());
+				buffer = new StringBuilder();
+
+				for (String wordid : fontSizePerWordIDS.keySet()) {
+					String s = String.format(sizescriptRuleFast, wordid, fontSizePerWordIDS.get(wordid));
+					buffer.append(s+"\n");
+				}
+
+				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$
+								+ 
+								//								"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(weightscriptRuleFast, wordid, fontWeightPerWordIDS.get(wordid));
+					}
+					buffer.append(s+"\n");
+				}
+
+				for (String wordid : fontFamillyPerWordIDS.keySet()) {
+					String s = String.format(famillyscriptRuleFast, wordid, fontFamillyPerWordIDS.get(wordid));
+					buffer.append(s+"\n");
+				}
+
+				if (buffer.length() > 0) execute(buffer.toString());
+				buffer = new StringBuilder();
+
+				if (focusedWordID != null) {
+					//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$
+					buffer.append(s+"\n");
+					focusedWordID = null; // focus one time
+				}
+
+				if (buffer.length() > 0) execute(buffer.toString());
+				buffer = new StringBuilder();
+
+				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$
+						buffer.append(s+"\n");
+						break;// one word only for now
+					}
+				}
+
+				//System.out.println(buffer);
+				if (buffer.length() > 0) execute(buffer.toString());
+				//System.out.println("n="+n+" time="+(System.currentTimeMillis()-start));
+			}
+		};
+		getBrowser().addProgressListener(progresslistener);
+		new CommandLink (synopticEditionEditor, getBrowser());
+		new EditionLink (synopticEditionEditor, getBrowser());
+	}
+
+	/**
+	 * Bypass BrowserViewer restriction on the getBrowser method
+	 */
+	public Browser getBrowser() {
+		return super.getBrowser();
+	}
+
+	/**
+	 * Bypass BrowserViewer restriction on the getBrowser method
+	 */
+	public String getDOM() {
+		return "";//execute("return document.innerHTML";
+	}
+
+	public ISelectionProvider getSelectionProvider() {
+		return selProvider;
+	}
+
+	public void setHighlightWordsById(RGBA color, HashSet<String> wordids) {
+		for (String wordid : wordids) {
+			if (this.highlightedColorPerWordIDS.get(wordid) != null) {
+				removeHighlightWordsById(color, wordid);
+			}
+			ArrayList<RGBA> hs = new ArrayList<RGBA>();
+			this.highlightedColorPerWordIDS.put(wordid, hs);
+			hs.add(color);
+		}
+	}
+
+	public void addHighlightWordsById(RGBA color, String wordid) {
+		if (!this.highlightedColorPerWordIDS.containsKey(wordid)) {
+			this.highlightedColorPerWordIDS.put(wordid, new ArrayList<RGBA>());
+		}
+		this.highlightedColorPerWordIDS.get(wordid).add(color);
+	}
+
+	/**
+	 * Can be called to refresh the page word styles but only when the page is loaded
+	 */
+	public void updateWordStyles() {
+		progresslistener.completed(null);
+	}
+
+	public void addHighlightWordsById(RGBA color, Collection<String> wordids) {
+		for (String wordid : wordids) {
+			addHighlightWordsById(color, wordid);
+		}
+	}
+
+	public void removeHighlightWordsById(RGBA color, Collection<String> wordids) {
+		//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");
+			}
+		}
+
+		if (buffer.length() > 0) execute(buffer.toString());
+	}
+
+	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);
+		this.highlightedColorPerWordIDS.get(wordid).remove(color);
+
+		if (this.highlightedColorPerWordIDS.get(wordid).size() == 0) {
+			this.highlightedColorPerWordIDS.remove(wordid);
+		}
+	}
+
+	/**
+	 * Open the page containing the word with ID=$line_wordid
+	 * @param line_wordid
+	 * @return true if the page changed
+	 */
+	public boolean backToText(Text text, String line_wordid) {
+
+		String name = currentEdition.getName();
+		Edition edition = text.getEdition(name);
+
+		if (edition == null) {
+			String s = SynopticEditionUIMessages.EditionPanel_0+text+SynopticEditionUIMessages.EditionPanel_5+name;
+			System.out.println(s);
+			StatusLine.setMessage(s);
+			Log.severe(s);
+		} else {
+			Page openedPage = null;
+			if (line_wordid != null && line_wordid.length() > 0) {
+				openedPage = edition.getPageForWordId(line_wordid);
+			} else {
+				openedPage = edition.getFirstPage();
+			}
+			if (openedPage != null && openedPage != currentPage) {
+				this.showPage(openedPage);
+				return true;
+			}
+		}
+		updateWordStyles(); // update styles if any new one
+		return false;
+	}
+
+	/**
+	 * First page.
+	 */
+	public void firstPage() {
+		// System.out.println(Messages.TxmBrowser_1+currentPage);
+		currentPage = currentEdition.getFirstPage();
+		currentText = currentEdition.getText();
+		if (currentPage == null) {
+			System.out.println(SynopticEditionUIMessages.EditionPanel_1+currentEdition.getName()+SynopticEditionUIMessages.EditionPanel_2+currentText.getName());
+		}
+
+		this.setURL(currentPage.toURL());
+
+		//page_label.setText(makePageLabel());
+	}
+
+	public void setURL(String url) {
+		super.setURL(url);
+	}
+
+	/**
+	 * Last page.
+	 */
+	public void lastPage() {
+		// System.out.println(Messages.TxmBrowser_2+currentPage);
+
+		if (currentPage != null && currentPage.getFile().equals(currentEdition.getLastPage().getFile())) {
+			return;
+		}
+		currentPage = currentEdition.getLastPage();
+		currentText = currentEdition.getText();
+		this.setURL(currentPage.toURL());
+	}
+
+	/**
+	 * Previous page.
+	 */
+	public void previousPage() {
+		// System.out.println(Messages.TxmBrowser_3+currentPage);
+		if (currentPage != null) {
+			Page previous = currentEdition.getPreviousPage(currentPage);
+
+			if (previous == currentPage) {
+				previousText(true);
+			} else {
+				currentPage = previous;
+				this.setURL(currentPage.toURL());
+			}
+			currentText = currentEdition.getText();
+		} else {
+			firstPage();
+		}
+		//page_label.setText(makePageLabel());
+	}
+
+
+
+	/**
+	 * Next page.
+	 */
+	public void nextPage() {
+		// System.out.println(Messages.TxmBrowser_4+currentPage);
+		if (currentPage != null) {
+			Page next = currentEdition.getNextPage(currentPage);
+			if (next == currentPage) {
+				nextText();
+			} else {
+				currentPage = next;
+				this.setURL(currentPage.toURL());
+			}
+			currentText = currentEdition.getText();
+		} else {
+			firstPage();
+		}
+		//page_label.setText(makePageLabel());
+	}
+
+
+	public void firstText() {
+		//Text current = this.currentPage.getEdition().getText();
+		Corpus corpus = currentText.getCorpus();
+		Text firstText = corpus.getFirstText();
+
+		if (firstText != null) {
+			String editionName = currentEdition.getName();
+			Edition tmp = firstText.getEdition(editionName);
+			if (tmp == null) {
+				System.out.println(SynopticEditionUIMessages.EditionPanel_6+editionName+SynopticEditionUIMessages.EditionPanel_7+firstText.getName());
+				return;
+			}
+			currentEdition = tmp;
+			currentPage = currentEdition.getFirstPage(); 
+			currentText = firstText;
+			if (currentPage == null) {
+				StatusLine.setMessage("No previous text"); //$NON-NLS-1$
+				return;
+			}
+			this.setURL(currentPage.toURL());
+		}
+	}
+
+	/**
+	 * Next text.
+	 */
+	public void lastText() {
+		//Text current = this.currentPage.getEdition().getText();
+		Corpus b = currentText.getCorpus();
+		Text lastText = b.getLastText();
+
+		if (lastText != null) {
+			String editionName = currentEdition.getName();
+			Edition tmp = lastText.getEdition(editionName);
+			if (tmp == null) {
+				System.out.println(SynopticEditionUIMessages.EditionPanel_6+editionName+SynopticEditionUIMessages.EditionPanel_7+lastText.getName());
+				return;
+			}
+
+			currentEdition = tmp;
+			currentPage = currentEdition.getFirstPage(); 
+			currentText = lastText;
+			if (currentPage == null) {
+				StatusLine.setMessage("No text next"); //$NON-NLS-1$
+				return;
+			}
+
+			this.setURL(currentPage.toURL());
+			//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
+	 */
+	public void previousText(boolean fromNextText) {
+
+		//Text current = this.currentPage.getEdition().getText();
+		Corpus corpus = currentText.getCorpus();
+		Text previousText = corpus.getPreviousText(currentText);
+
+		if (previousText != null) {
+			String editionName = currentEdition.getName();
+
+			Edition tmp = previousText.getEdition(editionName);
+			if (tmp == null) {
+				System.out.println(SynopticEditionUIMessages.EditionPanel_6+editionName+SynopticEditionUIMessages.EditionPanel_7+previousText.getName());
+			}
+			currentEdition = tmp;
+			currentText = previousText;
+			if (fromNextText) {
+				currentPage = currentEdition.getLastPage(); 
+			} else {
+				currentPage = currentEdition.getFirstPage(); 
+			}
+
+			if (currentPage == null) {
+				StatusLine.setMessage("No previous text"); //$NON-NLS-1$
+				return;
+			}
+			this.setURL(currentPage.toURL());
+		}
+		// System.out.println("Previous texts "+previousText);
+	}
+
+	/**
+	 * Next text.
+	 */
+	public void nextText() {
+		//Text current = this.currentPage.getEdition().getText();
+		Corpus b = currentText.getCorpus();
+		Text nextText = b.getNextText(currentText);
+
+		if (nextText != null) {
+			String editionName = currentEdition.getName();
+			Edition tmp = nextText.getEdition(editionName);
+			if (tmp == null) {
+				System.out.println(SynopticEditionUIMessages.EditionPanel_6+editionName+SynopticEditionUIMessages.EditionPanel_7+nextText.getName());
+				return;
+			}
+			currentEdition = tmp;
+
+			currentPage = currentEdition.getFirstPage(); 
+			currentText = nextText;
+			if (currentPage == null) {
+				StatusLine.setMessage("No text next"); //$NON-NLS-1$
+				return;
+			}
+
+			this.setURL(currentPage.toURL());
+			//page_label.setText(makePageLabel());
+		}
+		// System.out.println("Next texts "+nextText);
+	}
+
+
+	public void setText(Text text, boolean refresh) {
+		String editionName = currentEdition.getName();
+		Edition tmp = text.getEdition(editionName);
+		if (tmp == null) {
+			System.out.println(SynopticEditionUIMessages.EditionPanel_6+editionName+SynopticEditionUIMessages.EditionPanel_7+text.getName());
+			return;
+		}
+
+		currentEdition = tmp;
+		currentPage = currentEdition.getFirstPage(); 
+		currentText = text;
+		if (currentPage == null) {
+			StatusLine.setMessage("No text next"); //$NON-NLS-1$
+			return;
+		}
+
+		if (refresh) {
+			this.setURL(currentPage.toURL());
+		}
+		//page_label.setText(makePageLabel());
+	}
+
+	/**
+	 * Gets the current page.
+	 *
+	 * @return the current page
+	 */
+	public Page getCurrentPage() {
+		return currentPage;
+	}
+
+	/**
+	 * Gets the current text.
+	 *
+	 * @return the current page
+	 */
+	public Text getCurrentText() {
+		return currentText;
+	}
+
+	/**
+	 * Make page label.
+	 *
+	 * @return the string
+	 */
+	public String makePageLabel() {
+		return currentPage.getName()
+				+ " / " + currentPage.getEdition().getNumPages(); //$NON-NLS-1$
+	}
+
+	/**
+	 * Show page.
+	 *
+	 * @param page the page
+	 */
+	public void showPage(Page page) {
+		//System.out.println("SHOW PAGE "+page);
+		currentEdition = page.getEdition();
+		currentText = currentEdition.getText();
+		currentPage = page;
+		this.setURL(currentPage.toURL());
+	}
+
+	public void reloadPage() {
+		this.setURL(currentPage.toURL());
+	}
+
+	//	/**
+	//	 * Sets the edition.
+	//	 *
+	//	 * @param edition the new edition
+	//	 */
+	//	public void setEdition(Edition edition) {
+	//		this.currentEdition = edition;
+	//	}
+
+	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";
+
+	public String getTextSelectionDOM() {
+		return ((String) evaluate(SCRIPT01));
+	}
+
+	public String[] getWordSelection() {
+
+		//System.out.println("getWordSelection");
+		String SCRIPT02_getspans = ""//functions
+				+"var all = [];"
+				+"\nvar sel = txmGetSelection();"
+				+"\nif (sel.rangeCount == 0) {return all;}"
+				//+"\nalert('sel='+sel);"
+				+"\nvar range = txmGetRange(sel, 0);"
+				//+"\nalert('range='+range);"
+				+"\nvar frag = txmGetFragment(range);"
+				//+"\nalert('frag='+frag);"
+				+"\nvar children = txmGetChildren(frag);"
+				//+"\nalert('children='+children);"
+				//+"\nalert('children.length='+children.length);"
+				+"\nif ((children.length == 0) || (children.length == 1 && children.item(0).nodeType == 3)) {"
+				+"\n	var parent = txmGetParentElementRange(range);"
+				//+"\n	if (parent instanceof HTMLHtmlElement) {alert('HTMLHtmlElement parent='+parent);return findIdsInString(parent, all);}"
+				+"\n	if (typeof parent.getAttribute == 'undefined') {return all}"
+				+"\n	var id = parent.getAttribute('id');"
+				+"\n	var id = parent.getAttribute('id');"
+				+"\n	if (txmGetTagName(parent) == 'SPAN' && id != null && id.indexOf('w_') == 0) {"
+				+"\n		all.push(id);"
+				+"\n	} else {" // try with the parent's parent 
+				+"\n		var parent = txmGetParent(parent);"
+				//+"\n		alert('text selection, parent='+txmGetTagName(parent))"
+				+"\n	if (typeof parent.getAttribute == 'undefined') {return all}"
+				+"\n		var id = parent.getAttribute('id');"
+				+"\n		if (txmGetTagName(parent) == 'SPAN' && id != null && id.indexOf('w_') == 0) {"
+				+"\n			all.push(id);"
+				+"\n		}"
+				+"\n	}"
+				+"\n} else {"
+				+"\n	findSpans(children, all);"
+				+"\n}"
+				//+"alert('result='+all)"
+				+"\nreturn all;";
+
+		//		System.out.println(functions);
+		//		System.out.println(SCRIPT02_getspans);
+
+		Object ret = evaluate(SCRIPT02_getspans);
+		if (ret instanceof Object[]) {
+			Log.info("selection word ids="+Arrays.toString((Object[])ret));
+			Object[] array = (Object[])ret;
+			String[] sel = new String[2];
+			if (array.length == 0) {
+				return null;
+			} else if (array.length == 1) {
+				sel[0] = array[0].toString();
+				return sel;
+			} else {
+				sel[0] = array[0].toString();
+				sel[1] = array[array.length-1].toString();
+				return sel;
+			}
+		} else { 
+			System.out.println("SCRIPT RETURNED="+ret);
+			return null;
+		}
+	}
+
+	public String getTextSelection() {
+		//System.out.println("DOM="+getTextSelectionDOM());
+		String rez =  getTextSelectionDOM().replaceAll("<[^>]+>", "");
+		//System.out.println("STR="+rez);
+		return rez;
+	}
+
+	@Override
+	public void addSelectionChangedListener(ISelectionChangedListener listener) {	}
+
+	@Override
+	public ISelection getSelection() {
+		return new SynopticTextSelection(this);
+	}
+
+	@Override
+	public void removeSelectionChangedListener(
+			ISelectionChangedListener listener) {	}
+
+	@Override
+	public void setSelection(ISelection selection) {	}
+
+	static public class SynopticTextSelection implements ISelection  {
+		String str;
+		public SynopticTextSelection(EditionPanel panel) {
+			this.str = panel.getTextSelection();
+		}
+
+		@Override
+		public boolean isEmpty() {
+			return str != null && str.length() > 0;
+		}
+
+		public String getTextSelection() {
+			return str;
+		}
+	}
+
+	public Edition getEdition() {
+		return currentEdition;
+	}
+
+	public MenuManager getMenuManager() {	
+		return menuManager;
+	}
+
+	public void initMenu() {
+		// create a new menu	
+		menuManager = new MenuManager(); //$NON-NLS-1$
+
+		Menu menu = menuManager.createContextMenu(this.getBrowser());
+
+		menu.addMenuListener(new MenuListener() {
+
+			@Override
+			public void menuShown(MenuEvent e) {
+				Menu menu = menuManager.getMenu();
+				if (menu == null) return;
+				new MenuItem(menu, SWT.SEPARATOR);
+
+				MenuItem copyItem = new MenuItem(menu, SWT.NONE);
+				copyItem.setText("Copy text selection");
+				copyItem.addSelectionListener(new SelectionListener() {
+
+					@Override
+					public void widgetSelected(SelectionEvent e) {
+						String text = EditionPanel.this.getTextSelection();
+						if (text != null && text.length() > 0) {
+							IOClipboard.write(text);
+						}
+					}
+
+					@Override
+					public void widgetDefaultSelected(SelectionEvent e) { }
+				});
+				String text = EditionPanel.this.getTextSelection();
+				copyItem.setEnabled(text != null && text.length() > 0);
+
+				MenuItem reloadItem = new MenuItem(menu, SWT.NONE);
+				reloadItem.setText("Reload");
+				reloadItem.addSelectionListener(new SelectionListener() {
+
+					@Override
+					public void widgetSelected(SelectionEvent e) {
+						EditionPanel.this.getBrowser().refresh();
+					}
+
+					@Override
+					public void widgetDefaultSelected(SelectionEvent e) { }
+				});
+				MenuItem backItem = new MenuItem(menu, SWT.NONE);
+				backItem.setText("Back");
+				backItem.addSelectionListener(new SelectionListener() {
+
+					@Override
+					public void widgetSelected(SelectionEvent e) {
+						EditionPanel.this.getBrowser().back();
+					}
+
+					@Override
+					public void widgetDefaultSelected(SelectionEvent e) { }
+				});
+				MenuItem forwardItem = new MenuItem(menu, SWT.NONE);
+				forwardItem.setText("Forward");
+				forwardItem.addSelectionListener(new SelectionListener() {
+
+					@Override
+					public void widgetSelected(SelectionEvent e) {
+						EditionPanel.this.getBrowser().forward();
+					}
+
+					@Override
+					public void widgetDefaultSelected(SelectionEvent e) { }
+				});
+			}
+
+			@Override
+			public void menuHidden(MenuEvent e) {
+				// 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]);
+		//			}
+		//		}
+		// replace the menu
+		this.getBrowser().setMenu(menu); 
+	}
+
+	public void initSelectionProvider() {
+		selProvider = new ISelectionProvider() {
+			@Override
+			public void setSelection(ISelection selection) { }
+			@Override
+			public void removeSelectionChangedListener(ISelectionChangedListener listener) { }
+			@Override
+			public ISelection getSelection() {
+				ITextSelection sel = new ITextSelection() {
+					@Override
+					public boolean isEmpty() {return EditionPanel.this.getTextSelection().length() == 0;}
+					@Override
+					public String getText() {return EditionPanel.this.getTextSelection();}
+					@Override
+					public int getStartLine() {	return 0;}
+					@Override
+					public int getOffset() {return 0;}
+					@Override
+					public int getLength() {return 0;}
+					@Override
+					public int getEndLine() {return 0;}
+				};
+				return sel;
+			}
+
+			@Override
+			public void addSelectionChangedListener(ISelectionChangedListener listener) { }
+		};
+	}
+
+
+
+	public void goToPage(String name) {
+
+		Page next = currentEdition.get(name);
+		// System.out.println(Messages.TxmBrowser_4+currentPage);
+		if (next != null) {
+			currentPage = next;
+			this.setURL(currentPage.toURL());
+		} else {
+			System.out.println("Page not found ("+name+").");
+		}
+	}
+
+	public void setFocusedWordID(String focusid) {
+		this.focusedWordID = focusid;
+	}
+
+	public void setHighlightedArea(HashSet<int[]> positions) {
+		Log.info("Highlight area: not implemented");
+	}
+
+	public void expandSelectionTo(String[] ids) {
+		// expand selection
+
+		if (ids.length == 0) 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));
+		String id1 = ids[0];
+		String id2 = ids[1];
+		if (id2 == null) id2 = id1;
+		String SCRIPT02_expand = ""
+				+ "var elt = document.getElementById(\""+id1+"\");\n"
+				+ "var elt2 = document.getElementById(\""+id2+"\");\n"
+				//+ "alert(\"elt=\"+elt);\n"
+				+ "var sel = txmGetSelection();\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"
+				//+ "alert(\"range=\"+range);\n"
+				//+ "alert(\"typeof range=\"+Object.getOwnPropertyNames(range));\n"
+				//+ "alert(\"get_type range=\"+get_type(range));\n"
+				+"range.setStart(elt, 0);\n"
+				+"range.setEndAfter(elt2, 0);\n"
+				+"sel.removeAllRanges();\n"
+				+"sel.addRange(range);\n"
+				+ "\n"
+				+ "return null;";
+
+		//System.out.println("Eval...\n"+SCRIPT02_expand);
+		evaluate(SCRIPT02_expand);
+		return;
+	}
+
+	public void addFontWeightWordsById(String weight, List<String> wordids) {
+		for (String wordid : wordids) {
+			addFontWeightWordsById(weight, wordid);
+		}
+	}
+
+	public void addFontWeightWordsById(String weight, String wordid) {
+		this.fontWeightPerWordIDS.put(wordid, weight);
+	}
+
+	public void removeFontWeightWordsById(String wordid) {
+		this.fontWeightPerWordIDS.remove(wordid);
+	}
+
+	public void removeFontWeightWordsById(List<String> wordids) {
+		for (String wordid : wordids) {
+			removeFontWeightWordsById(wordid);
+		}
+	}
+
+	/**
+	 * Clear all highlighted words
+	 */
+	public void removeHighlightWords() {
+		Set<String> keys = highlightedColorPerWordIDS.keySet();
+		for (String key : keys) {
+			highlightedColorPerWordIDS.remove(key);
+		}
+	}
+}

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

Index: tmp/org.txm.edition.rcp/src/org/txm/edition/rcp/editors/RGBA.java
===================================================================
--- tmp/org.txm.edition.rcp/src/org/txm/edition/rcp/editors/RGBA.java	(revision 0)
+++ tmp/org.txm.edition.rcp/src/org/txm/edition/rcp/editors/RGBA.java	(revision 936)
@@ -0,0 +1,27 @@
+package org.txm.edition.rcp.editors;
+
+public class RGBA {
+	public int r=0, g=0, b=0;
+	public float a = 1f;
+	public RGBA(int r, int g, int b) {
+		this.r =r;this.g=g; this.b =b;
+	}
+	public RGBA(String rgb) {
+		String[] split = rgb.split(",");
+		try{this.r =Integer.parseInt(split[0]);}catch(Exception e){}
+		try{this.g =Integer.parseInt(split[1]);}catch(Exception e){}
+		try{this.b =Integer.parseInt(split[2]);}catch(Exception e){}
+	}
+	public RGBA(String rgb, float a) {
+		String[] split = rgb.split(",");
+		try{this.r =Integer.parseInt(split[0]);}catch(Exception e){}
+		try{this.g =Integer.parseInt(split[1]);}catch(Exception e){}
+		try{this.b =Integer.parseInt(split[2]);}catch(Exception e){}
+		this.a = a;
+	}
+	public RGBA(int r, int g, int b, float a) {
+		this.r =r;this.g=g; this.b =b;this.a =a;
+	}
+
+	public String toString() {return "{"+r+", "+g+","+b+", "+a+"}";}
+}

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

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 0)
+++ tmp/org.txm.edition.rcp/src/org/txm/edition/rcp/editors/SynopticEditionEditor.java	(revision 936)
@@ -0,0 +1,854 @@
+// Copyright © 2010-2013 ENS de Lyon.
+// Copyright © 2007-2010 ENS de Lyon, CNRS, INRP, University of
+// Lyon 2, University of Franche-Comté, University of Nice
+// Sophia Antipolis, University of Paris 3.
+// 
+// The TXM platform is free software: you can redistribute it
+// and/or modify it under the terms of the GNU General Public
+// License as published by the Free Software Foundation,
+// either version 2 of the License, or (at your option) any
+// later version.
+// 
+// The TXM platform is distributed in the hope that it will be
+// useful, but WITHOUT ANY WARRANTY; without even the implied
+// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+// PURPOSE. See the GNU General Public License for more
+// details.
+// 
+// You should have received a copy of the GNU General
+// Public License along with the TXM platform. If not, see
+// http://www.gnu.org/licenses.
+// 
+// 
+// 
+// $LastChangedDate:$
+// $LastChangedRevision:$
+// $LastChangedBy:$ 
+//
+package org.txm.edition.rcp.editors;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.LinkedHashMap;
+import java.util.List;
+
+import org.apache.commons.lang.StringUtils;
+import org.eclipse.core.commands.Command;
+import org.eclipse.core.commands.IParameter;
+import org.eclipse.core.commands.Parameterization;
+import org.eclipse.core.commands.ParameterizedCommand;
+import org.eclipse.core.commands.common.NotDefinedException;
+import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.jface.text.ITextSelection;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.ISelectionChangedListener;
+import org.eclipse.jface.viewers.ISelectionProvider;
+import org.eclipse.jface.window.Window;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.KeyEvent;
+import org.eclipse.swt.events.KeyListener;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.widgets.ToolItem;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.IEditorSite;
+import org.eclipse.ui.IPartListener2;
+import org.eclipse.ui.IWorkbenchPartReference;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.PartInitException;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.commands.ICommandService;
+import org.eclipse.ui.handlers.IHandlerService;
+import org.txm.edition.rcp.messages.SynopticEditionUIMessages;
+import org.txm.objects.Edition;
+import org.txm.objects.Text;
+import org.txm.rcp.IImageKeys;
+import org.txm.rcp.editors.IEditionEditor;
+import org.txm.rcp.editors.TXMEditor;
+import org.txm.rcp.swt.GLComposite;
+import org.txm.searchengine.cqp.corpus.Corpus;
+import org.txm.utils.logger.Log;
+/**
+ * Call the internal browser of RCP to display the Edition Pages of a Text
+ * 
+ * @author mdecorde.
+ * 
+ */
+public class SynopticEditionEditor extends TXMEditor<Text> implements IEditionEditor {
+
+	/** The Constant ID. */
+	public final static String ID = SynopticEditionEditor.class.getName(); //$NON-NLS-1$
+	LinkedHashMap<String, EditionPanel> editionPanels = new LinkedHashMap<String, EditionPanel>();
+
+	/** The page_label: show current page name. */
+	org.eclipse.swt.widgets.Text page_text;
+	Label page_label;
+	Composite editionsArea;
+	private String[] editionNames;
+	private Corpus corpus;
+	private Text text;
+	private Button editionsChooser;
+	//private Label editionsLabel;
+	private GLComposite controlsArea;
+//	private GLComposite annotationWidgetsArea;
+//	private TXMEditorToolBar supplementaryButtonToolbar;
+	private ISelectionProvider selProvider;
+
+	//TODO finish editor conversion
+	public Text getResult() {
+		for (EditionPanel panel : editionPanels.values()) {
+			return panel.getCurrentText();
+		}
+		return null;
+	}
+	
+	/**
+	 * Instantiates a new txm browser.
+	 */
+	public SynopticEditionEditor() {
+		selProvider = new ISelectionProvider() {
+			@Override
+			public void setSelection(ISelection selection) { }
+			@Override
+			public void removeSelectionChangedListener(ISelectionChangedListener listener) { }
+			@Override
+			public ISelection getSelection() {
+				ITextSelection sel = new ITextSelection() {
+					@Override
+					public boolean isEmpty() {
+						for (EditionPanel panel : editionPanels.values()) {
+							String s = panel.getTextSelection();
+							if (s.length() > 0) return false;
+						}
+						return true;
+					}
+					@Override
+					public String getText() {
+						for (EditionPanel panel : editionPanels.values()) {
+							String s = panel.getTextSelection();
+							if (s.length() > 0) return s;
+						}
+						return "";
+					}
+					@Override
+					public int getStartLine() {	return 0;}
+					@Override
+					public int getOffset() {return 0;}
+					@Override
+					public int getLength() {return 0;}
+					@Override
+					public int getEndLine() {return 0;}
+				};
+				return sel;
+			}
+
+			@Override
+			public void addSelectionChangedListener(ISelectionChangedListener listener) { }
+		};
+
+	}
+
+	public void setHighlightWordsById(RGBA color, HashSet<String> wordids) {
+		for(EditionPanel panel : editionPanels.values()) {
+			panel.setHighlightWordsById(color, wordids);
+		}
+	}
+
+	public void addHighlightWordsById(RGBA color, String wordid) {
+		for(EditionPanel panel : editionPanels.values()) {
+			panel.addHighlightWordsById(color, wordid);
+		}
+	}
+
+	public void addHighlightWordsById(RGBA color, Collection<String> wordids) {
+		for(EditionPanel panel : editionPanels.values()) {
+			panel.addHighlightWordsById(color, wordids);
+		}
+	}
+
+	public void removeHighlightWordsById(RGBA color, Collection<String> wordids) {
+		for(EditionPanel panel : editionPanels.values()) {
+			if (!panel.isDisposed()) {
+				panel.removeHighlightWordsById(color, wordids);
+			}
+		}
+	}
+
+	public void removeHighlightWordsById(RGBA color, String wordid) {
+		for(EditionPanel panel : editionPanels.values()) {
+			if (!panel.isDisposed()) {
+				panel.removeHighlightWordsById(color, wordid);
+			}
+		}
+	}
+
+	//	/**
+	//	 * 
+	//	 * @param wordids2 all the words to highlight
+	//	 * @param lineids2 the words to highlight better and to scroll to
+	//	 */
+	//	public void highlightWordsById(List<String> wordids, List<String> lineids, int[] pos, String focusid) {
+	//		for(EditionPanel panel : editionPanels.values()) {
+	//			if (panel.getEdition().getName().startsWith("facs")) {
+	//				List<int[]> wordRectangles = new ArrayList<int[]>();
+	//				List<int[]> keywordRectangles = new ArrayList<int[]>();
+	//				if (pos != null) keywordRectangles.add(pos);
+	//				panel.highlightWordsByPositions(wordRectangles, keywordRectangles);
+	//			} else {
+	//				panel.highlightWordsById(wordids, lineids, focusid);
+	//			}
+	//		}
+	//
+	//		updatePageLabel();
+	//		
+	//		
+	//	}
+
+	/**
+	 * First page.
+	 */
+	public void firstPage() {
+		for(EditionPanel panel : editionPanels.values())
+			panel.firstPage();
+		updatePageLabel();
+	}
+
+	/**
+	 * Last page.
+	 */
+	public void lastPage() {
+		for(EditionPanel panel : editionPanels.values())
+			panel.lastPage();
+		updatePageLabel();
+	}
+
+	/**
+	 * Previous page.
+	 */
+	public void previousPage() {
+		for(EditionPanel panel : editionPanels.values())
+			panel.previousPage();
+		updatePageLabel();
+	}
+
+	/**
+	 * Next page.
+	 */
+	public void nextPage() {
+		for(EditionPanel panel : editionPanels.values())
+			panel.nextPage();
+		updatePageLabel();
+	}
+
+	/**
+	 * Next page.
+	 */
+	public void goToPage(String name) {
+		for(EditionPanel panel : editionPanels.values())
+			panel.goToPage(name);
+		updatePageLabel();
+
+	}
+
+	/**
+	 * Previous text.
+	 */
+	public void previousText(boolean fromNextText) {
+		for(EditionPanel panel : editionPanels.values())
+			panel.previousText(fromNextText);
+		updatePageLabel();
+	}
+
+	/**
+	 * Next text.
+	 */
+	public void nextText() {
+		for(EditionPanel panel : editionPanels.values())
+			panel.nextText();
+		updatePageLabel();
+	}
+	
+	/**
+	 * Previous text.
+	 */
+	public void firstText() {
+		for(EditionPanel panel : editionPanels.values())
+			panel.firstText();
+		updatePageLabel();
+	}
+
+	/**
+	 * Next text.
+	 */
+	public void lastText() {
+		for(EditionPanel panel : editionPanels.values())
+			panel.lastText();
+		updatePageLabel();
+	}
+
+	public Composite getEditionArea() {
+		return editionsArea;
+	}
+
+//	public Composite getUpperToolbarArea() {
+//		return annotationWidgetsArea;
+//	}
+
+	public Composite getLowerToolbarArea() {
+		return controlsArea;
+	}
+
+	/* (non-Javadoc)
+	 * @see org.eclipse.ui.internal.browser.WebBrowserEditor#createPartControl(org.eclipse.swt.widgets.Composite)
+	 */
+	@Override
+	public void _createPartControl() {
+
+		editionsArea = getResultArea();
+
+		controlsArea = getBottomToolbar().installGLComposite("controls", 15, false);
+		controlsArea.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, false));
+		//spacer
+		new Label(controlsArea, SWT.NONE).setText("  "); //$NON-NLS-1$
+		
+//		annotationWidgetsArea = new GLComposite(getBetweenTopToolbarsAndResultComposite(), SWT.NONE, "Edition annotation area");
+//		this.annotationWidgetsArea.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, true, false));
+
+	//	supplementaryButtonToolbar = new TXMEditorToolBar(this, getTopToolbarContainer(), annotationWidgetsArea, SWT.NONE, "annotation urs");
+		
+		// Edition names label
+		editionsChooser = new Button(controlsArea, SWT.PUSH);
+		editionsChooser.setText(StringUtils.join(editionNames, " | ")); //$NON-NLS-1$
+
+		if (corpus.getEditionNames().size() > 1) {			
+
+			editionsChooser.addSelectionListener(new SelectionListener() {
+				@Override
+				public void widgetSelected(SelectionEvent e) {
+					try {
+						Shell shell = e.display.getActiveShell();
+						EditionSelectorDialog d = new EditionSelectorDialog(shell, corpus, editionNames);
+
+						if (corpus.getEditionNames().size() > 1 && d.open() == Window.OK) {
+							Object[] rez = d.getResult();
+							editionNames = new String[rez.length];
+							for(int i = 0 ; i < rez.length ; i++) editionNames[i] = rez[i].toString();
+							editionsChooser.setText(StringUtils.join(editionNames, " | ")); //$NON-NLS-1$
+							openEditions(corpus, text, editionNames);
+							firstPage();
+						} else if (corpus.getEditionNames().size() == 1) {
+							editionNames = new String[]{corpus.getEditionNames().get(0)};
+							editionsChooser.setText(StringUtils.join(editionNames, " | ")); //$NON-NLS-1$
+							openEditions(corpus, text, editionNames);
+							firstPage();
+						} else {
+							System.out.println(SynopticEditionUIMessages.SynopticEditionEditor_5);
+						}
+					} catch (Exception e2) {
+						org.txm.rcp.utils.Logger.printStackTrace(e2);
+						System.out.println(SynopticEditionUIMessages.SynopticEditionEditor_6+e2);
+					}
+				}
+
+				@Override
+				public void widgetDefaultSelected(SelectionEvent e) { }
+			});
+		} else {
+			editionsChooser.setEnabled(false);
+		}
+
+		// Navigation buttons
+		GLComposite pageNavigationComposite = new GLComposite(controlsArea, SWT.NONE, "page buttons");
+		pageNavigationComposite.getLayout().numColumns = 6;
+		Button first = new Button(pageNavigationComposite, SWT.FLAT|SWT.PUSH);
+		Button previous = new Button(pageNavigationComposite, SWT.FLAT|SWT.PUSH);
+		page_text = new org.eclipse.swt.widgets.Text(pageNavigationComposite, SWT.BORDER);
+		page_label = new Label(pageNavigationComposite, SWT.NONE);
+		Button next = new Button(pageNavigationComposite, SWT.FLAT|SWT.PUSH);
+		Button last = new Button(pageNavigationComposite, SWT.FLAT|SWT.PUSH);
+		pageNavigationComposite.setLayoutData(new GridData(GridData.CENTER, GridData.FILL, true, false));
+		
+		GLComposite textNavigationComposite = new GLComposite(controlsArea, SWT.NONE, "text buttons");
+		textNavigationComposite.getLayout().numColumns = 6;
+		Button firstText = new Button(textNavigationComposite, SWT.FLAT);
+		Button previousText = new Button(textNavigationComposite, SWT.FLAT);
+		new Label(textNavigationComposite, SWT.NONE).setText(" ");
+		Button nextText = new Button(textNavigationComposite, SWT.FLAT|SWT.PUSH);
+		Button lastText = new Button(textNavigationComposite, SWT.FLAT|SWT.PUSH);
+		textNavigationComposite.setLayoutData(new GridData(GridData.CENTER, GridData.FILL, false, false));
+		// Layouts data
+
+		editionsChooser.setLayoutData(new GridData(GridData.BEGINNING,GridData.CENTER, false, false));
+
+//		GridData buttonGridData = new GridData(GridData.END,GridData.CENTER, true, false);
+//		buttonGridData.widthHint = 30;
+//		buttonGridData.heightHint = 30;
+//		firstText.setLayoutData(buttonGridData);
+//		buttonGridData = new GridData(GridData.CENTER,GridData.CENTER, false, false);
+//		buttonGridData.widthHint = 30;
+//		buttonGridData.heightHint = 30;
+//		previousText.setLayoutData(buttonGridData);
+//		GridData centerButtonGridData = new GridData(GridData.END,GridData.CENTER, true, true);
+//		centerButtonGridData.widthHint = 30;
+//		centerButtonGridData.heightHint = 30;
+//		first.setLayoutData(centerButtonGridData);
+//		previous.setLayoutData(buttonGridData);
+
+		// set sizes
+
+//		GridData gdata = new GridData(GridData.END,GridData.CENTER, false, false);
+//		gdata.minimumWidth = 40;
+//		gdata.widthHint = 40;
+//		page_text.setLayoutData(gdata);
+//		page_label.setLayoutData(new GridData(GridData.BEGINNING,GridData.CENTER, false, false));
+//
+//		next.setLayoutData(buttonGridData);
+//		centerButtonGridData = new GridData(GridData.BEGINNING, GridData.CENTER, true, true);
+//		centerButtonGridData.widthHint = 30;
+//		centerButtonGridData.heightHint = 30;
+//		last.setLayoutData(centerButtonGridData);
+//		nextText.setLayoutData(buttonGridData);
+//		lastText.setLayoutData(buttonGridData);
+
+
+//		if (editionsChooser != null)
+//			editionsChooser.setLayoutData(new GridData(GridData.BEGINNING,GridData.CENTER, false, true));
+		//else spacer.setLayoutData(new GridData(GridData.END,GridData.CENTER, true, true));
+
+		// set labels
+		page_label.setText(""); //$NON-NLS-1$
+		firstText.setImage(IImageKeys.getImage(IImageKeys.CTRLREWINDSTART));
+		firstText.setToolTipText(SynopticEditionUIMessages.SynopticEditionEditor_0); 
+		previousText.setImage(IImageKeys.getImage(IImageKeys.CTRLREWIND));
+		previousText.setToolTipText(SynopticEditionUIMessages.SynopticEditionEditor_1); 
+		first.setImage(IImageKeys.getImage(IImageKeys.CTRLSTART)); 
+		first.setToolTipText(SynopticEditionUIMessages.SynopticEditionEditor_3); 
+		previous.setImage(IImageKeys.getImage(IImageKeys.CTRLREVERSE));
+		previous.setToolTipText(SynopticEditionUIMessages.SynopticEditionEditor_4); 
+		next.setImage(IImageKeys.getImage(IImageKeys.CTRLPLAY));
+		next.setToolTipText(SynopticEditionUIMessages.SynopticEditionEditor_7); 
+		last.setImage(IImageKeys.getImage(IImageKeys.CTRLEND));
+		last.setToolTipText(SynopticEditionUIMessages.SynopticEditionEditor_8);
+		nextText.setImage(IImageKeys.getImage(IImageKeys.CTRLFASTFORWARD));
+		nextText.setToolTipText(SynopticEditionUIMessages.SynopticEditionEditor_10); 
+		lastText.setImage(IImageKeys.getImage(IImageKeys.CTRLFASTFORWARDEND));
+		lastText.setToolTipText(SynopticEditionUIMessages.SynopticEditionEditor_11); 
+
+		page_text.addKeyListener(new KeyListener() {
+
+			@Override
+			public void keyReleased(KeyEvent e) {
+				if (e.keyCode == SWT.CR || e.keyCode == SWT.KEYPAD_CR) {
+					goToPage(page_text.getText());
+				}
+			}
+
+			@Override
+			public void keyPressed(KeyEvent e) {}
+		});
+		// 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();
+			}
+		});
+		// 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();
+			}
+		});
+		// set listeners
+		firstText.addSelectionListener(new SelectionListener() {
+			@Override
+			public void widgetDefaultSelected(SelectionEvent e) {
+				firstText();
+			}
+
+			@Override
+			public void widgetSelected(SelectionEvent e) {
+				firstText();
+			}
+		});
+
+		openEditions(corpus, text, editionNames);
+	}
+
+	/**
+	 * Opens the default corpus edition with the first Text
+	 * 
+	 * @param corpus
+	 */
+	public boolean openEditions(Corpus corpus) {
+		if (corpus == null) return false;
+		return openEditions(corpus, corpus.getFirstText(), corpus.getDefaultEdition());
+	}
+
+	/**
+	 * update editor title using the first panel only 
+	 */
+	private void updatePageLabel() {
+		for (EditionPanel p : editionPanels.values()) {
+			this.setPartName(p.getCurrentPage().getEdition().getText().getName()+ " - "+p.getCurrentPage().getName()); //$NON-NLS-1$
+			page_text.setText(p.getCurrentPage().getName());
+			page_label.setText(" / "+p.getCurrentPage().getEdition().getNumPages()); //$NON-NLS-1$
+			controlsArea.layout();
+			return;
+		}
+	}
+
+	public boolean openEditions(Corpus corpus, String textID, String... editionNames) {
+		Text text = corpus.getText(textID);
+		if (text == null) return false;
+		return openEditions(corpus, text, editionNames);
+	}
+
+	/**
+	 * Opens a list of edition corpus
+	 * @param corpus
+	 * @param editionNames
+	 */
+	public boolean openEditions(Corpus corpus, Text text, String... editionNames) {
+
+		// remove previous EditionPanel
+		for (EditionPanel panel : editionPanels.values()) {
+			panel.dispose();
+		}
+		editionPanels = new LinkedHashMap<String, EditionPanel>();
+
+		editionsArea.setLayout(new GridLayout(editionNames.length, true));
+
+		for (int i = 0 ; i < editionNames.length ;i++) {
+			String editionName = editionNames[i];
+			//System.out.println("EDITION NAME: "+editionName);
+			Composite container = editionsArea;//.getContainer(i);
+			Edition edition = text.getEdition(editionName);
+			if (edition != null) {
+				EditionPanel panel = new EditionPanel(this, container, SWT.BORDER, edition);
+				panel.initSelectionProvider();
+
+				if (i == 0) { // TODO: how to manage multiple menumanager -> the text selection does not work only the first panel selection is used
+					panel.initMenu();
+					getSite().registerContextMenu(panel.getMenuManager(), panel.getSelectionProvider());
+				}
+
+				editionPanels.put(editionName, panel);
+			} else {
+				System.out.println(SynopticEditionUIMessages.SynopticEditionEditor_9+editionName);
+			}
+		}
+		editionsArea.layout();
+		return true;
+	}
+
+	/**
+	 * 
+	 * //TODO: add getDefaultEditions to Corpus object
+	 * 
+	 * @param corpus
+	 * @return a list of default editions
+	 */
+	public String[] getDefaultEditions(Corpus corpus) {
+		String defaultEdition = corpus.getDefaultEdition();
+		if (defaultEdition.contains(",")) { //$NON-NLS-1$
+			return defaultEdition.split(","); //$NON-NLS-1$
+		} else {
+			return new String[]{defaultEdition};
+		}
+	}
+
+	@Override
+	public void doSaveAs() {
+		return;
+	}
+
+	@Override
+	public void init(IEditorSite site, IEditorInput input)
+			throws PartInitException {
+		super.init(site, input);
+
+		corpus = ((SynopticEditorInput) getEditorInput()).getCorpus();
+		corpus = corpus.getMainCorpus(); // get the main corpus of the corpus
+		text = ((SynopticEditorInput) getEditorInput()).getText();
+		editionNames = ((SynopticEditorInput) getEditorInput()).getEditions();
+	}
+
+	public boolean isDisposed() {
+		return editionsArea.isDisposed();
+	}
+
+	@Override
+	public boolean isSaveAsAllowed() {
+		return false;
+	}
+
+	@Override
+	public void setFocus() {
+
+	}
+
+	public void backToText(Text text, String line_wordid) {
+		for (EditionPanel p : editionPanels.values()) {
+			p.backToText(text, line_wordid);
+		}
+		updatePageLabel();
+		
+		notifyExtensions("onBackToText");
+	}
+
+	public void reloadPage() {
+		for (EditionPanel p : editionPanels.values()) {
+			p.reloadPage();
+		}
+	}
+
+	@Override
+	public String getTextSelection() {
+		String sel = null;
+		for (EditionPanel p : editionPanels.values()) {
+			sel = p.getTextSelection();
+			if (sel != null) return sel;
+		}
+		return "";
+	}
+
+	@Override
+	public Corpus getCorpus() {
+		return corpus;
+	}
+
+	public EditionPanel getEditionPanel(int i) {
+		int n = 0;
+		for (EditionPanel p : editionPanels.values()) {
+			if (n == i) return p;
+		}
+		return null;
+	}
+
+	/**
+	 * 
+	 * @return the first and last word ID covered by the text selection of the first EditionPanel
+	 */
+	public Object getWordSelection() {
+		for (EditionPanel p : editionPanels.values()) {
+			return p.getWordSelection();
+		}
+		return null;
+	}
+
+	/**
+	 * 
+	 * @param text2 the Text to set
+	 * @param refresh if true set the first Text page
+	 */
+	public void setText(Text text2, boolean refresh) {
+		for (EditionPanel p : editionPanels.values()) {
+			p.setText(text2, refresh);
+		}
+	}
+
+	public void setFocusedWordID(String focusid) {
+		for (EditionPanel p : editionPanels.values()) {
+			p.setFocusedWordID(focusid);
+		}
+	}
+
+	/**
+	 *  NOT DONE
+	 *  
+	 * @param pos
+	 */
+	public void setHighlightedArea(HashSet<int[]> positions) {
+		for (EditionPanel p : editionPanels.values()) {
+			p.setHighlightedArea(positions);
+		}
+	}
+
+	public void updateWordStyles() {
+		for (EditionPanel p : editionPanels.values()) {
+			p.updateWordStyles();
+		}
+	}
+
+	public void addFontWeightWordsById(String weight, List<String> previousSelectedUnitIDS) {
+		for (EditionPanel p : editionPanels.values()) {
+			p.addFontWeightWordsById(weight, previousSelectedUnitIDS);
+		}
+	}
+
+	public void removeFontWeightWordsById(List<String> previousSelectedUnitIDS) {
+		for (EditionPanel p : editionPanels.values()) {
+			p.removeFontWeightWordsById(previousSelectedUnitIDS);
+		}
+	}
+
+	public void fireIsDirty() {
+		this.firePropertyChange(IEditorPart.PROP_DIRTY);
+	}
+
+	/**
+	 * Clears all highlighted words.
+	 */
+	public void removeHighlightWords() {
+		for (EditionPanel p : editionPanels.values()) {
+			p.removeHighlightWords();
+		}
+	}
+
+	@Override
+	public void updateResultFromEditor() {
+		// TODO Auto-generated method stub
+		
+	}
+
+	@Override
+	public void updateEditorFromResult(boolean update) throws Exception {
+		// TODO Auto-generated method stub
+		
+	}
+	
+	// Called by JavaScript
+	
+
+	/**
+	 * Browser command that opens an edition
+	 * @author mdecorde
+	 *
+	 */
+	
+	
+	public static Object callTXMCommand(String id, HashMap<String, String> params) {
+		IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
+		ICommandService cmdService = (ICommandService)window.getService(ICommandService.class);
+		Command cmd = cmdService.getCommand(id);
+
+		//get the parameter
+		ArrayList<Parameterization> parameters = new ArrayList<Parameterization>();
+		for (String k : params.keySet()) {
+			try {
+				IParameter iparam = cmd.getParameter(k);
+				Parameterization p = new Parameterization(iparam, params.get(k));
+				parameters.add(p);
+			} catch (NotDefinedException e) {
+				System.out.println("warning: unknowned parameter id="+k);
+			}
+		}
+
+		//build the parameterized command
+		ParameterizedCommand pc = new ParameterizedCommand(cmd, parameters.toArray(new Parameterization[parameters.size()]));
+
+		//execute the command
+		IHandlerService handlerService = (IHandlerService)window.getService(IHandlerService.class);
+		try {
+			return handlerService.executeCommand(pc, null);
+		} catch (Exception e) {
+			e.printStackTrace();
+		}
+		return null;
+	}
+
+	/**
+	 * 
+	 * @param editor may be null, will be used by the command to display its result
+	 * @param arguments array of command id + (parameters+values). 
+	 * 
+	 * <pre>ex: String[] arguments = {"commandid", "paramname", "value", "paramname2", "othervalue"};</pre>
+	 * 
+	 * @return
+	 */
+	public static Object callTXMCommand(Object[] arguments) {
+		HashMap<String, String> params = new HashMap<String, String>();
+		for (int i = 0 ; i < arguments.length ; i += 2) {
+			params.put(arguments[i].toString(), arguments[i+1].toString());
+		}
+
+		String id = params.get("id");
+		if (id != null) {
+			params.remove("id");
+			//System.out.println("CALLING CMD with id="+id+" and parameters="+params);
+			//get the command from plugin.xml
+			callTXMCommand(id, params);
+		} else {
+			System.out.println("Cannot call txmcommand without 'id' parameter: "+params);
+		}
+		return arguments;
+	}
+}
\ No newline at end of file

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

Index: tmp/org.txm.edition.rcp/src/org/txm/edition/rcp/editors/CommandLink.java
===================================================================
--- tmp/org.txm.edition.rcp/src/org/txm/edition/rcp/editors/CommandLink.java	(revision 0)
+++ tmp/org.txm.edition.rcp/src/org/txm/edition/rcp/editors/CommandLink.java	(revision 936)
@@ -0,0 +1,18 @@
+package org.txm.edition.rcp.editors;
+
+import org.eclipse.swt.browser.Browser;
+import org.eclipse.swt.browser.BrowserFunction;
+
+public class CommandLink extends BrowserFunction {
+		String data = "";
+		Browser browser;
+		SynopticEditionEditor synopticEditionEditor;
+		CommandLink (SynopticEditionEditor synopticEditionEditor, Browser browser) {
+			super (browser, "txmcommand");
+			this.browser = browser;
+			this.synopticEditionEditor = synopticEditionEditor;
+		}
+		public Object function (Object[] arguments) {
+			return SynopticEditionEditor.callTXMCommand(arguments);
+		}
+	}
\ No newline at end of file

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

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 0)
+++ tmp/org.txm.edition.rcp/src/org/txm/edition/rcp/editors/EditionSelectorDialog.java	(revision 936)
@@ -0,0 +1,52 @@
+package org.txm.edition.rcp.editors;
+
+import org.eclipse.jface.viewers.ILabelProvider;
+import org.eclipse.jface.viewers.ILabelProviderListener;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.dialogs.ElementListSelectionDialog;
+import org.txm.edition.rcp.messages.SynopticEditionUIMessages;
+import org.txm.objects.Corpus;
+
+public class EditionSelectorDialog extends ElementListSelectionDialog {
+
+	public EditionSelectorDialog(Shell parent, Corpus corpus, String[] defaultSelection) {
+		super(parent, new ILabelProvider() {
+			@Override
+			public void removeListener(ILabelProviderListener listener) { }
+
+			@Override
+			public boolean isLabelProperty(Object element,
+					String property) {
+				return false;
+			}
+
+			@Override
+			public void dispose() { }
+
+			@Override
+			public void addListener(ILabelProviderListener listener) { }
+
+			@Override
+			public Image getImage(Object element) {
+				return null;
+			}
+
+			@Override
+			public String getText(Object element) {
+				return element.toString();
+			}
+		});
+
+		setTitle(SynopticEditionUIMessages.EditionSelectorDialog_0);
+		setMessage(SynopticEditionUIMessages.EditionSelectorDialog_1);
+		setMultipleSelection(true);
+		setElements(corpus.getEditionNames().toArray());
+		setFilter("*"); //$NON-NLS-1$
+		
+		if (defaultSelection == null) {
+			defaultSelection = new String[]{corpus.getDefaultEdition()};
+		}
+		this.setInitialSelections(defaultSelection);
+	}
+}
\ No newline at end of file

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

Index: tmp/org.txm.edition.rcp/res/js/functions.js
===================================================================
--- tmp/org.txm.edition.rcp/res/js/functions.js	(revision 0)
+++ tmp/org.txm.edition.rcp/res/js/functions.js	(revision 936)
@@ -0,0 +1,201 @@
+function getNodeText(node) {
+	if (typeof node == 'string')
+		return node;
+	else if (typeof node.innerText != 'undefined')
+		return node.innerText;
+	else if (typeof node.InnerText != 'undefined')
+		return node.InnerText;
+	else if (typeof node.textContent != 'undefined')
+		return node.textContent;
+	else
+		return null;
+}
+function txmGetParent(node) {
+	if (typeof node.parentNode != 'undefined')
+		return node.parentNode;
+	else
+		return null;
+}
+function txmGetChildren(node) {
+	if (typeof node == 'string')
+		return 'STRING HTML';
+	else if (typeof node.children != 'undefined')
+		return node.children;
+	else if (typeof node.ChildNodes != 'undefined')
+		return node.ChildNodes;
+	else if (typeof node.childNodes != 'undefined')
+		return node.childNodes;
+	else
+		return null;
+}
+function txmGetSelection() {
+	if (typeof window.getSelection != 'undefined') {
+		return window.getSelection();
+	} else if (typeof document.selection != 'undefined') {
+		return document.selection;
+	} else
+		return 'NO SELECTION';
+}
+function txmGetRangeSize(selection) {
+	if (typeof selection.rangeCount != 'undefined') {
+		return selection.rangeCount;
+	} else if (typeof selection.createRangeCollection != 'undefined') {
+		return selection.createRangeCollection().length();
+	} // IE5 has no multiple selection
+}
+function txmGetRange(selection, i) {
+	if (typeof selection.getRangeAt != 'undefined') {
+		return selection.getRangeAt(i);
+	} else if (typeof selection.createRangeCollection != 'undefined') {
+		return selection.createRangeCollection().item(i);
+	} else if (typeof selection.createRange != 'undefined') {
+		return selection.createRange();
+	} // IE5 has no multiple selection
+	else
+		return 'NO RANGE';
+}
+function txmGetParentElementRange(range) {
+	if (typeof range.parentElement != 'undefined') {
+		return range.parentElement();
+	} else if (typeof range.startContainer != 'undefined') {
+		return range.startContainer.parentNode;
+	} else
+		return 'NO PARENT';
+}
+function txmGetFragment(range) {
+	if (typeof range.cloneContents != 'undefined') {
+		return range.cloneContents();
+	} else if (typeof range.htmlText != 'undefined') {
+		var node = document.createElement('sel');
+		node.innerHTML = range.htmlText;
+		return node;
+	} else
+		return 'NO FRAG';
+}
+function txmGetTagName(node) {
+	if (typeof node.tagName != 'undefined') {
+		return node.tagName;
+	} else if (typeof node.nodeName != 'undefined') {
+		return node.nodeName;
+	} else if (typeof node.name != 'undefined') {
+		return node.name;
+	} else
+		return 'NO TAGNAME';
+}
+function findSpans(children, all) {
+	for (var i = 0; i < children.length; i++) {
+		var node = children.item(i);
+		if (node.nodeType == 1) {
+			var id = node.getAttribute('id');
+			if (node.tagName == 'SPAN' && id != null && id.indexOf('w_') == 0
+					&& getNodeText(node).length > 0) {
+				if (id != null)
+					all.push(id);
+			} else {
+				findSpans(txmGetChildren(node), all)
+			}
+		}
+	}
+}
+function findIdsInString(str, all) {
+	for (var i = 0; i < children.length; i++) {
+		var node = children.item(i);
+		if (node.nodeType == 1) {
+			var id = node.getAttribute('id');
+			if (node.tagName == 'SPAN' && id != null && id.indexOf('w_') == 0
+					&& getNodeText(node).length > 0) {
+				if (id != null)
+					all.push(id);
+			} else {
+				findSpans(txmGetChildren(node), all)
+			}
+		}
+	}
+}
+function get_type(thing) {
+	if (thing === null)
+		return "[object Null]";
+	return Object.prototype.toString.call(thing);
+}
+
+function getDetailedObject(inputObject) {
+	var detailedObject = {};
+	var properties;
+	do {
+		properties = Object.getOwnPropertyNames(inputObject);
+		for ( var o in properties) {
+			detailedObject[properties[o]] = inputObject[properties[o]];
+		}
+	} while (inputObject = Object.getPrototypeOf(inputObject));
+	return detailedObject;
+}
+
+var sheet = null;
+try {
+	var style = document.createElement("style");
+	style.appendChild(document.createTextNode(""));
+	document.head.appendChild(style);
+	sheet = style.sheet;
+} catch (e) {
+	sheet = 'error'
+}
+
+//try {
+//
+//	if (!Element.prototype.scrollIntoViewIfNeeded) {
+//		Element.prototype.scrollIntoViewIfNeeded = Element.prototype.scrollIntoView;
+////		Element.prototype.scrollIntoViewIfNeeded = function(centerIfNeeded) {
+////			centerIfNeeded = arguments.length === 0 ? true : !!centerIfNeeded;
+////			var parent = this.parentNode, parentComputedStyle = window
+////					.getComputedStyle(parent, null), parentBorderTopWidth = parseInt(parentComputedStyle
+////					.getPropertyValue('border-top-width')), parentBorderLeftWidth = parseInt(parentComputedStyle
+////					.getPropertyValue('border-left-width')), overTop = this.offsetTop
+////					- parent.offsetTop < parent.scrollTop, overBottom = (this.offsetTop
+////					- parent.offsetTop + this.clientHeight - parentBorderTopWidth) > (parent.scrollTop + parent.clientHeight), overLeft = this.offsetLeft
+////					- parent.offsetLeft < parent.scrollLeft, overRight = (this.offsetLeft
+////					- parent.offsetLeft + this.clientWidth - parentBorderLeftWidth) > (parent.scrollLeft + parent.clientWidth), alignWithTop = overTop
+////					&& !overBottom;
+////			if ((overTop || overBottom) && centerIfNeeded) {
+////				parent.scrollTop = this.offsetTop - parent.offsetTop
+////						- parent.clientHeight / 2 - parentBorderTopWidth
+////						+ this.clientHeight / 2;
+////			}
+////			if ((overLeft || overRight) && centerIfNeeded) {
+////				parent.scrollLeft = this.offsetLeft - parent.offsetLeft
+////						- parent.clientWidth / 2 - parentBorderLeftWidth
+////						+ this.clientWidth / 2;
+////			}
+////			if ((overTop || overBottom || overLeft || overRight)
+////					&& !centerIfNeeded) {
+////				this.scrollIntoView(alignWithTop);
+////			}
+////		};
+//	}
+//} catch (e) {
+//	Element.prototype.scrollIntoViewIfNeeded = Element.prototype.scrollIntoView
+//}
+
+function showElementIfNeeded(el) {
+	if (!Element.prototype.scrollIntoViewIfNeeded) {
+		if (!isAnyPartOfElementInViewport(el)) el.scrollIntoView(false);
+	} else {
+		el.scrollIntoViewIfNeeded();
+	}
+}
+
+function isAnyPartOfElementInViewport(el) {
+	try { 
+		const rect = el.getBoundingClientRect();
+    // 	DOMRect { x: 8, y: 8, width: 100, height: 100, top: 8, right: 108, bottom: 108, left: 8 }
+		const windowHeight = (window.innerHeight || document.documentElement.clientHeight);
+		const windowWidth = (window.innerWidth || document.documentElement.clientWidth);
+
+    // http://stackoverflow.com/questions/325933/determine-whether-two-date-ranges-overlap
+		const vertInView = (rect.top <= windowHeight) && ((rect.top + rect.height) >= 0);
+		const horInView = (rect.left <= windowWidth) && ((rect.left + rect.width) >= 0);
+
+		return (vertInView && horInView);
+	} catch (e) {
+		return false;
+	}
+}
\ No newline at end of file

Property changes on: tmp/org.txm.edition.rcp/res/js/functions.js
___________________________________________________________________
Added: svn:mime-type
   + text/plain


Property changes on: tmp/org.txm.edition.rcp
___________________________________________________________________
Added: svn:ignore
   + bin


