コード例 #1
0
  protected void setColumnAttributes(TableColumn column, int columnIndex) {
    Locale locale = LocaleManager.currentLocale();
    setAttribute("column", column);
    setAttribute("columnindex", columnIndex);
    setAttribute("columnmodel", column.getPropertyId());
    setAttribute("columnname", column.getName(locale));
    setAttribute("columnhint", column.getHint(locale));
    setAttribute("columnselectable", column.isSelectable());
    setAttribute("columnsortable", isColumnSortable(column));
    String icon = getSortIcon(column, columnIndex);
    setAttribute("iconId", icon);
    setAttribute("iconTextId", getSortKeyText(icon));

    String headerHTML = column.getHeaderHtmlStyle();
    String cellsHTML = column.getCellHtmlStyle();
    if (headerHTML == null) headerHTML = cellsHTML;
    if (headerHTML != null) {
      setAttribute("columnheaderhtmlstyle", StringUtils.defaultString(headerHTML));
      setAttribute(
          "columnheaderstyleedit",
          StringUtils.defaultString(StringEscapeUtils.escapeHtml(headerHTML)));
    }
    if (cellsHTML != null) {
      setAttribute("columncellhtmlstyle", StringUtils.defaultString(cellsHTML));
      setAttribute(
          "columncellstyleedit",
          StringUtils.defaultString(StringEscapeUtils.escapeHtml(cellsHTML)));
    }
    String htmlValue = column.getHtmlValue();
    if (htmlValue != null) {
      setAttribute("columnhtmlvalue", StringUtils.defaultString(htmlValue));
      setAttribute(
          "columnhtmlvalueedit",
          StringUtils.defaultString(StringEscapeUtils.escapeHtml(htmlValue)));
    }
  }
コード例 #2
0
 protected boolean isColumnSortable(TableColumn column) {
   return column.isSortable();
 }
コード例 #3
0
 protected String formatHtmlCellValue(Table table, TableColumn tableColumn, int row, int column) {
   if (StringUtils.isBlank(tableColumn.getHtmlValue())) return "";
   String result = tableColumn.getHtmlValue();
   return StringUtils.replace(
       result, TableColumn.DEFAULT_HTMLVALUE, formatCellValue(table, row, column));
 }