package panel;

import javax.faces.event.ValueChangeEvent;

public class Panel {

	private boolean rendered;

	private String width;
	private String height;
	private String[] title ;

	public Panel() {
		rendered = false;
		width = "350px";
		height = "400px";
		title = new String[] {"Titles_0", "Titles_1", "Titles_2"};
	}

	public String getHeight() {
		return height;
	}

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

	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 String[] getTitle() {
		return title;
	}

	public void setTitle(String[] title) {
		this.title = title;
	}
	
	public void makeTitle(ValueChangeEvent event){
		String t = event.getNewValue().toString();
		if(t.equalsIgnoreCase(""))
			for(int i = 0; i < title.length; i++) 
				title[i] = "Titles_" + i;
		else
			for(int i = 0; i < title.length; i++) 
				title[i] = t + "_" + i;  
		
	}
}
