Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Add the "Save R Session" button via extension point "org.eclipse.ui.m…
…enus"
- Loading branch information
Valentin Georgiev
committed
Mar 21, 2012
1 parent
3be35bf
commit 257c872
Showing
2 changed files
with
41 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
plugins/net.bioclipse.r.ui/src/net/bioclipse/r/ui/handlers/saveRSessionHandler.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package net.bioclipse.r.ui.handlers; | ||
|
||
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.ui.PlatformUI; | ||
|
||
/** | ||
* Handler for saving a R session | ||
* | ||
* @authors valyo | ||
* | ||
*/ | ||
public class saveRSessionHandler extends AbstractHandler implements IHandler { | ||
|
||
@Override | ||
public Object execute(ExecutionEvent event) throws ExecutionException { | ||
RConsoleView rView = (RConsoleView) PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().findView("net.bioclipse.r.ui.views.RConsoleView"); | ||
rView.execEditorInput("save.image(\".RData\")"); | ||
return null; | ||
} | ||
|
||
} |