Package com.google.gwt.user.client.ui

Examples of com.google.gwt.user.client.ui.InlineHTML


      // a step correspond to a css style.
      step = (maxOccurences - minOccurences) / STEP_NUMBER;

      for (Tag w : tags) {
        InlineHTML inline = null;
        if (w instanceof WordTag)
          inline = setInlineHTML((WordTag) w);
        else {
          Image ima = ((ImageTag) w).getImage();
          inline = new InlineHTML(" <a href='" + w.getLink()+ "'><img src='" + ima.getUrl() + "'</a>");
          inline.addStyleName("tag");
        }
        cloud.add(inline);
      }
    }
  }
View Full Code Here


   * @return The InlinHTML object that fits in the cloud
   */
  private InlineHTML setInlineHTML(WordTag w) {
    int nboc = w.getNumberOfOccurences();

    InlineHTML inline = new InlineHTML(" <a href='" + w.getLink() + "'>"+ w.getWord() + "</a>&nbsp;");
    inline.addStyleName("tag");

    // Apply the good style corersponding to the number of occurences
    if (nboc >= (maxOccurences - step)) {
      inline.addStyleName("tag10");
    } else if (nboc >= (maxOccurences - (step * 2))) {
      inline.addStyleName("tag9");
    } else if (nboc >= (maxOccurences - (step * 3))) {
      inline.addStyleName("tag8");
    } else if (nboc >= (maxOccurences - (step * 4))) {
      inline.addStyleName("tag7");
    } else if (nboc >= (maxOccurences - (step * 5))) {
      inline.addStyleName("tag6");
    } else if (nboc >= (maxOccurences - (step * 6))) {
      inline.addStyleName("tag5");
    } else if (nboc >= (maxOccurences - (step * 7))) {
      inline.addStyleName("tag4");
    } else if (nboc >= (maxOccurences - (step * 8))) {
      inline.addStyleName("tag3");
    } else if (nboc >= (maxOccurences - (step * 9))) {
      inline.addStyleName("tag2");
    } else if (nboc >= (maxOccurences - (step * 10))) {
      inline.addStyleName("tag1");
    }

    // applying color if needed
    if (isColored) {
      double r = Math.random() * 10;
      int seed = (int) Math.floor(r) + 1;
      switch (seed) {
      case 1:
        inline.addStyleName("red");
        break;
      case 2:
        inline.addStyleName("orange");
        break;
      case 3:
        inline.addStyleName("green");
        break;
      case 4:
        inline.addStyleName("lightblue");
        break;
      case 5:
        inline.addStyleName("purple");
        break;
      case 6:
        inline.addStyleName("blue");
        break;
      case 7:
        inline.addStyleName("pink");
        break;
      case 8:
        inline.addStyleName("brown");
        break;
      case 9:
        inline.addStyleName("blue");
        break;
      case 10:
        inline.addStyleName("grey");
        break;
      default:
        inline.addStyleName("black");
        break;
      }
    }

    return inline;
View Full Code Here

        {
          final Grid grid = new Grid(2, 9);
          grid.setWidget(0, 0, newShiftDateButton(-3600, "1h"));
          grid.setWidget(0, 1, newShiftDateButton(-600, "10m"));
          grid.setWidget(0, 2, newShiftDateButton(-60, "1m"));
          grid.setWidget(0, 3, new InlineHTML("&lsaquo;"));
          grid.setWidget(0, 4, now);
          grid.setWidget(0, 5, new InlineHTML("&rsaquo;"));
          grid.setWidget(0, 6, newShiftDateButton(+60, "1m"));
          grid.setWidget(0, 7, newShiftDateButton(+600, "10m"));
          grid.setWidget(0, 8, newShiftDateButton(+3600, "1h"));
          grid.setWidget(1, 0, newShiftDateButton(-86400 * 30, "30d"));
          grid.setWidget(1, 1, newShiftDateButton(-86400 * 7, "1w"));
          grid.setWidget(1, 2, newShiftDateButton(-86400, "1d"));
          grid.setWidget(1, 3, new InlineHTML("&laquo;"));
          grid.setWidget(1, 4, new InlineHTML("&nbsp;"));
          grid.setWidget(1, 5, new InlineHTML("&raquo;"));
          grid.setWidget(1, 6, newShiftDateButton(+86400, "1d"));
          grid.setWidget(1, 7, newShiftDateButton(+86400 * 7, "1w"));
          grid.setWidget(1, 8, newShiftDateButton(+86400 * 30, "30d"));
          final CellFormatter formatter = grid.getCellFormatter();
          formatter.setWidth(0, 4, "100%");
View Full Code Here

        this.itemOne = itemOne;
        this.itemTwo = itemTwo;

        grid.setText(ITEM_ONE_ROW, 0, itemOne.getVersionNum());
        List<String> itemOneContents = itemOne.getContents();
        itemOnePanel.setWidget(new InlineHTML(TextContentsDisplay
                .asSyntaxHighlight(itemOneContents).toSafeHtml()));

        grid.setText(ITEM_TWO_ROW, 0, itemTwo.getVersionNum());
        List<String> itemTwoContents = itemTwo.getContents();
        itemTwoPanel.setWidget(new InlineHTML(TextContentsDisplay.asDiff(
                itemOneContents, itemTwoContents).toSafeHtml()));
    }
View Full Code Here

        }
        if (determineDiffMode() == DiffMode.NORMAL) {
            SafeHtml safeHtml =
                    TextContentsDisplay.asDiff(queriesPadded, sourceContents)
                            .toSafeHtml();
            panel.setWidget(new InlineHTML(safeHtml));
        } else {
            SafeHtml safeHtmlHighlight =
                    TextContentsDisplay.asDiffHighlight(queriesPadded,
                            sourceContents).toSafeHtml();
            panel.setWidget(new InlineHTML(safeHtmlHighlight));
        }
        return panel;
    }
