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

import java.util.ArrayList;
import java.util.List;

import javax.inject.Named;

import de.ivu.elect.jee.exchange.Violation;
import de.ivu.elect.jee.presentation.dynamictable.AbstractColumnBuilder;
import de.ivu.elect.jee.presentation.dynamictable.ColumnEntry;

@Named(ViolationColumnBuilder.COMPONENT_NAME)
public class ViolationColumnBuilder extends AbstractColumnBuilder<Violation> {

  private static final long serialVersionUID = 1L;

  public static final String COMPONENT_NAME = "violationColumnBuilder";

  private ViolationLevelColumn violationLevelColumn;
  private ViolationMessageColumn violationMessageColumn;

  public ViolationColumnBuilder() {
    super();
  }

  @Override
  protected void initColumns() {
    violationLevelColumn = new ViolationLevelColumn(getMessages(), getIcons());
    violationMessageColumn = new ViolationMessageColumn(getMessages());
  }

  @Override
  protected List<ColumnEntry< ? super Violation>> getColumnEntriesSorted() {

    List<ColumnEntry< ? super Violation>> result = new ArrayList<>();
    result.add(violationLevelColumn);
    result.add(violationMessageColumn);

    return result;
  }

}
