📄 baseform.java
字号:
/*
* Created on 2006-8-2 10:04:49
*
* By SinoBest
* Copyright hnisi.com.cn, 2005-2006, All rights reserved.
*/
package cn.com.juneng.system.common;
import org.apache.commons.beanutils.BeanUtils;
import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.ToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle;
/**
* @author yehailong
*
*/
public class BaseForm {
private static final long serialVersionUID = 1L;
private String actionType; // 操作类型
private String functionType; // 功能类型 增加人chenbinlong
private int currentPage = 1; // 当前页码
private int pageCount; // 总共页数
private int rowCount = 10; // 每页显示条数
private long totalCount; // 总共记录数
private String formName; // 表单名称
private int startPos; // 开始记录
private int endPos; // 结束记录
private String orderCol; // 排序的列
private String order; // 升序或降序
private boolean showQuery;//显示查询
private boolean readonly;
/**
* 绑定到业务对象
*
* @modify wanghaifeng Aug 24, 2006-3:46:25 PM
*/
private Object busineseObject;
/**
* 分页显示,获取当前页码
*
* @return Returns the currentPage.
*/
public int getCurrentPage() {
return currentPage;
}
/**
* 分页显示,设置当前页码
*
* @param currentPage
* The currentPage to set.
*/
public void setCurrentPage(int currentPage) {
this.currentPage = currentPage;
}
/**
* 获取表单名称
*
* @return Returns the formName.
*/
public String getFormName() {
return formName;
}
/**
* 设置表单名称
*
* @param formName
* The formName to set.
*/
public void setFormName(String formName) {
this.formName = formName;
}
/**
* 获取分页显示的总页码
*
* @return Returns the pageCount.
*/
public int getPageCount() {
// return pageCount;
return (int) (totalCount % rowCount == 0 ? totalCount / rowCount
: totalCount / rowCount + 1);
}
/**
* 设置分页显示的总页码
*
* @param pageCount
* The pageCount to set.
*/
public void setPageCount(int pageCount) {
this.pageCount = pageCount;
}
/**
* 获取每页记录数
*
* @return Returns the rowCount.
*/
public int getRowCount() {
return rowCount;
}
/**
* 设置每页记录数
*
* @param rowCount
* The rowCount to set.
*/
public void setRowCount(int rowCount) {
this.rowCount = rowCount;
}
/**
*
* @return Returns the totalCount.
*/
public long getTotalCount() {
return totalCount;
}
/**
*
* @param totalCount
* The totalCount to set.
*/
public void setTotalCount(long totalCount) {
this.totalCount = totalCount;
}
public String getActionType() {
return actionType;
}
public void setActionType(String actionType) {
this.actionType = actionType;
}
public String getFunctionType() {
return functionType;
}
public void setFunctionType(String functionType) {
this.functionType = functionType;
}
public int getEndPos() {
// return endPos;
return currentPage * rowCount;
}
public void setEndPos(int endPos) {
this.endPos = endPos;
}
public int getStartPos() {
// return startPos;
return (currentPage - 1) * rowCount + 0;
}
public void setStartPos(int startPos) {
this.startPos = startPos;
}
public String getOrderCol() {
if(this.orderCol!=null){
return orderCol;
}else{
return "";
}
}
public void setOrderCol(String orderCol) {
this.orderCol = orderCol;
}
public String getOrder() {
if (COMMON.isEmpty(order)) {
return " ASC ";
}
return order;
}
public void setOrder(String order) {
this.order = order;
}
public Object getBusineseObject() {
return busineseObject;
}
public void setBusineseObject(Object busineseObject) {
this.busineseObject = busineseObject;
}
public boolean isShowQuery() {
return showQuery;
}
public void setShowQuery(boolean showQuery) {
this.showQuery = showQuery;
}
public boolean isReadonly() {
return readonly;
}
public void setReadonly(boolean readonly) {
this.readonly = readonly;
}
/**
* 对象实体属性克隆,用于对象克隆等
*
* @param source
*/
public void cloneProperties(Object source) {
try {
BeanUtils.copyProperties(this, source);
} catch (Exception e) {
e.printStackTrace();
}
}
public String toString() {
return ToStringBuilder.reflectionToString(this,
ToStringStyle.MULTI_LINE_STYLE);
}
public boolean equals(Object o) {
return EqualsBuilder.reflectionEquals(this, o);
}
public int hashCode() {
return HashCodeBuilder.reflectionHashCode(this);
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -