formatting.java

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

JAVA
45
字号
package com.wiley.compBooks.EJwithUML.Base.HtmlPrimitives.Core;import com.wiley.compBooks.EJwithUML.Base.HtmlPrimitives.Layout.*;/** The Formatting class contains some convenience methods for *  formatting attributes.*/public class Formatting{  /** if the value is -1 then ignore the attribute. Otherwise   *  include attribute name with value in quotes*/  public static String convertToAttribute(String name, int value)  {    return (value == -1) ? "" : " " +name+ "=\"" +value+ "\"";  }  /** Include attribute name with value in quotes*/  public static String convertToAttribute(String name, String value)  {    return (value == null) ? "" : " " +name+ "=\"" +value+ "\"";  }  /** Include attribute if value is true.*/  public static String convertToAttribute(String name, boolean value)  {    return (value == false) ? "" : " "+name;  }  /** Include attribute name with value in quotes*/  public static String convertToAttribute(String name, HAlignment value)  {    return (value == null) ? "" : " " +name+ "=\"" +value+ "\"";  }  /** Include attribute name with value in quotes*/  public static String convertToAttribute(String name, VAlignment value)  {    return (value == null) ? "" : " " +name+ "=\"" +value+ "\"";  }  /** Include attribute name with value in quotes */  public static String convertToAttribute(String name, Style value)  {    return (value == null) ? "" : " " +name+ "=\"" +value+ "\"";  }}

⌨️ 快捷键说明

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