📄 tableformat.java
字号:
".Direction.value='';" + FormName +
".submit();\" style=\"CURSOR: hand\">");
}
}
else {
out1.println(">");
}
}
else {
if (col.field.trim().length() > 0) {
if (OrderBy.equals(col.field)) {
if (Direction.equals("DESC")) {
tmpstr = url + "?" + paramString + "&OrderBy=" + col.field +
"&CurPage=" + CurPage + "&Direction=";
}
else {
tmpstr = url + "?" + paramString + "&OrderBy=" + col.field +
"&CurPage=" + CurPage + "&Direction=DESC";
}
}
else {
tmpstr = url + "?" + paramString + "&OrderBy=" + col.field +
"&CurPage=" + CurPage + "&Direction=";
}
out1.println(" onclick=\"javascript:window.navigate('" + tmpstr +
"');\" style=\"CURSOR: hand\">");
}
else {
out1.println(">");
}
}
}
else {
out1.println(">");
}
if (OrderBy.equals(col.field)) {
if (!Direction.equals("DESC")) {
out1.println("<img src='/images/up.gif'></img>");
}
else {
out1.println("<img src='/images/down.gif'></img>");
}
}
out1.println(col.title);
//////////
out1.println("</td>");
}
if (ifdetail) {
out1.println("<TD id=bgtitle width=50>详细</TD>");
}
if (ifchange) {
out1.println("<TD id=bgtitle width=50>修改</TD>");
}
if (ifdel) {
out1.println("<TD id=bgtitle width=50>删除</TD>");
}
if (ifheadpage) {
out1.println("<TD id=bgtitle width=80>首页</TD>");
}
if (ifinput) {
out1.println("<TD id=bgtitle width=80>录入</TD>");
}
out1.println("</tr>");
}
private void PrintStyle(JspWriter out1) throws Exception
//样式单输出
{
out1.println("<STYLE type=text/css>");
out1.println("A:link {COLOR: black; TEXT-DECORATION: none;borderColorDark:#ffffff;borderColorLight:#808080}");
out1.println("A:visited {COLOR: black; TEXT-DECORATION: none}");
out1.println("A:active {COLOR: black; TEXT-DECORATION: none}");
out1.println("A:hover {COLOR: black; TEXT-DECORATION: none}");
out1.println("</STYLE>");
}
class SubMenu
//紫菜单类
{
String title = ""; //标题
String link = ""; //连接
int width = 10; //宽度
SubMenu(String m_title, String m_link, int m_width)
//构造函数
{
title = m_title;
link = m_link;
width = m_width;
}
}
class Col
//列信息类
{
String title = ""; //标题
String align = "left"; //对其方式
String field = ""; //对应的数据库字段
int sorttype = M_CHAR;
int width = 0;
Col(String m_title, String m_align, int m_width, String m_field,
int m_sorttype)
//构造函数
{
title = m_title;
align = m_align;
width = m_width;
field = m_field;
sorttype = m_sorttype;
}
Col(String m_title, int m_width, String m_field, int m_sorttype)
//构造函数
{
title = m_title;
width = m_width;
field = m_field;
sorttype = m_sorttype;
}
}
private void QuickSortN(int start, int end, int orderby, int direct) {
int i = start;
int j = end;
if ( (start >= end) || (end < 0)) {
return;
}
Row row = null;
while (i < j) {
if (direct == 0) {
row = (Row) Rows.elementAt(i);
while ( (i < j) &&
(Float.parseFloat( ( (Row) Rows.elementAt(j)).rowData[orderby]) >
Float.parseFloat(row.rowData[orderby]))) {
j--;
}
row.swapitem( (Row) Rows.elementAt(j));
row = (Row) Rows.elementAt(j);
while ( (i < j) &&
(Float.parseFloat( ( (Row) Rows.elementAt(i)).rowData[orderby]) <=
Float.parseFloat(row.rowData[orderby]))) {
i++;
}
row.swapitem( (Row) Rows.elementAt(i));
}
else {
row = (Row) Rows.elementAt(i);
while ( (i < j) &&
(Float.parseFloat( ( (Row) Rows.elementAt(j)).rowData[orderby]) <=
Float.parseFloat(row.rowData[orderby]))) {
j--;
}
row.swapitem( (Row) Rows.elementAt(j));
row = (Row) Rows.elementAt(j);
while ( (i < j) &&
(Float.parseFloat( ( (Row) Rows.elementAt(i)).rowData[orderby]) >
Float.parseFloat(row.rowData[orderby]))) {
i++;
}
row.swapitem( (Row) Rows.elementAt(i));
}
}
QuickSortN(start, i - 1, orderby, direct);
QuickSortN(i + 1, end, orderby, direct);
}
private void QuickSortS(int start, int end, int orderby, int direct) {
int i = start;
int j = end;
if ( (start >= end) || (end < 0)) {
return;
}
Row row = null;
while (i < j) {
if (direct == 0) {
row = (Row) Rows.elementAt(i);
while ( (i < j) &&
( ( (Row) Rows.elementAt(j)).rowData[orderby].
compareTo(row.rowData[orderby]) > 0)) {
j--;
}
row.swapitem( (Row) Rows.elementAt(j));
row = (Row) Rows.elementAt(j);
while ( (i < j) &&
( ( (Row) Rows.elementAt(i)).rowData[orderby].
compareTo(row.rowData[orderby]) <= 0)) {
i++;
}
row.swapitem( (Row) Rows.elementAt(i));
}
else {
row = (Row) Rows.elementAt(i);
while ( (i < j) &&
( ( (Row) Rows.elementAt(j)).rowData[orderby].
compareTo(row.rowData[orderby]) <= 0)) {
j--;
}
row.swapitem( (Row) Rows.elementAt(j));
row = (Row) Rows.elementAt(j);
while ( (i < j) &&
( ( (Row) Rows.elementAt(i)).rowData[orderby].
compareTo(row.rowData[orderby]) > 0)) {
i++;
}
row.swapitem( (Row) Rows.elementAt(i));
}
}
QuickSortS(start, i - 1, orderby, direct);
QuickSortS(i + 1, end, orderby, direct);
}
class Row
//函数据类
{
public String[] rowData; //函数句数组
public String link; //行连接
public String dellink = ""; //删除连接
public String changelink = ""; //修改连接
public String BackColor = ContentUnSelColor; //行背景色
public String FontColor = ""; //行字体
Row(String[] data, String m_link)
//构造函数
{
rowData = data;
link = m_link;
}
Row(String[] data, String m_link, String m_dellink, String m_changelink)
//构造函数
{
rowData = data;
link = m_link;
dellink = m_dellink;
changelink = m_changelink;
}
Row(String[] data, String m_link, String m_bgcolor)
//构造函数
{
rowData = data;
link = m_link;
BackColor = m_bgcolor;
}
Row(String[] data, String m_link, String m_dellink, String m_changelink,
String m_bgcolor)
//构造函数
{
rowData = data;
link = m_link;
dellink = m_dellink;
changelink = m_changelink;
BackColor = m_bgcolor;
}
//构造函数
Row() {}
//类内容交换
public void swapitem(Row row) {
Row r = new Row();
r.link = this.link;
r.rowData = this.rowData;
this.link = row.link;
this.rowData = row.rowData;
row.link = r.link;
row.rowData = r.rowData;
r = null;
}
public void Print(JspWriter out1) throws Exception
//行数据输出函数
{
//if(link.trim().length()>0)
//out1.println("<TR ondblclick=\"javascript:window.navigate('"+link+"');\" onmouseout='this.style.backgroundColor=\""+ContentUnSelColor+"\"'onmouseover='this.style.backgroundColor=\""+ContentSelColor+"\"' >");
// else
out1.println("<TR bgcolor='" + BackColor +
"' onmouseout='this.style.backgroundColor=\"" + BackColor +
"\"'onmouseover='this.style.backgroundColor=\"" +
ContentSelColor + "\"' >");
for (int i = 0; i < rowData.length; i++) {
if (ifprinttab) {
out1.println("<TD id=bgbodyzzy height='30' align='center'>");
}
else {
out1.println("<TD id=bgbodyzzy align='" +
( (Col) Cols.elementAt(i)).align + "'>");
}
if (rowData[i] != null) {
out.println(rowData[i].toString());
}
else {
out.println(" ");
}
out1.println("</TD>");
}
if (ifdetail) {
if (link.trim().length() > 0) {
if (ifframe) {
out1.println("<td id=bgbodyzzy align='center'><a href='' onclick='javascript:window.parent.location.replace(\"" +
link +
"\");'><img src='/images/view.gif' border=0></a></td>");
}
else {
out1.println("<td id=bgbodyzzy align='center'><a href=" + link +
"><img src='/images/view.gif' border=0z></a></td>");
}
}
else {
out1.println("<td></td>");
}
}
if (ifchange) {
if (changelink.trim().length() > 0) {
out1.println("<td id=bgbodyzzy align='center'><a href=" + changelink +
">修改</a></td>");
}
else {
out1.println("<td></td>");
}
}
if (ifdel) {
if (dellink.trim().length() > 0) {
out1.println("<td id=bgbodyzzy align='center'><a style='CURSOR: hand' onclick=\"javascript:if(confirm('是否确信删除')) window.location.replace('" +
dellink + "')\">删除</a></td>");
}
else {
out1.println("<td></td>");
}
}
if (ifheadpage) {
if (link.trim().length() > 0) {
if (ifframe) {
out1.println("<td id=bgbodyzzy align='center'><a href='' onclick='javascript:window.parent.location.replace(\"" +
link +
"\");'><img src='/images/view.gif' border=0></a></td>");
}
else {
out1.println("<td id=bgbodyzzy align='center'><a href=" + link +
"><img src='/images/view.gif' border=0z></a></td>");
}
}
else {
out1.println("<td></td>");
}
}
if (ifinput) {
if (link.trim().length() > 0) {
if (ifframe) {
out1.println("<td id=bgbodyzzy align='center'><a href='' onclick='javascript:window.parent.location.replace(\"" +
link +
"\");'><img src='/images/view.gif' border=0></a></td>");
}
else {
out1.println("<td id=bgbodyzzy align='center'><a href=" + link +
"><img src='/images/view.gif' border=0z></a></td>");
}
}
else {
out1.println("<td></td>");
}
}
out1.println("</TR>");
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -