package parties;

import com.openrules.forms.gui.impl.DynamicTable;
import com.openrules.ruleengine.OpenRulesEngine;

public class PartyManager extends DynamicTable {

	public PartyManager(OpenRulesEngine engine) {
		super(engine);
		addNewParty();
	}
	
	public String getHeaderLayoutName() {
		return "partiesTableHeader";
	}
	
	public String getRowLayoutName() {
		return "partiesTableRow";
	}
	
	public void addNewParty() {
		Party party = new Party(this);
		addNewRow(party);
	}
	
	public Party getCurrentParty() {
		return (Party) getCurrentRow();
	}
	
	public void setCurrentParty() {
		setCurrentRow(getFirstCheckedRow("selected"));
	}

}