📄 webpane.java
字号:
/*
* @(#)WebPane.java
*
* Copyright (C) 2006 Sergey Bredikhin
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
package olivax.webmail;
import oliva.common.OlivaUtils;
public class WebPane {
public WebPane() {
}
private String width = "";
private String height = "";
private String style = "";
private int color = 0;
private String content = "";
public static final int COLOR_0099CC = 0;
public static final int COLOR_9999CC = 1;
public static final int COLOR_CCCC99 = 2;
public static final int COLOR_CCCCCC = 3;
public static final int COLOR_CCFF99 = 4;
private final String colors[] = { "0099cc", "9999cc", "cccc99", "cccccc",
"ccff99" };
public void setColor(int color) {
this.color = color;
}
public String getHeight() {
return height;
}
public void setHeight(String height) {
this.height = height;
}
public void setStyle(String style) {
this.style = style;
}
public String getWidth() {
return width;
}
public void setWidth(String width) {
this.width = width;
}
public String show() {
String height = this.height;
if(OlivaUtils.nvl(height).equals(""))
height = "10";
StringBuffer sb = new StringBuffer();
sb.append("<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\">\r\n");
sb.append("<tr>\r\n");
sb.append("<td><img src=\"pics/tl").append(colors[color]).append(".gif\" width=\"16\" height=\"16\"></td>\r\n");
sb.append("<td style=\"{background-image: url('pics/tt").append(colors[color]).append(".gif'); background-repeat: x-repeat; background-position: top left;}\" width=\"100%\"></td>\r\n");
sb.append("<td><img src=\"pics/tr").append(colors[color]).append(".gif\" width=\"16\" height=\"16\"></td>\r\n");
sb.append("</tr>\r\n");
sb.append("<tr>\r\n");
sb.append("<td style=\"{background-image: url('pics/ll").append(colors[color]).append(".gif'); background-repeat: y-repeat; background-position: top left;}\"></td>\r\n");
sb.append("<td bgcolor=\"#").append(colors[color]).append("\" height=\"").append(height).append("\" align=\"center\" valign=\"center\"");
if(!OlivaUtils.nvl(style).equals(""))
sb.append(" style=\"").append(style).append("\"");
sb.append(">\r\n");
sb.append(OlivaUtils.nvl(content)).append("\r\n");
sb.append("</td>\r\n");
sb.append("<td style=\"{background-image: url('pics/rr").append(colors[color]).append(".gif'); background-repeat: y-repeat; background-position: top left;}\"></td>\r\n");
sb.append("</tr>\r\n");
sb.append("<tr>\r\n");
sb.append("<td><img src=\"pics/bl").append(colors[color]).append(".gif\" width=\"16\" height=\"16\"></td>\r\n");
sb.append("<td style=\"{background-image: url('pics/bb").append(colors[color]).append(".gif'); background-repeat: x-repeat; background-position: top left;}\" width=\"100%\"></td>\r\n");
sb.append("<td><img src=\"pics/br").append(colors[color]).append(".gif\" width=\"16\" height=\"16\"></td>\r\n");
sb.append("</tr>\r\n");
sb.append("</table>\r\n");
return sb.toString();
}
public void setContent(String content) {
this.content = content;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -