コード例 #1
0
  /**
   * Instantiates a new user statistics.
   *
   * @param userId the user id
   * @param model the model
   * @param dateFrom the date from
   * @param dateTo the date to
   * @param segVal the seg val
   * @param dispatcher
   */
  public UserStatisticsLayout(
      Record userRec,
      String model,
      Date dateFrom,
      Date dateTo,
      final String segVal,
      DispatchAsync dispatcher,
      LangConstants lang) {
    this.dispatcher = dispatcher;
    this.userId = userRec != null ? userRec.getAttributeAsString(Constants.ATTR_ID) : UNIFYING;
    this.chartsLayout = new HLayout();
    this.lang = lang;
    this.userName =
        userRec != null
            ? (userRec.getAttributeAsString(Constants.ATTR_NAME)
                + " "
                + userRec.getAttribute(Constants.ATTR_SURNAME))
            : lang.unifyingCharts();
    HTMLFlow nameFlow = new HTMLFlow(HtmlCode.title(userName, 3));
    nameFlow.setHeight(40);
    addMember(nameFlow);
    addMember(chartsLayout);
    setBackgroundColor("white");

    htmlPieFlow = new HTMLFlow(html.replace("%s", PIE_CHART_NESTED_DIV_ID + userId));
    htmlPieFlow.setWidth("40%");
    htmlPieFlow.setHeight(250);
    htmlPieFlow.setExtraSpace((userRec != null) ? 10 : 50);
    chartsLayout.addMember(htmlPieFlow);

    htmlLineFlow = new HTMLFlow(html.replace("%s", LINE_CHART_NESTED_DIV_ID + userId));
    htmlLineFlow.setWidth("*");
    htmlLineFlow.setHeight(250);
    chartsLayout.addMember(htmlLineFlow);

    setShowEdges(true);
    setEdgeSize(3);
    setEdgeOpacity(60);
    setPadding(5);
    setExtraSpace(5);
    setHeight(280);

    final ModalWindow mw = new ModalWindow(chartsLayout);
    mw.setLoadingIcon("loadingAnimation.gif");
    mw.show(true);

    setdata(model, dateFrom, dateTo, segVal, mw);
  }
コード例 #2
0
  public void setDisplayValue() {
    if (paramClass == null) {
      setPrompt(null);
      return;
    }
    Record records[] = paramClass.getValueRecords();
    setValue("");
    if (records == null) {
      setPrompt(null);
      return;
    }
    String displayFields[] = paramClass.getDisplayFields();
    String value = "";

    String valuePrompt =
        "<table cellpadding=\"0\" cellspacing=\"0\" style=\"width: 350px; border: 1px solid #ABABAB;\"><tr>";
    for (String displayField : paramClass.getDisplayFieldTitles()) {
      valuePrompt +=
          "<td style=\"border-top: 1px solid #F0F0F0; font-weight: bold; height: 22px; padding-left: 4px; padding-right: 4px; background-image: url('images/hdr-bg-image.png');\">"
              + displayField
              + "</td>";
    }
    valuePrompt += "</tr>";
    int i = 0;
    for (Record record : records) {

      valuePrompt += "<tr>";
      for (String displayField : displayFields) {
        String itemValue = record.getAttributeAsString(displayField);
        if (i > 0) {
          value += ",";
        }
        value += itemValue;
        String borderColor = "#ABABAB";
        String bgColor = "";
        if (i != 0) {
          borderColor = "#F0F0F0";
        }
        if (i % 2 != 0) {
          bgColor = "background-color: #FAFAFA;";
        }

        valuePrompt +=
            "<td style=\"border-top: 1px solid "
                + borderColor
                + "; height: 22px; padding-left: 4px; padding-right: 4px; "
                + bgColor
                + "\">"
                + itemValue
                + "</td>";
      }

      valuePrompt += "</tr>";
      i++;
    }

    valuePrompt += "</table>";
    setPrompt(valuePrompt);
    setValue(value);
  }
コード例 #3
0
  /**
   * Get comments
   *
   * @param attributes
   * @param record
   */
  public void doGet(final HashMap<String, String> attributes, final Record record) {

    String type = attributes.get(MethodConstants.ATTR_TYPE);
    if (type.equals(ClassificationConstants.FNC_ID_Comment)) {

      String posting = record.getAttributeAsString(JaxrConstants.RIM_ID);
      CommentGridImpl grid = new CommentGridImpl(posting);

      new CommentsViewer(grid);
    }
  }
コード例 #4
0
ファイル: TownDto.java プロジェクト: siwiwit/gwtportlets
 public void copyFromRecord(Record from) {
   setId(from.getAttributeAsInt("id"));
   setName(from.getAttributeAsString("name"));
   setDate(from.getAttributeAsDate("date"));
 }