Search in sources :

Example 1 with HTML

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;
}
Also used : HTML(com.google.gwt.user.client.ui.HTML)

Example 2 with HTML

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);
}
Also used : HTML(com.google.gwt.user.client.ui.HTML)

Example 3 with 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);
}
Also used : HTML(com.google.gwt.user.client.ui.HTML)

Example 4 with 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());
}
Also used : JsonPostClient(cz.metacentrum.perun.webgui.json.JsonPostClient) Confirm(cz.metacentrum.perun.webgui.widgets.Confirm) HTML(com.google.gwt.user.client.ui.HTML) JSONString(com.google.gwt.json.client.JSONString)

Example 5 with HTML

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);
}
Also used : SmallHeading(com.google.gerrit.client.ui.SmallHeading) InlineHyperlink(com.google.gerrit.client.ui.InlineHyperlink) FormPanel(com.google.gwt.user.client.ui.FormPanel) Grid(com.google.gwt.user.client.ui.Grid) FlowPanel(com.google.gwt.user.client.ui.FlowPanel) HTML(com.google.gwt.user.client.ui.HTML) CellFormatter(com.google.gwt.user.client.ui.HTMLTable.CellFormatter) AccountInfo(com.google.gerrit.client.info.AccountInfo)

Aggregations

HTML (com.google.gwt.user.client.ui.HTML)170 ViewerPanel (org.cesiumjs.cs.widgets.ViewerPanel)34 ClickHandler (com.google.gwt.event.dom.client.ClickHandler)32 ClickEvent (com.google.gwt.event.dom.client.ClickEvent)31 Confirm (cz.metacentrum.perun.webgui.widgets.Confirm)26 VerticalPanel (com.google.gwt.user.client.ui.VerticalPanel)21 FlexTable (com.google.gwt.user.client.ui.FlexTable)17 JSONString (com.google.gwt.json.client.JSONString)16 ChangeEvent (com.google.gwt.event.dom.client.ChangeEvent)14 ChangeHandler (com.google.gwt.event.dom.client.ChangeHandler)14 Label (com.google.gwt.user.client.ui.Label)14 AbsolutePanel (com.google.gwt.user.client.ui.AbsolutePanel)13 HorizontalPanel (com.google.gwt.user.client.ui.HorizontalPanel)12 Image (com.google.gwt.user.client.ui.Image)11 Widget (com.google.gwt.user.client.ui.Widget)11 ViewerOptions (org.cesiumjs.cs.widgets.options.ViewerOptions)11 Button (org.gwtbootstrap3.client.ui.Button)11 ListBox (com.google.gwt.user.client.ui.ListBox)10 ArrayList (java.util.ArrayList)10 SmallLabel (org.uberfire.ext.widgets.common.client.common.SmallLabel)10