
package de.ivu.elect.presentation.gebietsbaum.menu;

import javax.inject.Inject;

import de.ivu.elect.business.gebietsbaum.entity.GebietMeta;
import de.ivu.elect.jee.entity.Meta;
import de.ivu.elect.presentation.LayoutComponentsContext;
import de.ivu.elect.presentation.exchange.ExportDescription;
import de.ivu.elect.presentation.exchange.menu.AbstractExportMenuItemEntry;
import de.ivu.elect.presentation.gebietsbaum.exchange.GebietExportDescription;

public class GebietExportMenuItemEntry extends AbstractExportMenuItemEntry {

  private static final long serialVersionUID = 1L;

  @Inject
  private transient LayoutComponentsContext layoutComponentsContext;

  @Inject
  private transient GebietMeta gebietMeta;

  @Inject
  private transient GebietExportDescription gebietExportDescription;

  public GebietExportMenuItemEntry() {
    super();
  }

  @Override
  protected ExportDescription getExportDescription() {
    return gebietExportDescription;
  }

  @Override
  public boolean isDisabledInternal() {
    return super.isDisabledInternal() || !layoutComponentsContext.isSelected();
  }

  @Override
  protected Meta getMeta() {
    return gebietMeta;
  }
}
