Example usage for org.apache.poi.ss.usermodel Font setUnderline

List of usage examples for org.apache.poi.ss.usermodel Font setUnderline

Introduction

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

Prototype


void setUnderline(byte underline);

Source Link

Document

set type of text underlining to use

Usage

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

License:Apache License

private CellStyle getTitleStyle(Workbook p_workbook) {
    if (m_titleStyle == null) {
        CellStyle style = p_workbook.createCellStyle();
        Font font = p_workbook.createFont();
        font.setUnderline(Font.U_NONE);
        font.setFontName("Times");
        font.setFontHeightInPoints((short) 14);
        font.setBoldweight(Font.BOLDWEIGHT_BOLD);
        style.setFont(font);//w w  w  .  j a  v a 2 s .  c o  m

        m_titleStyle = style;
    }

    return m_titleStyle;
}

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);/* www. 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.CommentXlsReportHelper.java

License:Apache License

private void addTitle(Workbook p_workbook, Sheet p_sheet, String sheetTitle) throws Exception {
    // title font is black bold on white
    Font titleFont = p_workbook.createFont();
    titleFont.setUnderline(Font.U_NONE);
    titleFont.setFontName("Times");
    titleFont.setFontHeightInPoints((short) 14);
    titleFont.setBoldweight(Font.BOLDWEIGHT_BOLD);
    CellStyle titileCs = p_workbook.createCellStyle();
    titileCs.setWrapText(false);// w w  w .  j ava2s .  c o m
    titileCs.setFont(titleFont);

    Row titleRow = getRow(p_sheet, 0);
    Cell titleCell = getCell(titleRow, 0);
    titleCell.setCellValue(sheetTitle);
    titleCell.setCellStyle(titileCs);
    p_sheet.setColumnWidth(0, 22 * 256);
}

From source file:com.globalsight.everest.webapp.pagehandler.administration.reports.customize.ExcelReportWriter.java

License:Apache License

private void setFormats() throws IOException {
    // Set title format
    Font titleFont = this.workbook.createFont();
    titleFont.setUnderline(Font.U_NONE);
    titleFont.setFontName("Times");
    titleFont.setFontHeightInPoints((short) 14);
    titleFont.setBoldweight(Font.BOLDWEIGHT_BOLD);
    titleFont.setColor(IndexedColors.BLACK.getIndex());

    this.titleStyle = this.workbook.createCellStyle();
    titleStyle.setFont(titleFont);//from   w  ww  .  jav  a  2s  .co  m
    titleStyle.setWrapText(false);

    // Set header format
    Font headerFont = this.workbook.createFont();
    headerFont.setUnderline(Font.U_NONE);
    headerFont.setFontName("Times");
    headerFont.setFontHeightInPoints((short) 11);
    headerFont.setBoldweight(Font.BOLDWEIGHT_BOLD);
    headerFont.setColor(IndexedColors.BLACK.getIndex());

    this.headerStyle = this.workbook.createCellStyle();
    headerStyle.setFont(headerFont);
    headerStyle.setWrapText(true);
    headerStyle.setFillPattern(CellStyle.SOLID_FOREGROUND);
    headerStyle.setFillForegroundColor(IndexedColors.GREY_25_PERCENT.getIndex());
    headerStyle.setBorderBottom(CellStyle.BORDER_THIN);
    headerStyle.setBorderRight(CellStyle.BORDER_THIN);
    headerStyle.setBorderTop(CellStyle.BORDER_THIN);
    headerStyle.setBorderLeft(CellStyle.BORDER_THIN);

    // Set content format
    Font font = this.workbook.createFont();
    font.setFontName("Arial");
    font.setFontHeightInPoints((short) 10);

    this.stringStyle = this.workbook.createCellStyle();
    stringStyle.setAlignment(CellStyle.ALIGN_LEFT);
    stringStyle.setVerticalAlignment(CellStyle.VERTICAL_CENTER);
    this.intStyle = this.workbook.createCellStyle();
    intStyle.setAlignment(CellStyle.ALIGN_LEFT);
    intStyle.setVerticalAlignment(CellStyle.VERTICAL_CENTER);

    // Set money format
    String moneyFormatString = CurrencyThreadLocal.getMoneyFormatString();
    DataFormat moneyFormat = this.workbook.createDataFormat();
    this.moneyStyle = this.workbook.createCellStyle();
    moneyStyle.setDataFormat(moneyFormat.getFormat(moneyFormatString));
    moneyStyle.setWrapText(false);

    // Set total format
    Font totalFont = this.workbook.createFont();
    totalFont.setUnderline(Font.U_NONE);
    totalFont.setFontName("Arial");
    totalFont.setFontHeightInPoints((short) 10);
    totalFont.setBoldweight(Font.BOLDWEIGHT_BOLD);
    totalFont.setColor(IndexedColors.BLACK.getIndex());

    this.totalStyle = this.workbook.createCellStyle();
    totalStyle.setFont(totalFont);
    totalStyle.setWrapText(true);
    totalStyle.setBorderTop(CellStyle.BORDER_THIN);
    totalStyle.setBorderBottom(CellStyle.BORDER_THIN);
    totalStyle.setFillPattern(CellStyle.SOLID_FOREGROUND);
    totalStyle.setFillForegroundColor(IndexedColors.GREY_25_PERCENT.getIndex());

    // Set total money format
    this.totalMoneyStyle = this.workbook.createCellStyle();
    totalMoneyStyle.setDataFormat(moneyFormat.getFormat(moneyFormatString));
    totalMoneyStyle.setWrapText(false);
    totalMoneyStyle.setBorderTop(CellStyle.BORDER_THIN);
    totalMoneyStyle.setBorderBottom(CellStyle.BORDER_THIN);
    totalMoneyStyle.setFillPattern(CellStyle.SOLID_FOREGROUND);
    totalMoneyStyle.setFillForegroundColor(IndexedColors.GREY_25_PERCENT.getIndex());
}

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

License:Apache License

/**
 * Add title to the sheet//from  w  ww.ja  v  a 2s.  c o  m
 * 
 * @param p_workBook
 * @param p_sheet
 *            the sheet
 * @throws Exception
 */
