Index: tmp/org.txm.rcp/src/main/java/org/txm/rcp/editors/TXMBrowser.java
===================================================================
--- tmp/org.txm.rcp/src/main/java/org/txm/rcp/editors/TXMBrowser.java	(revision 3104)
+++ tmp/org.txm.rcp/src/main/java/org/txm/rcp/editors/TXMBrowser.java	(revision 3105)
@@ -1,681 +0,0 @@
-// Copyright © 2010-2020 ENS de Lyon., University of Franche-Comté
-// 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.rcp.editors;
-
-import java.util.List;
-
-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.ProgressEvent;
-import org.eclipse.swt.browser.ProgressListener;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.layout.FormAttachment;
-import org.eclipse.swt.layout.FormData;
-import org.eclipse.swt.layout.FormLayout;
-import org.eclipse.swt.layout.RowData;
-import org.eclipse.swt.layout.RowLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Menu;
-import org.eclipse.ui.internal.browser.BrowserViewer;
-import org.eclipse.ui.internal.browser.WebBrowserEditor;
-import org.txm.objects.Edition;
-import org.txm.objects.Page;
-import org.txm.objects.Project;
-import org.txm.objects.Text;
-import org.txm.rcp.IImageKeys;
-import org.txm.rcp.StatusLine;
-import org.txm.rcp.messages.TXMUIMessages;
-
-/**
- * Call the internal browser of RCP specialized for TXM editions.
- * 
- * A Text can be set then the user can browse pages and others texts of the same corpus
- * 
- * @author mdecorde.
- */
-@SuppressWarnings("restriction")
-public class TXMBrowser extends WebBrowserEditor {
-	
-	/** The Constant ID. */
-	public final static String ID = "org.txm.rcp.editors.TXMBrowser"; //$NON-NLS-1$
-	
-	private ProgressListener progresslistener;
-	
-	private List<String> wordids;
-	
-	private List<String> lineids;
-	
-	/** The edition. */
-	Edition edition;
-	
-	/** The current page. */
-	Page currentPage;
-	
-	/** The page_label. */
-	Label page_label;
-	
-	/** The source. */
-	private Object source;
-	
-	/**
-	 * Instantiates a new txm browser.
-	 */
-	public TXMBrowser() {
-		
-	}
-	
-	/**
-	 * Gets the browser.
-	 *
-	 * @return the browser
-	 */
-	public Browser getBrowser() {
-		BrowserViewer webbrowser = this.webBrowser;
-		return webbrowser.getBrowser();
-	}
-	
-	@Override
-	public void setPartName(String partName) {
-		super.setPartName(partName);
-	}
-	
-	@Override
-	public void setTitleImage(Image titleImage) {
-		super.setTitleImage(titleImage);
-	}
-	
-	/**
-	 * 
-	 * @param wordids2 all the words to highlight
-	 * @param lineids2 the words to highlight better and to scroll to
-	 */
-	public void setWordsIds(List<String> wordids2, List<String> lineids2) {
-		this.wordids = wordids2;
-		this.lineids = lineids2;
-		if (progresslistener != null)
-			this.getBrowser().removeProgressListener(progresslistener);
-		progresslistener = new ProgressListener() {
-			
-			@Override
-			public void changed(ProgressEvent event) {}
-			
-			@Override
-			public void completed(ProgressEvent event) {
-				Page currentpage = getCurrentPage();
-				// System.out.println("Highlight ! "+currentpage.getEdition().getText()+" wordids ="+wordids);
-				
-				for (String wordid : wordids) {
-					String highlightscript = "try { var elt = document.getElementById(\"" + wordid + "\");" + //$NON-NLS-1$ //$NON-NLS-2$
-							"elt.style.backgroundColor=\"#F9D0D0\";" //$NON-NLS-1$
-							+
-							"elt.style.paddingLeft=\"3px\";" + //$NON-NLS-1$
-							"elt.style.paddingRight=\"3px\";" + //$NON-NLS-1$
-							"elt.style.paddingTop=\"1px\";" + //$NON-NLS-1$
-							"elt.style.paddingBottom=\"1px\";" + //$NON-NLS-1$
-							"} catch (e) { };"; //$NON-NLS-1$
-					
-					getBrowser().execute(highlightscript);
-				}
-				
-				for (String wordid : lineids) {
-					String highlightscript = "try { var elt = document.getElementById(\"" + wordid + "\");" + //$NON-NLS-1$ //$NON-NLS-2$
-							"elt.style.backgroundColor=\"#F9A0A0\";" + //$NON-NLS-1$
-							"elt.style.paddingLeft=\"3px\";" + //$NON-NLS-1$
-							"elt.style.paddingRight=\"3px\";" + //$NON-NLS-1$
-							"elt.style.paddingTop=\"1px\";" + //$NON-NLS-1$
-							"elt.style.paddingBottom=\"1px\";" + //$NON-NLS-1$
-							"} catch (e) { };"; //$NON-NLS-1$
-					
-					getBrowser().execute(highlightscript);
-				}
-				if (lineids.size() > 0) {
-					String script = "try { document.getElementById(\"" + lineids.get(0) + "\").scrollIntoView(true); } catch (e) { };"; //$NON-NLS-1$ //$NON-NLS-2$
-					getBrowser().execute(script);
-				}
-			}
-		};
-		getBrowser().addProgressListener(progresslistener);
-	}
-	
-	/**
-	 * Sets the edition.
-	 *
-	 * @param edition the new edition
-	 */
-	public void setEdition(Edition edition) {
-		this.edition = edition;
-	}
-	
-	/**
-	 * 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) {
-		edition = page.getEdition();
-		currentPage = page;
-		this.webBrowser.setURL(currentPage.toURL());
-		page_label.setText(makePageLabel());
-	}
-	
-	/**
-	 * First text.
-	 */
-	public void firstText() {
-		Text current = this.currentPage.getEdition().getText();
-		Project corpus = current.getProject();
-		Text firstText = corpus.getFirstText();
-		
-		if (firstText != null) {
-			String editionName = corpus.getDefaultEditionName();
-			currentPage = firstText.getEdition(editionName).getFirstPage();
-			if (currentPage == null) {
-				StatusLine.setMessage(TXMUIMessages.noPreviousText);
-				return;
-			}
-			this.setEdition(firstText.getEdition(editionName));
-			this.webBrowser.setURL(currentPage.toURL());
-			page_label.setText(makePageLabel());
-		}
-	}
-	
-	/**
-	 * Last text.
-	 */
-	public void lastText() {
-		Text current = this.currentPage.getEdition().getText();
-		Project b = current.getProject();
-		Text lastText = b.getLastText();
-		
-		if (lastText != null) {
-			currentPage = lastText.getEdition(b.getDefaultEditionName()).getFirstPage();
-			if (currentPage == null) {
-				StatusLine.setMessage(TXMUIMessages.noTextNext);
-				return;
-			}
-			this.setEdition(lastText.getEdition(b.getDefaultEditionName()));
-			this.webBrowser.setURL(currentPage.toURL());
-			page_label.setText(makePageLabel());
-		}
-	}
-	
-	/**
-	 * First page.
-	 */
-	public void firstPage() {
-		// System.out.println(Messages.TxmBrowser_1+currentPage);
-		currentPage = edition.getFirstPage();
-		this.webBrowser.setURL(currentPage.toURL());
-		page_label.setText(makePageLabel());
-	}
-	
-	/**
-	 * Last page.
-	 */
-	public void lastPage() {
-		// System.out.println(Messages.TxmBrowser_2+currentPage);
-		
-		if (currentPage != null && currentPage.getFile().equals(edition.getLastPage().getFile()))
-			return;
-		currentPage = edition.getLastPage();
-		this.webBrowser.setURL(currentPage.toURL());
-		page_label.setText(makePageLabel());
-	}
-	
-	/**
-	 * Previous page.
-	 */
-	public void previousPage() {
-		// System.out.println(Messages.TxmBrowser_3+currentPage);
-		if (currentPage != null) {
-			Page previous = edition.getPreviousPage(currentPage);
-			if (previous == currentPage) {
-				previousText(true);
-			}
-			else {
-				currentPage = previous;
-				this.webBrowser.setURL(currentPage.toURL());
-			}
-		}
-		else
-			firstPage();
-		page_label.setText(makePageLabel());
-	}
-	
-	/**
-	 * Next page.
-	 */
-	public void nextPage() {
-		// System.out.println(Messages.TxmBrowser_4+currentPage);
-		if (currentPage != null) {
-			Page next = edition.getNextPage(currentPage);
-			if (currentPage == next) {
-				nextText();
-			}
-			else {
-				currentPage = next;
-				this.webBrowser.setURL(currentPage.toURL());
-			}
-			
-		}
-		else
-			firstPage();
-		page_label.setText(makePageLabel());
-	}
-	
-	/**
-	 * Previous text.
-	 * 
-	 * @param fromNextText
-	 */
-	public void previousText(boolean fromNextText) {
-		
-		Text current = this.currentPage.getEdition().getText();
-		Project corpus = current.getProject();
-		Text previousText = corpus.getPreviousText(current);
-		
-		if (previousText != null) {
-			String editionName = corpus.getDefaultEditionName();
-			if (fromNextText) {
-				currentPage = previousText.getEdition(editionName).getLastPage();
-			}
-			else {
-				currentPage = previousText.getEdition(editionName).getFirstPage();
-			}
-			if (currentPage == null) {
-				StatusLine.setMessage(TXMUIMessages.noPreviousText);
-				return;
-			}
-			this.setEdition(previousText.getEdition(editionName));
-			this.webBrowser.setURL(currentPage.toURL());
-			page_label.setText(makePageLabel());
-		}
-		// System.out.println("Previous texts "+previousText);
-	}
-	
-	/**
-	 * Next text.
-	 */
-	public void nextText() {
-		Text current = this.currentPage.getEdition().getText();
-		Project b = current.getProject();
-		Text nextText = b.getNextText(current);
-		
-		if (nextText != null) {
-			currentPage = nextText.getEdition(b.getDefaultEditionName()).getFirstPage();
-			if (currentPage == null) {
-				StatusLine.setMessage(TXMUIMessages.noTextNext);
-				return;
-			}
-			this.setEdition(nextText.getEdition(b.getDefaultEditionName()));
-			this.webBrowser.setURL(currentPage.toURL());
-			page_label.setText(makePageLabel());
-		}
-		// System.out.println("Next texts "+nextText);
-	}
-	
-	/*
-	 * (non-Javadoc)
-	 * @see org.eclipse.ui.internal.browser.WebBrowserEditor#createPartControl(org.eclipse.swt.widgets.Composite)
-	 */
-	@Override
-	public void createPartControl(Composite parent) {
-		try {
-			super.createPartControl(parent);
-		}
-		catch (Exception e) {
-			System.err.println(TXMUIMessages.couldNotLaunchTheInternalWebBrowserYouMustSetThatParameterInThePreferencesMenuColonGeneralSupWebNavigator);
-			return;
-		}
-		
-		RowLayout navigLayout = new RowLayout(SWT.HORIZONTAL);
-		navigLayout.justify = true;
-		Composite panneau = new Composite(parent, SWT.NONE);
-		panneau.setLayout(navigLayout);
-		
-		RowLayout subLayout = new RowLayout(SWT.HORIZONTAL);
-		subLayout.pack = true;
-		subLayout.center = true;
-		subLayout.marginBottom = subLayout.marginHeight = 0;
-		subLayout.marginTop = subLayout.marginWidth = 0;
-		Composite subPanneau = new Composite(panneau, SWT.NONE);
-		subPanneau.setLayout(subLayout);
-		subPanneau.setLayoutData(new RowData(450, 22));
-		
-		Button firstText = new Button(subPanneau, SWT.FLAT);
-		Button previousText = new Button(subPanneau, SWT.FLAT);
-		Button first = new Button(subPanneau, SWT.FLAT | SWT.PUSH);
-		Button previous = new Button(subPanneau, SWT.FLAT | SWT.PUSH);
-		page_label = new Label(subPanneau, SWT.NONE);
-		Button next = new Button(subPanneau, SWT.FLAT | SWT.PUSH);
-		Button last = new Button(subPanneau, SWT.FLAT | SWT.PUSH);
-		Button nextText = new Button(subPanneau, SWT.FLAT | SWT.PUSH);
-		Button lastText = new Button(subPanneau, SWT.FLAT | SWT.PUSH);
-		
-		// set sizes
-		page_label.setLayoutData(new RowData(50, 20));
-		firstText.setLayoutData(new RowData(30, 20));
-		first.setLayoutData(new RowData(30, 20));
-		previous.setLayoutData(new RowData(30, 20));
-		next.setLayoutData(new RowData(30, 20));
-		last.setLayoutData(new RowData(30, 20));
-		nextText.setLayoutData(new RowData(30, 20));
-		previousText.setLayoutData(new RowData(30, 20));
-		lastText.setLayoutData(new RowData(30, 20));
-		
-		
-		// set labels
-		page_label.setText(""); //$NON-NLS-1$
-		firstText.setImage(IImageKeys.getImage(IImageKeys.CTRLREWINDSTART));
-		firstText.setToolTipText("|<<");
-		previousText.setImage(IImageKeys.getImage(IImageKeys.CTRLREWIND));
-		previousText.setToolTipText(TXMUIMessages.previousText);
-		first.setImage(IImageKeys.getImage(IImageKeys.CTRLSTART));
-		first.setToolTipText(TXMUIMessages.common_beginning);
-		previous.setImage(IImageKeys.getImage(IImageKeys.CTRLREVERSE));
-		previous.setToolTipText(TXMUIMessages.previousPage);
-		next.setImage(IImageKeys.getImage(IImageKeys.CTRLPLAY));
-		next.setToolTipText(TXMUIMessages.nextPage);
-		last.setImage(IImageKeys.getImage(IImageKeys.CTRLEND));
-		last.setToolTipText(TXMUIMessages.common_end);
-		nextText.setImage(IImageKeys.getImage(IImageKeys.CTRLFASTFORWARD));
-		nextText.setToolTipText(TXMUIMessages.nextText);
-		lastText.setImage(IImageKeys.getImage(IImageKeys.CTRLFASTFORWARDEND));
-		lastText.setToolTipText(">>|");
-		
-		
-		// set listeners
-		first.addSelectionListener(new SelectionListener() {
-			
-			@Override
-			public void widgetDefaultSelected(SelectionEvent e) {
-				firstPage();
-			}
-			
-			@Override
-			public void widgetSelected(SelectionEvent e) {
-				firstPage();
-			}
-		});
-		previous.addSelectionListener(new SelectionListener() {
-			
-			@Override
-			public void widgetDefaultSelected(SelectionEvent e) {
-				previousPage();
-			}
-			
-			@Override
-			public void widgetSelected(SelectionEvent e) {
-				previousPage();
-			}
-		});
-		next.addSelectionListener(new SelectionListener() {
-			
-			@Override
-			public void widgetDefaultSelected(SelectionEvent e) {
-				nextPage();
-			}
-			
-			@Override
-			public void widgetSelected(SelectionEvent e) {
-				nextPage();
-			}
-		});
-		last.addSelectionListener(new SelectionListener() {
-			
-			@Override
-			public void widgetDefaultSelected(SelectionEvent e) {
-				lastPage();
-			}
-			
-			@Override
-			public void widgetSelected(SelectionEvent e) {
-				lastPage();
-			}
-		});
-		nextText.addSelectionListener(new SelectionListener() {
-			
-			@Override
-			public void widgetDefaultSelected(SelectionEvent e) {
-				nextText();
-			}
-			
-			@Override
-			public void widgetSelected(SelectionEvent e) {
-				nextText();
-			}
-		});
-		// 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();
-			}
-		});
-		
-		subPanneau.pack();
-		panneau.pack();
-		
-		FormLayout parentLayout = new FormLayout();
-		
-		FormData datatop = new FormData();
-		datatop.top = new FormAttachment(0, 0);
-		datatop.left = new FormAttachment(0, 0);
-		datatop.right = new FormAttachment(100, 0);
-		datatop.bottom = new FormAttachment(panneau, 0);
-		webBrowser.setLayoutData(datatop);
-		
-		FormData databottom = new FormData(200, 30);
-		databottom.bottom = new FormAttachment(100, 0);
-		databottom.left = new FormAttachment(30, -100);
-		databottom.right = new FormAttachment(80, 100);
-		panneau.setLayoutData(databottom);
-		
-		parent.setLayout(parentLayout);
-		parent.pack();
-		
-		MenuManager menuManager = new MenuManager();
-		Menu menu = menuManager.createContextMenu(getBrowser());
-		
-		// Set the MenuManager
-		getBrowser().setMenu(menu);
-		ISelectionProvider selProvider = new ISelectionProvider() {
-			
-			@Override
-			public void setSelection(ISelection selection) {}
-			
-			@Override
-			public void removeSelectionChangedListener(ISelectionChangedListener listener) {}
-			
-			@Override
-			public ISelection getSelection() {
-				ITextSelection sel = new ITextSelection() {
-					
-					@Override
-					public boolean isEmpty() {
-						return false;
-					}
-					
-					@Override
-					public String getText() {
-						return 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) {}
-		};
-		getSite().registerContextMenu(menuManager, selProvider);
-		getSite().setSelectionProvider(selProvider);
-		
-		// System.out.println("Browser menu: "+getBrowser().getMenu());
-	}
-	
-	static String SCRIPT01 = "var html = \"\";" +
-			"if (typeof window.getSelection != \"undefined\") {" + // modern Web browsers
-			"var sel = window.getSelection();" +
-			"if (sel.rangeCount) {" +
-			"var container = document.createElement(\"div\");" +
-			"for (var i = 0, len = sel.rangeCount; i < len; ++i) {" +
-			"container.appendChild(sel.getRangeAt(i).cloneContents());" +
-			"}" +
-			"html = container.innerHTML;" +
-			"}" +
-			"} else if (typeof document.selection != \"undefined\") {" + // for IE < 11
-			"if (document.selection.type == \"Text\") {" +
-			"html = document.selection.createRange().htmlText;" +
-			"}" +
-			"}" +
-			"return html";
-	
-	// return the span@id of the current selection
-	static String SCRIPT02 = "function getChildren(node) {\n"
-			+ "if (node.children != \"undefined\")\n"
-			+ "	return node.children;\n"
-			+ "else \n"
-			+ "return node.ChildNodes;\n"
-			+ "}\n"
-			+ "findSpans = function findSpans(c, a) {\n" +
-			"    for (var i = 0 ; i < c.length ; i++) {\n" +
-			"        if (c.item(i).tagName == \"SPAN\") {\n" +
-			"            var id = c.item(i).getAttribute(\"id\")\n" +
-			"            if (id.indexOf(\"w_\") == 0)\n" +
-			"                a.push(id);\n" +
-			"        } else if (c.item(i).nodeType == 1) {\n" +
-			"            findSpans(c.item(i).children, a);\n" +
-			"        }\n" +
-			"    }\n" +
-			"}\n" +
-			"    var all = [];" +
-			"    var sel = window.getSelection();" +
-			"    if (sel.rangeCount == 0){" +
-			"        return all;" +
-			"    }" +
-			"\n" +
-			"    var range = sel.getRangeAt(0);" +
-			"    var frag = range.cloneContents();alert(frag);alert(frag.children);" +
-			"    findSpans(frag.children, all);" +
-			"    return all;";
-	
-	public String getTextSelectionDOM() {
-		return ((String) getBrowser().evaluate(SCRIPT01));
-	}
-	
-	public Object getWordIDsSelection() {
-		System.out.println("WORDS IDS " + getBrowser().evaluate(SCRIPT02));
-		return getBrowser().evaluate(SCRIPT02);
-	}
-	
-	public String getTextSelection() {
-		System.out.println("DOM=" + getTextSelectionDOM());
-		String rez = getTextSelectionDOM().replaceAll("<[^>]+>", "");
-		System.out.println("STR=" + rez);
-		return rez;
-	}
-	
-	/**
-	 * Gets the current page.
-	 *
-	 * @return the current page
-	 */
-	public Page getCurrentPage() {
-		return currentPage;
-	}
-}
Index: tmp/org.txm.rcp/src/main/java/org/txm/rcp/editors/TXMWebBrowserEditor.java
===================================================================
--- tmp/org.txm.rcp/src/main/java/org/txm/rcp/editors/TXMWebBrowserEditor.java	(revision 3104)
+++ tmp/org.txm.rcp/src/main/java/org/txm/rcp/editors/TXMWebBrowserEditor.java	(revision 3105)
@@ -1,132 +0,0 @@
-package org.txm.rcp.editors;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-
-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.swt.SWT;
-import org.eclipse.swt.browser.Browser;
-import org.eclipse.swt.browser.BrowserFunction;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.ToolBar;
-import org.eclipse.swt.widgets.ToolItem;
-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.eclipse.ui.internal.browser.ImageResource;
-import org.eclipse.ui.internal.browser.Messages;
-import org.eclipse.ui.internal.browser.WebBrowserEditor;
-import org.eclipse.ui.internal.browser.WebBrowserEditorInput;
-
-@SuppressWarnings("restriction")
-public class TXMWebBrowserEditor extends WebBrowserEditor {
-	
-	public static final String WEB_BROWSER_EDITOR_ID = "org.txm.rcp.editors.TXMWebBrowserEditor"; //$NON-NLS-1$
-	
-	@Override
-	public void setTitleImage(Image img) {
-		super.setTitleImage(img);
-	}
-	
-	@Override
-	public void setTitle(String title) {
-		super.setTitle(title);
-	}
-	
-	public void setTitleTooltip(String tooltip) {
-		super.setTitleToolTip(tooltip);
-	}
-	
-	public void focus() {
-		webBrowser.getBrowser().forceFocus();
-	}
-	
-	public BrowserViewer getWebBrowserViewer() {
-		return webBrowser;
-	}
-	
-	@Override
-	public void createPartControl(Composite parent) {
-		
-		super.createPartControl(parent);
-		
-		// createToolbar(parent);
-		
-		new CommandLink(this.webBrowser.getBrowser());
-	}
-	
-	ToolItem back;
-	
-	ToolItem forward;
-	
-	
-	// Called by JavaScript
-	public class CommandLink extends BrowserFunction {
-		
-		String data = "";
-		
-		Browser browser;
-		
-		CommandLink(Browser browser) {
-			super(browser, "txmcommand");
-			this.browser = browser;
-		}
-		
-		@Override
-		public Object function(Object[] arguments) {
-			if (arguments.length == 0) return null;
-			
-			HashMap<String, String> params = new HashMap<>();
-			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
-				IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
-				ICommandService cmdService = window.getService(ICommandService.class);
-				Command cmd = cmdService.getCommand(id);
-				
-				// get the parameter
-				ArrayList<Parameterization> parameters = new ArrayList<>();
-				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: unknown parameter id=" + k);
-					}
-				}
-				
-				// build the parameterized command
-				ParameterizedCommand pc = new ParameterizedCommand(cmd, parameters.toArray(new Parameterization[parameters.size()]));
-				
-				// execute the command
-				IHandlerService handlerService = window.getService(IHandlerService.class);
-				try {
-					handlerService.executeCommand(pc, null);
-				}
-				catch (Exception e) {
-					e.printStackTrace();
-				}
-			}
-			else {
-				System.out.println("Cannot call txmcommand without 'id' parameter: " + params);
-			}
-			return arguments;
-		}
-	}
-}
Index: tmp/org.txm.rcp/src/main/java/org/txm/rcp/editors/TXMEditor.java
===================================================================
--- tmp/org.txm.rcp/src/main/java/org/txm/rcp/editors/TXMEditor.java	(revision 3104)
+++ tmp/org.txm.rcp/src/main/java/org/txm/rcp/editors/TXMEditor.java	(revision 3105)
@@ -761,6 +761,7 @@
 	
 	@Override
 	public final void setFocus() {
+		if (this.parent.isDisposed()) return; // avoid SWTException
 		
 		this.parent.setFocus();
 		
Index: tmp/org.txm.rcp/src/main/java/org/txm/rcp/editors/TXMBrowserEditor.java
===================================================================
--- tmp/org.txm.rcp/src/main/java/org/txm/rcp/editors/TXMBrowserEditor.java	(revision 0)
+++ tmp/org.txm.rcp/src/main/java/org/txm/rcp/editors/TXMBrowserEditor.java	(revision 3105)
@@ -0,0 +1,678 @@
+// Copyright © 2010-2020 ENS de Lyon., University of Franche-Comté
+// 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.rcp.editors;
+
+import java.util.List;
+
+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.ProgressEvent;
+import org.eclipse.swt.browser.ProgressListener;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.layout.FormAttachment;
+import org.eclipse.swt.layout.FormData;
+import org.eclipse.swt.layout.FormLayout;
+import org.eclipse.swt.layout.RowData;
+import org.eclipse.swt.layout.RowLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Menu;
+import org.eclipse.ui.internal.browser.BrowserViewer;
+import org.eclipse.ui.internal.browser.WebBrowserEditor;
+import org.txm.objects.Edition;
+import org.txm.objects.Page;
+import org.txm.objects.Project;
+import org.txm.objects.Text;
+import org.txm.rcp.IImageKeys;
+import org.txm.rcp.StatusLine;
+import org.txm.rcp.messages.TXMUIMessages;
+
+/**
+ * Call the internal browser of RCP specialized for TXM editions.
+ * 
+ * A Text can be set then the user can browse pages and others texts of the same corpus
+ * 
+ * @author mdecorde.
+ */
+@SuppressWarnings("restriction")
+public class TXMBrowserEditor extends WebBrowserEditor {
+	
+	/** The Constant ID. */
+	public final static String ID = "org.txm.rcp.editors.TXMBrowser"; //$NON-NLS-1$
+	
+	private ProgressListener progresslistener;
+	
+	private List<String> wordids;
+	
+	private List<String> lineids;
+	
+	/** The edition. */
+	Edition edition;
+	
+	/** The current page. */
+	Page currentPage;
+	
+	/** The page_label. */
+	Label page_label;
+	
+	/**
+	 * Instantiates a new txm browser.
+	 */
+	public TXMBrowserEditor() {
+		
+	}
+	
+	/**
+	 * Gets the browser.
+	 *
+	 * @return the browser
+	 */
+	public Browser getBrowser() {
+		BrowserViewer webbrowser = this.webBrowser;
+		return webbrowser.getBrowser();
+	}
+	
+	@Override
+	public void setPartName(String partName) {
+		super.setPartName(partName);
+	}
+	
+	@Override
+	public void setTitleImage(Image titleImage) {
+		super.setTitleImage(titleImage);
+	}
+	
+	/**
+	 * 
+	 * @param wordids2 all the words to highlight
+	 * @param lineids2 the words to highlight better and to scroll to
+	 */
+	public void setWordsIds(List<String> wordids2, List<String> lineids2) {
+		this.wordids = wordids2;
+		this.lineids = lineids2;
+		if (progresslistener != null)
+			this.getBrowser().removeProgressListener(progresslistener);
+		progresslistener = new ProgressListener() {
+			
+			@Override
+			public void changed(ProgressEvent event) {}
+			
+			@Override
+			public void completed(ProgressEvent event) {
+				Page currentpage = getCurrentPage();
+				// System.out.println("Highlight ! "+currentpage.getEdition().getText()+" wordids ="+wordids);
+				
+				for (String wordid : wordids) {
+					String highlightscript = "try { var elt = document.getElementById(\"" + wordid + "\");" + //$NON-NLS-1$ //$NON-NLS-2$
+							"elt.style.backgroundColor=\"#F9D0D0\";" //$NON-NLS-1$
+							+
+							"elt.style.paddingLeft=\"3px\";" + //$NON-NLS-1$
+							"elt.style.paddingRight=\"3px\";" + //$NON-NLS-1$
+							"elt.style.paddingTop=\"1px\";" + //$NON-NLS-1$
+							"elt.style.paddingBottom=\"1px\";" + //$NON-NLS-1$
+							"} catch (e) { };"; //$NON-NLS-1$
+					
+					getBrowser().execute(highlightscript);
+				}
+				
+				for (String wordid : lineids) {
+					String highlightscript = "try { var elt = document.getElementById(\"" + wordid + "\");" + //$NON-NLS-1$ //$NON-NLS-2$
+							"elt.style.backgroundColor=\"#F9A0A0\";" + //$NON-NLS-1$
+							"elt.style.paddingLeft=\"3px\";" + //$NON-NLS-1$
+							"elt.style.paddingRight=\"3px\";" + //$NON-NLS-1$
+							"elt.style.paddingTop=\"1px\";" + //$NON-NLS-1$
+							"elt.style.paddingBottom=\"1px\";" + //$NON-NLS-1$
+							"} catch (e) { };"; //$NON-NLS-1$
+					
+					getBrowser().execute(highlightscript);
+				}
+				if (lineids.size() > 0) {
+					String script = "try { document.getElementById(\"" + lineids.get(0) + "\").scrollIntoView(true); } catch (e) { };"; //$NON-NLS-1$ //$NON-NLS-2$
+					getBrowser().execute(script);
+				}
+			}
+		};
+		getBrowser().addProgressListener(progresslistener);
+	}
+	
+	/**
+	 * Sets the edition.
+	 *
+	 * @param edition the new edition
+	 */
+	public void setEdition(Edition edition) {
+		this.edition = edition;
+	}
+	
+	/**
+	 * 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) {
+		edition = page.getEdition();
+		currentPage = page;
+		this.webBrowser.setURL(currentPage.toURL());
+		page_label.setText(makePageLabel());
+	}
+	
+	/**
+	 * First text.
+	 */
+	public void firstText() {
+		Text current = this.currentPage.getEdition().getText();
+		Project corpus = current.getProject();
+		Text firstText = corpus.getFirstText();
+		
+		if (firstText != null) {
+			String editionName = corpus.getDefaultEditionName();
+			currentPage = firstText.getEdition(editionName).getFirstPage();
+			if (currentPage == null) {
+				StatusLine.setMessage(TXMUIMessages.noPreviousText);
+				return;
+			}
+			this.setEdition(firstText.getEdition(editionName));
+			this.webBrowser.setURL(currentPage.toURL());
+			page_label.setText(makePageLabel());
+		}
+	}
+	
+	/**
+	 * Last text.
+	 */
+	public void lastText() {
+		Text current = this.currentPage.getEdition().getText();
+		Project b = current.getProject();
+		Text lastText = b.getLastText();
+		
+		if (lastText != null) {
+			currentPage = lastText.getEdition(b.getDefaultEditionName()).getFirstPage();
+			if (currentPage == null) {
+				StatusLine.setMessage(TXMUIMessages.noTextNext);
+				return;
+			}
+			this.setEdition(lastText.getEdition(b.getDefaultEditionName()));
+			this.webBrowser.setURL(currentPage.toURL());
+			page_label.setText(makePageLabel());
+		}
+	}
+	
+	/**
+	 * First page.
+	 */
+	public void firstPage() {
+		// System.out.println(Messages.TxmBrowser_1+currentPage);
+		currentPage = edition.getFirstPage();
+		this.webBrowser.setURL(currentPage.toURL());
+		page_label.setText(makePageLabel());
+	}
+	
+	/**
+	 * Last page.
+	 */
+	public void lastPage() {
+		// System.out.println(Messages.TxmBrowser_2+currentPage);
+		
+		if (currentPage != null && currentPage.getFile().equals(edition.getLastPage().getFile()))
+			return;
+		currentPage = edition.getLastPage();
+		this.webBrowser.setURL(currentPage.toURL());
+		page_label.setText(makePageLabel());
+	}
+	
+	/**
+	 * Previous page.
+	 */
+	public void previousPage() {
+		// System.out.println(Messages.TxmBrowser_3+currentPage);
+		if (currentPage != null) {
+			Page previous = edition.getPreviousPage(currentPage);
+			if (previous == currentPage) {
+				previousText(true);
+			}
+			else {
+				currentPage = previous;
+				this.webBrowser.setURL(currentPage.toURL());
+			}
+		}
+		else
+			firstPage();
+		page_label.setText(makePageLabel());
+	}
+	
+	/**
+	 * Next page.
+	 */
+	public void nextPage() {
+		// System.out.println(Messages.TxmBrowser_4+currentPage);
+		if (currentPage != null) {
+			Page next = edition.getNextPage(currentPage);
+			if (currentPage == next) {
+				nextText();
+			}
+			else {
+				currentPage = next;
+				this.webBrowser.setURL(currentPage.toURL());
+			}
+			
+		}
+		else
+			firstPage();
+		page_label.setText(makePageLabel());
+	}
+	
+	/**
+	 * Previous text.
+	 * 
+	 * @param fromNextText
+	 */
+	public void previousText(boolean fromNextText) {
+		
+		Text current = this.currentPage.getEdition().getText();
+		Project corpus = current.getProject();
+		Text previousText = corpus.getPreviousText(current);
+		
+		if (previousText != null) {
+			String editionName = corpus.getDefaultEditionName();
+			if (fromNextText) {
+				currentPage = previousText.getEdition(editionName).getLastPage();
+			}
+			else {
+				currentPage = previousText.getEdition(editionName).getFirstPage();
+			}
+			if (currentPage == null) {
+				StatusLine.setMessage(TXMUIMessages.noPreviousText);
+				return;
+			}
+			this.setEdition(previousText.getEdition(editionName));
+			this.webBrowser.setURL(currentPage.toURL());
+			page_label.setText(makePageLabel());
+		}
+		// System.out.println("Previous texts "+previousText);
+	}
+	
+	/**
+	 * Next text.
+	 */
+	public void nextText() {
+		Text current = this.currentPage.getEdition().getText();
+		Project b = current.getProject();
+		Text nextText = b.getNextText(current);
+		
+		if (nextText != null) {
+			currentPage = nextText.getEdition(b.getDefaultEditionName()).getFirstPage();
+			if (currentPage == null) {
+				StatusLine.setMessage(TXMUIMessages.noTextNext);
+				return;
+			}
+			this.setEdition(nextText.getEdition(b.getDefaultEditionName()));
+			this.webBrowser.setURL(currentPage.toURL());
+			page_label.setText(makePageLabel());
+		}
+		// System.out.println("Next texts "+nextText);
+	}
+	
+	/*
+	 * (non-Javadoc)
+	 * @see org.eclipse.ui.internal.browser.WebBrowserEditor#createPartControl(org.eclipse.swt.widgets.Composite)
+	 */
+	@Override
+	public void createPartControl(Composite parent) {
+		try {
+			super.createPartControl(parent);
+		}
+		catch (Exception e) {
+			System.err.println(TXMUIMessages.couldNotLaunchTheInternalWebBrowserYouMustSetThatParameterInThePreferencesMenuColonGeneralSupWebNavigator);
+			return;
+		}
+		
+		RowLayout navigLayout = new RowLayout(SWT.HORIZONTAL);
+		navigLayout.justify = true;
+		Composite panneau = new Composite(parent, SWT.NONE);
+		panneau.setLayout(navigLayout);
+		
+		RowLayout subLayout = new RowLayout(SWT.HORIZONTAL);
+		subLayout.pack = true;
+		subLayout.center = true;
+		subLayout.marginBottom = subLayout.marginHeight = 0;
+		subLayout.marginTop = subLayout.marginWidth = 0;
+		Composite subPanneau = new Composite(panneau, SWT.NONE);
+		subPanneau.setLayout(subLayout);
+		subPanneau.setLayoutData(new RowData(450, 22));
+		
+		Button firstText = new Button(subPanneau, SWT.FLAT);
+		Button previousText = new Button(subPanneau, SWT.FLAT);
+		Button first = new Button(subPanneau, SWT.FLAT | SWT.PUSH);
+		Button previous = new Button(subPanneau, SWT.FLAT | SWT.PUSH);
+		page_label = new Label(subPanneau, SWT.NONE);
+		Button next = new Button(subPanneau, SWT.FLAT | SWT.PUSH);
+		Button last = new Button(subPanneau, SWT.FLAT | SWT.PUSH);
+		Button nextText = new Button(subPanneau, SWT.FLAT | SWT.PUSH);
+		Button lastText = new Button(subPanneau, SWT.FLAT | SWT.PUSH);
+		
+		// set sizes
+		page_label.setLayoutData(new RowData(50, 20));
+		firstText.setLayoutData(new RowData(30, 20));
+		first.setLayoutData(new RowData(30, 20));
+		previous.setLayoutData(new RowData(30, 20));
+		next.setLayoutData(new RowData(30, 20));
+		last.setLayoutData(new RowData(30, 20));
+		nextText.setLayoutData(new RowData(30, 20));
+		previousText.setLayoutData(new RowData(30, 20));
+		lastText.setLayoutData(new RowData(30, 20));
+		
+		
+		// set labels
+		page_label.setText(""); //$NON-NLS-1$
+		firstText.setImage(IImageKeys.getImage(IImageKeys.CTRLREWINDSTART));
+		firstText.setToolTipText("|<<");
+		previousText.setImage(IImageKeys.getImage(IImageKeys.CTRLREWIND));
+		previousText.setToolTipText(TXMUIMessages.previousText);
+		first.setImage(IImageKeys.getImage(IImageKeys.CTRLSTART));
+		first.setToolTipText(TXMUIMessages.common_beginning);
+		previous.setImage(IImageKeys.getImage(IImageKeys.CTRLREVERSE));
+		previous.setToolTipText(TXMUIMessages.previousPage);
+		next.setImage(IImageKeys.getImage(IImageKeys.CTRLPLAY));
+		next.setToolTipText(TXMUIMessages.nextPage);
+		last.setImage(IImageKeys.getImage(IImageKeys.CTRLEND));
+		last.setToolTipText(TXMUIMessages.common_end);
+		nextText.setImage(IImageKeys.getImage(IImageKeys.CTRLFASTFORWARD));
+		nextText.setToolTipText(TXMUIMessages.nextText);
+		lastText.setImage(IImageKeys.getImage(IImageKeys.CTRLFASTFORWARDEND));
+		lastText.setToolTipText(">>|");
+		
+		
+		// set listeners
+		first.addSelectionListener(new SelectionListener() {
+			
+			@Override
+			public void widgetDefaultSelected(SelectionEvent e) {
+				firstPage();
+			}
+			
+			@Override
+			public void widgetSelected(SelectionEvent e) {
+				firstPage();
+			}
+		});
+		previous.addSelectionListener(new SelectionListener() {
+			
+			@Override
+			public void widgetDefaultSelected(SelectionEvent e) {
+				previousPage();
+			}
+			
+			@Override
+			public void widgetSelected(SelectionEvent e) {
+				previousPage();
+			}
+		});
+		next.addSelectionListener(new SelectionListener() {
+			
+			@Override
+			public void widgetDefaultSelected(SelectionEvent e) {
+				nextPage();
+			}
+			
+			@Override
+			public void widgetSelected(SelectionEvent e) {
+				nextPage();
+			}
+		});
+		last.addSelectionListener(new SelectionListener() {
+			
+			@Override
+			public void widgetDefaultSelected(SelectionEvent e) {
+				lastPage();
+			}
+			
+			@Override
+			public void widgetSelected(SelectionEvent e) {
+				lastPage();
+			}
+		});
+		nextText.addSelectionListener(new SelectionListener() {
+			
+			@Override
+			public void widgetDefaultSelected(SelectionEvent e) {
+				nextText();
+			}
+			
+			@Override
+			public void widgetSelected(SelectionEvent e) {
+				nextText();
+			}
+		});
+		// 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();
+			}
+		});
+		
+		subPanneau.pack();
+		panneau.pack();
+		
+		FormLayout parentLayout = new FormLayout();
+		
+		FormData datatop = new FormData();
+		datatop.top = new FormAttachment(0, 0);
+		datatop.left = new FormAttachment(0, 0);
+		datatop.right = new FormAttachment(100, 0);
+		datatop.bottom = new FormAttachment(panneau, 0);
+		webBrowser.setLayoutData(datatop);
+		
+		FormData databottom = new FormData(200, 30);
+		databottom.bottom = new FormAttachment(100, 0);
+		databottom.left = new FormAttachment(30, -100);
+		databottom.right = new FormAttachment(80, 100);
+		panneau.setLayoutData(databottom);
+		
+		parent.setLayout(parentLayout);
+		parent.pack();
+		
+		MenuManager menuManager = new MenuManager();
+		Menu menu = menuManager.createContextMenu(getBrowser());
+		
+		// Set the MenuManager
+		getBrowser().setMenu(menu);
+		ISelectionProvider selProvider = new ISelectionProvider() {
+			
+			@Override
+			public void setSelection(ISelection selection) {}
+			
+			@Override
+			public void removeSelectionChangedListener(ISelectionChangedListener listener) {}
+			
+			@Override
+			public ISelection getSelection() {
+				ITextSelection sel = new ITextSelection() {
+					
+					@Override
+					public boolean isEmpty() {
+						return false;
+					}
+					
+					@Override
+					public String getText() {
+						return 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) {}
+		};
+		getSite().registerContextMenu(menuManager, selProvider);
+		getSite().setSelectionProvider(selProvider);
+		
+		// System.out.println("Browser menu: "+getBrowser().getMenu());
+	}
+	
+	static String SCRIPT01 = "var html = \"\";" +
+			"if (typeof window.getSelection != \"undefined\") {" + // modern Web browsers
+			"var sel = window.getSelection();" +
+			"if (sel.rangeCount) {" +
+			"var container = document.createElement(\"div\");" +
+			"for (var i = 0, len = sel.rangeCount; i < len; ++i) {" +
+			"container.appendChild(sel.getRangeAt(i).cloneContents());" +
+			"}" +
+			"html = container.innerHTML;" +
+			"}" +
+			"} else if (typeof document.selection != \"undefined\") {" + // for IE < 11
+			"if (document.selection.type == \"Text\") {" +
+			"html = document.selection.createRange().htmlText;" +
+			"}" +
+			"}" +
+			"return html";
+	
+	// return the span@id of the current selection
+	static String SCRIPT02 = "function getChildren(node) {\n"
+			+ "if (node.children != \"undefined\")\n"
+			+ "	return node.children;\n"
+			+ "else \n"
+			+ "return node.ChildNodes;\n"
+			+ "}\n"
+			+ "findSpans = function findSpans(c, a) {\n" +
+			"    for (var i = 0 ; i < c.length ; i++) {\n" +
+			"        if (c.item(i).tagName == \"SPAN\") {\n" +
+			"            var id = c.item(i).getAttribute(\"id\")\n" +
+			"            if (id.indexOf(\"w_\") == 0)\n" +
+			"                a.push(id);\n" +
+			"        } else if (c.item(i).nodeType == 1) {\n" +
+			"            findSpans(c.item(i).children, a);\n" +
+			"        }\n" +
+			"    }\n" +
+			"}\n" +
+			"    var all = [];" +
+			"    var sel = window.getSelection();" +
+			"    if (sel.rangeCount == 0){" +
+			"        return all;" +
+			"    }" +
+			"\n" +
+			"    var range = sel.getRangeAt(0);" +
+			"    var frag = range.cloneContents();alert(frag);alert(frag.children);" +
+			"    findSpans(frag.children, all);" +
+			"    return all;";
+	
+	public String getTextSelectionDOM() {
+		return ((String) getBrowser().evaluate(SCRIPT01));
+	}
+	
+	public Object getWordIDsSelection() {
+		System.out.println("WORDS IDS " + getBrowser().evaluate(SCRIPT02));
+		return getBrowser().evaluate(SCRIPT02);
+	}
+	
+	public String getTextSelection() {
+		System.out.println("DOM=" + getTextSelectionDOM());
+		String rez = getTextSelectionDOM().replaceAll("<[^>]+>", "");
+		System.out.println("STR=" + rez);
+		return rez;
+	}
+	
+	/**
+	 * Gets the current page.
+	 *
+	 * @return the current page
+	 */
+	public Page getCurrentPage() {
+		return currentPage;
+	}
+}

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

