public com.google.gwt.safehtml.shared.SafeHtml html3(
     java.lang.String arg0,
     java.lang.String arg1,
     java.lang.String arg2,
     com.google.gwt.safehtml.shared.SafeHtml arg3,
     java.lang.String arg4,
     java.lang.String arg5,
     com.google.gwt.safehtml.shared.SafeHtml arg6,
     java.lang.String arg7,
     java.lang.String arg8,
     java.lang.String arg9,
     java.lang.String arg10,
     java.lang.String arg11,
     java.lang.String arg12,
     java.lang.String arg13,
     java.lang.String arg14) {
   StringBuilder sb = new java.lang.StringBuilder();
   sb.append("<div class='");
   sb.append(com.google.gwt.safehtml.shared.SafeHtmlUtils.htmlEscape(arg0));
   sb.append("'> <h3 class='");
   sb.append(com.google.gwt.safehtml.shared.SafeHtmlUtils.htmlEscape(arg1));
   sb.append("' id='");
   sb.append(com.google.gwt.safehtml.shared.SafeHtmlUtils.htmlEscape(arg2));
   sb.append("'> ");
   sb.append(arg3.asString());
   sb.append(" </h3> <h3 class='");
   sb.append(com.google.gwt.safehtml.shared.SafeHtmlUtils.htmlEscape(arg4));
   sb.append("' id='");
   sb.append(com.google.gwt.safehtml.shared.SafeHtmlUtils.htmlEscape(arg5));
   sb.append("'> ");
   sb.append(arg6.asString());
   sb.append(" </h3> </div> <div class='");
   sb.append(com.google.gwt.safehtml.shared.SafeHtmlUtils.htmlEscape(arg7));
   sb.append("' id='");
   sb.append(com.google.gwt.safehtml.shared.SafeHtmlUtils.htmlEscape(arg8));
   sb.append("'></div> <table class='");
   sb.append(com.google.gwt.safehtml.shared.SafeHtmlUtils.htmlEscape(arg9));
   sb.append("' id='boundElementHolder'> <tr id='description'> <td> <div class='");
   sb.append(com.google.gwt.safehtml.shared.SafeHtmlUtils.htmlEscape(arg10));
   sb.append("'>Description:</div> </td> <td> <span id='");
   sb.append(com.google.gwt.safehtml.shared.SafeHtmlUtils.htmlEscape(arg11));
   sb.append("'></span> </td> </tr> </table> <div class='");
   sb.append(com.google.gwt.safehtml.shared.SafeHtmlUtils.htmlEscape(arg12));
   sb.append("'> <span id='");
   sb.append(com.google.gwt.safehtml.shared.SafeHtmlUtils.htmlEscape(arg13));
   sb.append("'></span> <span id='");
   sb.append(com.google.gwt.safehtml.shared.SafeHtmlUtils.htmlEscape(arg14));
   sb.append("'></span> </div>");
   return new com.google.gwt.safehtml.shared.OnlyToBeUsedInGeneratedCodeStringBlessedAsSafeHtml(
       sb.toString());
 }
コード例 #2
0
  @SuppressWarnings({"unchecked", "rawtypes"})
  @Override
  protected void updateContent() {
    String textHtml = "";

    if (toolTipConfig.getRenderer() != null) {
      Object data = toolTipConfig.getData();
      ToolTipRenderer r = toolTipConfig.getRenderer();
      SafeHtml html = r.renderToolTip(data);
      textHtml = html.asString();
    } else {
      textHtml = Util.isEmptyString(bodyHtml) ? "&#160;" : bodyHtml;
    }

    appearance.updateContent(getElement(), titleHtml, textHtml);
  }
コード例 #3
0
 /**
  * Sets the tooltip's display string in HTML format
  *
  * @param text String display string in HTML format
  */
 public void setHtml(final SafeHtml html) {
   setHTML(true);
   if (html == null) {
     setTitle(""); // $NON-NLS-1$
   } else {
     setTitle(html.asString());
   }
 }
コード例 #4
0
        @Override
        public final SafeHtml getValue(Snapshot snapshot) {
          // Get raw description string (ignore < and > characters).
          // Customize description style as needed.
          SafeHtml description = SafeHtmlUtils.fromString(snapshot.getDescription());
          String descriptionStr = description.asString();

          if (snapshot.getStatus() == SnapshotStatus.IN_PREVIEW) {
            List<String> previewedItems =
                new ArrayList<>(Arrays.asList(constants.vmConfiguration()));
            previewedItems.addAll(Linq.getDiskAliases(snapshot.getDiskImages()));
            descriptionStr =
                messages.snapshotPreviewing(
                    descriptionStr, StringUtils.join(previewedItems, ", ")); // $NON-NLS-1$
            description =
                templates.snapshotDescription("color:orange", descriptionStr); // $NON-NLS-1$
          } else if (snapshot.getType() == SnapshotType.STATELESS) {
            descriptionStr =
                descriptionStr
                    + " ("
                    + constants.readonlyLabel()
                    + ")"; //$NON-NLS-1$ //$NON-NLS-2$
            description =
                templates.snapshotDescription("font-style:italic", descriptionStr); // $NON-NLS-1$
          } else if (snapshot.getType() == SnapshotType.PREVIEW) {
            descriptionStr = constants.snapshotDescriptionActiveVmBeforePreview();
            description =
                templates.snapshotDescription("color:gray", descriptionStr); // $NON-NLS-1$
          } else if (snapshot.getType() == SnapshotType.ACTIVE) {
            descriptionStr = constants.snapshotDescriptionActiveVm();
            description =
                templates.snapshotDescription("color:gray", descriptionStr); // $NON-NLS-1$
          } else if (snapshot.getType() == SnapshotType.REGULAR
              && !snapshot.getDiskImages().isEmpty()) {
            descriptionStr =
                messages.snapshotPreviewing(
                    descriptionStr,
                    StringUtils.join(
                        Linq.getDiskAliases(snapshot.getDiskImages()), ", ")); // $NON-NLS-1$
            description =
                templates.snapshotDescription("color:gold", descriptionStr); // $NON-NLS-1$
          }

          return description;
        }