private void addTitle(Workbook p_workBook, Sheet p_sheet) throws Exception {
    ResourceBundle bundle = m_bundle;
    // Title font is black bold on white
    Font titleFont = p_workBook.createFont();
    titleFont.setUnderline(Font.U_NONE);
    titleFont.setFontName("Times");
    titleFont.setFontHeightInPoints((short) 14);
    titleFont.setBoldweight(Font.BOLDWEIGHT_BOLD);
    CellStyle cs = p_workBook.createCellStyle();
    cs.setFont(titleFont);

    Row titleRow = getRow(p_sheet, 0);
    Cell titleCell = getCell(titleRow, 0);
    titleCell.setCellValue(bundle.getString("character_count_report"));
    titleCell.setCellStyle(cs);
}

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  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.webapp.pagehandler.administration.reports.generator.CommentsAnalysisReportGenerator.java

License:Apache License

private CellStyle getTitleStyle(Workbook p_workBook) {
    if (titleStyle == null) {
        // Title font is black bold on white
        Font titleFont = p_workBook.createFont();
        titleFont.setUnderline(Font.U_NONE);
        titleFont.setFontName("Times");
        titleFont.setFontHeightInPoints((short) 14);
        titleFont.setBoldweight(Font.BOLDWEIGHT_BOLD);
        CellStyle cs = p_workBook.createCellStyle();
        cs.setFont(titleFont);// ww  w  . j  av a  2  s  .  c o m

        titleStyle = cs;
    }

    return titleStyle;
}

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

License:Apache License

private CellStyle getRedRightStyle(Workbook p_workbook) throws Exception {
    CellStyle style = p_workbook.createCellStyle();
    Font font = p_workbook.createFont();
    if (hightLightRightStyle == null) {
        font.setBoldweight(Font.BOLDWEIGHT_BOLD);
        font.setColor(IndexedColors.BLACK.getIndex());
        font.setUnderline(Font.U_NONE);
        font.setFontName("Arial");
        font.setFontHeightInPoints((short) 10);

        style.setWrapText(true);/* w  ww.ja  v a 2 s .co  m*/
        style.setAlignment(CellStyle.ALIGN_RIGHT);
        style.setVerticalAlignment(CellStyle.VERTICAL_CENTER);
        style.setFillPattern(CellStyle.SOLID_FOREGROUND);
        style.setFillForegroundColor(IndexedColors.ROSE.getIndex());
        hightLightRightStyle = style;
    }

    return hightLightRightStyle;
}

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

License:Apache License

private CellStyle getRedStyle(Workbook p_workbook) throws Exception {
    CellStyle style = p_workbook.createCellStyle();
    Font font = p_workbook.createFont();
    if (hightLightStyle == null) {
        font.setBoldweight(Font.BOLDWEIGHT_BOLD);
        font.setColor(IndexedColors.BLACK.getIndex());
        font.setUnderline(Font.U_NONE);
        font.setFontName("Arial");
        font.setFontHeightInPoints((short) 10);

        style.setWrapText(true);//from  w ww  .  java2  s .c  o m
        style.setAlignment(CellStyle.ALIGN_LEFT);
        style.setVerticalAlignment(CellStyle.VERTICAL_CENTER);
        style.setFillPattern(CellStyle.SOLID_FOREGROUND);
        style.setFillForegroundColor(IndexedColors.ROSE.getIndex());
        hightLightStyle = style;
    }

    return hightLightStyle;
}

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

License:Apache License

private void addTitle(Workbook p_workbook, Sheet p_sheet) throws Exception {
    String EMEA = CompanyWrapper.getCurrentCompanyName();
    Font titleFont = p_workbook.createFont();
    titleFont.setUnderline(Font.U_NONE);
    titleFont.setFontName("Arial");
    titleFont.setFontHeightInPoints((short) 14);
    titleFont.setBoldweight(Font.BOLDWEIGHT_BOLD);
    CellStyle titleStyle = p_workbook.createCellStyle();
    titleStyle.setWrapText(false);/*  w w  w. jav  a  2s  .  co m*/
    titleStyle.setFont(titleFont);

    Row firRow = getRow(p_sheet, 0);
    Cell titleCell = getCell(firRow, 0);
    titleCell.setCellValue(EMEA + " " + m_bundle.getString("online_jobs_for_ip_translator"));
    titleCell.setCellStyle(titleStyle);
    p_sheet.setColumnWidth(0, 20 * 256);
}