Skip to content

Commit

Permalink
"Save R Session" button runs through RThread now
Browse files Browse the repository at this point in the history
changed label from "Running R script" to "Running R"
  • Loading branch information
Valentin Georgiev committed Sep 6, 2012
1 parent ac90324 commit 8efb63d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
Expand Up @@ -62,7 +62,7 @@ public void run() {
Job job = new Job("R-script") {
@Override
protected IStatus run( IProgressMonitor pm ) {
pm.beginTask( "Running R script",
pm.beginTask( "Running R",
IProgressMonitor.UNKNOWN );
monitor[0] = pm;
nextAction[0].runPreCommandHook();
Expand Down
Expand Up @@ -89,23 +89,24 @@ protected void evalCommand(final String command, boolean quotes) {
rThread.enqueue( new ScriptAction(input,
new Hook() {
public void run( final Object result ) {
echoCommand( command );
if (!command.contentEquals("save.image(\".RData\")")) {
echoCommand( command );
}
}
},
new Hook() {
public void run( final Object result ) {
printMessage(NEWLINE + result);
if (command.contentEquals("save.image(\".RData\")")) {
printMessage(NEWLINE + "R Session saved");
} else {
printMessage(NEWLINE + result);
}
}
}) );
}

public void saveSession() {
String saveRes = r.eval("save.image(\".RData\")");
if (saveRes.isEmpty()) {
printMessage(NEWLINE + "R Session saved");
} else {
printMessage(NEWLINE + saveRes);
}
evalCommand("save.image(\".RData\")", false);
}

private void getRBusinessManager() {
Expand Down

0 comments on commit 8efb63d

Please sign in to comment.