package de.ivu.elect.presentation;

import java.io.Serializable;

import javax.enterprise.context.RequestScoped;
import javax.faces.context.FacesContext;
import javax.inject.Inject;
import javax.inject.Named;

import org.apache.deltaspike.jsf.spi.scope.window.ClientWindow;

@Named(DeltaSpikeWindowId.COMPONENT_NAME)
@RequestScoped
public class DeltaSpikeWindowId implements Serializable {

  public static final String COMPONENT_NAME = "deltaSpikeWindowId";

  @Inject
  private transient ClientWindow clientWindow;

  public String getWindowId() {
    return clientWindow.getWindowId(FacesContext.getCurrentInstance());
  }

}
