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

📄 excelobject.java

📁 struts+spring+hibernate自创框架
💻 JAVA
字号:
package com.pegasus.framework.util.export.model;

import java.io.Serializable;

import jxl.format.BoldStyle;
import jxl.format.Colour;
import jxl.write.WritableCellFormat;
import jxl.write.WritableFont;
import jxl.write.WriteException;

import com.pegasus.framework.util.export.ExcelExport;

public class ExcelObject implements Serializable {
	
	private String value;
	private WritableCellFormat format;
	
	public ExcelObject(String value) {
		this.value = value;
		format = new WritableCellFormat();
	}
	
	public ExcelObject(String value,WritableCellFormat format) {
		this.value = value;
		this.format = format;
	}
	
	public ExcelObject(String value,WritableFont wfc) {
		this.value = value;
		this.format = new WritableCellFormat(wfc);
	}
	
	public ExcelObject(String value,Colour color) {
		WritableFont wfc = ExcelExport.createDefaultWcf();
		try {
			wfc.setColour(color);
		} catch (WriteException e) {
		}
		this.value = value;
		this.format = new WritableCellFormat(wfc);
	}
	
	public ExcelObject(String value,boolean isBold,Colour color) {
		WritableFont wfc = ExcelExport.createDefaultWcf();
		try {
			if(color != null)
				wfc.setColour(color);
			if(isBold)
				wfc.setBoldStyle(WritableFont.BOLD);
		} catch (WriteException e) {
		}
		this.value = value;
		this.format = new WritableCellFormat(wfc);
	}
	
	public ExcelObject(String value,boolean isBold) {
		WritableFont wfc = ExcelExport.createDefaultWcf();
		try {
			if(isBold)
				wfc.setBoldStyle(WritableFont.BOLD);
		} catch (WriteException e) {
		}
		this.value = value;
		this.format = new WritableCellFormat(wfc);
	}
	
	
	
	/**
	 * @return Returns the format.
	 */
	public WritableCellFormat getFormat() {
		return format;
	}
	/**
	 * @param format The format to set.
	 */
	public void setFormat(WritableCellFormat format) {
		this.format = format;
	}
	/**
	 * @return Returns the value.
	 */
	public String getValue() {
		return value;
	}
	/**
	 * @param value The value to set.
	 */
	public void setValue(String value) {
		this.value = value;
	}
	
	
	
	
	
}

⌨️ 快捷键说明

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