package de.ivu.elect.presentation.gebietsbaum;

import javax.enterprise.inject.Specializes;
import javax.inject.Inject;

import de.ivu.elect.presentation.NlWasStartViewResolver;

@Specializes
public class NlWasGebietSearchView extends CoreGebietSearchView {
  private static final long serialVersionUID = 1L;

  @Inject
  private transient NlWasStartViewResolver nlWasStartViewResolver;

  @Override
  public String getPageTitle() {
    return super.getPageTitle() + additionalHeader();
  }

  @Override
  public String getPageHeader() {
    return super.getPageHeader() + additionalHeader();
  }

  private String additionalHeader() {
    if (nlWasStartViewResolver.isPublicKeyImportRechtVorhanden() && nlWasStartViewResolver.isPublicKeyImportNeeded()) {
      return " (" + getMessage("eml.public.key.import.menu.item") + ")";
    }
    return "";
  }

}
