Example usage for org.apache.poi.ss.usermodel CellStyle setBorderRight

List of usage examples for org.apache.poi.ss.usermodel CellStyle setBorderRight

Introduction

In this page you can find the example usage for org.apache.poi.ss.usermodel CellStyle setBorderRight.

Prototype

void setBorderRight(BorderStyle border);

Source Link

Document

set the type of border to use for the right border of the cell

Usage

From source file:com.github.svrtm.xlreport.CellStyle_p.java

License:Apache License

public void copyTo(final CellStyle poiStyle) {
    if (verticalAlignment != null)
        poiStyle.setVerticalAlignment(verticalAlignment);
    if (alignment != null)
        poiStyle.setAlignment(alignment);

    if (borderBottom != null)
        poiStyle.setBorderBottom(borderBottom);
    if (bottomBorderColor != null)
        poiStyle.setBottomBorderColor(bottomBorderColor);
    if (borderLeft != null)
        poiStyle.setBorderLeft(borderLeft);
    if (leftBorderColor != null)
        poiStyle.setLeftBorderColor(leftBorderColor);
    if (borderRight != null)
        poiStyle.setBorderRight(borderRight);
    if (rightBorderColor != null)
        poiStyle.setRightBorderColor(rightBorderColor);
    if (borderTop != null)
        poiStyle.setBorderTop(borderTop);
    if (topBorderColor != null)
        poiStyle.setTopBorderColor(topBorderColor);

    if (wrapText != null)
        poiStyle.setWrapText(wrapText);/*from  w w w  .  ja  v  a2 s . c o  m*/

    if (fillPattern != null)
        poiStyle.setFillPattern(fillPattern);
    if (xssfFgColor == null) {
        if (fillForegroundColor != null)
            poiStyle.setFillForegroundColor(fillForegroundColor);
    } else
        ((XSSFCellStyle) poiStyle).setFillForegroundColor(xssfFgColor);

    if (fmt != null)
        poiStyle.setDataFormat(fmt);
}

From source file:com.globalsight.everest.qachecks.DITAQAChecker.java

License:Apache License

private CellStyle getHeaderStyle(Workbook p_workbook) throws Exception {
    if (headerStyle == null) {
        Font font = p_workbook.createFont();
        font.setBoldweight(Font.BOLDWEIGHT_BOLD);
        font.setColor(IndexedColors.BLACK.getIndex());
        font.setUnderline(Font.U_NONE);
        font.setFontName("Times");
        font.setFontHeightInPoints((short) 11);

        CellStyle cs = p_workbook.createCellStyle();
        cs.setFont(font);//from   ww  w .  j  a  v  a 2 s .  c  o  m
        cs.setWrapText(true);
        cs.setFillPattern(CellStyle.SOLID_FOREGROUND);
        cs.setFillForegroundColor(IndexedColors.GREY_25_PERCENT.getIndex());
        cs.setBorderTop(CellStyle.BORDER_THIN);
        cs.setBorderRight(CellStyle.BORDER_THIN);
        cs.setBorderBottom(CellStyle.BORDER_THIN);
        cs.setBorderLeft(CellStyle.BORDER_THIN);

        headerStyle = cs;
    }

    return headerStyle;
}

From source file:com.globalsight.everest.qachecks.QAChecker.java

License:Apache License

private CellStyle getHeaderStyle(Workbook p_workbook) {
    if (m_headerStyle == null) {
        Font font = p_workbook.createFont();
        font.setBoldweight(Font.BOLDWEIGHT_BOLD);
        font.setColor(IndexedColors.BLACK.getIndex());
        font.setUnderline(Font.U_NONE);
        font.setFontName("Times");
        font.setFontHeightInPoints((short) 11);

        CellStyle cs = p_workbook.createCellStyle();
        cs.setFont(font);/*from  w  w w .j  a v a 2 s . c o  m*/
        cs.setWrapText(true);
        cs.setFillPattern(CellStyle.SOLID_FOREGROUND);
        cs.setFillForegroundColor(IndexedColors.GREY_25_PERCENT.getIndex());
        cs.setBorderTop(CellStyle.BORDER_THIN);
        cs.setBorderRight(CellStyle.BORDER_THIN);
        cs.setBorderBottom(CellStyle.BORDER_THIN);
        cs.setBorderLeft(CellStyle.BORDER_THIN);

        m_headerStyle = cs;
    }

    return m_headerStyle;
}

From source file:com.globalsight.everest.webapp.pagehandler.administration.reports.generator.CommentsAnalysisReportGenerator.java

License:Apache License