Index: tmp/org.txm.rcp/src/main/java/org/txm/rcp/editors/TXMEditorToolBar.java
===================================================================
--- tmp/org.txm.rcp/src/main/java/org/txm/rcp/editors/TXMEditorToolBar.java	(revision 3104)
+++ tmp/org.txm.rcp/src/main/java/org/txm/rcp/editors/TXMEditorToolBar.java	(revision 3105)
@@ -55,6 +55,8 @@
 	
 	private ToolBarManager manager;
 	
+	private DropDownCheckToolItem openCloseButton;
+	
 	/**
 	 * 
 	 * The parent layout must be a GridLayout.
@@ -196,7 +198,7 @@
 	public Group installAlternativesGroup(final String groupTitle, String buttonToolTip, String openIconFilePath, String closeIconFilePath, boolean showGroup,
 			SelectionListener selectionListener, List<String> modes, List<SelectionListener> modeSelectionListeners) {
 		
-		final DropDownCheckToolItem openCloseButton = new DropDownCheckToolItem(this, buttonToolTip, openIconFilePath, closeIconFilePath);
+		openCloseButton = new DropDownCheckToolItem(this, buttonToolTip, openIconFilePath, closeIconFilePath);
 		
 		openCloseButton.addSelectionListener(new SelectionListener() {
 			
@@ -348,4 +350,8 @@
 		
 		return groups.get(id).isVisible();
 	}
+	
+	public DropDownCheckToolItem getOpenCloseButton() {
+		return openCloseButton;
+	}
 }
