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

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

import de.ivu.elect.business.internet.boundary.InternetWidgetConversationSelect;
import de.ivu.elect.business.internet.boundary.InternetWidgetFileConversationSelect;
import de.ivu.elect.business.internet.entity.InternetWidgetFileEntity;
import de.ivu.elect.presentation.menu.AbstractActionEntry;
import de.ivu.elect.presentation.security.AbstractGebietSecurity;

public abstract class AbstractInternetWidgetFileAction extends AbstractActionEntry<InternetWidgetFileEntity> {

  private static final long serialVersionUID = 1L;

  @Inject
  protected InternetWidgetFileConversationSelect conversationSelect;

  @Inject
  protected InternetWidgetConversationSelect internetWidgetConversationSelect;


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

  @Override
  protected void fireChangeEvent() {
    //
  }

  @Override
  public boolean isDisabledInternal(@Nonnull InternetWidgetFileEntity entity) {
    return entity == null || !internetWidgetConversationSelect.isSelected();
  }

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