spanprimitive.java
来自「考勤管理系统源码」· Java 代码 · 共 42 行
JAVA
42 行
package com.wiley.compBooks.EJwithUML.Base.HtmlPrimitives.ContentElements;import com.wiley.compBooks.EJwithUML.Base.HtmlPrimitives.Core.*;import java.util.*;/** The SpanPrimitive class encapsulates the logic for creating * a span that encloses text. */public class SpanPrimitive implements IHtmlPrimitive{ private StringBuffer content = new StringBuffer(); /** Construct a SpanPrimitive with the specified style and text.*/ public SpanPrimitive(Style style, String text) { String style_string = Formatting.convertToAttribute("class", style); content.append("<span " +style_string+ ">"); if (text != null) { content.append(text); } } /** add the specified text to this SpanPrimitive*/ public void addText(String text) { content.append(text); } /** add a line break to this SpanPrimitive */ public void addLineBreak() { content.append("</br>"); } /** Build the content for this primitive and append it to the * specified buffer.*/ public void buildContent(StringBuffer buffer) { content.append("</span>\n"); buffer.append(content.toString()); }}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?