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

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

Introduction

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

Prototype

void setWrapText(boolean wrapped);

Source Link

Document

Set whether the text should be wrapped.

Usage

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

License:Apache License

private CellStyle getRtlContentStyle(Workbook p_workbook) {
    if (rtlContentStyle == null) {
        Font font = p_workbook.createFont();
        font.setFontName("Arial");
        font.setFontHeightInPoints((short) 10);

        CellStyle style = p_workbook.createCellStyle();
        style.setFont(font);//ww  w  . j  a va  2  s .c o m
        style.setWrapText(true);
        style.setAlignment(CellStyle.ALIGN_RIGHT);
        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);
        style.setVerticalAlignment(CellStyle.VERTICAL_CENTER);

        rtlContentStyle = style;
    }

    return rtlContentStyle;
}

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

License:Apache License

private CellStyle getUnlockedStyle(Workbook p_workbook) {
    if (unlockedStyle == null) {
        Font font = p_workbook.createFont();
        font.setFontName("Arial");
        font.setFontHeightInPoints((short) 10);

        CellStyle style = p_workbook.createCellStyle();
        style.setFont(font);/*from  w ww.j  a v  a2  s. co  m*/
        style.setLocked(false);
        style.setWrapText(true);
        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);
        style.setVerticalAlignment(CellStyle.VERTICAL_CENTER);

        unlockedStyle = style;
    }

    return unlockedStyle;
}

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

License:Apache License

private CellStyle getUnlockedRightStyle(Workbook p_workbook) {
    if (unlockedRightStyle == null) {
        Font font = p_workbook.createFont();
        font.setFontName("Arial");
        font.setFontHeightInPoints((short) 10);

        CellStyle style = p_workbook.createCellStyle();
        style.setFont(font);//  w w  w . j av a  2  s .  c  o m
        style.setLocked(false);
        style.setWrapText(true);
        style.setAlignment(CellStyle.ALIGN_RIGHT);
        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);
        style.setVerticalAlignment(CellStyle.VERTICAL_CENTER);

        unlockedRightStyle = style;
    }

    return unlockedRightStyle;
}

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

License:Apache License

private CellStyle getEqual5Style(Workbook p_workbook) {
    if (equal5Style == null) {
        Font font = p_workbook.createFont();
        font.setColor(IndexedColors.BLACK.getIndex());
        font.setUnderline(Font.U_NONE);
        font.setFontName("Arial");
        font.setFontHeightInPoints((short) 9);

        CellStyle cs = p_workbook.createCellStyle();
        cs.setFont(font);//  www  . java  2 s.c  o m
        cs.setWrapText(true);
        cs.setFillPattern(CellStyle.SOLID_FOREGROUND);
        cs.setFillForegroundColor(IndexedColors.BRIGHT_GREEN.getIndex());
        cs.setBorderTop(CellStyle.BORDER_THIN);
        cs.setBorderRight(CellStyle.BORDER_THIN);
        cs.setBorderBottom(CellStyle.BORDER_THIN);
        cs.setBorderLeft(CellStyle.BORDER_THIN);
        cs.setVerticalAlignment(CellStyle.VERTICAL_CENTER);

        equal5Style = cs;
    }

    return equal5Style;
}

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

License:Apache License

private CellStyle getUnder5Style(Workbook p_workbook) {
    if (under5Style == null) {
        Font font = p_workbook.createFont();
        font.setColor(IndexedColors.BLACK.getIndex());
        font.setUnderline(Font.U_NONE);
        font.setFontName("Arial");
        font.setFontHeightInPoints((short) 9);

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

        under5Style = cs;
    }

    return under5Style;
}

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

License:Apache License

private CellStyle getUnder4Style(Workbook p_workbook) {
    if (under4Style == null) {
        Font font = p_workbook.createFont();
        font.setColor(IndexedColors.BLACK.getIndex());
        font.setUnderline(Font.U_NONE);
        font.setFontName("Arial");
        font.setFontHeightInPoints((short) 9);

        CellStyle cs = p_workbook.createCellStyle();
        cs.setFont(font);//w w w .  jav a2s .  c  o m
        cs.setWrapText(true);
        cs.setFillPattern(CellStyle.SOLID_FOREGROUND);
        cs.setFillForegroundColor(IndexedColors.LIGHT_ORANGE.getIndex());
        cs.setBorderTop(CellStyle.BORDER_THIN);
        cs.setBorderRight(CellStyle.BORDER_THIN);
        cs.setBorderBottom(CellStyle.BORDER_THIN);
        cs.setBorderLeft(CellStyle.BORDER_THIN);
        cs.setVerticalAlignment(CellStyle.VERTICAL_CENTER);

        under4Style = cs;
    }

    return under4Style;
}

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

License:Apache License

private CellStyle getUnder3Style(Workbook p_workbook) {
    if (under3Style == null) {
        Font font = p_workbook.createFont();
        font.setColor(IndexedColors.BLACK.getIndex());
        font.setUnderline(Font.U_NONE);
        font.setFontName("Arial");
        font.setFontHeightInPoints((short) 9);

        CellStyle cs = p_workbook.createCellStyle();
        cs.setFont(font);/*from   w w  w.  j  av  a  2  s.c om*/
        cs.setWrapText(true);
        cs.setFillPattern(CellStyle.SOLID_FOREGROUND);
        cs.setFillForegroundColor(IndexedColors.ROSE.getIndex());
        cs.setBorderTop(CellStyle.BORDER_THIN);
        cs.setBorderRight(CellStyle.BORDER_THIN);
        cs.setBorderBottom(CellStyle.BORDER_THIN);
        cs.setBorderLeft(CellStyle.BORDER_THIN);
        cs.setVerticalAlignment(CellStyle.VERTICAL_CENTER);

        under3Style = cs;
    }

    return under3Style;
}

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

License:Apache License

private CellStyle getHeaderStyle(Workbook p_workbook, Short top, Short right, Short bottom, Short left) {
    Font headerFont = p_workbook.createFont();
    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. jav a2 s. co  m*/
    cs.setWrapText(true);
    if (top != null) {
        cs.setBorderTop(top);
    }
    if (right != null) {
        cs.setBorderRight(right);
    }
    if (bottom != null) {
        cs.setBorderBottom(bottom);
    }
    if (left != null) {
        cs.setBorderLeft(left);
    }

    return cs;
}

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

License:Apache License

private CellStyle getCommonHeaderStyle(Workbook p_workbook) {
    Font headerFont = p_workbook.createFont();
    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);/*from  ww  w . j  a  va 2  s.c o m*/
    cs.setWrapText(true);
    cs.setBorderTop(CellStyle.BORDER_THIN);
    cs.setBorderRight(CellStyle.BORDER_THIN);
    cs.setBorderBottom(CellStyle.BORDER_THIN);
    cs.setBorderLeft(CellStyle.BORDER_THIN);
    return cs;
}

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

License:Apache License

private CellStyle getContentStyle1(Workbook p_workbook) {
    CellStyle style = p_workbook.createCellStyle();
    style.setWrapText(true);
    style.setAlignment(CellStyle.ALIGN_LEFT);
    style.setVerticalAlignment(CellStyle.VERTICAL_CENTER);
    Font font = p_workbook.createFont();
    font.setFontName("Arial");
    font.setFontHeightInPoints((short) 10);
    style.setFont(font);//ww  w  .  ja v  a2 s. c  om
    style.setFillPattern(CellStyle.SOLID_FOREGROUND);
    style.setFillForegroundColor(IndexedColors.YELLOW.getIndex());

    return style;
}