Example usage for org.apache.poi.hssf.converter AbstractExcelUtils getBorderWidth

List of usage examples for org.apache.poi.hssf.converter AbstractExcelUtils getBorderWidth

Introduction

In this page you can find the example usage for org.apache.poi.hssf.converter AbstractExcelUtils getBorderWidth.

Prototype

public static String getBorderWidth(BorderStyle xlsBorder) 

Source Link

Usage

From source file:com.wangzhu.poi.ExcelToHtmlConverter.java

License:Apache License

private void buildStyle_border(HSSFWorkbook workbook, StringBuffer style, String type, short xlsBorder,
        short borderColor) {
    if (xlsBorder == CellStyle.BORDER_NONE) {
        return;//  w w  w .  ja v  a 2 s .  c  o  m
    }

    StringBuffer borderStyle = new StringBuffer();
    borderStyle.append(AbstractExcelUtils.getBorderWidth(xlsBorder));
    borderStyle.append(' ');
    borderStyle.append(AbstractExcelUtils.getBorderStyle(xlsBorder));

    final HSSFColor color = workbook.getCustomPalette().getColor(borderColor);
    if (color != null) {
        borderStyle.append(' ');
        borderStyle.append(AbstractExcelUtils.getColor(color));
    }

    style.append("border-" + type + ":" + borderStyle + ";");
}