View Full Code Here

        }

        SafeHtml safeHtml =
                TextContentsDisplay.asSyntaxHighlight(
                        object.getTargetContents()).toSafeHtml();
        panel.setWidget(new InlineHTML(safeHtml));
        return panel;
    }
View Full Code Here

    @Override
    public void setSource(List<String> sourceContents) {
        SafeHtml safeHtml =
                TextContentsDisplay.asSyntaxHighlight(sourceContents)
                        .toSafeHtml();
        sourceTextContainer.setWidget(new InlineHTML(safeHtml));
    }
View Full Code Here

    @Override
    public void setTarget(List<String> targetContents) {
        SafeHtml safeHtml =
                TextContentsDisplay.asSyntaxHighlight(targetContents)
                        .toSafeHtml();
        targetTextContainer.setWidget(new InlineHTML(safeHtml));
    }
View Full Code Here

    InlineHTML commentContent;
    @UiField(provided = true)
    InlineHTML commentTime;

    public ReviewCommentItemLine(ReviewComment comment) {
        heading = new InlineHTML(template.heading(comment.getCommenterName()));
        commentContent = new InlineHTML(template.content(comment.getComment()));
        commentTime =
                new InlineHTML(template.timestamp(DateUtil
                        .formatShortDate(comment.getCreationDate())));

        initWidget(ourUiBinder.createAndBindUi(this));
    }
View Full Code Here

        // modified by person can be empty if translation is pushed from client
        String person =
                item.getModifiedBy().isEmpty() ? "(Someone offline)" : item
                        .getModifiedBy();
        heading =
                new InlineHTML(template.heading(person,
                        ContentStateToStyleUtil.stateToStyle(item.getStatus()),
                        stateRenderer.render(item.getStatus())));
        targetContents =
                new InlineHTML(template.targetContent(TextContentsDisplay
                        .asSyntaxHighlight(item.getContents()).toSafeHtml()));
        revision =
                new InlineHTML(template.targetRevision(item.getVersionNum(),
                        item.getOptionalTag()));
        initWidget(ourUiBinder.createAndBindUi(this));

        if (item.getStatus() == ContentState.Approved
                || item.getStatus() == ContentState.Rejected) {
View Full Code Here

TOP

Related Classes of com.google.gwt.user.client.ui.InlineHTML

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.