📄 displaywithdictionarylabelcell.java
字号:
/* $RCSfile: DisplayWithDictionaryLabelCell.java,v $
* Created on 2006-9-15 by zouxuemo
* $Source: /LilyDAPCVS/myAppfuse/src/web/com/lily/dap/webapp/extremecomponents/DisplayWithDictionaryLabelCell.java,v $
* $Id: DisplayWithDictionaryLabelCell.java,v 1.1 2006/11/25 02:30:28 zxm Exp $
* Copyright (c) 2005 Jiffle Ltd. All rights reserved.
*/
package com.lily.dap.webapp.extremecomponents;
import org.extremecomponents.table.bean.Column;
import org.extremecomponents.table.cell.DisplayCell;
import org.extremecomponents.table.core.TableModel;
/**
* 对于通过字典或者其他形式在column标签体内显示的列,在需要Excel导出时使用这个扩展Cell
* 使用方法举例:
* <ec:column property="state" sortable="true" cell="com.lily.dap.webapp.extremecomponents.DisplayWithDictionaryLabelCell" style="text-align: center; width:80px;" title="realtysales.realtyHouse.field.state">
* <LilyDAP:dictionary catalog="realtyHouseState" onlyShow="true" toScope="page"><c:out value="${realtyHouse.state}"/></LilyDAP:dictionary>
* </ec:column>
*
* @author zouxuemo
* @version $Revision: 1.1 $
*/
public class DisplayWithDictionaryLabelCell extends DisplayCell {
public String getExportDisplay(TableModel model, Column column) {
String value = column.getValueAsString();
value = value.trim();
value = value.replaceAll("\r\n", "");
value = value.replaceAll("\t", "");
//过滤掉文本中的用"<"和">"括起来的内容
//如果内容是一个URL("<a ...>context</a>")连接,则取链接内的文字信息
int ind1 = -1, ind2 = -1;
while ((ind1 = value.indexOf("<")) >= 0) {
ind2 = value.indexOf(">", ind1);
if (ind2 > 0) value = value.substring(0, ind1) + value.substring(ind2+1);
}
return value;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -