Index: tmp/org.txm.statsengine.r.rcp/.project
===================================================================
--- tmp/org.txm.statsengine.r.rcp/.project	(revision 0)
+++ tmp/org.txm.statsengine.r.rcp/.project	(revision 236)
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>org.txm.statsengine.r.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.statsengine.r.rcp/.project
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/org.txm.statsengine.r.rcp/src/org/txm/statsengine/r/rcp/perspectives/RPerspective.java
===================================================================
--- tmp/org.txm.statsengine.r.rcp/src/org/txm/statsengine/r/rcp/perspectives/RPerspective.java	(revision 0)
+++ tmp/org.txm.statsengine.r.rcp/src/org/txm/statsengine/r/rcp/perspectives/RPerspective.java	(revision 236)
@@ -0,0 +1,66 @@
+// 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.statsengine.r.rcp.perspectives;
+
+import org.eclipse.ui.IFolderLayout;
+import org.eclipse.ui.IPageLayout;
+import org.eclipse.ui.IPerspectiveFactory;
+import org.eclipse.ui.console.IConsoleConstants;
+import org.txm.rcpapplication.views.corpora.CorporaView;
+import org.txm.rcpapplication.views.fileexplorer.Explorer;
+import org.txm.statsengine.r.rcp.views.RConsole;
+import org.txm.statsengine.r.rcp.views.RVariablesView;
+
+// TODO: Auto-generated Javadoc
+/**
+ * The Class RPerspective.
+ */
+public class RPerspective implements IPerspectiveFactory {
+	
+	/* (non-Javadoc)
+	 * @see org.eclipse.ui.IPerspectiveFactory#createInitialLayout(org.eclipse.ui.IPageLayout)
+	 */
+	@Override
+	public void createInitialLayout(IPageLayout layout) {
+		String editorArea = layout.getEditorArea();
+		layout.setEditorAreaVisible(true);
+		layout.setFixed(false);
+		
+		IFolderLayout left = layout.createFolder("leftR", IPageLayout.LEFT, 0.25f, editorArea); //$NON-NLS-1$
+		left.addView(RVariablesView.ID);
+		left.addView(CorporaView.ID);
+		left.addView(Explorer.ID);
+		
+		//if olderLayout bottom = layout.createFolder("bottomR", IPageLayout.BOTTOM, 0.66f, editorArea); //$NON-NLS-1$
+		layout.addView(IConsoleConstants.ID_CONSOLE_VIEW, IPageLayout.BOTTOM, 0.8f, editorArea);
+		layout.addView(RConsole.ID, IPageLayout.BOTTOM, 0.5f, editorArea);
+		
+		
+		RVariablesView.reload();
+	}
+}

Property changes on: tmp/org.txm.statsengine.r.rcp/src/org/txm/statsengine/r/rcp/perspectives/RPerspective.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/org.txm.statsengine.r.rcp/src/org/txm/statsengine/r/rcp/TXMRServeWatcher.java
===================================================================
--- tmp/org.txm.statsengine.r.rcp/src/org/txm/statsengine/r/rcp/TXMRServeWatcher.java	(revision 0)
+++ tmp/org.txm.statsengine.r.rcp/src/org/txm/statsengine/r/rcp/TXMRServeWatcher.java	(revision 236)
@@ -0,0 +1,108 @@
+// 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.statsengine.r.rcp;
+
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.swt.widgets.Display;
+import org.txm.rcpapplication.Messages;
+import org.txm.rcpapplication.views.corpora.CorporaView;
+import org.txm.statsengine.r.core.RserveWatcher;
+
+// TODO: Auto-generated Javadoc
+/**
+ * Watch if RServe is running
+ */
+@Deprecated
+public class TXMRServeWatcher extends RserveWatcher{
+	
+	/** The parent. */
+	private Display parent;
+
+	/**
+	 * Instantiates a new tXMR serve watcher.
+	 *
+	 * @param parent the parent
+	 */
+	TXMRServeWatcher(Display parent)
+	{
+		this.parent = parent;
+	}
+	
+	/* (non-Javadoc)
+	 * @see org.txm.RserveWatcher#restart()
+	 */
+	@Override
+	public boolean restart()
+	{
+		parent.syncExec(new Runnable(){
+		      @Override
+			public void run(){
+		    	  MessageDialog d =
+					    new MessageDialog(
+					      parent.getActiveShell(),
+					      Messages.TXMRServeWatcher_0,
+					      null,
+					      Messages.TXMRServeWatcher_1,
+					      MessageDialog.ERROR,
+					      new String[] { Messages.TXMRServeWatcher_2 },
+					      0);
+					    d.open();
+		      }
+		    });
+		
+		boolean ret = super.restart();
+		
+		parent.syncExec(new Runnable(){
+		      @Override
+			public void run(){
+		    	  MessageDialog d =
+					    new MessageDialog(
+					      parent.getActiveShell(),
+					      Messages.TXMRServeWatcher_3,
+					      null,
+					      Messages.TXMRServeWatcher_4,
+					      MessageDialog.ERROR,
+					      new String[] { Messages.TXMRServeWatcher_2 },
+					      0);
+					    d.open();
+		      }
+		    });
+		
+		if (ret)
+		{
+			parent.syncExec(new Runnable(){
+			      @Override
+				public void run(){
+			    	  CorporaView.reload();
+			      }
+			    });
+		}
+		
+		return ret;
+	}
+}

