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

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

import de.ivu.elect.business.datei.boundary.DateiExportChangeEvent;
import de.ivu.elect.business.datei.entity.DateiExport;
import de.ivu.elect.business.security.UseCasePermission;
import de.ivu.elect.presentation.exchange.ExportDescriptionSelect;
import de.ivu.elect.presentation.menu.AbstractActionEntry;
import de.ivu.elect.presentation.security.AbstractGebietSecurity;

public abstract class AbstractDateiExportAction extends AbstractActionEntry<DateiExport> {

  private static final long serialVersionUID = 1L;

  @Inject
  private ExportDescriptionSelect exportDescriptionSelect;

  @Inject
  private DateiExportChangeEvent changeEvent;

  public AbstractDateiExportAction() {
    super();
  }

  @Override
  protected void fireChangeEvent() {
    changeEvent.sendChangeEvent();
  }

  @Override
  protected boolean isFireChangeEvent() {
    return false;
  }

  @Override
  protected boolean isDisabledInternal(@Nonnull DateiExport entity) {
    return false;
  }

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

  @Override
  protected AbstractGebietSecurity getGebietSecurity() {
    return KEINE_GEBIET_SECURITY;
  }
}
