formprimitive.java

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

JAVA
47
字号
package com.wiley.compBooks.EJwithUML.Base.HtmlPrimitives.FormPrimitives;import com.wiley.compBooks.EJwithUML.Base.HtmlPrimitives.Core.*;import java.util.*;/** The FormPrimitive encapsulates the details of building the HTML  *  for an input form. */public class FormPrimitive implements IHtmlPrimitive{  private String submitTarget;  private String name;  private ArrayList primitives = new ArrayList();  /** Construct a FormPrimitive with the specified submit target   *  and form name. */  public FormPrimitive(String submitTarget, String name)  {    this.submitTarget = submitTarget;    this.name = name;  }  /** Add the producer to this form. */  public void addPrimitive(IHtmlPrimitive primitive)  {    this.primitives.add(primitive);  }  /** Build the content for this primitive and append it to   *  the specified buffer.*/  public void buildContent(StringBuffer buffer)  {    String name_string = Formatting.convertToAttribute("name", name);    String action_string = Formatting.convertToAttribute("action", submitTarget);    buffer.append("<form" +name_string+action_string+ " method=POST>");    // add the HTML from each producer to the HTML for this producer.    Iterator producersIterator = primitives.iterator();    while (producersIterator.hasNext())    {      IHtmlPrimitive producer = (IHtmlPrimitive) producersIterator.next();      producer.buildContent(buffer);    }    // end the form tag    buffer.append("</form>\n");  }}

⌨️ 快捷键说明

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