Property changes on: tmp/org.txm.statsengine.r.rcp/src/org/txm/statsengine/r/rcp/TXMRServeWatcher.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/org.txm.statsengine.r.rcp/src/org/txm/statsengine/r/rcp/views/RConsole.java
===================================================================
--- tmp/org.txm.statsengine.r.rcp/src/org/txm/statsengine/r/rcp/views/RConsole.java	(revision 0)
+++ tmp/org.txm.statsengine.r.rcp/src/org/txm/statsengine/r/rcp/views/RConsole.java	(revision 236)
@@ -0,0 +1,309 @@
+// 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.statsengine.r.rcp.views;
+
+import org.eclipse.jface.action.Action;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.custom.StyledText;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.ui.IViewPart;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.part.ViewPart;
+import org.txm.Toolbox;
+import org.txm.rcpapplication.IImageKeys;
+import org.txm.rcpapplication.Messages;
+import org.txm.statsengine.r.core.RWorkspace;
+import org.txm.statsengine.r.core.RWorkspaceException;
+import org.txm.utils.MessagePrinter;
+import org.txm.utils.StreamHog;
+import org.txm.utils.logger.Log;
+
+/**
+ * display the R logs only 
+ * @author mdecorde.
+ */
+public class RConsole extends ViewPart implements MessagePrinter {
+
+	/** The ID. */
+	public static String ID = "org.txm.rcpapplication.views.RConsole"; //$NON-NLS-1$
+
+	/** The text area. */
+	private StyledText textArea;
+	private Display display;
+	boolean readyToDisplay = false;
+	
+	//	/** The out. */
+	//	private static PrintStream out;
+	//
+	//	/** The err. */
+	//	private static PrintStream err;
+	//
+	//	/** The quit. */
+	//	private boolean quit;
+	//
+	//	/** The reader. */
+	//	private Thread reader;
+	//
+	//	/** The reader2. */
+	//	private Thread reader2;
+	//
+	//	/** The pin. */
+	//	PipedInputStream pin = new PipedInputStream();
+	//
+	//	/** The pin2. */
+	//	PipedInputStream pin2 = new PipedInputStream();
+	//
+	//	/** The output. */
+	//	static PrintStream output = System.out;
+	//
+	//	/** The errput. */
+	//	static PrintStream errput = System.err;
+	//
+	//	/** The blue. */
+	//	static Color blue;
+	//
+	//	/** The red. */
+	//	static Color red;
+
+	/**
+	 * Instantiates a new r console.
+	 */
+	public RConsole() {
+		//		try {
+		//			PipedOutputStream pout = new PipedOutputStream(pin);
+		//			out = new PrintStream(pout, true);
+		//
+		//			new PipedOutputStream(pin2);
+		//			err = new PrintStream(pout, true);
+		//
+		//		} catch (IOException e) {
+		//			org.txm.rcpapplication.utils.Logger.printStackTrace(e);
+		//		}
+		//
+		//		reader = new Thread(this);
+		//		reader.setDaemon(true);
+		//		reader.start();
+		//		reader2 = new Thread(this);
+		//		reader2.setDaemon(true);
+		//		reader2.start();
+	}
+
+	/**
+	 * Redirect.
+	 *
+	 * @param b the b
+	 */
+	public static void redirect(boolean b) {
+		//		if (b) {
+		//			System.setOut(out);
+		//			System.setErr(err);
+		//		} else {
+		//			System.setOut(output);
+		//			System.setErr(errput);
+		//		}
+	}
+
+	//	/**
+	//	 * Lecture de la sortie standard.
+	//	 *
+	//	 * @param in the in
+	//	 * @return the string
+	//	 * @throws IOException Signals that an I/O exception has occurred.
+	//	 */
+	//	protected synchronized String readLine(PipedInputStream in)
+	//			throws IOException {
+	//		String input = ""; //$NON-NLS-1$
+	//		do {
+	//			int available = in.available();
+	//			if (available == 0)
+	//				break;
+	//			byte b[] = new byte[available];
+	//			in.read(b);
+	//			input = input + new String(b, 0, b.length);
+	//		} while (!input.endsWith("\n") && !input.endsWith("\r\n") && !quit); //$NON-NLS-1$ //$NON-NLS-2$
+	//		return input;
+	//	}
+	//
+	//	/* (non-Javadoc)
+	//	 * @see java.lang.Runnable#run()
+	//	 */
+	//	@Override
+	//	public synchronized void run() {
+	//		try {
+	//			while (Thread.currentThread() == reader) {
+	//				try {
+	//					this.wait(100);
+	//				} catch (InterruptedException ie) {
+	//				}
+	//				if (pin.available() != 0) {
+	//					String input = this.readLine(pin);
+	//					textArea.append(input);
+	//				}
+	//				if (quit)
+	//					return;
+	//			}
+	//
+	//			while (Thread.currentThread() == reader2) {
+	//				try {
+	//					this.wait(100);
+	//				} catch (InterruptedException ie) {
+	//				}
+	//				if (pin2.available() != 0) {
+	//					String input = this.readLine(pin2);
+	//					textArea.append(input);
+	//				}
+	//
+	//				if (quit)
+	//					return;
+	//			}
+	//		} catch (Exception e) {
+	//			textArea.append(Messages.GroovyConsole_4);
+	//			textArea.append(Messages.GroovyConsole_5 + e);
+	//		}
+	//	}
+
+	/* (non-Javadoc)
+	 * @see org.eclipse.ui.part.WorkbenchPart#createPartControl(org.eclipse.swt.widgets.Composite)
+	 */
+	@Override
+	public void createPartControl(Composite parent) {
+		display = parent.getDisplay();
+
+		//	blue = parent.getDisplay().getSystemColor(SWT.COLOR_BLUE);
+		//	red = parent.getDisplay().getSystemColor(SWT.COLOR_RED);
+
+		textArea = new StyledText(parent, SWT.BORDER | SWT.MULTI | SWT.V_SCROLL
+				| SWT.H_SCROLL);
+		textArea.setEditable(false);
+
+		textArea.setLayoutData(new GridData(GridData.FILL_BOTH
+				| GridData.GRAB_HORIZONTAL | GridData.GRAB_VERTICAL));
+
+		// Custom Action for the View's Menu  
+		Action lCustomAction = new Action() {
+			public void run() {  
+				clear();
+			} 
+		};
+		lCustomAction.setId("org.txm.rcpapplication.views.RConsole.clear"); //$NON-NLS-1$
+		//lCustomAction.setText("Clear");  
+		lCustomAction.setImageDescriptor(IImageKeys.getImageDescriptor(IImageKeys.ACTION_DELETE)); 
+		getViewSite().getActionBars().getToolBarManager().add(lCustomAction); 
+
+		connectToRWorkspace();
+	}
+	
+	public void reconnectToRWorkspace() {
+		readyToDisplay = false;
+		connectToRWorkspace();
+	}
+	
+	public void connectToRWorkspace() {
+		if (!readyToDisplay && Toolbox.isStatEngineInitialized()) {
+			RWorkspace rw = null;
+			Log.warning(Messages.RConsole_0);
+			try {
+				rw = RWorkspace.getRWorkspaceInstance();
+				if (rw == null) return;
+				StreamHog errorLogger = rw.getErrorLogger();
+				StreamHog inputLogger = rw.getInputLogger();
+				//if (errorLogger.getMessagePrinter() == null) {
+					//System.out.println("SET MESSAGEPRINTER OF THE RCONSOLE");
+					if (errorLogger != null)
+						errorLogger.addMessagePrinter(this);
+					if (inputLogger != null)
+						inputLogger.addMessagePrinter(this);
+					readyToDisplay = true;
+				//}
+			} catch (RWorkspaceException e) {
+				System.out.println(Messages.RConsole_1+e);
+				Log.printStackTrace(e);
+			}
+		}
+	}
+
+	/**
+	 * Println.
+	 *
+	 * @param txt the txt
+	 */
+	String txtToPrint;
+	public void println(String txt) {
+		txtToPrint = txt;
+		display.syncExec(new Runnable() {
+			public void run() {
+				if (textArea != null) {
+					textArea.append(txtToPrint + "\n"); //$NON-NLS-1$
+					textArea.setTopIndex(textArea.getLineCount());
+				}
+			}
+		});
+	}
+
+	/**
+	 * Prints the.
+	 *
+	 * @param txt the txt
+	 */
+	public void print(String txt) {
+		txtToPrint = txt;
+		display.syncExec(new Runnable() {
+			public void run() {
+				if (textArea != null) {
+					textArea.append(txtToPrint); //$NON-NLS-1$
+					textArea.setTopIndex(textArea.getLineCount());
+				}
+			}
+		});
+	}
+
+	/* (non-Javadoc)
+	 * @see org.eclipse.ui.part.WorkbenchPart#setFocus()
+	 */
+	@Override
+	public void setFocus() {
+		// TODO Auto-generated method stub
+	}
+
+	public void clear() {
+		if (textArea != null)
+			textArea.setText(""); //$NON-NLS-1$
+	}
+	
+	public static void reload() {
+		for (IWorkbenchWindow window : PlatformUI.getWorkbench().getWorkbenchWindows()) {
+			IViewPart v = window.getActivePage().findView(RConsole.ID);
+			if (v == null) return;
+			RConsole rc = (RConsole) v;
+			rc.reconnectToRWorkspace();
+		}
+	}
+}

