Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Add save R session button
in the R console toolbar
  • Loading branch information
Valentin Georgiev committed Mar 16, 2012
1 parent e26fade commit bc61741
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 0 deletions.
13 changes: 13 additions & 0 deletions plugins/net.bioclipse.r.ui/plugin.xml
Expand Up @@ -106,4 +106,17 @@

</extension>

<extension point="org.eclipse.ui.viewActions">
<viewContribution
id="net.bioclipse.r.ui.views.saveSession"
targetID="net.bioclipse.r.ui.views.RConsoleView">
<action id="..."
toolbarPath="action1"
class="net.bioclipse.r.ui.views.saveRSession"
style="push"
label="Save your R session"
icon="icons/r_icon.gif">
</action>
</viewContribution>
</extension>
</plugin>
@@ -0,0 +1,29 @@
package net.bioclipse.r.ui.views;

import org.eclipse.jface.action.IAction;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.ui.IViewActionDelegate;
import org.eclipse.ui.IViewPart;
import org.eclipse.ui.PlatformUI;

public class saveRSession implements IViewActionDelegate{

@Override
public void run(IAction action) {
RConsoleView rView = (RConsoleView) PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().findView("net.bioclipse.r.ui.views.RConsoleView");
rView.executeCommand("save.image(\".RData\")");
}

@Override
public void selectionChanged(IAction action, ISelection selection) {
// TODO Auto-generated method stub

}

@Override
public void init(IViewPart view) {
// TODO Auto-generated method stub

}

}

0 comments on commit bc61741

Please sign in to comment.