
package de.ivu.elect.presentation.dokumente.action;

import javax.annotation.Nonnull;
import javax.inject.Inject;

import de.ivu.elect.business.security.UseCasePermission;
import de.ivu.elect.presentation.dokumente.exchange.DokumentBulkExportSearchEntry;
import de.ivu.elect.presentation.security.AbstractGebietSecurity;

public abstract class AbstractDokumentBulkExportSearchEntryDokumentVorlageEditAction extends AbstractDokumentBulkExportSearchEntryDokumentVorlageAction {

  private static final long serialVersionUID = 1L;

  @Inject
  protected transient DokumentVorlageEditAction dokumentVorlageEditAction;

  public AbstractDokumentBulkExportSearchEntryDokumentVorlageEditAction() {
    super();
  }

  @Override
  protected UseCasePermission getRequiredPermission() {
    return dokumentVorlageEditAction.getRequiredPermission();
  }

  @Override
  protected AbstractGebietSecurity getGebietSecurity() {
    return dokumentVorlageEditAction.getGebietSecurity();
  }

  @Override
  protected boolean isDisabledInternal(@Nonnull DokumentBulkExportSearchEntry dokumentBulkExportSearchEntry) {
    return super.isDisabledInternal(dokumentBulkExportSearchEntry) || dokumentBulkExportSearchEntry.getDokumentVorlagen().isEmpty();
  }

  @Override
  public String getLabelKey() {
    return "entity.edit.menu.item.label";
  }

  @Override
  public String getIcon() {
    return dokumentVorlageEditAction.getIcon();
  }
}
