use of org.rstudio.studio.client.server.VoidServerRequestCallback in project rstudio by rstudio.
the class TextEditingTargetNotebook method setDirtyState.
private void setDirtyState() {
if (getCommitMode() == MODE_UNCOMMITTED && !dirtyState_.getValue()) {
// mark the document dirty (if it isn't already) since it now
// contains notebook cache changes that haven't been committed
dirtyState_.markDirty(false);
source_.setSourceDocumentDirty(docUpdateSentinel_.getId(), true, new VoidServerRequestCallback());
}
}
use of org.rstudio.studio.client.server.VoidServerRequestCallback in project rstudio by rstudio.
the class ConsoleProgressDialog method attachToProcess.
public void attachToProcess(final ConsoleProcess consoleProcess) {
consoleProcess_ = consoleProcess;
// interaction-always mode is a shell -- customize ui accordingly
if (getInteractionMode() == ConsoleProcessInfo.INTERACTION_ALWAYS) {
hideProgress();
stopButton().setText("Close");
int height = Window.getClientHeight() - 150;
int width = Math.min(800, Window.getClientWidth() - 150);
Style style = display_.getShellWidget().getElement().getStyle();
style.setHeight(height, Unit.PX);
style.setWidth(width, Unit.PX);
} else {
showProgress();
stopButton().setText("Stop");
}
stopButton().addClickHandler(this);
if (consoleProcess != null) {
addHandlerRegistration(consoleProcess.addConsolePromptHandler(this));
addHandlerRegistration(consoleProcess.addConsoleOutputHandler(this));
addHandlerRegistration(consoleProcess.addProcessExitHandler(this));
consoleProcess.start(new SimpleRequestCallback<Void>() {
@Override
public void onError(ServerError error) {
// Show error and stop
super.onError(error);
// if this is showOnOutput_ then we will never get
// a ProcessExitEvent or an onUnload so we should unsubscribe
// from events here
unregisterHandlers();
closeDialog();
}
});
}
addCloseHandler(new CloseHandler<PopupPanel>() {
@Override
public void onClose(CloseEvent<PopupPanel> popupPanelCloseEvent) {
if (consoleProcess != null)
consoleProcess.reap(new VoidServerRequestCallback());
}
});
}
use of org.rstudio.studio.client.server.VoidServerRequestCallback in project rstudio by rstudio.
the class TerminalPane method onTerminalTitle.
@Override
public void onTerminalTitle(TerminalTitleEvent event) {
// Notification from a TerminalSession that it changed its title
TerminalSession visibleTerm = getSelectedTerminal();
TerminalSession retitledTerm = event.getTerminalSession();
if (visibleTerm != null && visibleTerm.getHandle().equals(retitledTerm.getHandle())) {
// update the toolbar label if currently displayed terminal has changed
// its title
setTerminalTitle(retitledTerm.getTitle());
}
// Update local metadata
if (!terminals_.retitleTerminal(retitledTerm.getHandle(), retitledTerm.getTitle())) {
// title unchanged
return;
}
// update server
server_.processSetTitle(retitledTerm.getHandle(), retitledTerm.getTitle(), new VoidServerRequestCallback() {
@Override
public void onError(ServerError error) {
// failed; this might mean we show the wrong title after
// a reset, but it will update itself fairly quickly
Debug.logError(error);
}
});
}
use of org.rstudio.studio.client.server.VoidServerRequestCallback in project rstudio by rstudio.
the class TerminalSession method onResizeTerminal.
@Override
public void onResizeTerminal(ResizeTerminalEvent event) {
cols_ = event.getCols();
rows_ = event.getRows();
consoleProcess_.resizeTerminal(cols_, rows_, new VoidServerRequestCallback() {
@Override
public void onError(ServerError error) {
writeError(error.getUserMessage());
}
});
}
Aggregations