⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 selectionprimitive.java

📁 考勤管理系统源码
💻 JAVA
字号:
package com.wiley.compBooks.EJwithUML.Base.HtmlPrimitives.FormPrimitives;import com.wiley.compBooks.EJwithUML.Base.HtmlPrimitives.Core.*;import java.util.*;/** * The SelectionPrimitive class encapsulates the details of * building the HTML for a pulldown selector widget. * */public class SelectionPrimitive implements IHtmlPrimitive{  private String name;  private Style style;  private StringBuffer optionsBuffer = new StringBuffer();  /** Construct a SelectionPrimitive with the specified name   *  of the form input element. */  public SelectionPrimitive(String name)  {    this.name = name;  }  /** Specify the style class that is applied to the selection. */  public void setStyle(Style style)  {    this.style = style;  }  /** Add a value to the selector. */  public void addValue(String displayValue, String dataValue, boolean selected)  {    String class_string = Formatting.convertToAttribute("class", style);    String data_value_string = Formatting.convertToAttribute("value", dataValue);    String selected_string = Formatting.convertToAttribute("selected", selected);    optionsBuffer.append("<option" +data_value_string+selected_string+class_string+ ">" +displayValue+ "</option>\n");  }  /** Build the content for this primitive and append it to   *  the specified buffer.*/  public void buildContent(StringBuffer buffer)  {    String name_string = Formatting.convertToAttribute("name", this.name);    buffer.append("<select" +name_string+ ">\n");    buffer.append(this.optionsBuffer.toString());    buffer.append("</select>");  }}

⌨️ 快捷键说明

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