コード例 #5
0
ファイル: CellExample.java プロジェクト: hammoum/gwt
    @Override
    public void render(Context context, String value, SafeHtmlBuilder sb) {
      /*
       * Always do a null check on the value. Cell widgets can pass null to
       * cells if the underlying data contains a null, or if the data arrives
       * out of order.
       */
      if (value == null) {
        return;
      }

      // If the value comes from the user, we escape it to avoid XSS attacks.
      SafeHtml safeValue = SafeHtmlUtils.fromString(value);

      // Use the template to create the Cell's html.
      SafeStyles styles = SafeStylesUtils.forTrustedColor(safeValue.asString());
      SafeHtml rendered = templates.cell(styles, safeValue);
      sb.append(rendered);
    }
コード例 #6
0
 /**
  * Creates a check box button with the specified text label.
  *
  * @param label the check box's label
  * @param directionEstimator A DirectionEstimator object used for automatic direction adjustment.
  *     For convenience, {@link #DEFAULT_DIRECTION_ESTIMATOR} can be used.
  */
 public CheckBoxButton(SafeHtml label, DirectionEstimator directionEstimator) {
   this();
   setDirectionEstimator(directionEstimator);
   setHTML(label.asString());
 }
コード例 #7
0
 /**
  * Creates a check box button with the specified text label.
  *
  * @param label the check box's label
  */
 public CheckBoxButton(SafeHtml label) {
   this(label.asString(), true);
 }
コード例 #8
0
  @Override
  protected void render(
      com.google.gwt.cell.client.Cell.Context context, SafeHtml data, SafeHtmlBuilder sb) {
    /*
     * Always do a null check on the value. Cell widgets can pass null to
     * cells if the underlying data contains a null, or if the data arrives
     * out of order.
     */
    if (data == null) {
      return;
    }

    final KieContainer container = containersProvider.getContainer(data.asString());
    final boolean isUp = SharedUtils.getContainerStatus(container);
    final boolean isKieApp =
        container.getType() != null
            && KieImageCategory.KIEAPP.equals(container.getType().getCategory());

    // If the value comes from the user, we escape it to avoid XSS attacks.
    // SafeHtml safeValue = SafeHtmlUtils.fromString(data.asString());

    // Use the template to create the Cell's html.
    // SafeStyles styles = SafeStylesUtils.fromTrustedString(safeValue
    // .asString());

    // generate the image cell
    SafeHtml rendered =
        templates.cell(
            PLAY, isUp ? disabledStyle : enabledStyle, ICON_PLAY, Constants.INSTANCE.start());
    sb.append(rendered);

    /*
        -- Disabled STOP container button, as it sometimes fails from the Docker remote API. --
    rendered = templates.cell(STOP, isUp ? enabledStyle : disabledStyle, ICON_STOP, Constants.INSTANCE.stop());
    sb.append(rendered);
    */

    rendered =
        templates.cell(
            RELOAD, isUp ? enabledStyle : disabledStyle, ICON_RELOAD, Constants.INSTANCE.restart());
    sb.append(rendered);

    rendered = templates.cell(REMOVE, enabledStyle, ICON_REMOVE, Constants.INSTANCE.remove());
    sb.append(rendered);

    rendered =
        templates.cell(VIEW_LOGS, enabledStyle, ICON_VIEW_LOGS, Constants.INSTANCE.viewLogs());
    sb.append(rendered);

    if (isKieApp) {
      rendered =
          templates.cell(
              VIEW_DETAILS,
              isUp ? enabledStyle : disabledStyle,
              ICON_VIEW_DETAILS,
              Constants.INSTANCE.viewDetails());
      sb.append(rendered);

      rendered =
          templates.cell(
              NAVIGATE,
              isUp ? enabledStyle : disabledStyle,
              ICON_NAVIGATE,
              Constants.INSTANCE.navigate());
      sb.append(rendered);
    }
  }
コード例 #9
0
ファイル: Header.java プロジェクト: Rebelo/GXT-ADMZ
 public void setHTML(SafeHtml html) {
   setHTML(html.asString());
 }