
package de.ivu.elect.business.system.entity;

import de.ivu.elect.jee.faces.Messages;
import de.ivu.elect.jee.presentation.charts.AbstractChartModelBuilder;

public enum LogNachrichtArt {

  INFO {
    @Override
    public void createMessage(Messages messages, long systemLogCountArt) {
      messages.addInfoMessage("system.log.hint.info", systemLogCountArt);
    }

    @Override
    public String getStyleClass() {
      return "color-success";
    }

    @Override
    public boolean isPopupMessageAnzeigen() {
      return false;
    }

    @Override
    public boolean isWarnungOderFehlerZuBehandeln() {
      return false;
    }

    @Override
    public String getColor() {
      return AbstractChartModelBuilder.GRUEN;
    }

    @Override
    public boolean isInfo() {
      return true;
    }
  },
  WARNUNG {
    @Override
    public void createMessage(Messages messages, long systemLogCountArt) {
      messages.addWarnMessage("system.log.hint.warn", systemLogCountArt);
    }

    @Override
    public String getStyleClass() {
      return "color-warn";
    }

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

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

    @Override
    public String getColor() {
      return AbstractChartModelBuilder.ORANGE;
    }
  },
  FEHLER {
    @Override
    public void createMessage(Messages messages, long systemLogCountArt) {
      messages.addErrorMessage("system.log.hint.error", systemLogCountArt);
    }

    @Override
    public String getStyleClass() {
      return "color-error";
    }

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

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

    @Override
    public String getColor() {
      return AbstractChartModelBuilder.ROT;
    }
  };

  public abstract void createMessage(Messages messages, long systemLogCountArt);

  public abstract String getStyleClass();

  public abstract boolean isPopupMessageAnzeigen();

  public abstract boolean isWarnungOderFehlerZuBehandeln();

  public abstract String getColor();

  public boolean isInfo() {
    return false;
  }
}