Property changes on: tmp/org.txm.statsengine.r.rcp/src/org/txm/statsengine/r/rcp/views/RConsole.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/org.txm.statsengine.r.rcp/src/org/txm/statsengine/r/rcp/views/RVariablesView.java
===================================================================
--- tmp/org.txm.statsengine.r.rcp/src/org/txm/statsengine/r/rcp/views/RVariablesView.java	(revision 0)
+++ tmp/org.txm.statsengine.r.rcp/src/org/txm/statsengine/r/rcp/views/RVariablesView.java	(revision 236)
@@ -0,0 +1,507 @@
+// 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.statsengine.r.rcp.views;
+
+import java.io.File;
+import java.lang.reflect.Method;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.List;
+
+import org.eclipse.jface.action.MenuManager;
+import org.eclipse.jface.viewers.DoubleClickEvent;
+import org.eclipse.jface.viewers.IDoubleClickListener;
+import org.eclipse.jface.viewers.ITreeContentProvider;
+import org.eclipse.jface.viewers.LabelProvider;
+import org.eclipse.jface.viewers.TreeSelection;
+import org.eclipse.jface.viewers.TreeViewer;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.osgi.util.NLS;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.KeyEvent;
+import org.eclipse.swt.events.KeyListener;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Menu;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.part.ViewPart;
+import org.txm.Toolbox;
+import org.txm.ca.core.functions.CA;
+import org.txm.cah.core.functions.CAH;
+import org.txm.cooccurrence.core.functions.Cooccurrence;
+import org.txm.core.results.ITXMResult;
+import org.txm.functions.concordances.Concordance;
+import org.txm.functions.referencer.Referencer;
+import org.txm.index.core.functions.Index;
+import org.txm.lexicaltable.core.statsengine.data.LexicalTable;
+import org.txm.objects.Base;
+import org.txm.progression.core.functions.Progression;
+import org.txm.rcpapplication.IImageKeys;
+import org.txm.rcpapplication.Messages;
+import org.txm.rcpapplication.commands.EditFile;
+import org.txm.rcpapplication.commands.R.CopySelection;
+import org.txm.searchengine.cqp.clientExceptions.CqiClientException;
+import org.txm.searchengine.cqp.corpus.Corpus;
+import org.txm.searchengine.cqp.corpus.CorpusManager;
+import org.txm.searchengine.cqp.corpus.Lexicon;
+import org.txm.searchengine.cqp.corpus.MainCorpus;
+import org.txm.searchengine.cqp.corpus.Partition;
+import org.txm.specificities.core.functions.SpecificitesResult;
+import org.txm.statsengine.r.core.RWorkspace;
+// TODO: Auto-generated Javadoc
+/**
+ * The Class RVariablesView.
+ */
+public class RVariablesView extends ViewPart {
+
+	/** The tv. */
+	TreeViewer tv;
+
+	/** The ID. */
+	public static String ID = "org.txm.rcpapplication.views.RVariablesView"; //$NON-NLS-1$
+
+	/**
+	 * Refresh.
+	 */
+	public static void refresh() {
+		IWorkbenchWindow activeworksbench = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
+		if (activeworksbench == null)
+			return;
+		IWorkbenchPage activepage = activeworksbench.getActivePage();
+		if (activepage == null)
+			return;
+		RVariablesView rview = (RVariablesView) activepage.findView(RVariablesView.ID);
+		if (rview != null)
+			rview.tv.refresh();
+	}
+
+	/**
+	 * Reload.
+	 */
+	public static void reload() {
+
+		IWorkbenchWindow activeworksbench = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
+		if (activeworksbench == null)
+			return;
+		IWorkbenchPage activepage = activeworksbench.getActivePage();
+		if (activepage == null)
+			return;
+		RVariablesView rview = (RVariablesView) activepage.findView(RVariablesView.ID);
+		if (rview != null)
+			rview._reload();
+	}
+
+	/**
+	 * _reload.
+	 */
+	public void _reload() {
+		tv.setContentProvider(new RVariablesTreeProvider());
+		tv.setLabelProvider(new RVariablesLabelProvider());
+		List<MainCorpus> corpora;
+		try {
+			corpora = CorpusManager.getCorpusManager().getCorpora();
+			if (corpora != null)
+			{
+				buildTreeContent(corpora);
+				tv.refresh();
+			}
+		} catch (CqiClientException e) { }
+	}
+	
+	/**
+	 * Builds the tree content.
+	 *
+	 * @param corpora the corpora
+	 */
+	protected void buildTreeContent(List<MainCorpus> corpora)
+	{
+		ArrayList<ITXMResult> notempty = new ArrayList<ITXMResult>(corpora);
+		for(ITXMResult container : corpora)
+		{
+			String symbol = null;
+			try {
+				Method getname = container.getClass().getMethod("getSymbol"); //$NON-NLS-1$
+				symbol = (String)getname.invoke(container);
+			} catch (Exception e2) {}
+
+			if (symbol != null)
+				continue;
+			
+			//System.out.println("check "+container.getName());
+			if (container.getResults().size() > 0
+					//FIXME: commented by SJ for TXMResult implementation
+					//|| container.getSubHasResults().size() > 0
+					)
+			{
+				if (!deepSearch(container))
+					notempty.remove(container);
+			}
+			else
+			{
+				notempty.remove(container);
+			}
+		}
+		tv.setInput(notempty);
+	}
+		
+	/**
+	 * Deep search.
+	 *
+	 * @param container the container
+	 * @return true, if successful
+	 */
+	protected boolean deepSearch(ITXMResult container)
+	{
+		boolean own = hasSymbol(container.getResults());
+		if (own)
+		{
+			return true;
+		}
+		else // continue deeper
+		{
+			
+			for(ITXMResult children : container.getResults())
+			{
+				boolean childrencontainer = deepSearch(children);
+				if (childrencontainer)
+					return true;
+			}
+		}
+		return false;
+	}
+
+	/**
+	 * Checks for symbol.
+	 *
+	 * @param results the results
+	 * @return true, if successful
+	 */
+	private boolean hasSymbol(ArrayList<ITXMResult> results) {
+		String symbol = null;
+		for(Object rez : results)
+		{
+			try {
+				Method getname = rez.getClass().getMethod("getSymbol"); //$NON-NLS-1$
+				symbol = (String)getname.invoke(rez);
+			} catch (Exception e2) {}
+			if (symbol != null)
+				return true;
+		}
+		return false;
+	}
+
+	/* (non-Javadoc)
+	 * @see org.eclipse.ui.part.WorkbenchPart#createPartControl(org.eclipse.swt.widgets.Composite)
+	 */
+	@Override
+	public void createPartControl(Composite parent) {
+		parent.setLayout(new GridLayout(2, true));
+		Button export = new Button(parent, SWT.PUSH);
+		export.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true,
+				false));
+		export.setText(Messages.RVariablesView_1);
+		export.addSelectionListener(new SelectionListener() {
+			@Override
+			public void widgetSelected(SelectionEvent arg0) {
+				//System.out.println("reload");
+				_reload();
+			}
+
+			@Override
+			public void widgetDefaultSelected(SelectionEvent arg0) {	}
+		});
+		
+		Button logs = new Button(parent, SWT.PUSH);
+		logs.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true,	false));
+		logs.setText(Messages.RVariablesView_2);
+		logs.addSelectionListener(new SelectionListener() {
+			@Override
+			public void widgetSelected(SelectionEvent arg0) {
+				//System.out.println("reload");
+				
+				try {
+					File homedir = new File(Toolbox.getParam(Toolbox.USER_TXM_HOME));
+					long time = System.currentTimeMillis();
+					File tmp = new File(homedir, "REvalLogs.txt"); //$NON-NLS-1$
+					RWorkspace.saveEvalLog(tmp);
+					EditFile.openfile(tmp.getAbsolutePath());
+				} catch (Exception e) {
+					// TODO Auto-generated catch block
+					org.txm.rcpapplication.utils.Logger.printStackTrace(e);
+				}
+			}
+
+			@Override
+			public void widgetDefaultSelected(SelectionEvent arg0) {	}
+		});
+
+		tv = new TreeViewer(parent);
+		tv.getTree().setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, true, 2, 1));
+		//_reload();
+
+		tv.addDoubleClickListener(new IDoubleClickListener() {
+			@Override
+			public void doubleClick(DoubleClickEvent event) {
+			}
+		});
+
+		tv.getTree().addKeyListener(new KeyListener() {
+
+			@Override
+			public void keyReleased(KeyEvent e) {				
+			}
+
+			@Override
+			public void keyPressed(KeyEvent e) {
+				/*
+				if (e.keyCode == SWT.DEL) {
+					DeleteObject.delete(tv.getSelection());
+				}
+				else if (e.keyCode == SWT.F5) {
+					reload();
+				}*/
+				if ((char)e.keyCode == 'c' & ((e.stateMask & SWT.CTRL) != 0))
+				{
+					TreeSelection selection = (TreeSelection) tv.getSelection();
+					CopySelection.copyFirst(selection);
+
+				}
+			}
+		});
+
+		MenuManager menuManager = new MenuManager();
+		Menu menu = menuManager.createContextMenu(tv.getTree());
+
+		// Set the MenuManager
+		tv.getTree().setMenu(menu);
+		getSite().registerContextMenu(menuManager, tv);
+		// Make the selection available
+		getSite().setSelectionProvider(tv);
+	}
+
+	/* (non-Javadoc)
+	 * @see org.eclipse.ui.part.WorkbenchPart#setFocus()
+	 */
+	@Override
+	public void setFocus() {
+		// TODO Auto-generated method stub
+
+	}
+
+	/**
+	 * The Class RVariablesLabelProvider.
+	 */
+	public class RVariablesLabelProvider extends LabelProvider{
+
+		/* (non-Javadoc)
+		 * @see org.eclipse.jface.viewers.LabelProvider#getText(java.lang.Object)
+		 */
+		@Override
+		public String getText(Object element) {
+			String name =""; //$NON-NLS-1$
+			String symbol = null;
+
+			try {
+				Method getname = element.getClass().getMethod("getName"); //$NON-NLS-1$
+				name = (String)getname.invoke(element);
+			} catch (Exception e) {}
+
+			try {
+				Method getname = element.getClass().getMethod("getSymbol"); //$NON-NLS-1$
+				symbol = (String)getname.invoke(element);
+			} catch (Exception e) {}
+
+			if (symbol == null)
+				return name;
+			else
+				return NLS.bind(Messages.RVariablesView_9, name, symbol);
+		}
+
+		/* (non-Javadoc)
+		 * @see org.eclipse.jface.viewers.LabelProvider#getImage(java.lang.Object)
+		 */
+		@Override
+		public final Image getImage(Object element) {
+			if (element instanceof Corpus)
+				return IImageKeys.getImage(IImageKeys.CORPUS);
+			else if (element instanceof Partition)
+				return IImageKeys.getImage(IImageKeys.PARTITION);
+			else if (element instanceof Lexicon)
+				return IImageKeys.getImage(IImageKeys.ACTION_FREQUENCY_LIST);
+			else if (element instanceof Index)
+				return IImageKeys.getImage(IImageKeys.ACTION_INDEX);
+			else if (element instanceof SpecificitesResult)
+				return IImageKeys.getImage(IImageKeys.ACTION_SPECIFICITIES);
+			else if (element instanceof Concordance)
+				return IImageKeys.getImage(IImageKeys.ACTION_CONCORDANCES);
+			else if (element instanceof Cooccurrence)
+				return IImageKeys.getImage(IImageKeys.ACTION_COOCCURRENCE);
+			else if (element instanceof LexicalTable)
+				return IImageKeys.getImage(IImageKeys.LEXICALTABLE);
+			else if (element instanceof CA)
+				return IImageKeys.getImage(IImageKeys.ACTION_CORRESPONDANCE_ANALYSIS);
+			else if (element instanceof CAH)
+				return IImageKeys.getImage(IImageKeys.ACTION_CAH);
+			else if (element instanceof Referencer)
+				return IImageKeys.getImage(IImageKeys.ACTION_REFERENCER);
+			else if (element instanceof Progression)
+				return IImageKeys.getImage(IImageKeys.ACTION_PROGRESSION);
+			return null;
+		}
+	}
+
+	/**
+	 * The Class RVariablesTreeProvider.
+	 */
+	public class RVariablesTreeProvider implements ITreeContentProvider {
+
+		/* (non-Javadoc)
+		 * @see org.eclipse.jface.viewers.ITreeContentProvider#getChildren(java.lang.Object)
+		 */
+		@Override
+		public Object[] getChildren(Object element) {
+			//System.out.println("get children of "+element);
+			if (element instanceof ITXMResult) {
+//				List<Object> results = ((HasResults) element).getResults();
+//				ArrayList<ITXMResult> sub = ((HasResults) element).getSubHasResults();
+				//ArrayList<Object> children = new ArrayList<Object>();
+//				children.addAll(sub);
+//				children.addAll(results);
+				
+				ArrayList<ITXMResult> children = ((ITXMResult)element).getDeepResults();
+				
+				for(int i = 0 ; i < children.size() ; i++)
+				{
+					
+					Object obj = children.get(i);
+					//System.out.println("test > "+obj);
+					if (obj instanceof ITXMResult)
+					{
+						//System.out.println("deap "+obj);
+						if (!deepSearch((ITXMResult) obj))
+						{
+							children.remove(i);
+							i--;
+						}
+					}
+					else
+					{
+						String symbol = null;
+						try {
+							Method getname = obj.getClass().getMethod("getSymbol"); //$NON-NLS-1$
+							symbol = (String)getname.invoke(obj);
+						} catch (Exception e) {}
+						//System.out.println("symbol "+symbol);
+						if (symbol == null)
+						{
+							children.remove(i);
+							i--;
+						}
+					}
+				}
+				//System.out.println(""+element+" > "+children);
+				return children.toArray();
+			}
+			return new Object[0];
+		}
+
+		/* (non-Javadoc)
+		 * @see org.eclipse.jface.viewers.ITreeContentProvider#getParent(java.lang.Object)
+		 */
+		@Override
+		public Object getParent(Object element) {
+			Partition partition = null;
+			try {
+				Method getname = element.getClass().getMethod("getPartition"); //$NON-NLS-1$
+				partition = (Partition)getname.invoke(element);
+			} catch (Exception e) {}
+			
+			if (partition == null)
+			{
+				return partition;
+			}
+			
+			Corpus corpus = null;
+			try {
+				Method getname = element.getClass().getMethod("getCorpus"); //$NON-NLS-1$
+				corpus = (Corpus)getname.invoke(element);
+			} catch (Exception e) {}
+			
+			return corpus;
+		}
+		
+		/* (non-Javadoc)
+		 * @see org.eclipse.jface.viewers.ITreeContentProvider#hasChildren(java.lang.Object)
+		 */
+		@Override
+		public boolean hasChildren(Object element) {
+			if (element instanceof ITXMResult) {
+				return getChildren(element).length > 0;
+			}
+			return false;
+		}
+
+		/* (non-Javadoc)
+		 * @see org.eclipse.jface.viewers.IStructuredContentProvider#getElements(java.lang.Object)
+		 */
+		@Override
+		public Object[] getElements(Object element) {
+			Collection<Base> input = (Collection<Base>) element;
+			Object[] objects = new Object[input.size()];
+			Iterator<Base> it = input.iterator();
+			int i = 0;
+			while (it.hasNext()) {
+				objects[i] = it.next();
+				i++;
+			}
+			return objects;
+		}
+
+		/* (non-Javadoc)
+		 * @see org.eclipse.jface.viewers.IContentProvider#dispose()
+		 */
+		@Override
+		public void dispose() {
+		}
+
+		/* (non-Javadoc)
+		 * @see org.eclipse.jface.viewers.IContentProvider#inputChanged(org.eclipse.jface.viewers.Viewer, java.lang.Object, java.lang.Object)
+		 */
+		@Override
+		public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
+		}
+	}
+}

