use of org.rstudio.studio.client.rmarkdown.model.RmdRenderResult in project rstudio by rstudio.
the class RmdOutput method onRenderRmd.
@Override
public void onRenderRmd(final RenderRmdEvent event) {
quitInitiatedAfterLastRender_ = false;
final Operation renderOperation = new Operation() {
@Override
public void execute() {
renderInProgress_ = true;
server_.renderRmd(event.getSourceFile(), event.getSourceLine(), event.getFormat(), event.getEncoding(), event.getParamsFile(), event.asTempfile(), event.getType(), event.getExistingOutputFile(), event.getWorkingDir(), event.getViewerType(), new SimpleRequestCallback<Boolean>() {
@Override
public void onError(ServerError error) {
renderInProgress_ = false;
}
});
}
};
// information back into the preview window.
if (shinyDoc_ != null && event.getSourceFile().equals(shinyDoc_.getFile()) && !shinyDoc_.getFormat().getFormatName().endsWith(RmdOutputFormat.OUTPUT_PRESENTATION_SUFFIX) && (result_ == null || "shiny".equals(result_.getRuntime()))) {
final RmdRenderResult result = RmdRenderResult.createFromShinyDoc(shinyDoc_);
displayHTMLRenderResult(result);
} else {
performRenderOperation(renderOperation);
}
}
use of org.rstudio.studio.client.rmarkdown.model.RmdRenderResult in project rstudio by rstudio.
the class RmdOutput method onRmdRenderCompleted.
@Override
public void onRmdRenderCompleted(RmdRenderCompletedEvent event) {
renderInProgress_ = false;
// that instead
if (onRenderCompleted_ != null) {
onRenderCompleted_.execute();
onRenderCompleted_ = null;
return;
}
// ignore failures and completed Shiny docs (the latter are handled when
// the server starts rather than when the render process is finished)
final RmdRenderResult result = event.getResult();
if (result.isShinyDocument()) {
shinyDoc_ = null;
return;
}
if (result.hasShinyContent() && !result.isShinyDocument()) {
// If the result has Shiny content but wasn't rendered as a Shiny
// document, suggest rendering as a Shiny document instead
new ShinyDocumentWarningDialog(new OperationWithInput<Integer>() {
@Override
public void execute(Integer input) {
switch(input) {
case ShinyDocumentWarningDialog.RENDER_SHINY_NO:
if (result.getSucceeded())
displayRenderResult(result);
break;
case ShinyDocumentWarningDialog.RENDER_SHINY_ONCE:
rerenderAsShiny(result);
break;
case ShinyDocumentWarningDialog.RENDER_SHINY_ALWAYS:
events_.fireEvent(new ConvertToShinyDocEvent(result.getTargetFile()));
break;
}
}
}).showModal();
} else if (result.getSucceeded()) {
displayRenderResult(event.getResult());
}
}
use of org.rstudio.studio.client.rmarkdown.model.RmdRenderResult in project rstudio by rstudio.
the class RmdOutput method displayRenderResult.
private void displayRenderResult(WindowEx win, int viewerType, RmdPreviewParams params) {
if (viewerType == RMD_VIEWER_TYPE_NONE)
return;
RmdRenderResult result = params.getResult();
if (outputFrame_ == null)
outputFrame_ = createOutputFrame(viewerType);
// we're refreshing if the window is up and we're pulling the same
// output file as the last one
boolean isRefresh = win != null && result_ != null && result_.getOutputFile().equals(result.getOutputFile());
// position of the old document before we replace it
if (!isRefresh && result_ != null && win != null) {
cacheDocPosition(result_, outputFrame_.getScrollPosition(), outputFrame_.getAnchor());
}
// if it is a refresh, use the doc's existing positions
if (isRefresh) {
params.setScrollPosition(outputFrame_.getScrollPosition());
params.setAnchor(outputFrame_.getAnchor());
}
boolean isNotebook = result_ != null && FileSystemItem.getExtensionFromPath(result_.getOutputFile()) == NOTEBOOK_EXT;
// show the preview; activate the window (but not for auto-refresh of
// notebook preview)
outputFrame_.showRmdPreview(params, !(isRefresh && isNotebook && result.viewed()));
result.setViewed(true);
// reset live preview state
livePreviewRenderInProgress_ = false;
// save the result so we know if the next render is a re-render of the
// same document
result_ = result;
}
use of org.rstudio.studio.client.rmarkdown.model.RmdRenderResult in project rstudio by rstudio.
the class RmdOutput method onRmdShinyDocStarted.
@Override
public void onRmdShinyDocStarted(RmdShinyDocStartedEvent event) {
shinyDoc_ = event.getDocInfo();
RmdRenderResult result = RmdRenderResult.createFromShinyDoc(shinyDoc_);
displayHTMLRenderResult(result);
}
use of org.rstudio.studio.client.rmarkdown.model.RmdRenderResult in project rstudio by rstudio.
the class ClientEventDispatcher method dispatchEvent.
private void dispatchEvent(ClientEvent event) {
String type = event.getType();
try {
if (type.equals(ClientEvent.Busy)) {
boolean busy = event.<Bool>getData().getValue();
eventBus_.fireEvent(new BusyEvent(busy));
} else if (type.equals(ClientEvent.ConsoleOutput)) {
ConsoleText output = event.getData();
eventBus_.fireEvent(new ConsoleWriteOutputEvent(output));
} else if (type.equals(ClientEvent.ConsoleError)) {
ConsoleText error = event.getData();
eventBus_.fireEvent(new ConsoleWriteErrorEvent(error));
} else if (type.equals(ClientEvent.ConsoleWritePrompt)) {
String prompt = event.getData();
eventBus_.fireEvent(new ConsoleWritePromptEvent(prompt));
} else if (type.equals(ClientEvent.ConsoleWriteInput)) {
ConsoleText input = event.getData();
eventBus_.fireEvent(new ConsoleWriteInputEvent(input));
} else if (type.equals(ClientEvent.ConsolePrompt)) {
ConsolePrompt prompt = event.getData();
eventBus_.fireEvent(new ConsolePromptEvent(prompt));
} else if (type.equals(ClientEvent.ShowEditor)) {
ShowEditorData data = event.getData();
eventBus_.fireEvent(new ShowEditorEvent(data));
} else if (type.equals(ClientEvent.FileChanged)) {
FileChange fileChange = event.getData();
eventBus_.fireEvent(new FileChangeEvent(fileChange));
} else if (type.equals(ClientEvent.WorkingDirChanged)) {
String path = event.getData();
eventBus_.fireEvent(new WorkingDirChangedEvent(path));
} else if (type.equals(ClientEvent.ShowHelp)) {
String helpUrl = event.getData();
eventBus_.fireEvent(new ShowHelpEvent(helpUrl));
} else if (type.equals(ClientEvent.ShowErrorMessage)) {
ErrorMessage errorMessage = event.getData();
eventBus_.fireEvent(new ShowErrorMessageEvent(errorMessage));
} else if (type.equals(ClientEvent.ChooseFile)) {
boolean newFile = event.<Bool>getData().getValue();
eventBus_.fireEvent(new ChooseFileEvent(newFile));
} else if (type.equals(ClientEvent.BrowseUrl)) {
BrowseUrlInfo urlInfo = event.getData();
eventBus_.fireEvent(new BrowseUrlEvent(urlInfo));
} else if (type.equals(ClientEvent.PlotsStateChanged)) {
PlotsState plotsState = event.getData();
eventBus_.fireEvent(new PlotsChangedEvent(plotsState));
} else if (type.equals(ClientEvent.ViewData)) {
DataView dataView = event.getData();
eventBus_.fireEvent(new ViewDataEvent(dataView));
} else if (type.equals(ClientEvent.PackageStateChanged)) {
PackageState newState = event.getData();
eventBus_.fireEvent(new PackageStateChangedEvent(newState));
} else if (type.equals(ClientEvent.PackageStatusChanged)) {
PackageStatus status = event.getData();
eventBus_.fireEvent(new PackageStatusChangedEvent(status));
} else if (type.equals(ClientEvent.Locator)) {
eventBus_.fireEvent(new LocatorEvent());
} else if (type.equals(ClientEvent.ConsoleResetHistory)) {
ConsoleResetHistory reset = event.getData();
eventBus_.fireEvent(new ConsoleResetHistoryEvent(reset));
} else if (type.equals(ClientEvent.SessionSerialization)) {
SessionSerializationAction action = event.getData();
eventBus_.fireEvent(new SessionSerializationEvent(action));
} else if (type.equals(ClientEvent.HistoryEntriesAdded)) {
RpcObjectList<HistoryEntry> entries = event.getData();
eventBus_.fireEvent(new HistoryEntriesAddedEvent(entries));
} else if (type.equals(ClientEvent.QuotaStatus)) {
QuotaStatus quotaStatus = event.getData();
eventBus_.fireEvent(new QuotaStatusEvent(quotaStatus));
} else if (type.equals(ClientEvent.FileEdit)) {
FileSystemItem file = event.getData();
eventBus_.fireEvent(new FileEditEvent(file));
} else if (type.equals(ClientEvent.ShowContent)) {
ContentItem content = event.getData();
eventBus_.fireEvent(new ShowContentEvent(content));
} else if (type.equals(ClientEvent.ShowData)) {
DataItem data = event.getData();
eventBus_.fireEvent(new ShowDataEvent(data));
} else if (type.equals(ClientEvent.AbendWarning)) {
eventBus_.fireEvent(new SessionAbendWarningEvent());
} else if (type.equals(ClientEvent.ShowWarningBar)) {
WarningBarMessage message = event.getData();
eventBus_.fireEvent(new ShowWarningBarEvent(message));
} else if (type.equals(ClientEvent.OpenProjectError)) {
OpenProjectError error = event.getData();
eventBus_.fireEvent(new OpenProjectErrorEvent(error));
} else if (type.equals(ClientEvent.VcsRefresh)) {
JsObject data = event.getData();
eventBus_.fireEvent(new VcsRefreshEvent(Reason.NA, data.getInteger("delay")));
} else if (type.equals(ClientEvent.AskPass)) {
AskPassEvent.Data data = event.getData();
eventBus_.fireEvent(new AskPassEvent(data));
} else if (type.equals(ClientEvent.ConsoleProcessOutput)) {
ServerConsoleOutputEvent.Data data = event.getData();
eventBus_.fireEvent(new ServerConsoleOutputEvent(data.getHandle(), data.getOutput(), data.isError()));
} else if (type.equals(ClientEvent.ConsoleProcessPrompt)) {
ServerConsolePromptEvent.Data data = event.getData();
eventBus_.fireEvent(new ServerConsolePromptEvent(data.getHandle(), data.getPrompt()));
} else if (type.equals(ClientEvent.ConsoleProcessCreated)) {
ConsoleProcessCreatedEvent.Data data = event.getData();
eventBus_.fireEvent(new ConsoleProcessCreatedEvent(data));
} else if (type.equals(ClientEvent.ConsoleProcessExit)) {
ServerProcessExitEvent.Data data = event.getData();
eventBus_.fireEvent(new ServerProcessExitEvent(data.getHandle(), data.getExitCode()));
} else if (type.equals(ClientEvent.HTMLPreviewStartedEvent)) {
HTMLPreviewStartedEvent.Data data = event.getData();
eventBus_.fireEvent(new HTMLPreviewStartedEvent(data));
} else if (type.equals(ClientEvent.HTMLPreviewOutputEvent)) {
String output = event.getData();
eventBus_.fireEvent(new HTMLPreviewOutputEvent(output));
} else if (type.equals(ClientEvent.HTMLPreviewCompletedEvent)) {
HTMLPreviewResult result = event.getData();
eventBus_.fireEvent(new HTMLPreviewCompletedEvent(result));
} else if (type.equals(ClientEvent.CompilePdfStartedEvent)) {
CompilePdfStartedEvent.Data data = event.getData();
eventBus_.fireEvent(new CompilePdfStartedEvent(data));
} else if (type.equals(ClientEvent.CompilePdfOutputEvent)) {
CompileOutput output = event.getData();
eventBus_.fireEvent(new CompilePdfOutputEvent(output));
} else if (type.equals(ClientEvent.CompilePdfErrorsEvent)) {
JsArray<SourceMarker> data = event.getData();
eventBus_.fireEvent(new CompilePdfErrorsEvent(data));
} else if (type.equals(ClientEvent.CompilePdfCompletedEvent)) {
CompilePdfResult result = event.getData();
eventBus_.fireEvent(new CompilePdfCompletedEvent(result));
} else if (type.equals(ClientEvent.SynctexEditFile)) {
SourceLocation sourceLocation = event.getData();
eventBus_.fireEvent(new SynctexEditFileEvent(sourceLocation));
} else if (type.equals(ClientEvent.FindResult)) {
FindResultEvent.Data data = event.getData();
eventBus_.fireEvent(new FindResultEvent(data.getHandle(), data.getResults().toArrayList()));
} else if (type.equals(ClientEvent.FindOperationEnded)) {
String data = event.getData();
eventBus_.fireEvent(new FindOperationEndedEvent(data));
} else if (type.equals(ClientEvent.RPubsUploadStatus)) {
RPubsUploadStatusEvent.Status status = event.getData();
eventBus_.fireEvent(new RPubsUploadStatusEvent(status));
} else if (type.equals(ClientEvent.BuildStarted)) {
eventBus_.fireEvent(new BuildStartedEvent());
} else if (type.equals(ClientEvent.BuildOutput)) {
CompileOutput data = event.getData();
eventBus_.fireEvent(new BuildOutputEvent(data));
} else if (type.equals(ClientEvent.BuildCompleted)) {
BuildCompletedEvent.Data data = event.getData();
eventBus_.fireEvent(new BuildCompletedEvent(data));
} else if (type.equals(ClientEvent.BuildErrors)) {
BuildErrorsEvent.Data data = event.getData();
eventBus_.fireEvent(new BuildErrorsEvent(data));
} else if (type.equals(ClientEvent.DirectoryNavigate)) {
DirectoryNavigateEvent.Data data = event.getData();
eventBus_.fireEvent(new DirectoryNavigateEvent(data));
} else if (type.equals(ClientEvent.DeferredInitCompleted)) {
eventBus_.fireEvent(new DeferredInitCompletedEvent());
} else if (type.equals(ClientEvent.PlotsZoomSizeChanged)) {
PlotsZoomSizeChangedEvent.Data data = event.getData();
eventBus_.fireEvent(new PlotsZoomSizeChangedEvent(data));
} else if (type.equals(ClientEvent.SourceCppStarted)) {
eventBus_.fireEvent(new SourceCppStartedEvent());
} else if (type.equals(ClientEvent.SourceCppCompleted)) {
SourceCppState state = event.getData();
eventBus_.fireEvent(new SourceCppCompletedEvent(state));
} else if (type.equals(ClientEvent.LoadedPackageUpdates)) {
String installCmd = event.getData();
eventBus_.fireEvent(new LoadedPackageUpdatesEvent(installCmd));
} else if (type.equals(ClientEvent.ActivatePane)) {
String pane = event.getData();
eventBus_.fireEvent(new ActivatePaneEvent(pane));
} else if (type.equals(ClientEvent.ShowPresentationPane)) {
PresentationState state = event.getData();
eventBus_.fireEvent(new ShowPresentationPaneEvent(state));
} else if (type.equals(ClientEvent.EnvironmentRefresh)) {
eventBus_.fireEvent(new EnvironmentRefreshEvent());
} else if (type.equals(ClientEvent.ListChanged)) {
eventBus_.fireEvent(new ListChangedEvent(event.<JsObject>getData()));
} else if (type.equals(ClientEvent.UiPrefsChanged)) {
UiPrefsChangedEvent.Data data = event.getData();
eventBus_.fireEvent(new UiPrefsChangedEvent(data));
} else if (type.equals(ClientEvent.ContextDepthChanged)) {
EnvironmentContextData data = event.getData();
eventBus_.fireEvent(new ContextDepthChangedEvent(data, true));
} else if (type.equals(ClientEvent.HandleUnsavedChanges)) {
eventBus_.fireEvent(new HandleUnsavedChangesEvent());
} else if (type.equals(ClientEvent.Quit)) {
QuitEvent.Data data = event.getData();
eventBus_.fireEvent(new QuitEvent(data));
} else if (type.equals(ClientEvent.Suicide)) {
// NOTE: we don't explicitly stop listening for events here
// for the reasons cited above in ClientEvent.Quit
// fire event
String message = event.getData();
eventBus_.fireEvent(new SuicideEvent(message));
} else if (type.equals(ClientEvent.SaveActionChanged)) {
SaveAction action = event.getData();
eventBus_.fireEvent(new SaveActionChangedEvent(action));
} else if (type.equals(ClientEvent.EnvironmentAssigned)) {
RObject objectInfo = event.getData();
eventBus_.fireEvent(new EnvironmentObjectAssignedEvent(objectInfo));
} else if (type.equals(ClientEvent.EnvironmentRemoved)) {
String objectName = event.getData();
eventBus_.fireEvent(new EnvironmentObjectRemovedEvent(objectName));
} else if (type.equals(ClientEvent.BrowserLineChanged)) {
LineData lineData = event.getData();
eventBus_.fireEvent(new BrowserLineChangedEvent(lineData));
} else if (type.equals(ClientEvent.PackageLoaded)) {
eventBus_.fireEvent(new PackageLoadedEvent((String) event.getData()));
} else if (type.equals(ClientEvent.PackageUnloaded)) {
eventBus_.fireEvent(new PackageUnloadedEvent((String) event.getData()));
} else if (type.equals(ClientEvent.PresentationPaneRequestCompleted)) {
eventBus_.fireEvent(new PresentationPaneRequestCompletedEvent());
} else if (type.equals(ClientEvent.UnhandledError)) {
UnhandledError err = event.getData();
eventBus_.fireEvent(new UnhandledErrorEvent(err));
} else if (type.equals(ClientEvent.ErrorHandlerChanged)) {
ErrorHandlerType handlerType = event.getData();
eventBus_.fireEvent(new ErrorHandlerChangedEvent(handlerType));
} else if (type.equals(ClientEvent.ViewerNavigate)) {
ViewerNavigateEvent.Data data = event.getData();
eventBus_.fireEvent(new ViewerNavigateEvent(data));
} else if (type.equals(ClientEvent.SourceExtendedTypeDetected)) {
SourceExtendedTypeDetectedEvent.Data data = event.getData();
eventBus_.fireEvent(new SourceExtendedTypeDetectedEvent(data));
} else if (type.equals(ClientEvent.ShinyViewer)) {
ShinyApplicationParams data = event.getData();
eventBus_.fireEvent(new ShinyApplicationStatusEvent(data, true));
} else if (type.equals(ClientEvent.DebugSourceCompleted)) {
DebugSourceResult result = (DebugSourceResult) event.getData();
eventBus_.fireEvent(new DebugSourceCompletedEvent(result));
} else if (type.equals(ClientEvent.RmdRenderStarted)) {
RmdRenderStartedEvent.Data data = event.getData();
eventBus_.fireEvent(new RmdRenderStartedEvent(data));
} else if (type.equals(ClientEvent.RmdRenderOutput)) {
CompileOutput data = event.getData();
eventBus_.fireEvent(new RmdRenderOutputEvent(data));
} else if (type.equals(ClientEvent.RmdRenderCompleted)) {
RmdRenderResult result = event.getData();
eventBus_.fireEvent(new RmdRenderCompletedEvent(result));
} else if (type.equals(ClientEvent.RmdShinyDocStarted)) {
RmdShinyDocInfo docInfo = event.getData();
eventBus_.fireEvent(new RmdShinyDocStartedEvent(docInfo));
} else if (type.equals(ClientEvent.RSConnectDeploymentOutput)) {
CompileOutput output = event.getData();
eventBus_.fireEvent(new RSConnectDeploymentOutputEvent(output));
} else if (type.equals(ClientEvent.RSConnectDeploymentCompleted)) {
String url = event.getData();
eventBus_.fireEvent(new RSConnectDeploymentCompletedEvent(url));
} else if (type.equals(ClientEvent.RSConnectDeploymentFailed)) {
RSConnectDeploymentFailedEvent.Data data = event.getData();
eventBus_.fireEvent(new RSConnectDeploymentFailedEvent(data));
} else if (type.equals(ClientEvent.UserPrompt)) {
UserPrompt prompt = event.getData();
eventBus_.fireEvent(new UserPromptEvent(prompt));
} else if (type.equals(ClientEvent.InstallRtools)) {
InstallRtoolsEvent.Data data = event.getData();
eventBus_.fireEvent(new InstallRtoolsEvent(data));
} else if (type.equals(ClientEvent.InstallShiny)) {
String userAction = event.getData();
eventBus_.fireEvent(new InstallShinyEvent(userAction));
} else if (type.equals(ClientEvent.SuspendAndRestart)) {
SuspendAndRestartEvent.Data data = event.getData();
eventBus_.fireEvent(new SuspendAndRestartEvent(data));
} else if (type.equals(ClientEvent.DataViewChanged)) {
DataViewChangedEvent.Data data = event.getData();
eventBus_.fireEvent(new DataViewChangedEvent(data));
} else if (type.equals(ClientEvent.ViewFunction)) {
SearchPathFunctionDefinition data = event.getData();
eventBus_.fireEvent(new CodeBrowserNavigationEvent(data, null, false, true));
} else if (type.equals(ClientEvent.MarkersChanged)) {
MarkersChangedEvent.Data data = event.getData();
eventBus_.fireEvent(new MarkersChangedEvent(data));
} else if (type.equals(ClientEvent.EnableRStudioConnect)) {
EnableRStudioConnectUIEvent.Data data = event.getData();
eventBus_.fireEvent(new EnableRStudioConnectUIEvent(data));
} else if (type.equals(ClientEvent.UpdateGutterMarkers)) {
LintEvent.Data data = event.getData();
eventBus_.fireEvent(new LintEvent(data));
} else if (type.equals(ClientEvent.SnippetsChanged)) {
SnippetsChangedEvent.Data data = event.getData();
eventBus_.fireEvent(new SnippetsChangedEvent(data));
} else if (type.equals(ClientEvent.JumpToFunction)) {
JumpToFunctionEvent.Data data = event.getData();
eventBus_.fireEvent(new JumpToFunctionEvent(data));
} else if (type.equals(ClientEvent.CollabEditStarted)) {
CollabEditStartParams params = event.getData();
eventBus_.fireEvent(new CollabEditStartedEvent(params));
} else if (type.equals(ClientEvent.SessionCountChanged)) {
SessionCountChangedEvent.Data data = event.getData();
eventBus_.fireEvent(new SessionCountChangedEvent(data));
} else if (type.equals(ClientEvent.CollabEditEnded)) {
CollabEditEndedEvent.Data data = event.getData();
eventBus_.fireEvent(new CollabEditEndedEvent(data));
} else if (type.equals(ClientEvent.ProjectUsersChanged)) {
ProjectUserChangedEvent.Data data = event.getData();
eventBus_.fireEvent(new ProjectUserChangedEvent(data));
} else if (type.equals(ClientEvent.RVersionsChanged)) {
RVersionsInfo versions = event.getData();
eventBus_.fireEvent(new RVersionsChangedEvent(versions));
} else if (type.equals(ClientEvent.ShinyGadgetDialog)) {
ShinyGadgetDialogEvent.Data data = event.getData();
eventBus_.fireEvent(new ShinyGadgetDialogEvent(data));
} else if (type.equals(ClientEvent.RmdParamsReady)) {
String paramsFile = event.getData();
eventBus_.fireEvent(new RmdParamsReadyEvent(paramsFile));
} else if (type.equals(ClientEvent.RegisterUserCommand)) {
RegisterUserCommandEvent.Data data = event.getData();
eventBus_.fireEvent(new RegisterUserCommandEvent(data));
} else if (type.equals(ClientEvent.SendToConsole)) {
SendToConsoleEvent.Data data = event.getData();
eventBus_.fireEvent(new SendToConsoleEvent(data));
} else if (type.equals(ClientEvent.UserFollowStarted)) {
ProjectUser user = event.getData();
eventBus_.fireEvent(new FollowUserEvent(user, true));
} else if (type.equals(ClientEvent.UserFollowEnded)) {
ProjectUser user = event.getData();
eventBus_.fireEvent(new FollowUserEvent(user, false));
} else if (type.equals(ClientEvent.ProjectAccessRevoked)) {
eventBus_.fireEvent(new ProjectAccessRevokedEvent());
} else if (type.equals(ClientEvent.CollabEditSaved)) {
CollabEditSavedEvent.Data data = event.getData();
eventBus_.fireEvent(new CollabEditSavedEvent(data));
} else if (type.equals(ClientEvent.AddinRegistryUpdated)) {
RAddins data = event.getData();
eventBus_.fireEvent(new AddinRegistryUpdatedEvent(data));
} else if (type.equals(ClientEvent.ChunkOutput)) {
RmdChunkOutput data = event.getData();
eventBus_.fireEvent(new RmdChunkOutputEvent(data));
} else if (type.equals(ClientEvent.ChunkOutputFinished)) {
RmdChunkOutputFinishedEvent.Data data = event.getData();
eventBus_.fireEvent(new RmdChunkOutputFinishedEvent(data));
} else if (type.equals(ClientEvent.RprofStarted)) {
eventBus_.fireEvent(new RprofEvent(RprofEvent.RprofEventType.START, null));
} else if (type.equals(ClientEvent.RprofStopped)) {
eventBus_.fireEvent(new RprofEvent(RprofEvent.RprofEventType.STOP, null));
} else if (type.equals(ClientEvent.RprofCreated)) {
RprofEvent.Data data = event.getData();
eventBus_.fireEvent(new RprofEvent(RprofEvent.RprofEventType.CREATE, data));
} else if (type.equals(ClientEvent.EditorCommand)) {
EditorCommandEvent.Data data = event.getData();
EditorCommandEvent payload = new EditorCommandEvent(data);
eventBus_.fireEvent(new EditorCommandDispatchEvent(payload));
} else if (type.equals(ClientEvent.PreviewRmd)) {
PreviewRmdEvent.Data data = event.getData();
eventBus_.fireEvent(new PreviewRmdEvent(data));
} else if (type.equals(ClientEvent.WebsiteFileSaved)) {
FileSystemItem fsi = event.getData();
eventBus_.fireEvent(new WebsiteFileSavedEvent(fsi));
} else if (type.equals(ClientEvent.ChunkPlotRefreshed)) {
ChunkPlotRefreshedEvent.Data data = event.getData();
eventBus_.fireEvent(new ChunkPlotRefreshedEvent(data));
} else if (type.equals(ClientEvent.ChunkPlotRefreshFinished)) {
ChunkPlotRefreshFinishedEvent.Data data = event.getData();
eventBus_.fireEvent(new ChunkPlotRefreshFinishedEvent(data));
} else if (type.equals(ClientEvent.ReloadWithLastChanceSave)) {
eventBus_.fireEvent(new ReloadWithLastChanceSaveEvent());
} else if (type.equals(ClientEvent.ConnectionUpdated)) {
ConnectionUpdatedEvent.Data data = event.getData();
eventBus_.fireEvent(new ConnectionUpdatedEvent(data));
} else if (type.equals(ClientEvent.EnableConnections)) {
eventBus_.fireEvent(new EnableConnectionsEvent());
} else if (type.equals(ClientEvent.ConnectionListChanged)) {
JsArray<Connection> connections = event.getData();
eventBus_.fireEvent(new ConnectionListChangedEvent(connections));
} else if (type.equals(ClientEvent.ActiveConnectionsChanged)) {
JsArray<ConnectionId> connections = event.getData();
eventBus_.fireEvent(new ActiveConnectionsChangedEvent(connections));
} else if (type.equals(ClientEvent.ConnectionOpened)) {
Connection connection = event.getData();
eventBus_.fireEvent(new ConnectionOpenedEvent(connection));
} else if (type.equals(ClientEvent.NotebookRangeExecuted)) {
NotebookRangeExecutedEvent.Data data = event.getData();
eventBus_.fireEvent(new NotebookRangeExecutedEvent(data));
} else if (type.equals(ClientEvent.ChunkExecStateChanged)) {
ChunkExecStateChangedEvent.Data data = event.getData();
eventBus_.fireEvent(new ChunkExecStateChangedEvent(data));
} else if (type.equals(ClientEvent.NavigateShinyFrame)) {
ShinyFrameNavigatedEvent.Data data = event.getData();
eventBus_.fireEvent(new ShinyFrameNavigatedEvent(data));
} else if (type.equals(ClientEvent.UpdateNewConnectionDialog)) {
NewConnectionDialogUpdatedEvent.Data data = event.getData();
eventBus_.fireEvent(new NewConnectionDialogUpdatedEvent(data));
} else if (type.equals(ClientEvent.ProjectTemplateRegistryUpdated)) {
ProjectTemplateRegistry data = event.getData();
eventBus_.fireEvent(new ProjectTemplateRegistryUpdatedEvent(data));
} else if (type.equals(ClientEvent.TerminalSubProcs)) {
TerminalSubprocEvent.Data data = event.getData();
eventBus_.fireEvent(new TerminalSubprocEvent(data));
} else if (type.equals(ClientEvent.PackageExtensionIndexingCompleted)) {
PackageProvidedExtensions.Data data = event.getData();
eventBus_.fireEvent(new PackageExtensionIndexingCompletedEvent(data));
} else if (type.equals(ClientEvent.RStudioAPIShowDialog)) {
RStudioAPIShowDialogEvent.Data data = event.getData();
eventBus_.fireEvent(new RStudioAPIShowDialogEvent(data));
} else {
GWT.log("WARNING: Server event not dispatched: " + type, null);
}
} catch (Throwable e) {
GWT.log("WARNING: Exception occured dispatching event: " + type, e);
}
}
Aggregations