Skip to content
Browse files

R output from running snippets printed in the R console

When running snippets or the whole R editor content, the output
shows up in the R console view
  • Loading branch information...
1 parent 9441372 commit 3fd691986f272d211d0ea8988292abda39786457 @valyo valyo committed Dec 19, 2011
View
5 plugins/net.bioclipse.r.ui/src/net/bioclipse/r/ui/handlers/RunRAllHandler.java
@@ -3,13 +3,15 @@
import net.bioclipse.r.business.Activator;
import net.bioclipse.r.business.IRBusinessManager;
import net.bioclipse.r.ui.editors.REditor;
+import net.bioclipse.r.ui.views.RConsoleView;
import org.eclipse.core.commands.AbstractHandler;
import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.core.commands.ExecutionException;
import org.eclipse.core.commands.IHandler;
import org.eclipse.jface.text.IDocument;
import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.handlers.HandlerUtil;
/**
@@ -34,7 +36,8 @@ public Object execute(ExecutionEvent event) throws ExecutionException {
IRBusinessManager r = Activator.getDefault().getJavaRBusinessManager();
r.evalSnippet(contents);
-
+ RConsoleView rView = (RConsoleView) PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().findView("net.bioclipse.r.ui.views.RConsoleView");
+ rView.execSnippet(contents);
//We are done
return null;
}
View
5 plugins/net.bioclipse.r.ui/src/net/bioclipse/r/ui/handlers/RunRSnippetHandler.java
@@ -2,13 +2,15 @@
import net.bioclipse.r.business.Activator;
import net.bioclipse.r.business.IRBusinessManager;
+import net.bioclipse.r.ui.views.RConsoleView;
import org.eclipse.core.commands.AbstractHandler;
import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.core.commands.ExecutionException;
import org.eclipse.core.commands.IHandler;
import org.eclipse.jface.text.ITextSelection;
import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.handlers.HandlerUtil;
/**
@@ -30,7 +32,8 @@ public Object execute(ExecutionEvent event) throws ExecutionException {
IRBusinessManager r = Activator.getDefault().getJavaRBusinessManager();
r.evalSnippet(textsel.getText());
-
+ RConsoleView rView = (RConsoleView) PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().findView("net.bioclipse.r.ui.views.RConsoleView");
+ rView.execSnippet(textsel.getText());
//We are done
return null;
}
View
3 plugins/net.bioclipse.r.ui/src/net/bioclipse/r/ui/views/RConsoleView.java
@@ -31,6 +31,9 @@ public void createPartControl(Composite parent) {
getRBusinessManager();
}
+ public String execSnippet(String command) {
+ return executeCommand(command);
+ }
/*
* Execute the R command - First check if r manager is available.
*/

0 comments on commit 3fd6919

Please sign in to comment.
Something went wrong with that request. Please try again.