⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 searchform.java

📁 1 系统简介 1.1 系统名称:bugtrail 1.2 适用范围:大型或小型公司 1.3 用途:在项目周期内进行项目管理
💻 JAVA
字号:
/*
 * Generated by MyEclipse Struts
 * Template path: templates/java/JavaClass.vtl
 */
package bugtrail.form;

import javax.servlet.http.HttpServletRequest;

import org.apache.struts.action.ActionError;
import org.apache.struts.action.ActionErrors;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionMapping;

import bugtrail.basic.Role;

/**
 * MyEclipse Struts Creation date: 01-03-2007
 * 
 * XDoclet definition:
 * 
 * @struts.form name="searchForm"
 */
public class SearchForm extends ActionForm {
	/*
	 * Generated Methods
	 */

	private String type;

	private int state;

	private String title;

	private String priority;

	private int owner;

	private String name;

	private int role;

	private int department;

	/**
	 * Method validate
	 * 
	 * @param mapping
	 * @param request
	 * @return ActionErrors
	 */
	public ActionErrors validate(ActionMapping mapping,
			HttpServletRequest request) {
		ActionErrors errors = new ActionErrors();
		if (this.type.equals("bug")) {
			if (this.state == -1 && this.title.equals("") && this.owner == -1
					&& this.priority.equals("-1")) {
				errors.add("searcherror", new ActionError("search.error"));
				return errors;
			}
		} else if (this.type.equals("user")) {
			if (((Role) request.getSession().getAttribute("myRole"))
					.getUserConfig() != 1) {
				errors.add("searcherror", new ActionError("search.user.error"));
			} else if ((this.name == null || this.name.equals(""))
					&& this.department == -1 && this.role == -1) {
				errors.add("searcherror", new ActionError("search.error"));
				
			}
			return errors;
		}
		return null;
	}

	/**
	 * Method reset
	 * 
	 * @param mapping
	 * @param request
	 */
	public void reset(ActionMapping mapping, HttpServletRequest request) {
		// TODO Auto-generated method stub
	}

	public void setType(String type) {
		this.type = type;
	}

	public String getType() {
		return this.type;
	}

	/**
	 * Returns the title.
	 * 
	 * @return String
	 */
	public String getTitle() {
		return title;
	}

	/**
	 * Set the title.
	 * 
	 * @param title
	 *            The title to set
	 */
	public void setTitle(String title) {
		this.title = title;
	}

	/**
	 * Returns the priority.
	 * 
	 * @return String
	 */
	public String getPriority() {
		return priority;
	}

	/**
	 * Set the priority.
	 * 
	 * @param priority
	 *            The priority to set
	 */
	public void setPriority(String priority) {
		this.priority = priority;
	}

	/**
	 * Returns the state.
	 * 
	 * @return String
	 */
	public int getState() {
		return state;
	}

	/**
	 * Set the state.
	 * 
	 * @param state
	 *            The state to set
	 */
	public void setState(int state) {
		this.state = state;
	}

	public int getOwner() {
		return owner;
	}

	/**
	 * Set the finder.
	 * 
	 * @param finder
	 *            The finder to set
	 */
	public void setOwner(int owner) {
		this.owner = owner;
	}

	public String getName() {
		return name;
	}

	public int getRole() {
		return role;
	}

	public int getDepartment() {
		return department;
	}

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

	public void setRole(int role) {
		this.role = role;
	}

	public void setDepartment(int department) {
		this.department = department;
	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -