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

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

Introduction

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

Prototype

public static String getBorderStyle(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  ww  .  j  a  v  a 2s. co 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 + ";");
}