
package de.ivu.elect.presentation.exchange;

import javax.inject.Inject;

import org.apache.deltaspike.core.api.scope.GroupedConversation;
import org.apache.deltaspike.core.api.scope.ConversationGroup;
import org.apache.deltaspike.core.api.scope.GroupedConversationScoped;

@GroupedConversationScoped
@ConversationGroup(DateiVorschauContextStore.class)
public class DateiVorschauContextStore implements DateiVorschauContext {

  private static final long serialVersionUID = 1L;

  @Inject
  protected GroupedConversation conversation;

  private String lastViewId;

  private String pageMenuComponentName;

  @Override
  public String getLastViewId() {
    return lastViewId;
  }

  public void setLastViewId(String lastViewId) {
    this.lastViewId = lastViewId;
  }

  @Override
  public String getPageMenuComponentName() {
    return pageMenuComponentName;
  }

  public void setPageMenuComponentName(String pageMenuComponentName) {
    this.pageMenuComponentName = pageMenuComponentName;
  }

  public boolean isSelected() {
    return getLastViewId() != null;
  }

  public void close() {
    conversation.close();
  }
}
