// TOOD: move this back tot he constructor after we revise the
// interrupt hack(s)
events_.addHandler(ClientDisconnectedEvent.TYPE, this);
// create workbench
Workbench wb = workbench_.get();
eventBusProvider_.get().fireEvent(new SessionInitEvent()) ;
// disable commands
SessionInfo sessionInfo = session_.getSessionInfo();
if (!sessionInfo.getAllowShell())
{
commands_.showShellDialog().remove();
}
if (!sessionInfo.getAllowPackageInstallation())
{
commands_.installPackage().remove();
commands_.updatePackages().remove();
}
if (!sessionInfo.getAllowVcs())
{
commands_.versionControlProjectSetup().remove();
}
if (!sessionInfo.getAllowFileDownloads())
{
commands_.exportFiles().remove();
}
// disable rpubs if requested
if (!sessionInfo.getAllowRpubsPublish())
{
commands_.publishHTML().remove();
commands_.publishPlotToRPubs().remove();
commands_.presentationPublishToRpubs().remove();
commands_.viewerPublishToRPubs().remove();
}
// hide the agreement menu item if we don't have one
if (!session_.getSessionInfo().hasAgreement())
commands_.rstudioAgreement().setVisible(false);
// show workbench
view_.showWorkbenchView(wb.getMainView().asWidget());
// hide zoom actual size everywhere but cocoa desktop
if (!BrowseCap.isCocoaDesktop())
{
commands_.zoomActualSize().remove();