package de.ivu.elect.business.konfiguration.entity;

import java.util.Collection;
import java.util.Iterator;
import java.util.Locale;
import java.util.ResourceBundle;

import javax.faces.FacesException;
import javax.faces.application.Application;
import javax.faces.application.FacesMessage;
import javax.faces.application.NavigationHandler;
import javax.faces.application.StateManager;
import javax.faces.application.ViewHandler;
import javax.faces.component.UIComponent;
import javax.faces.component.UIViewRoot;
import javax.faces.context.ExternalContext;
import javax.faces.context.FacesContext;
import javax.faces.context.ResponseStream;
import javax.faces.context.ResponseWriter;
import javax.faces.convert.Converter;
import javax.faces.el.MethodBinding;
import javax.faces.el.PropertyResolver;
import javax.faces.el.ReferenceSyntaxException;
import javax.faces.el.ValueBinding;
import javax.faces.el.VariableResolver;
import javax.faces.event.ActionListener;
import javax.faces.render.RenderKit;
import javax.faces.validator.Validator;

import de.ivu.elect.business.lokalisierung.control.LokalisierungResourceBundle;

/**
 *  on 14.07.2017.
 */
class CustomParameterFakeFacesContext extends FacesContext {

  @Override
  public Application getApplication() {
    return new Application() {

      @Override
      public ResourceBundle getResourceBundle(FacesContext ctx, String name) {
        return LokalisierungResourceBundle.INSTANCE;
      }

      @Override
      public ActionListener getActionListener() {
        return null;
      }

      @Override
      public void setActionListener(ActionListener actionListener) {

      }

      @Override
      public Locale getDefaultLocale() {
        return Locale.getDefault();
      }

      @Override
      public void setDefaultLocale(Locale locale) {

      }

      @Override
      public String getDefaultRenderKitId() {
        return null;
      }

      @Override
      public void setDefaultRenderKitId(String s) {

      }

      @Override
      public String getMessageBundle() {
        return null;
      }

      @Override
      public void setMessageBundle(String s) {

      }

      @Override
      public NavigationHandler getNavigationHandler() {
        return null;
      }

      @Override
      public void setNavigationHandler(NavigationHandler navigationHandler) {

      }

      @Override
      public PropertyResolver getPropertyResolver() {
        return null;
      }

      @Override
      public void setPropertyResolver(PropertyResolver propertyResolver) {

      }

      @Override
      public VariableResolver getVariableResolver() {
        return null;
      }

      @Override
      public void setVariableResolver(VariableResolver variableResolver) {

      }

      @Override
      public ViewHandler getViewHandler() {
        return null;
      }

      @Override
      public void setViewHandler(ViewHandler viewHandler) {

      }

      @Override
      public StateManager getStateManager() {
        return null;
      }

      @Override
      public void setStateManager(StateManager stateManager) {

      }

      @Override
      public void addComponent(String s, String s1) {

      }

      @Override
      public UIComponent createComponent(String s) throws FacesException {
        return null;
      }

      @Override
      public UIComponent createComponent(ValueBinding valueBinding, FacesContext facesContext, String s) throws FacesException {
        return null;
      }

      @Override
      public Iterator<String> getComponentTypes() {
        return null;
      }

      @Override
      public void addConverter(String s, String s1) {

      }

      @Override
      public void addConverter(Class<?> aClass, String s) {

      }

      @Override
      public Converter createConverter(String s) {
        return null;
      }

      @Override
      public Converter createConverter(Class<?> aClass) {
        return null;
      }

      @Override
      public Iterator<String> getConverterIds() {
        return null;
      }

      @Override
      public Iterator<Class<?>> getConverterTypes() {
        return null;
      }

      @Override
      public MethodBinding createMethodBinding(String s, Class<?>[] classes) throws ReferenceSyntaxException {
        return null;
      }

      @Override
      public Iterator<Locale> getSupportedLocales() {
        return null;
      }

      @Override
      public void setSupportedLocales(Collection<Locale> collection) {

      }

      @Override
      public void addValidator(String s, String s1) {

      }

      @Override
      public Validator createValidator(String s) throws FacesException {
        return null;
      }

      @Override
      public Iterator<String> getValidatorIds() {
        return null;
      }

      @Override
      public ValueBinding createValueBinding(String s) throws ReferenceSyntaxException {
        return null;
      }
    };
  }

  @Override
  public Iterator<String> getClientIdsWithMessages() {
    return null;
  }

  @Override
  public ExternalContext getExternalContext() {
    return null;
  }

  @Override
  public FacesMessage.Severity getMaximumSeverity() {
    return null;
  }

  @Override
  public Iterator<FacesMessage> getMessages() {
    return null;
  }

  @Override
  public Iterator<FacesMessage> getMessages(String s) {
    return null;
  }

  @Override
  public RenderKit getRenderKit() {
    return null;
  }

  @Override
  public boolean getRenderResponse() {
    return false;
  }

  @Override
  public boolean getResponseComplete() {
    return false;
  }

  @Override
  public ResponseStream getResponseStream() {
    return null;
  }

  @Override
  public void setResponseStream(ResponseStream responseStream) {

  }

  @Override
  public ResponseWriter getResponseWriter() {
    return null;
  }

  @Override
  public void setResponseWriter(ResponseWriter responseWriter) {

  }

  @Override
  public UIViewRoot getViewRoot() {
    UIViewRoot result = new UIViewRoot() {
      @Override
      public Locale getLocale() {
        return Locale.getDefault();
      }
    };
    try {
      result.setLocale(Locale.getDefault());
    } catch (Exception ignore){
      // ELECT-12098
    }
    return result;
  }

  @Override
  public void setViewRoot(UIViewRoot uiViewRoot) {

  }

  @Override
  public void addMessage(String s, FacesMessage facesMessage) {

  }

  @Override
  public void release() {

  }

  @Override
  public void renderResponse() {

  }

  @Override
  public void responseComplete() {

  }

}
