Package com.google.gwt.safehtml.shared

Examples of com.google.gwt.safehtml.shared.SafeHtmlBuilder


      ImageResource img = imgForStatus(str.charAt(0));

      if (img == null)
         return SafeHtmlUtils.fromString(str);

      SafeHtmlBuilder builder = new SafeHtmlBuilder();
      builder.append(SafeHtmlUtils.fromTrustedString(
            "<span " +
            "class=\"" + ctRes_.cellTableStyle().status() + "\" " +
            "title=\"" +
            SafeHtmlUtils.htmlEscape(descForStatus(str)) +
            "\">"));

      builder.append(SafeHtmlUtils.fromTrustedString(AbstractImagePrototype.create(
            img).getHTML()));

      builder.appendHtmlConstant("</span>");

      return builder.toSafeHtml();
   }
View Full Code Here


   private class SubjectRenderer implements SafeHtmlRenderer<CommitInfo>
   {
      @Override
      public SafeHtml render(CommitInfo commit)
      {
         SafeHtmlBuilder builder = new SafeHtmlBuilder();

         for (String ref : JsUtil.asIterable(commit.getRefs()))
         {
            String style = styles_.ref();
            if (ref.startsWith("refs/heads/"))
            {
               ref = ref.substring("refs/heads/".length());
               style += " " + styles_.branch();
            }
            else if (ref.startsWith("refs/remotes/"))
            {
               ref = ref.substring("refs/remotes/".length());
               style += " " + styles_.remote();
            }
            else if (ref.equals("HEAD"))
            {
               style += " " + styles_.head();
            }

            SafeHtmlUtil.appendSpan(builder, style, ref);
         }
         for (String tag : JsUtil.asIterable(commit.getTags()))
         {
            if (tag.startsWith("refs/tags/"))
               tag = tag.substring("refs/tags/".length());
            SafeHtmlUtil.appendSpan(builder, styles_.tag(), tag);
         }

         builder.appendEscaped(commit.getSubject());

         return builder.toSafeHtml();
      }
View Full Code Here

        return this;
    }

    @Deprecated
    public MultipleToOneLayout setDescription(String description) {
        this.description = new SafeHtmlBuilder().appendHtmlConstant(description).toSafeHtml();
        return this;
    }
View Full Code Here

        this.helpText = helpText;
    }

    public StaticHelpPanel(String helpText) {

        SafeHtmlBuilder builder = new SafeHtmlBuilder();
        builder.appendHtmlConstant("<div class='help-attribute-descriptions' style='padding-left:10px;'>");
        builder.appendHtmlConstant(helpText);
        builder.appendHtmlConstant("</div>");
        this.helpText = builder.toSafeHtml();
    }
View Full Code Here

    }

    @Override
    public void render(Context context, DeploymentRecord record, SafeHtmlBuilder sb) {
        if (isCellActive(record)) {
            SafeHtml html = new SafeHtmlBuilder()
                .appendHtmlConstant("<a href='javascript:void(0)' tabindex=\"-1\" class='textlink-cell'>")
                .appendHtmlConstant(this.command.getLabel(record))
                .appendHtmlConstant("</a>")
                .toSafeHtml();
            sb.append(html);
        } else {
            SafeHtml html = new SafeHtmlBuilder()
                .appendHtmlConstant("&nbsp;")
                .toSafeHtml();
            sb.append(html);
        }
    }
View Full Code Here

        super(new SafeHtmlCell());
    }

    @Override
    public SafeHtml getValue(DeploymentRecord record) {
        SafeHtmlBuilder html = new SafeHtmlBuilder();

        String title = null;
        if(record.getRuntimeName().length()>27)
            title = record.getName().substring(0,26)+"...";
        else
            title = record.getName();
        //html.appendHtmlConstant("<a href='javascript:void(0)' style='outline:none'>");
        html.appendEscaped(title);
        //html.appendHtmlConstant("</a>");

        if(record.getPath()!=null)
            html.appendHtmlConstant("&nbsp;<span class='footnote'><sup>[1]</sup></span>");

        return html.toSafeHtml();
    }
View Full Code Here

        form.setFields(contextName, workmanager);
        form.setNumColumns(2);

        form.bind(table);

        SafeHtmlBuilder description = new SafeHtmlBuilder();
        description.appendHtmlConstant(Console.CONSTANTS.subsys_jca_boostrap_config_desc());

        FormToolStrip<JcaBootstrapContext> formTools = new FormToolStrip<JcaBootstrapContext>(
                form,
                new FormToolStrip.FormCallback<JcaBootstrapContext>() {
                    @Override
                    public void onSave(Map<String, Object> changeset) {
                        presenter.onSaveBootstrapContext(form.getEditedEntity(), changeset);
                    }

                    @Override
                    public void onDelete(JcaBootstrapContext entity) {

                    }
                }
        );
        formTools.providesDeleteOp(false);

        final FormHelpPanel helpPanel = new FormHelpPanel(
                new FormHelpPanel.AddressCallback() {
                    @Override
                    public ModelNode getAddress() {
                        ModelNode address = Baseadress.get();
                        address.add("subsystem", "jca");
                        address.add("bootstrap-context", "*");
                        return address;
                    }
                }, form
        );

        VerticalPanel formPanel = new VerticalPanel();
        formPanel.setStyleName("fill-layout-width");
        formPanel.add(formTools.asWidget());
        formPanel.add(helpPanel.asWidget());
        formPanel.add(form.asWidget());

        Widget panel = new MultipleToOneLayout()
                .setPlain(true)
                .setTitle("Bootstrap")
                .setHeadline("JCA Bootstrap Contexts")
                .setDescription(description.toSafeHtml())
                .setMaster(Console.MESSAGES.available("Bootstrap Context"), table)
                .setTopLevelTools(topLevelTools.asWidget())
                .setDetail(Console.CONSTANTS.common_label_selection(), formPanel)
                .build();

View Full Code Here

                    window.setGlassEnabled(true);
                    window.center();
                }
                else {

                    SafeHtmlBuilder html = new SafeHtmlBuilder();
                    html.appendHtmlConstant(Console.CONSTANTS.subsys_jca_datasource_error_loadDriver_desc());
                    Feedback.alert(Console.CONSTANTS.subsys_jca_datasource_error_loadDriver(), html.toSafeHtml());
                }
            }
        });
    }
View Full Code Here

                    window.setGlassEnabled(true);
                    window.center();
                }
                else {
                    SafeHtmlBuilder html = new SafeHtmlBuilder();
                    html.appendHtmlConstant(Console.CONSTANTS.subsys_jca_datasource_error_loadDriver_desc());
                    Feedback.alert(Console.CONSTANTS.subsys_jca_datasource_error_loadDriver(), html.toSafeHtml());
                }
            }
        });

    }
View Full Code Here

            {
                render = TEMPLATE.render(labelId, title);
            }
            else
            {
                render = new SafeHtmlBuilder().toSafeHtml();
            }
            safeHtmlBuilder.append(render);
        }
View Full Code Here

TOP

Related Classes of com.google.gwt.safehtml.shared.SafeHtmlBuilder

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.