private void updateFieldsValues() {
    lblName.setText(userConfig.getName());
    lblDescription.setText(userConfig.getDescription() != null ? userConfig.getDescription() : "");
    lblDate.setText(sdf.format(userConfig.getCreatedAt()));
    if (userConfig.getOwner() != null) {
      lblOwner.setText(
          userConfig.getOwner().getNachname() + ", " + userConfig.getOwner().getVorname());
    } else {
      lblOwner.setText("- Unknown -");
    }

    ibName.setText(userConfig.getName());
    ibDescription.setText(userConfig.getDescription() != null ? userConfig.getDescription() : "");
    if (userConfig.isPublic()) {
      rbtnYes.setSelected(true);
    } else {
      rbtnNo.setSelected(true);
    }
  }
Beispiel #2
0
  /** Update the filter info. */
  protected void updateFilterInfo() {

    // Bundle bundle = model.getBundle();
    // String entity = bundle.getString(model.getEntityClass().getName());

    StringBuilder sb = new StringBuilder();
    StringBuilder sbWhere = new StringBuilder();

    for (Column col : model.getColumns()) {
      if (col.getFilter() != null) {
        QueryElement filter = col.getFilter();
        if (sbWhere.length() != 0) {
          if (filter.getLinkType() == QueryElement.AND) {
            sbWhere.append(" and ");
          } else {
            sbWhere.append(" or ");
          }
        }
        sbWhere.append("<b>").append(col.getTitle()).append("</b> ");
        sbWhere.append(filter.getOperation()).append(" ").append(filter.getValue());
      }
    }

    sb.append(ImageLibrary.ICON_TBL_FILTER.toImgTag());

    if (sbWhere.length() == 0) {
      sb.append(" All ");
    }
    //		sb.append("<b>")
    //		  .append(entity)
    //		  .append("</b>");
    //		if (!entity.endsWith("s")) {
    //			sb.append("s");
    //		}

    if (sbWhere.length() != 0) {
      //			sb.append(" filtered by ");
      sb.append(sbWhere);
    }

    lblFilterInfo.setText(sb.toString());
  }