package panelBar;

import javax.faces.event.ValueChangeEvent;

public class PanelBar {

	private String width;

	private String height;
	private String contentStyle;
	private String style=null;
	private String headerStyle=null;
	private String btnLabel="ON";

	private String[] label = {"label_0","label_1", "label_2", "label_3"};
	               
	private boolean rendered;

	public PanelBar() {

		height = "300px";
		width = "500px";
		rendered = true;
		//contentStyle=null;
		//style=null;
		//headerStyle=null;
	}
	
	public void doStyles()
	{
		if (getContentStyle() == null) {
			setBtnLabel("OFF");
			setContentStyle("contentStyle");
			setHeaderStyle("activeTabStyle");
			setStyle("style");			
		} else {
			setBtnLabel("ON");
			setContentStyle(null);
			setHeaderStyle(null);
			setStyle(null);	
		}
	}
	
	public String getHeight() {
		return height;
	}

	public String getContentStyle() {
		return contentStyle;
	}

	public void setContentStyle(String contentStyle) {
		this.contentStyle = contentStyle;
	}

	public String getHeaderStyle() {
		return headerStyle;
	}

	public void setHeaderStyle(String headerStyle) {
		this.headerStyle = headerStyle;
	}

	public String getStyle() {
		return style;
	}

	public void setStyle(String style) {
		this.style = style;
	}

	public void setHeight(String height) {
		this.height = height;
	}

	public String[] getLabel() {
		return label;
	}

	public boolean isRendered() {
		return rendered;
	}

	public void setRendered(boolean rendered) {
		this.rendered = rendered;
	}

	public String getWidth() {
		return width;
	}

	public void setWidth(String width) {
		this.width = width;
	}

	public void setLabel(String[] label) {

		this.label = label;

	}

	public void makeLabels(ValueChangeEvent event) {
		String tlabel = event.getNewValue().toString();
		if (tlabel.equalsIgnoreCase("")) {
			for (int i = 0; i < 4; i++) {
				label[i] = "label_" + i;
			}
		} else {
			for (int i = 0; i < 4; i++) {
				label[i] = tlabel + "_" + i;
			}
		}

	}

	public String getBtnLabel() {
		return btnLabel;
	}

	public void setBtnLabel(String btnLabel) {
		this.btnLabel = btnLabel;
	}

}
