Example usage for org.apache.poi.ss.util RegionUtil setTopBorderColor

List of usage examples for org.apache.poi.ss.util RegionUtil setTopBorderColor

Introduction

In this page you can find the example usage for org.apache.poi.ss.util RegionUtil setTopBorderColor.

Prototype

public static void setTopBorderColor(int color, CellRangeAddress region, Sheet sheet) 

Source Link

Document

Sets the top border color for a region of cells by manipulating the cell style of the individual cells on the top

Usage

From source file:org.haplo.jsinterface.generate.KGenerateXLS.java

License:Mozilla Public License

private void styleBorder(SheetStyleInstruction i) {
    CellRangeAddress region = styleInstructionCellRangeAddress(i);
    // Border/*w  w  w .j a va  2  s .  co m*/
    RegionUtil.setBorderBottom(BorderStyle.MEDIUM, region, this.sheet);
    RegionUtil.setBorderTop(BorderStyle.MEDIUM, region, this.sheet);
    RegionUtil.setBorderLeft(BorderStyle.MEDIUM, region, this.sheet);
    RegionUtil.setBorderRight(BorderStyle.MEDIUM, region, this.sheet);
    // Colour
    short colindex = styleFindColour(IndexedColors.BLACK.getIndex(), i.colour);
    RegionUtil.setBottomBorderColor(colindex, region, this.sheet);
    RegionUtil.setTopBorderColor(colindex, region, this.sheet);
    RegionUtil.setLeftBorderColor(colindex, region, this.sheet);
    RegionUtil.setRightBorderColor(colindex, region, this.sheet);
}