?? cellprimitive.java
字號:
package com.wiley.compBooks.EJwithUML.Base.HtmlPrimitives.Layout;import com.wiley.compBooks.EJwithUML.Base.HtmlPrimitives.Core.*;/** The CellPrimitive class encapsulates the logic for producing * cells within a table*/class CellPrimitive implements IHtmlPrimitive{ private Style style; private HAlignment horizontalAlignment; private VAlignment verticalAlignment; private int columnSpan = -1; private IHtmlPrimitive content; /** Construct a cell primitive with the specified primitive * as its content. */ CellPrimitive(IHtmlPrimitive content) { this.content = content; } /** Specify the style class that is applied to the cell. */ void setStyle(Style style) { this.style = style; } /** Set the horizontal and vertical alignment of the contents * of the cell. */ void setAlignment(HAlignment horizontalAlignment, VAlignment verticalAlignment) { this.horizontalAlignment = horizontalAlignment; this.verticalAlignment = verticalAlignment; } /** Set the number of columns that this cell should span. */ void setColumnSpan(int columnSpan) { this.columnSpan = columnSpan; } // return column span, but return 1 if it is not set. int getColumnSpan() { return Math.max(this.columnSpan, 1); } /** Build the content for this primitive and append it to * the specified buffer.*/ public void buildContent(StringBuffer buffer) { String class_string = Formatting.convertToAttribute("class", style); String align_string = Formatting.convertToAttribute("align", horizontalAlignment); String valign_string = Formatting.convertToAttribute("valign", verticalAlignment); String colspan_string = Formatting.convertToAttribute("colspan", columnSpan); buffer.append("<td" +class_string+align_string+valign_string+colspan_string+ ">"); content.buildContent(buffer); buffer.append("</td>"); }}
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -