Ejemplo n.º 1
0
  /**
   * @param col
   * @return
   */
  public static String getColStringsOnCurrentPage(PmTableCol col) {
    @SuppressWarnings({"unchecked"})
    PmTable<? extends PmBean<?>> table = (PmTable<? extends PmBean<?>>) col.getPmParent();
    String columnName = col.getPmName();
    List<String> strings = new ArrayList<String>();

    for (PmBean<?> r : table.getRowPms()) {
      strings.add(getDisplayStringOfCell(r, columnName));
    }
    return StringUtils.join(strings, ", ");
  }
Ejemplo n.º 2
0
  /**
   * Provides the localized strings of all selected rows that are shown for the given column.
   *
   * @param col The column to report the localized string content for.
   * @return a comma separated list of the column string. Sorted as the table rows.
   */
  @SuppressWarnings("unchecked")
  public static String getColStringsOfSelection(PmTableCol col) {
    PmTable<? extends PmBean<?>> table = (PmTable<? extends PmBean<?>>) col.getPmParent();
    String columnName = col.getPmName();
    List<String> strings = new ArrayList<String>();

    Selection<PmBean<?>> selection =
        (Selection<PmBean<?>>) table.getPmPageableCollection().getSelection();
    for (PmBean<?> r : table.getPmPageableCollection()) {
      if (selection.contains(r)) {
        strings.add(getDisplayStringOfCell(r, columnName));
      }
    }

    return StringUtils.join(strings, ", ");
  }