submitprimitive.java

来自「考勤管理系统源码」· Java 代码 · 共 51 行

JAVA
51
字号
package com.wiley.compBooks.EJwithUML.Base.HtmlPrimitives.FormPrimitives;import com.wiley.compBooks.EJwithUML.Base.HtmlPrimitives.Core.*;/** * The SubmitPrimitive class encapsulates the details of building * the HTML for a submit button. */public class SubmitPrimitive implements IHtmlPrimitive{  private String label;  private String name;  private Style style;  /** Construct a simple submit button with the default label. */  public SubmitPrimitive()  {  }  /** Construct an submit input with the specified label and style.*/  public SubmitPrimitive(String label, Style style)  {    this.label = label;    this.style = style;  }  /** Construct an submit input with the specified label.*/  public SubmitPrimitive(String label)  {    this.label = label;  }  /** Set the name of this submit button for internal use. */  public void setName(String name)  {    this.name = name;  }  /** Build the content for this primitive and append it to   *  the specified buffer.*/  public void buildContent(StringBuffer buffer)  {    String type_string = Formatting.convertToAttribute("type", "submit");    String value_string = Formatting.convertToAttribute("value", this.label);    String name_string = Formatting.convertToAttribute("name", this.name);    String class_string = Formatting.convertToAttribute("class", this.style);    buffer.append("<input" +type_string+value_string+name_string+class_string+ ">");    buffer.append("</input>");  }}

⌨️ 快捷键说明

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