use of org.rstudio.core.client.widget.HyperlinkLabel 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();
}
use of org.rstudio.core.client.widget.HyperlinkLabel in project rstudio by rstudio.
the class SupportPopupMenu method addMenuItem.
private void addMenuItem(FlexTable supportTable, String caption, final String email, final GlobalDisplay globalDisplay) {
// maintain reference to containing class for closing
final PopupPanel popupPanel = this;
// create a hyperlink label for this URL
HyperlinkLabel link = new HyperlinkLabel(caption, new ClickHandler() {
public void onClick(ClickEvent event) {
globalDisplay.openEmailComposeWindow(email, null);
popupPanel.hide();
}
});
int row = supportTable.getRowCount();
supportTable.setWidget(row, 0, link);
}
Aggregations