use of org.rstudio.studio.client.server.VoidServerRequestCallback in project rstudio by rstudio.
the class BreakpointManager method notifyServer.
private void notifyServer(Breakpoint breakpoint, boolean added, boolean arm) {
ArrayList<Breakpoint> bps = new ArrayList<Breakpoint>();
bps.add(breakpoint);
server_.updateBreakpoints(bps, added, arm, new VoidServerRequestCallback());
}
use of org.rstudio.studio.client.server.VoidServerRequestCallback in project rstudio by rstudio.
the class BreakpointManager method clearAllBreakpoints.
private void clearAllBreakpoints() {
Set<FileFunction> functions = new TreeSet<FileFunction>();
for (Breakpoint breakpoint : breakpoints_) {
breakpoint.setState(Breakpoint.STATE_REMOVING);
if (breakpoint.getType() == Breakpoint.TYPE_FUNCTION)
functions.add(new FileFunction(breakpoint));
}
// set previously
for (FileFunction function : functions) {
server_.setFunctionBreakpoints(function.functionName, function.fileName, function.packageName, new ArrayList<String>(), new ServerRequestCallback<Void>() {
@Override
public void onError(ServerError error) {
// There's a possibility here that the breakpoints were
// not successfully cleared, so we may be in a temporarily
// confusing state, but no error message will be less
// confusing.
}
});
}
server_.removeAllBreakpoints(new VoidServerRequestCallback());
notifyBreakpointsSaved(new ArrayList<Breakpoint>(breakpoints_), false);
breakpoints_.clear();
onBreakpointAddOrRemove();
}
use of org.rstudio.studio.client.server.VoidServerRequestCallback in project rstudio by rstudio.
the class RmdOutputFramePane method onViewerCleared.
@Override
public void onViewerCleared(ViewerClearedEvent event) {
// viewer is cleared
if (isShiny_ && event.isForStop()) {
server_.terminateRenderRmd(true, new VoidServerRequestCallback());
isShiny_ = false;
}
}
use of org.rstudio.studio.client.server.VoidServerRequestCallback in project rstudio by rstudio.
the class ProjectSourceControlPreferencesPane method confirmGitRepo.
private void confirmGitRepo(final Command onConfirmed) {
final ProgressIndicator indicator = getProgressIndicator();
indicator.onProgress("Checking for git repository...");
final String projDir = session_.getSessionInfo().getActiveProjectDir().getPath();
server_.gitHasRepo(projDir, new ServerRequestCallback<Boolean>() {
@Override
public void onResponseReceived(Boolean result) {
indicator.onCompleted();
if (result) {
onConfirmed.execute();
} else {
globalDisplay_.showYesNoMessage(MessageDialog.QUESTION, "Confirm New Git Repository", "Do you want to initialize a new git repository " + "for this project?", false, new Operation() {
@Override
public void execute() {
server_.gitInitRepo(projDir, new VoidServerRequestCallback(indicator) {
@Override
public void onSuccess() {
onConfirmed.execute();
}
@Override
public void onFailure() {
setVcsSelection(VCSConstants.NO_ID);
}
});
}
}, new Operation() {
@Override
public void execute() {
setVcsSelection(VCSConstants.NO_ID);
indicator.onCompleted();
}
}, true);
}
}
@Override
public void onError(ServerError error) {
setVcsSelection(VCSConstants.NO_ID);
indicator.onError(error.getUserMessage());
}
});
}
use of org.rstudio.studio.client.server.VoidServerRequestCallback in project rstudio by rstudio.
the class Shell method onConsoleClear.
@Handler
void onConsoleClear() {
// clear output
view_.clearOutput();
// notify server
server_.resetConsoleActions(new VoidServerRequestCallback());
// if we don't bounce setFocus the menu retains focus
Scheduler.get().scheduleDeferred(new ScheduledCommand() {
public void execute() {
view_.getInputEditorDisplay().setFocus(true);
}
});
}
Aggregations