package scrollableDataTable;

import java.util.ArrayList;
import java.util.Random;

import dataScroller.Data;

public class ScrollableDataTable 
{
	private ArrayList<Data> data;
	private String [] status = {"error", "fatal", "info", "passed", "warn"};
	private String [] statusIcon = {"/pics/error.gif", "/pics/fatal.gif", "/pics/info.gif", "/pics/passed.gif", "/pics/warn.gif"};
	private String width;
	private int rows;
	private String key;
	private boolean hideWhenScrolling;
	
	public boolean isHideWhenScrolling() {
		return hideWhenScrolling;
	}

	public void setHideWhenScrolling(boolean hideWhenScrolling) {
		this.hideWhenScrolling = hideWhenScrolling;
	}

	public ScrollableDataTable() {
		width = "400px";
		rows = 30;
		hideWhenScrolling = false;
		
		data = new ArrayList<Data>();
		int k;
		for(int i = 0; i < 10000; i++) {
			k = new Random().nextInt(5);
			data.add(new Data("Bug " + new Random().nextInt(10 + i), i,status[k], statusIcon[k]));
		}
	}

	public ArrayList<Data> getData() {
		return data;
	}

	public void setData(ArrayList<Data> data) {
		this.data = data;
	}

	public String getWidth() {
		return width;
	}

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

	public int getRows() {
		return rows;
	}

	public void setRows(int rows) {
		this.rows = rows;
	}

	public void setKey(String key) {
		this.key = key;
	}
}