package it.mice.voila.runtime.springmvc.bean;

import java.io.Serializable;
import java.util.Collection;

public class TabInfoBean implements Serializable {
	/**
	 * 
	 */
	private static final long serialVersionUID = 3337446545022432232L;
	private String tabName;
	private String tabContent;
	private String tabTitle;
	
	private String otherParams;
	
	private String imageOn;
	private String imageOff;
	private String imageCurrent;
	private String imageTodo;
	private String imageDone;
	
	private PageStatus[] hideFor;
	
	private boolean disabled;
	private Collection <?> listEntityTabBase;

	public Collection<?> getListEntityTabBase() {
		return listEntityTabBase;
	}

	public void setListEntityTabBase(Collection<?> listEntityTabBase) {
		this.listEntityTabBase = listEntityTabBase;
	}

	public TabInfoBean(String tabName, String tabContent, String tabTitle) {
		super();
		this.tabName = tabName;
		this.tabContent = tabContent;
		this.tabTitle = tabTitle;
	}

	public TabInfoBean(String tabName, String tabContent, String tabTitle, PageStatus... hideFor) {
		super();
		this.tabName = tabName;
		this.tabContent = tabContent;
		this.tabTitle = tabTitle;
		this.hideFor = hideFor;
	}

	public TabInfoBean(String tabName, String tabContent, String tabTitle, String imgOn, String imgOff, boolean disabled) {
		this.tabName = tabName;
		this.tabContent = tabContent;
		this.tabTitle = tabTitle;
		this.imageOff = imgOff;
		this.imageOn = imgOn;
		this.disabled = disabled;
	}

	public TabInfoBean(String tabName, String tabContent, String tabTitle, String imgOn, String imgOff, boolean disabled, Collection<?> listEntityTabBase) {
		this.listEntityTabBase=listEntityTabBase;
		this.tabName = tabName;
		this.tabContent = tabContent;
		this.tabTitle = tabTitle;
		this.imageOff = imgOff;
		this.imageOn = imgOn;
		this.disabled = disabled;
	}
	
	public String getOtherParams() {
		return otherParams;
	}

	public void setOtherParams(String otherParams) {
		this.otherParams = otherParams;
	}

	public String getTabContent() {
		return tabContent;
	}

	public void setTabContent(String tabContent) {
		this.tabContent = tabContent;
	}

	public String getTabName() {
		return tabName;
	}

	public void setTabName(String tabName) {
		this.tabName = tabName;
	}

	public String getTabTitle() {
		return tabTitle;
	}

	public void setTabTitle(String tabTitle) {
		this.tabTitle = tabTitle;
	}

	/**
	 * @return the imageOn
	 */
	public String getImageOn() {
		return imageOn;
	}

	/**
	 * @param imageOn the imageOn to set
	 */
	public void setImageOn(String imageOn) {
		this.imageOn = imageOn;
	}

	/**
	 * @return the imageOff
	 */
	public String getImageOff() {
		return imageOff;
	}

	/**
	 * @param imageOff the imageOff to set
	 */
	public void setImageOff(String imageOff) {
		this.imageOff = imageOff;
	}

	/**
	 * @return the imageCurrent
	 */
	public String getImageCurrent() {
		return imageCurrent;
	}

	/**
	 * @param imageCurrent the imageCurrent to set
	 */
	public void setImageCurrent(String imageCurrent) {
		this.imageCurrent = imageCurrent;
	}

	/**
	 * @return the imageTodo
	 */
	public String getImageTodo() {
		return imageTodo;
	}

	/**
	 * @param imageTodo the imageTodo to set
	 */
	public void setImageTodo(String imageTodo) {
		this.imageTodo = imageTodo;
	}

	/**
	 * @return the imageDone
	 */
	public String getImageDone() {
		return imageDone;
	}

	/**
	 * @param imageDone the imageDone to set
	 */
	public void setImageDone(String imageDone) {
		this.imageDone = imageDone;
	}

	/**
	 * @return the disabled
	 */
	public boolean isDisabled() {
		return disabled;
	}

	/**
	 * @param disabled the disabled to set
	 */
	public void setDisabled(boolean disabled) {
		this.disabled = disabled;
	}

	public PageStatus[] getHideFor() {
		return hideFor;
	}

	public void setHideFor(PageStatus[] hideFor) {
		this.hideFor = hideFor;
	}

	public boolean hideFor(PageStatus pageStatus) {
		if (getHideFor() == null) {
			return false;
		}
		for (PageStatus ps : getHideFor()) {
			if (ps.getName().equals(pageStatus.getName())) {
				return true;
			}
		}
		return false;
	}
}
