Package com.google.gwt.safehtml.shared

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


  }

  @Override
  protected <N> SafeHtml getRenderedValue(int rowIndex, int colIndex, M m, ListStore<M>.Record record) {
    ColumnConfig<M, N> cc = cm.getColumn(colIndex);
    SafeHtml s = super.getRenderedValue(rowIndex, colIndex, m, record);
    TreeNode<M> node = findNode(m);
    if (node != null && cc == tree.getTreeColumn()) {
      return getTemplate(m, node.getId(), s, tree.calculateIconStyle(m), false, tree.calculateJoint(m),
          treeStore.getDepth(m));
    }
View Full Code Here


    @Override
    public void render(Context context,
                       RuleFormatImageResource value,
                       SafeHtmlBuilder sb) {
        SafeHtml html = SafeHtmlUtils.fromTrustedString( AbstractImagePrototype.create( value ).getHTML() );
        sb.append( html );
    }
View Full Code Here

    NodeList<Element> summaries = getSummaries();
    List<GroupingData<M>> groupData = getGroupData();
    for (int i = 0; i < groupData.size(); i++) {
      Element g = groups.getItem(i);
      if (g == null) continue;
      SafeHtml s = renderGroupSummary(groupData.get(i));
      s = tpls.table("", SafeStylesUtils.fromTrustedString(""), s, SafeHtmlUtils.EMPTY_SAFE_HTML);
      Element existing = summaries.getItem(i);
      existing.getParentElement().replaceChild(XDOM.create(s).getLastChild().<Element>cast().getFirstChildElement(), existing);
    }
  }
View Full Code Here

      if (cf.getCellClassName() != null) {
        cellClasses += " " + cf.getCellClassName();
      }

      Number n = data.get(cm.getValueProvider(i));
      SafeHtml value = SafeHtmlUtils.EMPTY_SAFE_HTML;

      if (cf.getSummaryFormat() != null) {
        if (n != null) {
          value = SafeHtmlUtils.fromString(cf.getSummaryFormat().format(n.doubleValue()));
        }
      } else if (cf.getSummaryRenderer() != null) {
        value = cf.getSummaryRenderer().render(n, data);
      }
      final SafeHtml tdContent;
      if (!selectable && GXT.isIE()) {
        tdContent = tpls.tdUnselectable(i, cellClasses, cd.getStyles(), cellInner, cf.getColumnTextStyle(), value);
      } else {
        tdContent = tpls.td(i, cellClasses, cd.getStyles(), cellInner, cf.getColumnTextStyle(), value);
      }
      trBuilder.append(tdContent);

    }

    String rowClasses = getGroupingAppearance().style().summaryRow();

    if (!selectable) {
      rowClasses += unselectableClass;
    }

    SafeHtml cells = trBuilder.toSafeHtml();

    return tpls.tr(rowClasses, cells);
  }
View Full Code Here

        getElement().appendChild(text.getElement());
      }

      getElement().appendChild(img);

      SafeHtml tip = config.getToolTip();
      if (tip != null) {
        getElement().setAttribute("qtip", tip.asString());
      }

      sinkEvents(Event.ONCLICK | Event.MOUSEEVENTS | Event.FOCUSEVENTS | Event.ONKEYPRESS);

      String s = config.getCellClassName() == null ? "" : " " + config.getCellClassName();
View Full Code Here

    all.removeAll();

    SafeHtmlBuilder sb = new SafeHtmlBuilder();
    bufferRender(models, sb);

    SafeHtml markup = sb.toSafeHtml();
    getElement().setInnerHTML(markup.asString());

    SafeHtmlBuilder esb = new SafeHtmlBuilder();
    appearance.renderEnd(esb);
    DomHelper.insertHtml("beforeend", getElement(), esb.toSafeHtml().asString());
View Full Code Here

    AggregationRowConfig<M> config = cm.getAggregationRow(row);
    ColumnConfig<M, N> c = cm.getColumn(col);

    AggregationRenderer<M> renderer = config.getRenderer(c);
    if (renderer != null) {
      SafeHtml s = renderer.render(col, grid);
      return s;
    }
    return SafeHtmlUtils.EMPTY_SAFE_HTML;
  }
View Full Code Here

    sb.appendHtmlConstant("</div>");

  }

  protected void writeIcon(SafeHtmlBuilder builder, ImageResource icon, int height) {
    SafeHtml iconHtml = AbstractImagePrototype.create(icon).getSafeHtml();
    if (height == -1) {
      builder.append(templates.icon(style.iconWrap(), iconHtml));
    } else {
      int adjustedHeight = height - heightOffset;
      SafeStyles heightStyle = SafeStylesUtils.fromTrustedString("height:" + adjustedHeight + "px;");
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;
        if (i == 0) {
          cellClasses += " " + cellFirstClass;
        } else if (i == last) {
          cellClasses += " " + cellLastClass;
        }

        String cellInnerClasses = cellInnerClass;
        if (columnConfig.getColumnTextClassName() != null) {
          cellInnerClasses += " " + columnConfig.getColumnTextClassName();
        }
        if (!columnConfig.isCellPadding()) {
          cellInnerClasses += " " + styles.noPadding();
        }

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

        if (columnConfig.getCellClassName() != null) {
          cellClasses += " " + columnConfig.getCellClassName();
        }

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

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

        final SafeStyles cellStyles = columnData.getStyles();

        final SafeHtml tdContent;
        if (enableRowBody && i == 0) {
          tdContent = tpls.tdRowSpan(i, cellClasses, cellStyles, rowBodyRowSpan, cellInnerClasses, rv);
        } else {
          if (!selectable && GXT.isIE()) {
            tdContent = tpls.tdUnselectable(i, cellClasses, cellStyles, cellInnerClasses,
                columnConfig.getColumnTextStyle(), rv);
          } else {
            tdContent = tpls.td(i, cellClasses, cellStyles, cellInnerClasses, columnConfig.getColumnTextStyle(), rv);
          }

        }
        trBuilder.append(tdContent);
      }

      if (enableRowBody) {
        String cls = styles.dataTable() + " x-grid-resizer";

        SafeHtmlBuilder sb = new SafeHtmlBuilder();
        sb.append(tpls.tr("", trBuilder.toSafeHtml()));
        sb.appendHtmlConstant("<tr class='" + rowBodyRow + "'><td colspan=" + rowBodyColSpanCount + "><div class='"
            + rowBody + "'></div></td></tr>");

        SafeHtml tdWrap = null;
        if (!selectable && GXT.isIE()) {
          tdWrap = tpls.tdWrapUnselectable(colCount, "", rowWrap,
              tpls.table(cls, rowStyles, sb.toSafeHtml(), renderHiddenHeaders(columnWidths)));
        } else {
          tdWrap = tpls.tdWrap(colCount, "", rowWrap,
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.