📄 basetag.java
字号:
package com.core.taglib;
import org.apache.commons.logging.*;
/**
* 所有Tag的父类,提供:
* 1、通用属性的读入。
* 2、生成通用属性的HTML字符串。
*/
public class BaseTag extends javax.servlet.jsp.tagext.TagSupport {
private static Log log = LogFactory.getLog(BaseTag.class);
protected String cssname;
protected String cssstyle;
protected String disabled;
protected String type;
protected String name;
protected String tabindex;
protected String value;
protected String nullable;
protected String charset;
protected String datatype;
protected String namevalue;
// * HTML scripting events attributes * //
protected String onclick;
protected String ondblclick;
protected String onmousedown;
protected String onmouseup;
protected String onmouseover;
protected String onmousemove;
protected String onmouseout;
protected String onfocus;
protected String onblur;
protected String onkeypress;
protected String onkeydown;
protected String onkeyup;
protected String onselect;
protected String onchange;
public BaseTag() {
}
/**
* 生成通用属性的HTML字符串.
*/
public String getCommHtml() {
StringBuffer bufComm = new StringBuffer();
bufComm.append(" name=\"" + name + "\"");
if (id != null && !id.equals("")) {
bufComm.append(" id=\"" + id + "\"");
}
if (this.getCssname() != null && !this.getCssname().equals("")) {
bufComm.append(" class=\"" + this.getCssname() + "\"");
}
if (this.getCssstyle() != null && !this.getCssstyle().equals("")) {
bufComm.append(" style=\"" + this.getCssstyle() + "\"");
}
if (this.getType() != null && !this.getType().equals("")) {
bufComm.append(" type=\"" + this.getType() + "\"");
}
if (this.getNullable() != null && !this.getNullable().equals("")) {
bufComm.append(" nullable=\"" + this.getNullable() + "\"");
}
if (this.getCharset() != null && !this.getCharset().equals("")) {
bufComm.append(" charset=\"" + this.getCharset() + "\"");
}
if (this.getDatatype() != null && !this.getDatatype().equals("")) {
bufComm.append(" datatype=\"" + this.getDatatype() + "\"");
}
if (this.getNamevalue() != null && !this.getNamevalue().equals("")) {
bufComm.append(" namevalue=\"" + this.getNamevalue() + "\"");
}
if (this.getDisabled() != null && !this.getDisabled().equals("")) {
bufComm.append(" disabled=\"" + this.getDisabled() + "\"");
}
if (this.getTabindex() != null && !this.getTabindex().equals("")) {
bufComm.append(" tabindex=\"" + this.getTabindex() + "\"");
}
if (onchange != null && !onchange.equals("")) {
bufComm.append(" onchange=\"" + onchange + "\"");
}
if (onkeyup != null && !onkeyup.equals("")) {
bufComm.append(" onkeyup=\"" + onkeyup + "\"");
}
if (this.getOnfocus() != null && !this.getOnfocus().equals("")) {
bufComm.append(" onfocus=\"" + this.getOnfocus() + "\"");
}
if (this.getOnkeydown() != null && !this.getOnkeydown().equals("")) {
bufComm.append(" onkeydown=\"" + this.getOnkeydown() + "\"");
}
if (this.getOnblur() != null && !this.getOnblur().equals("")) {
bufComm.append(" onblur=\"" + this.getOnblur() + "\"");
}
if (this.getOnclick() != null && !this.getOnclick().equals("")) {
bufComm.append(" onclick=\"" + this.getOnclick() + "\"");
}
if (this.getOndblclick() != null && !this.getOndblclick().equals("")) {
bufComm.append(" ondblclick=\"" + this.getOndblclick() + "\"");
}
if (this.getOnkeypress() != null && !this.getOnkeypress().equals("")) {
bufComm.append(" onkeypress=\"" + this.getOnkeypress() + "\"");
}
if (this.getOnmousedown() != null && !this.getOnmousedown().equals("")) {
bufComm.append(" onmousedown=\"" + this.getOnmousedown() + "\"");
}
if (this.getOnmousemove() != null && !this.getOnmousemove().equals("")) {
bufComm.append(" onmousemove=\"" + this.getOnmousemove() + "\"");
}
if (this.getOnmouseout() != null && !this.getOnmouseout().equals("")) {
bufComm.append(" onmouseout=\"" + this.getOnmouseout() + "\"");
}
if (this.getOnmouseover() != null && !this.getOnmouseover().equals("")) {
bufComm.append(" onmouseover=\"" + this.getOnmouseover() + "\"");
}
if (this.getOnmouseup() != null && !this.getOnmouseup().equals("")) {
bufComm.append(" onmouseup=\"" + this.getOnmouseup() + "\"");
}
return bufComm.toString();
}
public String getCharset() {
return charset;
}
public String getCssname() {
return cssname;
}
public String getDatatype() {
return datatype;
}
public String getName() {
return name;
}
public String getNamevalue() {
return namevalue;
}
public String isNullable() {
return nullable;
}
public String getOnblur() {
return onblur;
}
public String getOnchange() {
return onchange;
}
public String getOnclick() {
return onclick;
}
public String getOndblclick() {
return ondblclick;
}
public String getOnfocus() {
return onfocus;
}
public String getOnkeydown() {
return onkeydown;
}
public String getOnkeypress() {
return onkeypress;
}
public String getOnkeyup() {
return onkeyup;
}
public String getType() {
return type;
}
public String getNullable() {
return nullable;
}
public String getCssstyle() {
return cssstyle;
}
public String getDisabled() {
return disabled;
}
public String getOnmousedown() {
return onmousedown;
}
public String getOnmousemove() {
return onmousemove;
}
public String getOnmouseout() {
return onmouseout;
}
public String getOnmouseover() {
return onmouseover;
}
public String getOnmouseup() {
return onmouseup;
}
public String getOnselect() {
return onselect;
}
public String getTabindex() {
return tabindex;
}
public String getValue() {
return value;
}
public void setCharset(String charset) {
this.charset = charset;
}
public void setCssname(String cssname) {
this.cssname = cssname;
}
public void setDatatype(String datatype) {
this.datatype = datatype;
}
public void setName(String name) {
this.name = name;
}
public void setNamevalue(String namevalue) {
this.namevalue = namevalue;
}
public void setNullable(String nullable) {
this.nullable = nullable;
}
public void setOnblur(String onblur) {
this.onblur = onblur;
}
public void setOnchange(String onchange) {
this.onchange = onchange;
}
public void setOnclick(String onclick) {
this.onclick = onclick;
}
public void setOndblclick(String ondblclick) {
this.ondblclick = ondblclick;
}
public void setOnfocus(String onfocus) {
this.onfocus = onfocus;
}
public void setOnkeydown(String onkeydown) {
this.onkeydown = onkeydown;
}
public void setOnkeypress(String onkeypress) {
this.onkeypress = onkeypress;
}
public void setOnkeyup(String onkeyup) {
this.onkeyup = onkeyup;
}
public void setType(String type) {
this.type = type;
}
public void setCssstyle(String cssstyle) {
this.cssstyle = cssstyle;
}
public void setDisabled(String disabled) {
this.disabled = disabled;
}
public void setOnmousedown(String onmousedown) {
this.onmousedown = onmousedown;
}
public void setOnmousemove(String onmousemove) {
this.onmousemove = onmousemove;
}
public void setOnmouseout(String onmouseout) {
this.onmouseout = onmouseout;
}
public void setOnmouseover(String onmouseover) {
this.onmouseover = onmouseover;
}
public void setOnmouseup(String onmouseup) {
this.onmouseup = onmouseup;
}
public void setOnselect(String onselect) {
this.onselect = onselect;
}
public void setTabindex(String tabindex) {
this.tabindex = tabindex;
}
public void setValue(String value) {
this.value = value;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -