Examples of CTBorder


Examples of org.openxmlformats.schemas.spreadsheetml.x2006.main.CTBorder

     * @see org.apache.poi.ss.usermodel.CellStyle#BORDER_DASH_DOT_DOT
     * @see org.apache.poi.ss.usermodel.CellStyle#BORDER_MEDIUM_DASH_DOT_DOT
     * @see org.apache.poi.ss.usermodel.CellStyle#BORDER_SLANTED_DASH_DOT
     */
   public void setBorderRight(short border) {
        CTBorder ct = getCTBorder();
        CTBorderPr pr = ct.isSetRight() ? ct.getRight() : ct.addNewRight();
        if(border == BORDER_NONE) ct.unsetRight();
        else pr.setStyle(STBorderStyle.Enum.forInt(border + 1));

        int idx = _stylesSource.putBorder(new XSSFCellBorder(ct));

        _cellXf.setBorderId(idx);
View Full Code Here

Examples of org.openxmlformats.schemas.spreadsheetml.x2006.main.CTBorder

     * @see org.apache.poi.ss.usermodel.CellStyle#BORDER_DASH_DOT_DOT
     * @see org.apache.poi.ss.usermodel.CellStyle#BORDER_MEDIUM_DASH_DOT_DOT
     * @see org.apache.poi.ss.usermodel.CellStyle#BORDER_SLANTED_DASH_DOT
     */
   public void setBorderTop(short border) {
        CTBorder ct = getCTBorder();
        CTBorderPr pr = ct.isSetTop() ? ct.getTop() : ct.addNewTop();
        if(border == BORDER_NONE) ct.unsetTop();
        else pr.setStyle(STBorderStyle.Enum.forInt(border + 1));

        int idx = _stylesSource.putBorder(new XSSFCellBorder(ct));

        _cellXf.setBorderId(idx);
View Full Code Here

Examples of org.openxmlformats.schemas.spreadsheetml.x2006.main.CTBorder

     * Set the color to use for the bottom border
     *
     * @param color the color to use, null means no color
     */
    public void setBottomBorderColor(XSSFColor color) {
        CTBorder ct = getCTBorder();
        if(color == null && !ct.isSetBottom()) return;

        CTBorderPr pr = ct.isSetBottom() ? ct.getBottom() : ct.addNewBottom();
        if(color != nullpr.setColor(color.getCTColor());
        else pr.unsetColor();

        int idx = _stylesSource.putBorder(new XSSFCellBorder(ct));

View Full Code Here

Examples of org.openxmlformats.schemas.spreadsheetml.x2006.main.CTBorder

    /**
     * Get a <b>copy</b> of the currently used CTBorder, if none is used, return a new instance.
     */
    private CTBorder getCTBorder(){
        CTBorder ct;
        if(_cellXf.getApplyBorder()) {
            int idx = (int)_cellXf.getBorderId();
            XSSFCellBorder cf = _stylesSource.getBorderAt(idx);

            ct = (CTBorder)cf.getCTBorder().copy();
View Full Code Here

Examples of org.openxmlformats.schemas.spreadsheetml.x2006.main.CTBorder

     * Set the color to use for the left border as a {@link XSSFColor} value
     *
     * @param color the color to use
     */
    public void setLeftBorderColor(XSSFColor color) {
        CTBorder ct = getCTBorder();
        if(color == null && !ct.isSetLeft()) return;

        CTBorderPr pr = ct.isSetLeft() ? ct.getLeft() : ct.addNewLeft();
        if(color != nullpr.setColor(color.getCTColor());
        else pr.unsetColor();

        int idx = _stylesSource.putBorder(new XSSFCellBorder(ct));

View Full Code Here

Examples of org.openxmlformats.schemas.spreadsheetml.x2006.main.CTBorder

     * Set the color to use for the right border as a {@link XSSFColor} value
     *
     * @param color the color to use
     */
    public void setRightBorderColor(XSSFColor color) {
        CTBorder ct = getCTBorder();
        if(color == null && !ct.isSetRight()) return;

        CTBorderPr pr = ct.isSetRight() ? ct.getRight() : ct.addNewRight();
        if(color != nullpr.setColor(color.getCTColor());
        else pr.unsetColor();

        int idx = _stylesSource.putBorder(new XSSFCellBorder(ct));

View Full Code Here

Examples of org.openxmlformats.schemas.spreadsheetml.x2006.main.CTBorder

     * Set the color to use for the top border as a {@link XSSFColor} value
     *
     * @param color the color to use
     */
    public void setTopBorderColor(XSSFColor color) {
        CTBorder ct = getCTBorder();
        if(color == null && !ct.isSetTop()) return;

        CTBorderPr pr = ct.isSetTop() ? ct.getTop() : ct.addNewTop();
        if(color != nullpr.setColor(color.getCTColor());
        else pr.unsetColor();

        int idx = _stylesSource.putBorder(new XSSFCellBorder(ct));

View Full Code Here

Examples of org.openxmlformats.schemas.spreadsheetml.x2006.main.CTBorder

    CTFill[] ctFill = createDefaultFills();
    fills.add(new XSSFCellFill(ctFill[0]));
    fills.add(new XSSFCellFill(ctFill[1]));

    CTBorder ctBorder = createDefaultBorder();
    borders.add(new XSSFCellBorder(ctBorder));

    CTXf styleXf = createDefaultXf();
    styleXfs.add(styleXf);
    CTXf xf = createDefaultXf();
View Full Code Here

Examples of org.openxmlformats.schemas.spreadsheetml.x2006.main.CTBorder

    ctXf.setFillId(0);
    ctXf.setBorderId(0);
    return ctXf;
  }
  private static CTBorder createDefaultBorder() {
    CTBorder ctBorder = CTBorder.Factory.newInstance();
    ctBorder.addNewBottom();
    ctBorder.addNewTop();
    ctBorder.addNewLeft();
    ctBorder.addNewRight();
    ctBorder.addNewDiagonal();
    return ctBorder;
  }
View Full Code Here

Examples of org.openxmlformats.schemas.wordprocessingml.x2006.main.CTBorder

        CTP ctp = p.getCTP();
        CTPPr ppr = ctp.getPPr()== null? ctp.addNewPPr() : ctp.getPPr();

        //bordi
        CTPBdr bdr = ppr.addNewPBdr();
        CTBorder borderTop = bdr.addNewTop();
        borderTop.setVal(STBorder.DOUBLE);
        bdr.setTop(borderTop);

        assertEquals(Borders.DOUBLE, p.getBorderTop());
        p.setBorderTop(Borders.SINGLE);
        assertEquals(STBorder.SINGLE, borderTop.getVal());
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.