package de.ivu.elect.presentation.gruppe.table;

import de.ivu.elect.business.gruppe.entity.Gruppe;
import de.ivu.elect.jee.faces.Messages;
import de.ivu.elect.presentation.table.AbstractColumnEntry;
import de.ivu.elect.jee.presentation.dynamictable.ColumnType;

/**
 *  on 02.12.2015.
 */
public class GruppeLogoColumn extends AbstractColumnEntry<Gruppe> {

  public GruppeLogoColumn(Messages messages) {
    super(messages);
  }

  @Override
  public Object getValue(Gruppe entity) {
    if (entity == null || entity.getLogo() == null) {
      return null;
    }
    return entity.getLogo().getId();
  }

  @Override
  public String getHeader() {
    return getMessage("gruppe.column.logo");
  }

  @Override
  public ColumnType getType() {
    return ColumnType.BILD;
  }


}