private CellStyle getHeaderStyle(Workbook p_workbook) {
    if (headerStyle == null) {
        Font font = p_workbook.createFont();
        font.setBoldweight(Font.BOLDWEIGHT_BOLD);
        font.setColor(IndexedColors.BLACK.getIndex());
        font.setUnderline(Font.U_NONE);
        font.setFontName("Times");
        font.setFontHeightInPoints((short) 11);

        CellStyle cs = p_workbook.createCellStyle();
        cs.setFont(font);/*from ww w .j  ava2  s. co  m*/
        cs.setWrapText(true);
        cs.setFillPattern(CellStyle.SOLID_FOREGROUND);
        cs.setFillForegroundColor(IndexedColors.GREY_25_PERCENT.getIndex());
        cs.setBorderTop(CellStyle.BORDER_THIN);
        cs.setBorderRight(CellStyle.BORDER_THIN);
        cs.setBorderBottom(CellStyle.BORDER_THIN);
        cs.setBorderLeft(CellStyle.BORDER_THIN);

        headerStyle = cs;
    }

    return headerStyle;
}

From source file:com.globalsight.everest.webapp.pagehandler.administration.reports.generator.OnlineJobsReportForIPTranslatorGenerator.java

License:Apache License

private CellStyle getHeaderStyle(Workbook p_workbook) {
    if (headerStyle == null) {
        Font headerFont = p_workbook.createFont();
        headerFont.setBoldweight(Font.BOLDWEIGHT_BOLD);
        headerFont.setColor(IndexedColors.BLACK.getIndex());
        headerFont.setUnderline(Font.U_NONE);
        headerFont.setFontName("Arial");
        headerFont.setFontHeightInPoints((short) 9);

        CellStyle cs = p_workbook.createCellStyle();
        cs.setFont(headerFont);//  w w w .ja va2 s.c  o  m
        cs.setWrapText(true);
        cs.setFillPattern(CellStyle.SOLID_FOREGROUND);
        cs.setFillForegroundColor(IndexedColors.GREY_25_PERCENT.getIndex());
        cs.setBorderTop(CellStyle.BORDER_THIN);
        cs.setBorderRight(CellStyle.BORDER_THIN);
        cs.setBorderBottom(CellStyle.BORDER_THIN);
        cs.setBorderLeft(CellStyle.BORDER_THIN);

        headerStyle = cs;
    }

    return headerStyle;
}

From source file:com.globalsight.everest.webapp.pagehandler.administration.reports.generator.PostReviewQAReportGenerator.java

License:Apache License

private void writeQualityAssessmentInfo(Workbook p_workbook, Sheet p_sheet, Job p_job,
        GlobalSightLocale p_targetLocale) throws Exception {
    String qualityAssessment = null;
    int col = 1;//  ww  w  .jav a2s.  c om
    int row = 6;
    CellStyle contentStyle = p_workbook.createCellStyle();
    contentStyle.cloneStyleFrom(getContentStyle(p_workbook));
    contentStyle.setBorderTop(CellStyle.BORDER_THIN);
    contentStyle.setBorderRight(CellStyle.BORDER_THIN);
    contentStyle.setBorderBottom(CellStyle.BORDER_THIN);
    contentStyle.setBorderLeft(CellStyle.BORDER_THIN);
    contentStyle.setLocked(false);
    Row langInfoRow = getRow(p_sheet, row);
    Cell qualityCell = getCell(langInfoRow, col++);
    for (Workflow wf : p_job.getWorkflows()) {
        if (p_targetLocale.getId() == wf.getTargetLocale().getId()) {
            Collection tasks = ServerProxy.getTaskManager().getCurrentTasks(wf.getId());
            if (tasks != null) {
                for (Iterator it = tasks.iterator(); it.hasNext();) {
                    Task task = (Task) it.next();
                    qualityAssessment = task.getQualityAssessment();
                }
            }
        }
    }
    if (qualityAssessment != null && !"".endsWith(qualityAssessment)) {
        qualityCell.setCellValue(qualityAssessment);
    } else {
        qualityCell.setCellValue("");
    }

    qualityCell.setCellStyle(contentStyle);

}

From source file:com.globalsight.everest.webapp.pagehandler.administration.reports.generator.PostReviewQAReportGenerator.java

License:Apache License

