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

import de.ivu.elect.business.internet.boundary.InternetSeiteChangeEvent;
import de.ivu.elect.business.internet.boundary.InternetSeiteConversationSelect;
import de.ivu.elect.business.internet.boundary.InternetWidgetChangeEvent;
import de.ivu.elect.business.internet.boundary.InternetWidgetConversationSelect;
import de.ivu.elect.business.internet.entity.InternetSeite;
import de.ivu.elect.business.internet.entity.InternetWidget;
import de.ivu.elect.presentation.menu.AbstractActionEntry;
import de.ivu.elect.presentation.security.AbstractGebietSecurity;

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

public abstract class AbstractInternetWidgetAction extends AbstractActionEntry<InternetWidget> {

  private static final long serialVersionUID = 1L;

  @Inject
  protected InternetWidgetConversationSelect conversationSelect;

  @Inject
  private transient InternetWidgetChangeEvent changeEvent;

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

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

  @Override
  public boolean isDisabledInternal(@Nonnull InternetWidget entity) {
    return entity == null;
  }

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