Package com.google.gwt.safehtml.shared

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


        sb.appendHtmlConstant("<div>");

        // current user
        String userHtml = "<i style='color:#cecece' class='icon-user'></i>&nbsp;"+bootstrap.getPrincipal();

        SafeHtml principal = new SafeHtmlBuilder().appendHtmlConstant("<div class='header-textlink'>"+userHtml+"</div>").toSafeHtml();
        final HTML userButton = new HTML(principal);
        userButton.getElement().setAttribute("style", "cursor:pointer");
        tools.add(userButton);

        final DefaultPopup menuPopup = new DefaultPopup(DefaultPopup.Arrow.TOP);
View Full Code Here


        // user menu

        // current user
        String userHtml = "<i style='color:#cecece' class='icon-user'></i>&nbsp;"+Console.getBootstrapContext().getPrincipal();
        HTML roleHtml = new HTML("<i class='icon-tags'></i>&nbsp;"+Console.getBootstrapContext().getRole());
        SafeHtml principal = new SafeHtmlBuilder().appendHtmlConstant("<div class='header-textlink'>"+userHtml+"</div>").toSafeHtml();
        final HTML userButton = new HTML(principal);
        userButton.getElement().setAttribute("style", "cursor:pointer");
        tools.add(userButton);

        final DefaultPopup menuPopup = new DefaultPopup(DefaultPopup.Arrow.TOP);
View Full Code Here

  public Column<Dto, SafeHtml> getColumn(final String fieldName, final View viewMode, final Callback<QuicksearchValue> fieldUpdatedCallback) {
    return new Column<Dto, SafeHtml>(new SafeHtmlCell()) {
      @Override
      public SafeHtml getValue(final Dto object) {
        if (View.isReadOnly(viewMode)) {
          return new SafeHtml() {
            private static final long serialVersionUID = -8017901422992491763L;
            @Override
            public String asString() {
              final String name = getInitialName(fieldName, object);
              return null == name ? "[unresolved]" : name;
View Full Code Here

   * @return the rendered HTML
   */
  SafeHtml getImageHtml(ImageResource res, VerticalAlignmentConstant valign,
      boolean isPlaceholder) {
    // Get the HTML for the image.
    SafeHtml image;
    if (isPlaceholder) {
      image = SafeHtmlUtils.fromTrustedString("<div></div>");
    } else {
      AbstractImagePrototype proto = AbstractImagePrototype.create(res);
      image = SafeHtmlUtils.fromTrustedString(proto.getHTML());
View Full Code Here

      viewData = null;
    }

    if (viewData != null) {
      String text = viewData.getText();
      SafeHtml html = renderer.render(text);
      if (viewData.isEditing()) {
        // Note the template will not treat SafeHtml specially
        sb.append(template.input(html.asString()));
      } else {
        // The user pressed enter, but view data still exists.
        sb.append(html);
      }
    } else if (value != null) {
      SafeHtml html = renderer.render(value);
      sb.append(html);
    }
  }
View Full Code Here

      viewData = null;
    }

    String s = (viewData != null) ? viewData.getCurrentValue() : value;
    if (s != null) {
      SafeHtml html = renderer.render(s);
      // Note: template will not treat SafeHtml specially
      sb.append(template.input(html.asString()));
    } else {
      sb.appendHtmlConstant("<input type=\"text\" tabindex=\"-1\"></input>");
    }
  }
View Full Code Here

        dataTableBody.removeChildren();
      } else {
        dataTableBody.setInnerHTML("");
      }

      SafeHtml con = appearance.renderEmptyContent(emptyText);
      con = tpls.tr("", tpls.tdWrap(cm.getColumnCount(), "", styles.empty(), con));
      DomHelper.append(dataTableBody, con.asString());
    }
  }
View Full Code Here

      SafeHtmlBuilder trBuilder = new SafeHtmlBuilder();

      // loop each cell per row
      for (int i = 0; i < colCount; i++) {
        SafeHtml rv = getRenderedValue(rowIndex, i, model, r);
        ColumnConfig<M, ?> columnConfig = cm.getColumn(i);
        ColumnData columnData = cs.get(i);

        String cellClasses = cellClass;
        cellClasses += (i == 0 ? cellFirstClass : (i == last ? cellLastClass : ""));

        if (columnConfig.getColumnTextClassName() != null) {
          cellInnerClass += " " + columnConfig.getColumnTextClassName();
        }

        String id = columnConfig.getColumnClassSuffix();

        if (columnData.getClassNames() != null) {
          cellClasses += " " + columnData.getClassNames();
        }

        if (id != null && !id.equals("")) {
          cellClasses += " x-grid-td-" + id;
        }

        if (showDirtyCells && r != null && r.getChange(columnConfig.getValueProvider()) != null) {
          cellClasses += cellDirty;
        }

        if (viewConfig != null) {
          cellClasses += " " + viewConfig.getColStyle(model, cm.getValueProvider(i), rowIndex, i);
        }

        SafeStylesBuilder cellStyles = new SafeStylesBuilder();
        cellStyles.append(columnData.getStyles());

        SafeHtml tdContent = null;
        if (enableRowBody && i == 0) {
          tdContent = tpls.tdRowSpan(i, cellClasses, cellStyles.toSafeStyles(), rowBodyRowSpan, rv);
        } else {
          tdContent = tpls.td(i, cellClasses, cellStyles.toSafeStyles(), cellInnerClass,
              columnConfig.getColumnTextStyle(), rv);
View Full Code Here

      } else {
        dataTableBody.setInnerHTML("");
      }
    }

    SafeHtml html = renderRows(firstRow, lastRow);
    XElement before = getRow(firstRow).cast();

    if (before != null) {
      DomHelper.insertBefore(before, html.asString());
    } else {
      DomHelper.insertHtml("beforeEnd", dataTableBody, html.asString());
    }
    if (!isUpdate) {
      processRows(firstRow, false);
    }
  }
View Full Code Here

     */
    if (redrawRequired) {
      // Redraw the entire content.
      SafeHtmlBuilder sb = new SafeHtmlBuilder();
      view.render(sb, pending.rowData, pending.pageStart, selectionModel);
      SafeHtml newContents = sb.toSafeHtml();
      if (!newContents.equals(lastContents)) {
        lastContents = newContents;
        view.replaceAllChildren(pending.rowData, newContents,
            pending.keyboardStealFocus);
      }
      view.resetFocus();
View Full Code Here

TOP

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

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.