package mildo.wiwo.components.descriptors;

public class ObjectListTableDescriptor {

	public ObjectListTableDescriptor(String[] anAttributes, String[] aHeaders, IActionDescriptor[] anActions) {
		super();
		attributes2Display = anAttributes;
		headerLabels = aHeaders;
		actions = anActions;
	}
	
	private String[] attributes2Display;
	
	public void setAttributes2Display(String[] aValue) {
		attributes2Display = aValue;
	}
	
	public String[] getAttributes2Display() {
		System.out.println("Returning attributes for list table");
		return attributes2Display;
	}
	
	public String getAttribute2Display() {
		return attributes2Display[currentAttribute2DisplayIdx];
	}
	
	public int attributes2DisplayCount() {
		return attributes2Display.length;
	}
	
	// -----------------
	
	private int currentAttribute2DisplayIdx;
	
	public void setCurrentAttribute2DisplayIdx(int aValue) {
		currentAttribute2DisplayIdx = aValue;
	}
	
	public int getCurrentAttribute2DisplayIdx() {
		return currentAttribute2DisplayIdx;
	}
	
	// -----------------
	
	private String[] headerLabels;
	
	public void setHeaderLabels(String[] aValue) {
		headerLabels = aValue;
	}
	
	public String[] getHeaderLabels() {
		System.out.println("Returning headers for list table");
		return headerLabels;
	}
	
	// ---------------
	
	private int currentHeaderLabelIdx;
	
	public void setCurrentHeaderLabelIdx(int aValue) {
		currentHeaderLabelIdx = aValue;
	}
	
	public int getCurrentHeaderLabelIdx() {
		return currentHeaderLabelIdx;
	}
	
	public String getHeaderLabel() {
		return headerLabels[currentHeaderLabelIdx];
	}
	
	public int headerLabelCount() {
		return headerLabels.length;
	}
	
	// ---------------
	
	private IActionDescriptor[] actions;
	
	public void setActions(IActionDescriptor[] aValue) {
		actions = aValue;
	}
	
	public IActionDescriptor[] getActions() {
		System.out.println("Returning actions for list table");
		return actions;
	}
	
	// --------------
	
	private int currentActionIdx;
	
	public void setCurrentActionIdx(int aValue) {
		currentActionIdx = aValue;
	}
	
	public int getCurrentActionIdx() {
		return currentActionIdx;
	}
	
	public IActionDescriptor getCurrentAction() {
		return actions[currentActionIdx];
	}
	
	public int actionCount() {
		return actions.length;
	}
	
}
