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

import javax.annotation.Nullable;

import de.ivu.elect.business.internet.entity.InternetWidget;
import de.ivu.elect.jee.faces.Messages;

public class InternetWidgetTypColumn extends AbstractInternetWidgetColumn<InternetWidget> {

  private static final long serialVersionUID = 1L;

  protected InternetWidgetTypColumn(AbstractInternetWidgetColumn<InternetWidget> statusColumn, Messages messages) {
    super(statusColumn.getId(), messages, statusColumn.getHeaderKey(), statusColumn.getType(), InternetWidget::getWidgetTyp);
  }

  @Override
  public boolean isIconPresent() {
    return true;
  }

  @Override
  public boolean isIconRendered(InternetWidget entity) {
    return entity != null;
  }

  @Nullable
  @Override
  public String getIcon(InternetWidget entity) {
    return entity.getWidgetTyp().getIcon();
  }
}