Property changes on: tmp/org.txm.statsengine.r.rcp/src/org/txm/statsengine/r/rcp/views/RVariablesView.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/org.txm.statsengine.r.rcp/src/org/txm/statsengine/r/rcp/handlers/CheckRPackages.java
===================================================================
--- tmp/org.txm.statsengine.r.rcp/src/org/txm/statsengine/r/rcp/handlers/CheckRPackages.java	(revision 0)
+++ tmp/org.txm.statsengine.r.rcp/src/org/txm/statsengine/r/rcp/handlers/CheckRPackages.java	(revision 236)
@@ -0,0 +1,223 @@
+package org.txm.statsengine.r.rcp.handlers;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.List;
+
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.jface.util.Util;
+import org.eclipse.swt.widgets.Shell;
+import org.rosuda.REngine.REXP;
+import org.rosuda.REngine.REXPInteger;
+import org.rosuda.REngine.REXPMismatchException;
+import org.rosuda.REngine.RList;
+import org.txm.Toolbox;
+import org.txm.rcp.handlers.BaseAbstractHandler;
+import org.txm.rcpapplication.TxmPreferences;
+import org.txm.rcpapplication.preferences.AdvancePreferencePage;
+import org.txm.statsengine.r.core.RWorkspace;
+import org.txm.statsengine.r.core.RWorkspaceException;
+import org.txm.statsengine.r.rcp.messages.RUIMessages;
+import org.txm.utils.logger.Log;
+
+public class CheckRPackages extends BaseAbstractHandler {
+
+	public static HashMap<String, String> packages;
+	public static HashMap<String, String> errorMessages;
+	public static HashMap<String, List<String>> depends;
+	{
+		packages = new HashMap<String,String>();
+		errorMessages = new HashMap<String,String>();
+		depends = new HashMap<String,List<String>>();
+		
+		packages.put("textometry", "0.1.4"); //$NON-NLS-1$ //$NON-NLS-2$
+		packages.put("FactoMineR", "1.24"); //$NON-NLS-1$ //$NON-NLS-2$
+		
+		depends.put("textometry", new ArrayList<String>()); //$NON-NLS-1$
+		depends.put("FactoMineR", Arrays.asList("MASS", //$NON-NLS-1$ //$NON-NLS-2$
+				"nnet",  //$NON-NLS-1$
+				"car",  //$NON-NLS-1$
+				"ellipse",  //$NON-NLS-1$
+				"leaps",  //$NON-NLS-1$
+				"lattice",  //$NON-NLS-1$
+				"cluster",  //$NON-NLS-1$
+				"scatterplot3d")); //$NON-NLS-1$
+		
+		errorMessages.put("textometry", RUIMessages.CheckRPackages_0); //$NON-NLS-1$
+		errorMessages.put("FactoMineR", RUIMessages.CheckRPackages_1); //$NON-NLS-1$
+	}
+
+	@Override
+	public Object execute(ExecutionEvent event) throws ExecutionException {
+		
+		if(!super.checkStatsEngine())	{
+			return null;
+		}
+		
+		Shell shell = new Shell();
+		if (check()) {
+			MessageDialog.openInformation(shell, RUIMessages.CheckRPackages_2, RUIMessages.CheckRPackages_3);
+		} else {
+			MessageDialog.openError(shell, RUIMessages.CheckRPackages_4, RUIMessages.CheckRPackages_5);
+		}
+		return null;
+	}
+
+	public static String buildVersion(REXPInteger rExpInteger) throws REXPMismatchException {
+		StringBuffer buff = new StringBuffer(""); //$NON-NLS-1$
+		
+		//RList list = rExpInteger.asList();
+		int[] ints = rExpInteger.asIntegers();
+		for (int i = 0 ; i < rExpInteger.length() ;i++) {
+			buff.append("."+ints[i]); //$NON-NLS-1$
+		}
+		if (buff.length() > 0)
+			return buff.substring(1); // first "."
+
+		return ""; //$NON-NLS-1$
+	}
+
+	public static boolean check() {
+		System.out.print(RUIMessages.CheckRPackages_9);
+		//Log.info("Checking R packages...");
+		
+		String method = "internal"; // default method is internal //$NON-NLS-1$
+		if (Util.isMac()) method = "curl"; //$NON-NLS-1$
+		else if (Util.isLinux()) method = "wget"; //$NON-NLS-1$
+		
+		boolean ret = true;
+		if (Toolbox.isStatEngineInitialized()) {
+			RWorkspace rw = null;
+			try {
+				rw = RWorkspace.getRWorkspaceInstance();
+			} catch (RWorkspaceException e) {
+				Log.printStackTrace(e);
+				System.out.println(RUIMessages.CheckRPackages_13+e);
+				return false;
+			}
+			for (String p : packages.keySet()) {
+				//String v = packages.get(p);
+				//String error = errorMessages.get(p);
+				try {
+					rw.eval("library(\""+p+"\")"); //$NON-NLS-1$ //$NON-NLS-2$
+				} catch (Exception e) {
+					Log.printStackTrace(e);
+					Log.severe(p+" package not installed. Error="+e); //$NON-NLS-1$
+					ret = false;
+				}
+				if (ret) { // check the version and install if possible
+					try {
+						String currentVersion = getVersion(rw,p);
+						ret = updateIfNecessary(rw, p, currentVersion);				
+					} catch (Exception e) {
+						Log.printStackTrace(e);
+						System.out.println("Error while testing package: "+e); //$NON-NLS-1$
+						ret = false;
+					}
+				} else { // package is not present, install it
+					try {
+						System.out.println(RUIMessages.CheckRPackages_14+p+RUIMessages.CheckRPackages_15);
+						try {rw.eval("detach(\"package:"+p+"\", character.only = TRUE)");} catch(Exception tmpE){} // unload package to be able to reinstall it //$NON-NLS-1$ //$NON-NLS-2$
+						
+						rw.eval("install.packages(\""+p+"\", dependencies=TRUE, method=\""+method+"\", repos=\"http://cran.rstudio.com\");"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+						
+						try {
+							rw.eval("library(\""+p+"\")"); //$NON-NLS-1$ //$NON-NLS-2$
+							System.out.println(RUIMessages.CheckRPackages_19+p+RUIMessages.CheckRPackages_20);
+						} catch (Exception e) {
+							Log.printStackTrace(e);
+							System.out.println(RUIMessages.CheckRPackages_21+p+RUIMessages.CheckRPackages_22+p+RUIMessages.CheckRPackages_23);
+							ret = false;
+						}
+					} catch (Exception e) {
+						Log.printStackTrace(e);
+						System.out.println(RUIMessages.CheckRPackages_24+e);
+						ret = false;
+					}
+				}
+			}
+		} else {
+			System.out.println(RUIMessages.CheckRPackages_25);
+			try {
+				installRPAckagesViaRscript();
+			} catch(Exception e) {
+				System.out.println(RUIMessages.CheckRPackages_26);
+			}
+			ret = false;
+		}
+		if (ret == true) System.out.println(" OK"); //$NON-NLS-1$
+		return ret;
+	}
+	
+	public static boolean installRPAckagesViaRscript() throws IOException {
+		String cmd = ""; //$NON-NLS-1$
+		String installPath = TxmPreferences.get(AdvancePreferencePage.INSTALL_DIR);
+		if (Util.isMac() || Util.isLinux()) {
+			cmd = "R --no-save < \""+installPath+"/R/rlibs.R\""; //$NON-NLS-1$ //$NON-NLS-2$
+		} else if (Util.isWindows()) {
+			return false;
+		} else {
+			return false;
+		}
+		Runtime.getRuntime().exec(cmd);
+		return true;
+	}
+
+	private static String getVersion(RWorkspace rw, String p) throws REXPMismatchException, RWorkspaceException {
+		REXP rRez = rw.eval("packageVersion(\""+p+"\")"); //$NON-NLS-1$ //$NON-NLS-2$
+		if (rRez.isList()) {
+			RList rList = rRez.asList();
+			if (rList.size() > 0) {
+				Object elem = rList.get(0);
+				if (elem instanceof REXPInteger) {
+					REXPInteger rExpInt = (REXPInteger)elem;
+					return buildVersion(rExpInt);
+				} else {
+					System.out.println(RUIMessages.CheckRPackages_31+elem);
+				}
+			} else {
+				System.out.println(RUIMessages.CheckRPackages_32+rList);
+			}
+		} else {
+			System.out.println(RUIMessages.CheckRPackages_33+rRez);
+		}	
+		return ""; //$NON-NLS-1$
+	}
+
+	/**
+	 * 
+	 * @param rw
+	 * @param p
+	 * @param currentVersion
+	 * @return false if update failed
+	 * 
+	 * @throws RWorkspaceException
+	 * @throws REXPMismatchException
+	 */
+	private static boolean updateIfNecessary(RWorkspace rw, String p, String currentVersion) throws RWorkspaceException, REXPMismatchException {
+		//System.out.println("Current version of "+p+" is "+v+" and need "+packages.get(p));
+		//System.out.println("comp "+(packages.get(p))+" to "+(v));
+		//System.out.println(packages.get(p).compareTo(v));
+		if (packages.get(p).compareTo(currentVersion) > 0) {
+			System.out.println(RUIMessages.CheckRPackages_35+p+RUIMessages.CheckRPackages_36+currentVersion+RUIMessages.CheckRPackages_37+packages.get(p));
+			
+			try {rw.eval("detach(\"package:"+p+"\", character.only = TRUE)");} catch(Exception tmpE){} // unload package to be able to reinstall it //$NON-NLS-1$ //$NON-NLS-2$
+			
+			//update.packages don't work ?
+			//rw.eval("update.packages(\""+p+"\", dependencies=TRUE, ask=FALSE, repos=\"http://cran.rstudio.com\");"); //$NON-NLS-1$ //$NON-NLS-2$
+			rw.eval("install.packages(\""+p+"\", dependencies=TRUE, repos=\"http://cran.rstudio.com\");"); //$NON-NLS-1$ //$NON-NLS-2$
+			
+			try {rw.eval("library(\""+p+"\")");} catch(Exception tmpE){} // reload it //$NON-NLS-1$ //$NON-NLS-2$
+			String newVersion = getVersion(rw, p);
+			if (!newVersion.equals(packages.get(p))) {
+				System.out.println(RUIMessages.CheckRPackages_42+p+RUIMessages.CheckRPackages_43+newVersion+RUIMessages.CheckRPackages_44);
+				return false;
+			}
+		}
+		return true;
+	}
+}

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

Index: tmp/org.txm.statsengine.r.rcp/src/org/txm/statsengine/r/rcp/handlers/ReconnectToRWorkspace.java
===================================================================
--- tmp/org.txm.statsengine.r.rcp/src/org/txm/statsengine/r/rcp/handlers/ReconnectToRWorkspace.java	(revision 0)
+++ tmp/org.txm.statsengine.r.rcp/src/org/txm/statsengine/r/rcp/handlers/ReconnectToRWorkspace.java	(revision 236)
@@ -0,0 +1,55 @@
+// 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.statsengine.r.rcp.handlers;
+
+import org.eclipse.core.commands.AbstractHandler;
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.IWorkbenchPart;
+import org.eclipse.ui.handlers.HandlerUtil;
+import org.txm.statsengine.r.rcp.views.RConsole;
+
+public class ReconnectToRWorkspace extends AbstractHandler {
+
+	/* (non-Javadoc)
+	 * @see org.eclipse.core.commands.AbstractHandler#execute(org.eclipse.core.commands.ExecutionEvent)
+	 */
+	@Override
+	public Object execute(ExecutionEvent event) throws ExecutionException {
+		IWorkbenchPage wbp = HandlerUtil.getActiveWorkbenchWindow(event).getActivePage();
+		IWorkbenchPart view = wbp.getActivePartReference().getPart(true);
+		//System.out.println("Active part: "+view);
+		if (view instanceof RConsole) {
+			//System.out.println("Rconsole view!");
+			RConsole console = (RConsole)view;
+			console.reconnectToRWorkspace();
+		}
+		return null;
+	}
+}

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

Index: tmp/org.txm.statsengine.r.rcp/src/org/txm/statsengine/r/rcp/handlers/ExecuteRScript.java
===================================================================
--- tmp/org.txm.statsengine.r.rcp/src/org/txm/statsengine/r/rcp/handlers/ExecuteRScript.java	(revision 0)
+++ tmp/org.txm.statsengine.r.rcp/src/org/txm/statsengine/r/rcp/handlers/ExecuteRScript.java	(revision 236)
@@ -0,0 +1,192 @@
+// 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.statsengine.r.rcp.handlers;
+
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.FileReader;
+import java.util.Iterator;
+
+import org.eclipse.core.commands.AbstractHandler;
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.core.runtime.preferences.IPreferencesService;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.osgi.util.NLS;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.FileDialog;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.IViewPart;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.IWorkbenchPart;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.handlers.HandlerUtil;
+import org.eclipse.ui.ide.FileStoreEditorInput;
+import org.txm.rcpapplication.Application;
+import org.txm.rcpapplication.Messages;
+import org.txm.rcpapplication.StatusLine;
+import org.txm.rcpapplication.editors.TxtEditor;
+import org.txm.rcpapplication.preferences.ScriptPreferenceInitializer;
+import org.txm.rcpapplication.preferences.ScriptPreferencePage;
+import org.txm.rcpapplication.swt.dialog.LastOpened;
+import org.txm.statsengine.r.core.RWorkspace;
+import org.txm.statsengine.r.core.RWorkspaceException;
+import org.txm.statsengine.r.rcp.views.RConsole;
+import org.txm.utils.logger.Log;
+// TODO: Auto-generated Javadoc
+/**
+ * Handler: Execute a R script file in the same thread a the RCP.
+ *
+ * @author mdecorde
+ */
+public class ExecuteRScript extends AbstractHandler {
+
+	private static final String ID = "org.txm.rcpapplication.commands.ExecuteRScript"; //$NON-NLS-1$
+	/* (non-Javadoc)
+	 * @see org.eclipse.core.commands.AbstractHandler#execute(org.eclipse.core.commands.ExecutionEvent)
+	 */
+	@Override
+	public Object execute(ExecutionEvent event) throws ExecutionException {
+		String result = ""; //$NON-NLS-1$
+		IWorkbenchWindow aww = HandlerUtil.getActiveWorkbenchWindow(event);
+		IWorkbenchPage page = aww.getActivePage();
+		IViewPart view = page.findView(RConsole.ID);
+		if (view != null && view instanceof RConsole) {
+			((RConsole)view).connectToRWorkspace();
+		}
+		IWorkbenchPart part = page.getActivePart();
+		
+		ISelection selection = page.getSelection();
+		if (part != null && part instanceof TxtEditor) {
+			TxtEditor te = (TxtEditor) part;
+			FileStoreEditorInput input = (FileStoreEditorInput) te
+					.getEditorInput();
+
+			File f = new File(input.getURI().getPath());
+			result = f.getAbsolutePath();
+		} else if (selection != null
+				& selection instanceof IStructuredSelection) {
+			File file = null;
+			IStructuredSelection strucSelection = (IStructuredSelection) selection;
+			for (Iterator<Object> iterator = strucSelection.iterator(); iterator
+					.hasNext();) {
+				file = (File) iterator.next();
+				result = file.getAbsolutePath();
+				break;
+			}
+		}
+
+		if ("" == result) { //$NON-NLS-1$
+			Shell shell = HandlerUtil.getActiveWorkbenchWindowChecked(event)
+					.getShell();
+			FileDialog dialog = new FileDialog(shell, SWT.OPEN);
+			if (LastOpened.getFile(ID) != null) {
+				dialog.setFilterPath(LastOpened.getFolder(ID));
+				dialog.setFileName(LastOpened.getFile(ID));
+			}
+			dialog.setFilterExtensions(new String[] { "*.R" }); //$NON-NLS-1$
+
+			IPreferencesService service = Platform.getPreferencesService();
+			String scriptCurrentDir = service.getString(Application.PLUGIN_ID,
+					ScriptPreferencePage.SCRIPT_CURRENT_DIR,
+					ScriptPreferenceInitializer.SCRIPT_CURRENT_DIR_DEFAULT,
+					null);
+
+			dialog.setFilterPath(scriptCurrentDir);
+			result = dialog.open();
+			if (result == null) return null;
+			LastOpened.set(ID, new File(result));
+		}
+
+		executeScript(result);
+		return null;
+	}
+
+	/**
+	 * Execute script.
+	 *
+	 * @param scriptfile the scriptfile
+	 */
+	public static void executeScript(String scriptfile) {
+		File rFile = new File(scriptfile);
+		if (!rFile.exists()) {
+			System.err.println(NLS.bind(Messages.ExecuteScriptR_0, rFile));
+			return;
+		}
+
+		RWorkspace rw = null;
+		try {
+			rw = RWorkspace.getRWorkspaceInstance();
+		} catch (RWorkspaceException e1) {
+			org.txm.rcpapplication.utils.Logger.printStackTrace(e1);
+			return;
+		}
+		boolean initState = rw.isLogging();
+		rw.setLog(true);
+		try {
+			System.out.println(NLS.bind(Messages.ExecuteRScript_1, rFile.getName()));
+			long time = System.currentTimeMillis();
+			//execute a file line per line
+
+			//if (TxmPreferences.getBoolean(RPreferencePage.R_REMOTE)) {
+				BufferedReader reader = new BufferedReader(new FileReader(rFile));// create a file reader
+				String line = reader.readLine();// read next line
+				StringBuffer buffer = new StringBuffer();
+				while(line != null) {
+					buffer.append(line+"\n"); //$NON-NLS-1$
+					line = reader.readLine();//read next line
+				}
+				
+				String allScript = buffer.toString();
+				//if (rw.isLogging() && allScript.length() > 0) RConsole.printUser(allScript);
+
+				//String str = rw.userEval(allScript); // evaluate line in R
+				rw.eval(allScript);
+				//if (str != null && rw.isLogging() && str.length() > 0)
+					//RConsole.printServer(str);
+				reader.close();
+//			} else {
+//				String cmd = "source(\""+rFile.getAbsolutePath().replace("\\", "/")+"\")";
+//				if (rw.isLogging())
+//					RConsole.printUser)(cmd);
+//				String str = rw.userEval(cmd);//evaluate line in R
+//				if (rw.isLogging() && str.length() > 0)
+//					RConsole.printServer(cmd);
+//			}
+			System.out.println(Messages.ExecuteRScript_2+(System.currentTimeMillis()-time)+Messages.ExecuteRScript_3);
+		} catch(Exception e) {
+			System.out.println(NLS.bind(Messages.ExecuteScriptR_1, rFile, e)); 
+			StatusLine.error(NLS.bind(Messages.ExecuteScriptR_1, rFile, e)); 
+			Log.printStackTrace(e);
+		}
+
+		rw.setLog(initState);
+	}
+}

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

Index: tmp/org.txm.statsengine.r.rcp/src/org/txm/statsengine/r/rcp/handlers/ExecuteRText.java
===================================================================
--- tmp/org.txm.statsengine.r.rcp/src/org/txm/statsengine/r/rcp/handlers/ExecuteRText.java	(revision 0)
+++ tmp/org.txm.statsengine.r.rcp/src/org/txm/statsengine/r/rcp/handlers/ExecuteRText.java	(revision 236)
@@ -0,0 +1,107 @@
+// 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.statsengine.r.rcp.handlers;
+
+import org.eclipse.core.commands.AbstractHandler;
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.jface.text.TextSelection;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.osgi.util.NLS;
+import org.eclipse.ui.handlers.HandlerUtil;
+import org.txm.rcpapplication.Messages;
+import org.txm.rcpapplication.StatusLine;
+import org.txm.statsengine.r.core.RWorkspace;
+import org.txm.statsengine.r.core.RWorkspaceException;
+import org.txm.statsengine.r.rcp.views.RConsole;
+import org.txm.utils.logger.Log;
+// TODO: Auto-generated Javadoc
+/**
+ * Handler: execute a selection of R code from the TxtEditor.
+ *
+ * @author mdecorde
+ */
+public class ExecuteRText extends AbstractHandler {
+
+	/* (non-Javadoc)
+	 * @see org.eclipse.core.commands.AbstractHandler#execute(org.eclipse.core.commands.ExecutionEvent)
+	 */
+	@Override
+	public Object execute(ExecutionEvent event) throws ExecutionException {
+
+		ISelection selection = HandlerUtil.getActiveWorkbenchWindow(event)
+				.getActivePage().getSelection();
+		if (selection == null) return null;
+		if (!(selection instanceof TextSelection)) return null;
+
+		TextSelection t = (TextSelection) selection;
+		String result = t.getText();
+
+		executeText(result);
+		return null;
+	}
+
+	/**
+	 * Execute text.
+	 *
+	 * @param text the text
+	 * @return the object
+	 */
+	public static Object executeText(String text) {
+		RWorkspace rw = null;
+		try {
+			rw = RWorkspace.getRWorkspaceInstance();
+		} catch (RWorkspaceException e1) {
+			org.txm.rcpapplication.utils.Logger.printStackTrace(e1);
+			return null;
+		}
+		boolean initState = rw.isLogging();
+		rw.setLog(true);
+
+		try {
+			System.out.println(Messages.ExecuteRText_0);
+			long time = System.currentTimeMillis();
+			//execute a file line per line
+
+			//String str = rw.userEval(text);//evaluate line in R
+			rw.eval(text);
+//			if (str != null && rw.isLogging() && str.length() > 0)
+//				RConsole.printServer(str);
+			RWorkspace.appendtoEvalLog(text);
+
+			System.out.println(Messages.ExecuteRScript_2+(System.currentTimeMillis()-time)+Messages.ExecuteRText_2); 
+		} catch(Exception e) {
+			System.out.println(NLS.bind(Messages.ExecuteRText_1, text, Log.toString(e))); 
+			StatusLine.error(NLS.bind(Messages.ExecuteRText_1, text, Log.toString(e))); 
+			org.txm.rcpapplication.utils.Logger.printStackTrace(e);
+		}
+
+		rw.setLog(initState);
+		return null;
+	}
+}

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

Index: tmp/org.txm.statsengine.r.rcp/src/org/txm/statsengine/r/rcp/preferences/RPreferencePage.java
===================================================================
--- tmp/org.txm.statsengine.r.rcp/src/org/txm/statsengine/r/rcp/preferences/RPreferencePage.java	(revision 0)
+++ tmp/org.txm.statsengine.r.rcp/src/org/txm/statsengine/r/rcp/preferences/RPreferencePage.java	(revision 236)
@@ -0,0 +1,231 @@
+// 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.statsengine.r.rcp.preferences;
+
+import org.eclipse.jface.preference.BooleanFieldEditor;
+import org.eclipse.jface.preference.FieldEditor;
+import org.eclipse.jface.preference.FileFieldEditor;
+import org.eclipse.jface.preference.IntegerFieldEditor;
+import org.eclipse.jface.preference.StringFieldEditor;
+import org.eclipse.jface.util.PropertyChangeEvent;
+import org.eclipse.ui.IWorkbench;
+import org.txm.core.preferences.TXMPreferences;
+import org.txm.rcp.preferences.TXMPreferencePage;
+import org.txm.rcp.preferences.TXMPreferenceStore;
+import org.txm.rcpapplication.Messages;
+import org.txm.statsengine.r.core.RWorkspace;
+import org.txm.statsengine.r.core.preferences.RPreferences;
+import org.txm.statsengine.r.rcp.messages.RUIMessages;
+// TODO: Auto-generated Javadoc
+/**
+ * This class represents a preference page that is contributed to the
+ * Preferences dialog. By subclassing <samp>FieldEditorPreferencePage</samp>, we
+ * can use the field support built into JFace that allows us to create a page
+ * that is small and knows how to save, restore and apply itself.
+ * <p>
+ * This page is used to modif y preferences only. They are stored in the
+ * preference store that belongs to the main plug-in class. That way,
+ * preferences can be accessed directly via the preference store.
+ */
+
+public class RPreferencePage extends TXMPreferencePage {
+
+//	/** The Constant R_PATH_TO_EXECUTABLE. */
+//	public static final String R_PATH_TO_EXECUTABLE = Toolbox.R_PATH_TO_EXECUTABLE;
+//	
+//	/** The Constant R_REMOTE. */
+//	public static final String R_REMOTE = Toolbox.R_REMOTE;
+//	
+//	/** The Constant R_SERVER_ADRESS. */
+//	public static final String R_SERVER_ADRESS = Toolbox.R_SERVER_ADDRESS;
+//	
+//	public static final String R_PORT = Toolbox.R_PORT;
+//	public static final String R_DEBUG = Toolbox.R_DEBUG;
+//	
+//	/** The Constant R_USER. */
+//	public static final String R_USER = Toolbox.R_USER;
+//	
+//	/** The Constant R_PASSWORD. */
+//	public static final String R_PASSWORD = Toolbox.R_PASSWORD;
+//	
+//	/** The Constant R_FILE_TRANSFERT. */
+//	public static final String R_FILE_TRANSFERT = Toolbox.R_FILE_TRANSFERT;
+//	
+//	public static final String R_SVG_DEVICE = Toolbox.R_SVG_DEVICE;
+
+//	/** The preferences. */
+//	private ScopedPreferenceStore preferences;
+
+	/** The r_path_to_executable. */
+	private StringFieldEditor r_path_to_executable;
+	
+	/** The r_server_adress. */
+	private StringFieldEditor r_server_adress;
+	private IntegerFieldEditor r_port;
+	
+	/** The r_user. */
+	private StringFieldEditor r_user;
+	
+	/** The r_password. */
+	private StringFieldEditor r_password;
+	
+	/** The r_is_remote. */
+	private BooleanFieldEditor r_is_remote;
+	
+	private BooleanFieldEditor r_debug;
+
+	
+	/** The r_use_file_transfert. */
+	private BooleanFieldEditor r_use_file_transfert;
+	
+	private StringFieldEditor r_svg_device;
+	
+	private StringFieldEditor r_rargs;
+	private StringFieldEditor r_rserveargs;
+
+	
+	
+	@Override
+	public void init(IWorkbench workbench) {
+		this.setPreferenceStore(new TXMPreferenceStore(RPreferences.PREFERENCES_NODE));
+		//this.setTitle(RUIMessages.RPreferencePage_0);
+		//FIXME todo if needed
+		//setDescription(Messages.RPreferencePage_1);
+		//this.setImageDescriptor(SpecificitiesAdapterFactory.ICON);
+	}
+
+	
+
+
+	/**
+	 * Creates the field editors. Field editors are abstractions of the common
+	 * GUI blocks needed to manipulate various types of preferences. Each field
+	 * editor knows how to save and restore itself.
+	 */
+	@Override
+	public void createFieldEditors() {
+
+		r_debug = new BooleanFieldEditor(RPreferences.DEBUG, RUIMessages.RPreferencePage_0, BooleanFieldEditor.DEFAULT, getFieldEditorParent());
+		addField(r_debug);
+		
+		r_is_remote = new BooleanFieldEditor(RPreferences.REMOTE, RUIMessages.RPreferencePage_3, BooleanFieldEditor.DEFAULT, getFieldEditorParent());
+		addField(r_is_remote);
+
+		r_path_to_executable = new FileFieldEditor(RPreferences.PATH_TO_EXECUTABLE, RUIMessages.RPreferencePage_2, getFieldEditorParent());
+		addField(r_path_to_executable);
+		
+		r_rargs = new StringFieldEditor(RPreferences.RARGS, RUIMessages.RPreferencePage_8, getFieldEditorParent());
+		addField(r_rargs);
+		
+		r_rserveargs = new StringFieldEditor(RPreferences.RSERVEARGS, RUIMessages.RPreferencePage_9, getFieldEditorParent());
+		addField(r_rserveargs);
+				
+		r_use_file_transfert = new BooleanFieldEditor(RPreferences.FILE_TRANSFERT, RUIMessages.RPreferencePage_7, BooleanFieldEditor.DEFAULT,
+				getFieldEditorParent());
+		addField(r_use_file_transfert);
+
+		r_server_adress = new StringFieldEditor(RPreferences.SERVER_ADDRESS, RUIMessages.RPreferencePage_4, getFieldEditorParent());
+		addField(r_server_adress);
+		
+		r_port = new IntegerFieldEditor(RPreferences.PORT, RUIMessages.RPreferencePage_1, getFieldEditorParent());
+		addField(r_port);
+
+		r_user = new StringFieldEditor(RPreferences.USER, RUIMessages.RPreferencePage_5, getFieldEditorParent());
+		addField(r_user);
+
+		r_password = new StringFieldEditor(RPreferences.PASSWORD, RUIMessages.RPreferencePage_6, getFieldEditorParent());
+		addField(r_password);
+		
+//		r_svg_device = new StringFieldEditor(R_SVG_DEVICE, Messages.RPreferencePage_5,
+//				getFieldEditorParent());
+//		addField(r_svg_device);
+
+		
+		changeFieldStates(TXMPreferences.getBoolean(RPreferences.PREFERENCES_NODE, RPreferences.REMOTE));
+	}
+	
+	
+	/**
+	 * Enable/disable the fields according to the remote mode activation.
+	 * @param serverIsRemote
+	 */
+	public void changeFieldStates(boolean serverIsRemote) {
+		if (serverIsRemote) {
+			r_server_adress.setEnabled(true, getFieldEditorParent());
+			r_user.setEnabled(true, getFieldEditorParent());
+			r_password.setEnabled(true, getFieldEditorParent());
+			r_port.setEnabled(true, getFieldEditorParent());
+			r_path_to_executable.setEnabled(false, getFieldEditorParent());
+			r_rargs.setEnabled(false, getFieldEditorParent());
+			r_rserveargs.setEnabled(false, getFieldEditorParent());
+			r_use_file_transfert.setEnabled(false, getFieldEditorParent());
+		} else {
+			r_server_adress.setEnabled(false, getFieldEditorParent());
+			r_user.setEnabled(false, getFieldEditorParent());
+			r_password.setEnabled(false, getFieldEditorParent());
+			r_port.setEnabled(false, getFieldEditorParent());
+			r_path_to_executable.setEnabled(true, getFieldEditorParent());
+			r_rargs.setEnabled(true, getFieldEditorParent());
+			r_rserveargs.setEnabled(true, getFieldEditorParent());
+			r_use_file_transfert.setEnabled(true, getFieldEditorParent());
+		}
+	}
+
+	/* (non-Javadoc)
+	 * @see org.eclipse.jface.preference.FieldEditorPreferencePage#propertyChange(org.eclipse.jface.util.PropertyChangeEvent)
+	 */
+	@Override
+	public void propertyChange(PropertyChangeEvent event) {
+		if (((FieldEditor) event.getSource()) == r_is_remote) {
+			changeFieldStates((Boolean) event.getNewValue());
+		}
+	}
+
+
+
+	/* (non-Javadoc)
+	 * @see org.eclipse.jface.preference.FieldEditorPreferencePage#performOk()
+	 */
+	@Override
+	public boolean performOk() {
+		try {
+			super.performOk();
+			org.txm.Toolbox
+					.updateProperties(org.txm.rcpapplication.ApplicationWorkbenchAdvisor
+							.getProperties());
+			
+			RWorkspace rw = RWorkspace.getRWorkspaceInstance();
+			if (rw != null)	{
+				RWorkspace.setUseFileCommunication(TXMPreferences.getBoolean(RPreferences.PREFERENCES_NODE, RPreferences.FILE_TRANSFERT));
+			}
+		} catch (Exception e) {
+			System.err.println(Messages.FAILED_TO_SAVE_PREFERENCES + e);
+		}
+		return true;
+	}
+}

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

Index: tmp/org.txm.statsengine.r.rcp/src/org/txm/statsengine/r/rcp/messages/messages.properties
===================================================================
--- tmp/org.txm.statsengine.r.rcp/src/org/txm/statsengine/r/rcp/messages/messages.properties	(revision 0)
+++ tmp/org.txm.statsengine.r.rcp/src/org/txm/statsengine/r/rcp/messages/messages.properties	(revision 236)
@@ -0,0 +1,39 @@
+
+CheckRPackages_0  = TXM could not load the 'textometry' R package. The Cooccurence, Specificity and Progression commands won't be available
+CheckRPackages_1  = TXM could not load the 'FactoMineR' R package. The Correspondance analysis, Classification commands won't be available
+CheckRPackages_13 = An error occured while getting RWorkspace insance: 
+CheckRPackages_14 = The '
+CheckRPackages_15 = ' package is not installed. Trying to install it now...
+CheckRPackages_19 = Done: '
+CheckRPackages_2  = R package diagnostic
+CheckRPackages_20 = ' installed successfully.
+CheckRPackages_21 = The '
+CheckRPackages_22 = ' package was not installed. Please install it manually:\n * Run R\n * and execute 'install.packages("
+CheckRPackages_23 = "')
+CheckRPackages_24 = Error while installing package: 
+CheckRPackages_25 = The R StatEngine is not running. Trying to reinstall the packages (RServe, FactoMineR, textometry,...
+CheckRPackages_26 = TXM could not reinstall R packages. Please do it manually (see manual).
+CheckRPackages_3  = Necessary packages are ready.
+CheckRPackages_31 = ERROR: Rlist first element is not REXPInteger: 
+CheckRPackages_32 = ERROR: REval list size is 0: 
+CheckRPackages_33 = ERROR: REval is not a list: 
+CheckRPackages_35 = Updating the 
+CheckRPackages_36 = \ (
+CheckRPackages_37 = ) R package up to version 
+CheckRPackages_4  = R package diagnostic
+CheckRPackages_42 = Update of '
+CheckRPackages_43 = ' failed (current version is still 
+CheckRPackages_44 = ). Warning: Windows users need to restart TXM.
+CheckRPackages_5  = Some packages are missing. See console for details.
+CheckRPackages_9  = Checking R packages...
+
+RPreferencePage_0 = Run RServe in debug mode
+RPreferencePage_1 = Port (default is 6311)
+RPreferencePage_2 = Path to R binary
+RPreferencePage_3 = Remote connection
+RPreferencePage_4 = Server address
+RPreferencePage_5 = User
+RPreferencePage_6 = Password
+RPreferencePage_7 = Use file based R data transfert
+RPreferencePage_8 = R args
+RPreferencePage_9 = Rserve args

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

Index: tmp/org.txm.statsengine.r.rcp/src/org/txm/statsengine/r/rcp/messages/RUIMessages.java
===================================================================
--- tmp/org.txm.statsengine.r.rcp/src/org/txm/statsengine/r/rcp/messages/RUIMessages.java	(revision 0)
+++ tmp/org.txm.statsengine.r.rcp/src/org/txm/statsengine/r/rcp/messages/RUIMessages.java	(revision 236)
@@ -0,0 +1,60 @@
+package org.txm.statsengine.r.rcp.messages;
+
+import org.eclipse.osgi.util.NLS;
+import org.txm.core.messages.TXMCoreMessages;
+
+public class RUIMessages extends NLS {
+	
+
+	private static final String BUNDLE_NAME = "org.txm.statsengine.r.rcp.messages.messages"; //$NON-NLS-1$
+	
+	public static String RPreferencePage_0;
+	public static String RPreferencePage_1;
+	public static String RPreferencePage_2;
+	public static String RPreferencePage_3;
+	public static String RPreferencePage_4;
+	public static String RPreferencePage_5;
+	public static String RPreferencePage_6;
+	public static String RPreferencePage_7;
+
+	public static String RPreferencePage_8;
+
+	public static String RPreferencePage_9;
+
+	public static String CheckRPackages_0;
+	public static String CheckRPackages_1;
+	public static String CheckRPackages_13;
+	public static String CheckRPackages_14;
+	public static String CheckRPackages_15;
+	public static String CheckRPackages_19;
+	public static String CheckRPackages_2;
+	public static String CheckRPackages_20;
+	public static String CheckRPackages_21;
+	public static String CheckRPackages_22;
+	public static String CheckRPackages_23;
+	public static String CheckRPackages_24;
+	public static String CheckRPackages_25;
+	public static String CheckRPackages_26;
+	public static String CheckRPackages_3;
+	public static String CheckRPackages_31;
+	public static String CheckRPackages_32;
+	public static String CheckRPackages_33;
+	public static String CheckRPackages_35;
+	public static String CheckRPackages_36;
+	public static String CheckRPackages_37;
+	public static String CheckRPackages_4;
+	public static String CheckRPackages_42;
+	public static String CheckRPackages_43;
+	public static String CheckRPackages_44;
+	public static String CheckRPackages_5;
+	public static String CheckRPackages_9;
+
+	
+	static {
+		// initialize resource bundle
+		TXMCoreMessages.initializeMessages(BUNDLE_NAME, RUIMessages.class);
+	}
+
+	private RUIMessages() {
+	}
+}

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

Index: tmp/org.txm.statsengine.r.rcp/src/org/txm/statsengine/r/rcp/messages/messages_ru.properties
===================================================================
--- tmp/org.txm.statsengine.r.rcp/src/org/txm/statsengine/r/rcp/messages/messages_ru.properties	(revision 0)
+++ tmp/org.txm.statsengine.r.rcp/src/org/txm/statsengine/r/rcp/messages/messages_ru.properties	(revision 236)
@@ -0,0 +1,7 @@
+
+RPreferencePage_2 = Путь к исполняемому &файлу R
+RPreferencePage_3 = Удаленное соединение
+RPreferencePage_4 = Адрес сервера
+RPreferencePage_5 = Пользователь
+RPreferencePage_6 = Пароль
+RPreferencePage_7 = Использовать передачу данных R через файл

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

Index: tmp/org.txm.statsengine.r.rcp/src/org/txm/statsengine/r/rcp/messages/messages_fr.properties
===================================================================
--- tmp/org.txm.statsengine.r.rcp/src/org/txm/statsengine/r/rcp/messages/messages_fr.properties	(revision 0)
+++ tmp/org.txm.statsengine.r.rcp/src/org/txm/statsengine/r/rcp/messages/messages_fr.properties	(revision 236)
@@ -0,0 +1,9 @@
+
+RPreferencePage_0 = RServe lancé en mode debug
+RPreferencePage_1 = Port (valeur par défaut : 6311)
+RPreferencePage_2 = Chemin vers l'&exécutable de R
+RPreferencePage_3 = Connexion distante
+RPreferencePage_4 = Adresse du serveur
+RPreferencePage_5 = Utilisateur
+RPreferencePage_6 = Mot de passe
+RPreferencePage_7 = Utiliser la transmission de données R par fichier

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

Index: tmp/org.txm.statsengine.r.rcp/build.properties
===================================================================
--- tmp/org.txm.statsengine.r.rcp/build.properties	(revision 0)
+++ tmp/org.txm.statsengine.r.rcp/build.properties	(revision 236)
@@ -0,0 +1,5 @@
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+               .,\
+               plugin.xml

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

Index: tmp/org.txm.statsengine.r.rcp/OSGI-INF/l10n/bundle.properties
===================================================================
--- tmp/org.txm.statsengine.r.rcp/OSGI-INF/l10n/bundle.properties	(revision 0)
+++ tmp/org.txm.statsengine.r.rcp/OSGI-INF/l10n/bundle.properties	(revision 236)
@@ -0,0 +1,16 @@
+
+command.name.45 = Run R script
+
+command.name.46 = Execute Text Selection
+
+command.name.90 = Check R packages
+
+command.name.93 = Reconnect to RWorkspace
+
+menu.label.11 = R
+
+page.name = Statistics Engine
+
+view.name.5 = R variables
+
+view.name.6 = R Console

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

Index: tmp/org.txm.statsengine.r.rcp/OSGI-INF/l10n/bundle_ru.properties
===================================================================
--- tmp/org.txm.statsengine.r.rcp/OSGI-INF/l10n/bundle_ru.properties	(revision 0)
+++ tmp/org.txm.statsengine.r.rcp/OSGI-INF/l10n/bundle_ru.properties	(revision 236)
@@ -0,0 +1,14 @@
+
+command.name.45 = Выполнить скрипт R
+
+command.name.46 = Выполнить выделенные строки как скрипт R 
+
+command.name.90 = Добавить текст
+
+menu.label.11 = R
+
+page.name = Статистическая машина
+
+view.name.5 = Переменные R
+
+view.name.6 = Консоль R

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

Index: tmp/org.txm.statsengine.r.rcp/OSGI-INF/l10n/bundle_fr.properties
===================================================================
--- tmp/org.txm.statsengine.r.rcp/OSGI-INF/l10n/bundle_fr.properties	(revision 0)
+++ tmp/org.txm.statsengine.r.rcp/OSGI-INF/l10n/bundle_fr.properties	(revision 236)
@@ -0,0 +1,16 @@
+
+command.name.45 = Exécuter le script R
+
+command.name.46 = Exécuter la sélection de texte
+
+command.name.90 = Vérifier les packages R
+
+command.name.93 = Reconnecter le RWorkspace
+
+menu.label.11 = R
+
+page.name = Moteur de Statistiques
+
+view.name.5 = Variables R
+
+view.name.6 = Console R

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

Index: tmp/org.txm.statsengine.r.rcp/OSGI-INF/l10n/bundle_ru_utf-8.properties
===================================================================
--- tmp/org.txm.statsengine.r.rcp/OSGI-INF/l10n/bundle_ru_utf-8.properties	(revision 0)
+++ tmp/org.txm.statsengine.r.rcp/OSGI-INF/l10n/bundle_ru_utf-8.properties	(revision 236)
@@ -0,0 +1,5 @@
+command.name.45=Выполнить скрипт R
+page.name=Статистическая машина
+command.name.90=Добавить текст
+command.label.137=Консоль R
+command.label.138=Переменные R
\ No newline at end of file

Property changes on: tmp/org.txm.statsengine.r.rcp/OSGI-INF/l10n/bundle_ru_utf-8.properties
___________________________________________________________________
Added: svn:mime-type
   + text/plain

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

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

Index: tmp/org.txm.statsengine.r.rcp/plugin.xml
===================================================================
--- tmp/org.txm.statsengine.r.rcp/plugin.xml	(revision 0)
+++ tmp/org.txm.statsengine.r.rcp/plugin.xml	(revision 236)
@@ -0,0 +1,109 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.4"?>
+<plugin>
+   <extension
+         point="org.eclipse.ui.preferencePages">
+      <page
+            category="org.txm.rcpapplication.preferences.AdvancePreferencePage"
+            class="org.txm.statsengine.r.rcp.preferences.RPreferencePage"
+            id="org.txm.statsengine.r.rcp.preferences.RPreferencePage"
+            name="%page.name">
+      </page>
+   </extension>
+   <extension
+         point="org.eclipse.ui.commands">
+               <command
+            defaultHandler="org.txm.statsengine.r.rcp.handlers.CheckRPackages"
+            id="CheckRPackages"
+            name="%command.name.90">
+      </command>
+                  <command
+            defaultHandler="org.txm.statsengine.r.rcp.handlers.ReconnectToRWorkspace"
+            id="ReconnectToRWorkspace"
+            name="%command.name.93">
+      </command>
+               <command
+            defaultHandler="org.txm.statsengine.r.rcp.handlers.ExecuteRScript"
+            id="ExecuteRScript"
+            name="%command.name.45">
+      </command>
+      <command
+            defaultHandler="org.txm.statsengine.r.rcp.handlers.ExecuteRText"
+            id="ExecuteRText"
+            name="%command.name.46">
+      </command>
+         
+   </extension>
+   <extension
+         point="org.eclipse.ui.menus">
+      <menuContribution
+            allPopups="false"
+            locationURI="menu:menu.file">
+         <command
+               commandId="CheckRPackages"
+               style="push">
+         </command>
+      </menuContribution>
+      <menuContribution
+            allPopups="false"
+            locationURI="menu:menu.display.views">
+         <command
+               commandId="org.eclipse.ui.views.showView"
+               icon="icons/R.png"
+               label="%view.name.6"
+               style="push">
+            <parameter
+                  name="org.eclipse.ui.views.showView.viewId"
+                  value="RConsoleView">
+            </parameter>
+         </command>
+         <command
+               commandId="org.eclipse.ui.views.showView"
+               icon="icons/R.png"
+               label="%view.name.5"
+               style="push">
+            <parameter
+                  name="org.eclipse.ui.views.showView.viewId"
+                  value="RVariablesView">
+            </parameter>
+         </command>
+      </menuContribution>
+      <menuContribution
+            locationURI="popup:#TextEditorContext">
+         <menu
+               icon="icons/R.png"
+               label="%menu.label.11">
+            <command
+                  commandId="ExecuteRText"
+                  style="push">
+            </command>
+            <command
+                  commandId="ExecuteRScript"
+                  style="push">
+            </command>
+         </menu>
+      </menuContribution>
+   </extension>
+   <extension
+         point="org.eclipse.ui.views">
+               <view
+            allowMultiple="false"
+            category="org.txm.rcpapplication"
+            class="org.txm.statsengine.r.rcp.views.RConsole"
+            icon="icons/R.png"
+            id="RConsoleView"
+            name="%view.name.6"
+            restorable="true">
+      </view>
+               <view
+                     category="org.txm.rcpapplication"
+                     class="org.txm.statsengine.r.rcp.views.RVariablesView"
+                     icon="icons/R.png"
+                     id="RVariablesView"
+                     name="%view.name.5"
+                     restorable="true">
+               </view>
+         
+   </extension>
+
+</plugin>

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

Index: tmp/org.txm.statsengine.r.rcp/.settings/org.eclipse.jdt.core.prefs
===================================================================
--- tmp/org.txm.statsengine.r.rcp/.settings/org.eclipse.jdt.core.prefs	(revision 0)
+++ tmp/org.txm.statsengine.r.rcp/.settings/org.eclipse.jdt.core.prefs	(revision 236)
@@ -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.statsengine.r.rcp/.settings/org.eclipse.jdt.core.prefs
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/org.txm.statsengine.r.rcp/.classpath
===================================================================
--- tmp/org.txm.statsengine.r.rcp/.classpath	(revision 0)
+++ tmp/org.txm.statsengine.r.rcp/.classpath	(revision 236)
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
+	<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+	<classpathentry kind="src" path="src"/>
+	<classpathentry kind="output" path="bin"/>
+</classpath>

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

Index: tmp/org.txm.statsengine.r.rcp/META-INF/MANIFEST.MF
===================================================================
--- tmp/org.txm.statsengine.r.rcp/META-INF/MANIFEST.MF	(revision 0)
+++ tmp/org.txm.statsengine.r.rcp/META-INF/MANIFEST.MF	(revision 236)
@@ -0,0 +1,12 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: R Statistics Engine RCP
+Bundle-SymbolicName: org.txm.statsengine.r.rcp;singleton:=true
+Bundle-Version: 1.0.0.qualifier
+Bundle-RequiredExecutionEnvironment: JavaSE-1.6
+Require-Bundle: org.txm.core;bundle-version="0.7.0",
+ org.txm.statsengine.r.core;bundle-version="1.0.0",
+ org.eclipse.core.runtime;bundle-version="3.10.0",
+ org.eclipse.ui;bundle-version="3.106.1",
+ org.txm.rcp;bundle-version="0.7.8"
+Export-Package: org.txm.statsengine.r.rcp.views

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

