/** * Get the cell properties for the cell. * @return The cell properties * @since 4.0.0 */ protected CTTcPr getTcPr() { return ctTc.isSetTcPr() ? ctTc.getTcPr() : ctTc.addNewTcPr(); }
/** * Get the vertical alignment of the cell. * * @return the cell alignment enum value or <code>null</code> * if no vertical alignment is set. */ public XWPFVertAlign getVerticalAlignment() { XWPFVertAlign vAlign = null; CTTcPr tcpr = ctTc.getTcPr(); if (tcpr != null) { CTVerticalJc va = tcpr.getVAlign(); if(va != null) { vAlign = stVertAlignTypeMap.get(va.getVal().intValue()); } } return vAlign; }
/** * Get cell color. Note that this method only returns the "fill" value. * * @return RGB string of cell color */ public String getColor() { String color = null; CTTcPr tcpr = ctTc.getTcPr(); if (tcpr != null) { CTShd ctshd = tcpr.getShd(); if (ctshd != null) { color = ctshd.xgetFill().getStringValue(); } } return color; }
private static CTTcPr getTcPr(XWPFTableCell cell) { CTTcPr tcPr = cell.getCTTc().isSetTcPr() ? cell.getCTTc().getTcPr() : cell.getCTTc().addNewTcPr(); return tcPr; }
CTTc ctTc = cell.getCTTc(); CTTcPr tcPr = ctTc.getTcPr(); CTTcBorders border = tcPr.addNewTcBorders(); border.addNewBottom().setVal(STBorder.SINGLE); border.addNewRight().setVal(STBorder.SINGLE); border.addNewLeft().setVal(STBorder.SINGLE); border.addNewTop().setVal(STBorder.SINGLE);
private void buildCellBorder(Border border, XWPFTableCell tableCell,int type) { CTTcPr cellPropertie = tableCell.getCTTc().getTcPr(); if(cellPropertie==null){ cellPropertie=tableCell.getCTTc().addNewTcPr();
public CTTcPr getTcPr( XWPFTableCell cell ) { CTTc tc = cell.getCTTc(); if ( tc == null ) { return null; } return tc.getTcPr(); }
public CTTcPr getTcPr( XWPFTableCell cell ) { CTTc tc = cell.getCTTc(); if ( tc == null ) { return null; } return tc.getTcPr(); }
private int getCellIndex( int cellIndex, XWPFTableCell cell ) { BigInteger gridSpan = stylesDocument.getTableCellGridSpan( cell.getCTTc().getTcPr() ); if ( gridSpan != null ) { cellIndex = cellIndex + gridSpan.intValue(); } else { cellIndex++; } return cellIndex; }
/** * Get the cell properties for the cell. * @return The cell properties * @since 4.0.0 */ protected CTTcPr getTcPr() { return ctTc.isSetTcPr() ? ctTc.getTcPr() : ctTc.addNewTcPr(); }
public static CTTblWidth getWidth( XWPFTableCell cell ) { return cell.getCTTc().getTcPr().getTcW(); }
public static CTTblWidth getWidth( XWPFTableCell cell ) { return cell.getCTTc().getTcPr().getTcW(); }
/** * Set the vertical alignment of the cell. * @param vAlign - the desired alignment enum value */ public void setVerticalAlignment(XWPFVertAlign vAlign) { CTTcPr tcpr = ctTc.isSetTcPr() ? ctTc.getTcPr() : ctTc.addNewTcPr(); CTVerticalJc va = tcpr.addNewVAlign(); va.setVal(alignMap.get(vAlign)); }
public static TableWidth getTableWidth( XWPFTableCell cell ) { float width = 0; boolean percentUnit = false; CTTcPr tblPr = cell.getCTTc().getTcPr(); if ( tblPr.isSetTcW() ) { CTTblWidth tblWidth = tblPr.getTcW(); return getTableWidth( tblWidth ); } return new TableWidth( width, percentUnit ); }
public static TableWidth getTableWidth( XWPFTableCell cell ) { float width = 0; boolean percentUnit = false; CTTcPr tblPr = cell.getCTTc().getTcPr(); if ( tblPr.isSetTcW() ) { CTTblWidth tblWidth = tblPr.getTcW(); return getTableWidth( tblWidth ); } return new TableWidth( width, percentUnit ); }
public static TableWidth getTableWidth( XWPFTableCell cell ) { float width = 0; boolean percentUnit = false; CTTcPr tblPr = cell.getCTTc().getTcPr(); if ( tblPr.isSetTcW() ) { CTTblWidth tblWidth = tblPr.getTcW(); return getTableWidth( tblWidth ); } return new TableWidth( width, percentUnit ); }
/** * Set cell color. This sets some associated values; for finer control * you may want to access these elements individually. * @param rgbStr - the desired cell color, in the hex form "RRGGBB". */ public void setColor(String rgbStr) { CTTcPr tcpr = ctTc.isSetTcPr() ? ctTc.getTcPr() : ctTc.addNewTcPr(); CTShd ctshd = tcpr.isSetShd() ? tcpr.getShd() : tcpr.addNewShd(); ctshd.setColor("auto"); ctshd.setVal(STShd.CLEAR); ctshd.setFill(rgbStr); }