
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
  protected transient ExportDescriptionSelect exportDescriptionSelect;

  @Inject
  protected transient DateiExportChangeEvent dateiExportChangeEvent;

  protected AbstractDateiExportAction() {
    super();
  }

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

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

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

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

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