private void writeMarketSuitabilityInfo(Workbook p_workbook, Sheet p_sheet, Job p_job,
        GlobalSightLocale p_targetLocale) throws Exception {
    String marketSuitabilty = null;
    int col = 1;//  w  ww  .ja  v  a2s  .  co  m
    int row = 7;
    CellStyle contentStyle = p_workbook.createCellStyle();
    contentStyle.cloneStyleFrom(getContentStyle(p_workbook));
    contentStyle.setBorderTop(CellStyle.BORDER_THIN);
    contentStyle.setBorderRight(CellStyle.BORDER_THIN);
    contentStyle.setBorderBottom(CellStyle.BORDER_THIN);
    contentStyle.setBorderLeft(CellStyle.BORDER_THIN);
    contentStyle.setLocked(false);
    Row langInfoRow = getRow(p_sheet, row);
    Cell marketCell = getCell(langInfoRow, col++);
    for (Workflow wf : p_job.getWorkflows()) {
        if (p_targetLocale.getId() == wf.getTargetLocale().getId()) {
            Collection tasks = ServerProxy.getTaskManager().getCurrentTasks(wf.getId());
            if (tasks != null) {
                for (Iterator it = tasks.iterator(); it.hasNext();) {
                    Task task = (Task) it.next();
                    marketSuitabilty = task.getMarketSuitability();
                }
            }
        }
    }
    if (marketSuitabilty != null && !"".endsWith(marketSuitabilty)) {
        marketCell.setCellValue(marketSuitabilty);
    } else {
        marketCell.setCellValue("");
    }
    marketCell.setCellStyle(contentStyle);

}

From source file:com.globalsight.everest.webapp.pagehandler.administration.reports.generator.PostReviewQAReportGenerator.java

License:Apache License

private void writeReviewerComment(Workbook p_workbook, Sheet p_sheet) throws Exception {
    int col = 1;//from ww  w  .j a  va 2s .com
    int row = 8;
    CellStyle contentStyle = p_workbook.createCellStyle();
    contentStyle.cloneStyleFrom(getContentStyle(p_workbook));
    contentStyle.setBorderTop(CellStyle.BORDER_THIN);
    contentStyle.setBorderRight(CellStyle.BORDER_THIN);
    contentStyle.setBorderBottom(CellStyle.BORDER_THIN);
    contentStyle.setBorderLeft(CellStyle.BORDER_THIN);
    contentStyle.setLocked(false);
    Row langInfoRow = getRow(p_sheet, row);

    Cell commentCell = getCell(langInfoRow, col++);
    commentCell.setCellValue("");
    commentCell.setCellStyle(contentStyle);

}

From source file:com.globalsight.everest.webapp.pagehandler.administration.reports.generator.ReviewersCommentsSimpleReportGenerator.java

License:Apache License

private CellStyle getHeaderStyle(Workbook p_workbook) throws Exception {
    if (headerStyle == null) {
        Font font = p_workbook.createFont();
        font.setBoldweight(Font.BOLDWEIGHT_BOLD);
        font.setColor(IndexedColors.BLACK.getIndex());
        font.setUnderline(Font.U_NONE);
        font.setFontName("Times");
        font.setFontHeightInPoints((short) 11);

        CellStyle cs = p_workbook.createCellStyle();
        cs.setFont(font);/*from  w  ww .ja  v a  2 s . c  om*/
        cs.setWrapText(true);
        cs.setFillPattern(CellStyle.SOLID_FOREGROUND);
        cs.setFillForegroundColor(IndexedColors.GREY_40_PERCENT.getIndex());
        cs.setBorderTop(CellStyle.BORDER_THIN);
        cs.setBorderRight(CellStyle.BORDER_THIN);
        cs.setBorderBottom(CellStyle.BORDER_THIN);
        cs.setBorderLeft(CellStyle.BORDER_THIN);

        headerStyle = cs;
    }

    return headerStyle;
}

From source file:com.globalsight.everest.webapp.pagehandler.administration.reports.generator.ReviewersCommentsSimpleReportGenerator.java

License:Apache License

private CellStyle getContentStyle(Workbook p_workbook) throws Exception {
    if (contentStyle == null) {
        CellStyle style = p_workbook.createCellStyle();
        style.setWrapText(true);/*from   w  w  w. ja v a  2  s. c  o m*/
        style.setAlignment(CellStyle.ALIGN_LEFT);
        style.setVerticalAlignment(CellStyle.VERTICAL_CENTER);
        style.setBorderTop(CellStyle.BORDER_THIN);
        style.setBorderRight(CellStyle.BORDER_THIN);
        style.setBorderBottom(CellStyle.BORDER_THIN);
        style.setBorderLeft(CellStyle.BORDER_THIN);
        Font font = p_workbook.createFont();
        font.setFontName("Arial");
        font.setFontHeightInPoints((short) 10);
        style.setFont(font);

        contentStyle = style;
    }

    return contentStyle;
}