package de.thomasjacob.improve.presentation.project;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;

import org.apache.struts.action.ActionMapping;
import org.apache.struts.validator.ValidatorForm;


public class ProjectForm extends ValidatorForm
{
	private String enabled = "";

	private String name = "";

	private String projectId = "";

	public static ProjectForm getInstance(HttpServletRequest request)
	{
		HttpSession session = request.getSession();
		ProjectForm form = (ProjectForm) session.getAttribute("projectForm");
		if (form == null)
		{
			form = new ProjectForm();
			session.setAttribute("projectForm", form);
		}

		return form;
	}

	public String getEnabled()
	{
		return enabled;
	}

	public String getName()
	{
		return name;
	}

	public String getProjectId()
	{
		return projectId;
	}

	public void reset(ActionMapping mapping, HttpServletRequest request)
	{
		super.reset(mapping, request);

		enabled = "";
		name = "";
		projectId = "";
	}

	public void setEnabled(String enabled)
	{
		this.enabled = enabled;
	}

	public void setName(String name)
	{
		this.name = name;
	}

	public void setProjectId(String projectId)
	{
		this.projectId = projectId;
	}
}