
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 InternetWidgetStatusColumn extends AbstractInternetWidgetColumn<InternetWidget> {

  private static final long serialVersionUID = 1L;

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

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

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

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