package de.ivu.elect.presentation.email.form;

import de.ivu.elect.business.email.entity.AbstractEmailVorgang;
import de.ivu.elect.business.email.entity.EmailVorgangPlatzhalter;
import de.ivu.elect.business.email.entity.EmailVorlage;
import de.ivu.elect.business.email.entity.EmailVorlageConstants;
import de.ivu.elect.jee.presentation.dynamicform.AbstractCKEditorProperty;

public class EmailVorlageInhaltCKEditorProperty extends AbstractCKEditorProperty {

  private final EmailVorlage entity;

  public EmailVorlageInhaltCKEditorProperty(EmailVorlage entity) {
    this.entity = entity;
  }

  @Override
  public String getDefaultLabel() {
    return getMessage(EmailVorlageConstants.MESSAGE_KEY_INHALT_EINZAHL);
  }

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

  @Override
  public String getValue() {
    return entity.getInhalt();
  }

  @Override
  public void setValue(String value) {
    entity.setInhalt(value);
  }

  @Override
  protected boolean isPlaceholderButtonEnabled() {
    return true;
  }

  @Override
  public String getPlaceholderItems() {
    return EmailVorgangPlatzhalter.getCKEditorPlaceholderItems(getMessages());
  }

  @Override
  public String getDefaultValue() {
    return AbstractEmailVorgang.getInhaltDefaultValue();
  }
}
