use of org.rstudio.core.client.widget.MessageDialog in project rstudio by rstudio.
the class VersionControlPage method acceptNavigation.
@Override
protected boolean acceptNavigation() {
SessionInfo sessionInfo = RStudioGinjector.INSTANCE.getSession().getSessionInfo();
if (!sessionInfo.isVcsAvailable(getVcsId())) {
NewProjectResources.Styles styles = NewProjectResources.INSTANCE.styles();
VerticalPanel verticalPanel = new VerticalPanel();
verticalPanel.addStyleName(styles.vcsNotInstalledWidget());
if (Desktop.isDesktop()) {
HTML msg = new HTML("<p>" + getTitle() + " was not detected " + "on the system path.</p>" + "<p>To create projects from " + getTitle() + " " + "repositories you should install " + getTitle() + " " + "and then restart RStudio.</p>" + "<p>Note that if " + getTitle() + " is installed " + "and not on the path, then you can specify its location using " + "the " + (BrowseCap.isMacintosh() ? "Preferences" : "Options") + " dialog.</p>");
msg.setWidth("100%");
verticalPanel.add(msg);
HelpLink vcsHelpLink = new VcsHelpLink();
vcsHelpLink.setCaption("Using " + getTitle() + " with RStudio");
vcsHelpLink.addStyleName(styles.vcsHelpLink());
verticalPanel.add(vcsHelpLink);
} else {
HTML msg = new HTML("<p>An installation of " + getTitle() + " was not detected " + "on this system.</p>" + "<p>To create projects from " + getTitle() + " " + "repositories you should request that your server " + "administrator install the " + getTitle() + " package.</p>");
msg.setWidth("100%");
verticalPanel.add(msg);
}
MessageDialog dlg = new MessageDialog(MessageDialog.INFO, getTitle() + " Not Found", verticalPanel);
dlg.addButton("OK", (Operation) null, true, false);
dlg.showModal();
return false;
} else {
return true;
}
}
use of org.rstudio.core.client.widget.MessageDialog in project rstudio by rstudio.
the class RStudioAPI method showDialog.
private void showDialog(String caption, String message, final String url) {
VerticalPanel verticalPanel = new VerticalPanel();
verticalPanel.addStyleName(RES.styles().textInfoWidget());
SafeHtml safeMsg = DialogHtmlSanitizer.sanitizeHtml(message);
HTML msg = new HTML(safeMsg.asString());
msg.setWidth("100%");
verticalPanel.add(msg);
if (!StringUtil.isNullOrEmpty(url)) {
HyperlinkLabel link = new HyperlinkLabel(url, new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
RStudioGinjector.INSTANCE.getGlobalDisplay().openWindow(url);
}
});
link.addStyleName(RES.styles().installLink());
verticalPanel.add(link);
}
MessageDialog dlg = new MessageDialog(MessageDialog.INFO, caption, verticalPanel);
dlg.addButton("OK", new Operation() {
@Override
public void execute() {
server_.showDialogCompleted(null, false, new SimpleRequestCallback<Void>());
}
}, true, false);
dlg.showModal();
}
Aggregations