use of com.google.gwt.user.client.ui.HTML in project che by eclipse.
the class CompletionItemBasedCompletionProposal method createAdditionalInfoWidget.
private Widget createAdditionalInfoWidget() {
String documentation = completionItem.getDocumentation();
if (documentation == null || documentation.trim().isEmpty()) {
documentation = "No documentation found.";
}
HTML widget = new HTML(documentation);
widget.setWordWrap(true);
widget.getElement().getStyle().setColor(theme.completionPopupItemTextColor());
widget.getElement().getStyle().setFontSize(13, Style.Unit.PX);
widget.getElement().getStyle().setMarginLeft(4, Style.Unit.PX);
widget.getElement().getStyle().setOverflow(Overflow.AUTO);
widget.getElement().getStyle().setProperty("userSelect", "text");
widget.setHeight("100%");
return widget;
}
use of com.google.gwt.user.client.ui.HTML in project che by eclipse.
the class SubversionOutputConsoleViewImpl method printPredefinedStyle.
/**
* Print text with a given style in view.
*
* @param text
* The text to display
* @param style
*/
@Override
public void printPredefinedStyle(String text, String style) {
String preStyle = " style='margin:0px; font-size: 12px;' ";
HTML html = new HTML();
html.setHTML("<pre" + preStyle + "><span style='" + SimpleHtmlSanitizer.sanitizeHtml(style).asString() + "'>" + SimpleHtmlSanitizer.sanitizeHtml(text).asString() + "</span></pre>");
html.getElement().setAttribute("style", "padding-left: 2px;");
consoleArea.add(html);
}
use of com.google.gwt.user.client.ui.HTML in project che by eclipse.
the class SubversionOutputConsoleViewImpl method print.
@Override
public void print(String text, String color) {
String preStyle = " style='margin:0px; font-size: 12px;' ";
HTML html = new HTML();
html.setHTML("<pre" + preStyle + "><span style='color:" + SimpleHtmlSanitizer.sanitizeHtml(color).asString() + ";'>" + SimpleHtmlSanitizer.sanitizeHtml(text).asString() + "</span></pre>");
html.getElement().setAttribute("style", "padding-left: 2px;");
consoleArea.add(html);
}
use of com.google.gwt.user.client.ui.HTML in project perun by CESNET.
the class CreatePassword method validateAndSetUserExtSources.
/**
* Validates password and sets user ext sources
*
* @param userId user to set password for
* @param login used for validation only
* @param namespace defined login in namespace
*/
public void validateAndSetUserExtSources(int userId, String login, String namespace) {
this.userId = userId;
this.namespace = namespace;
this.login = login;
// test arguments
String errorMsg = "";
if (userId == 0) {
errorMsg += "<p>User ID can't be 0.";
}
if (namespace.isEmpty()) {
errorMsg += "<p>Namespace can't be empty.";
}
if (login.isEmpty()) {
errorMsg += "<p>Login to create password for can't be empty.";
}
if (errorMsg.length() > 0) {
Confirm c = new Confirm("Error while creating password.", new HTML(errorMsg), true);
c.show();
return;
}
JsonPostClient jspc = new JsonPostClient(events);
jspc.sendData(JSON_URL_VALIDATE_AND_SET_USER_EXT_SOURCE, validateCallJSON());
}
use of com.google.gwt.user.client.ui.HTML in project gerrit by GerritCodeReview.
the class RegisterScreen method onInitUI.
@Override
protected void onInitUI() {
super.onInitUI();
setPageTitle(Util.C.welcomeToGerritCodeReview());
final FlowPanel formBody = new FlowPanel();
final FlowPanel contactGroup = new FlowPanel();
contactGroup.setStyleName(Gerrit.RESOURCES.css().registerScreenSection());
contactGroup.add(new SmallHeading(Util.C.welcomeReviewContact()));
final HTML whereFrom = new HTML(Util.C.welcomeContactFrom());
whereFrom.setStyleName(Gerrit.RESOURCES.css().registerScreenExplain());
contactGroup.add(whereFrom);
contactGroup.add(new ContactPanelShort() {
@Override
protected void display(AccountInfo account) {
super.display(account);
if ("".equals(nameTxt.getText())) {
// No name? Encourage the user to provide us something.
//
nameTxt.setFocus(true);
save.setEnabled(true);
}
}
});
formBody.add(contactGroup);
if (Gerrit.getUserAccount().username() == null && Gerrit.info().auth().canEdit(AccountFieldName.USER_NAME)) {
final FlowPanel fp = new FlowPanel();
fp.setStyleName(Gerrit.RESOURCES.css().registerScreenSection());
fp.add(new SmallHeading(Util.C.welcomeUsernameHeading()));
final Grid userInfo = new Grid(1, 2);
final CellFormatter fmt = userInfo.getCellFormatter();
userInfo.setStyleName(Gerrit.RESOURCES.css().infoBlock());
userInfo.addStyleName(Gerrit.RESOURCES.css().accountInfoBlock());
fp.add(userInfo);
fmt.addStyleName(0, 0, Gerrit.RESOURCES.css().topmost());
fmt.addStyleName(0, 1, Gerrit.RESOURCES.css().topmost());
fmt.addStyleName(0, 0, Gerrit.RESOURCES.css().bottomheader());
UsernameField field = new UsernameField();
if (LocaleInfo.getCurrentLocale().isRTL()) {
userInfo.setText(0, 1, Util.C.userName());
userInfo.setWidget(0, 0, field);
fmt.addStyleName(0, 1, Gerrit.RESOURCES.css().header());
} else {
userInfo.setText(0, 0, Util.C.userName());
userInfo.setWidget(0, 1, field);
fmt.addStyleName(0, 0, Gerrit.RESOURCES.css().header());
}
formBody.add(fp);
}
if (Gerrit.info().hasSshd()) {
final FlowPanel sshKeyGroup = new FlowPanel();
sshKeyGroup.setStyleName(Gerrit.RESOURCES.css().registerScreenSection());
sshKeyGroup.add(new SmallHeading(Util.C.welcomeSshKeyHeading()));
final HTML whySshKey = new HTML(Util.C.welcomeSshKeyText());
whySshKey.setStyleName(Gerrit.RESOURCES.css().registerScreenExplain());
sshKeyGroup.add(whySshKey);
sshKeyGroup.add(new SshPanel() {
{
setKeyTableVisible(false);
}
});
formBody.add(sshKeyGroup);
}
final FlowPanel choices = new FlowPanel();
choices.setStyleName(Gerrit.RESOURCES.css().registerScreenNextLinks());
if (Gerrit.info().auth().useContributorAgreements()) {
final FlowPanel agreementGroup = new FlowPanel();
agreementGroup.setStyleName(Gerrit.RESOURCES.css().registerScreenSection());
agreementGroup.add(new SmallHeading(Util.C.welcomeAgreementHeading()));
final HTML whyAgreement = new HTML(Util.C.welcomeAgreementText());
whyAgreement.setStyleName(Gerrit.RESOURCES.css().registerScreenExplain());
agreementGroup.add(whyAgreement);
choices.add(new InlineHyperlink(Util.C.newAgreement(), PageLinks.SETTINGS_NEW_AGREEMENT));
choices.add(new InlineHyperlink(Util.C.welcomeAgreementLater(), nextToken));
formBody.add(agreementGroup);
} else {
choices.add(new InlineHyperlink(Util.C.welcomeContinue(), nextToken));
}
formBody.add(choices);
final FormPanel form = new FormPanel();
form.add(formBody);
add(form);
}
Aggregations