/** * 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; }
/** * 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 = getTcPr(); CTShd ctshd = tcpr.isSetShd() ? tcpr.getShd() : tcpr.addNewShd(); ctshd.setColor("auto"); ctshd.setVal(STShd.CLEAR); ctshd.setFill(rgbStr); }
@Override public Color getValue( CTTcPr tcPr ) { if ( tcPr != null ) { return ColorHelper.getFillColor( tcPr.getShd() ); } return null; } }
@Override public Color getValue( CTTcPr tcPr ) { if ( tcPr != null ) { return ColorHelper.getFillColor( tcPr.getShd() ); } return null; } }
@Override public Color getValue( CTTcPr tcPr, XWPFStylesDocument document ) { if ( tcPr != null ) { return ColorHelper.getFillColor( tcPr.getShd() ); } return null; } }
@Override public Color getValue( CTTcPr tcPr, XWPFStylesDocument document ) { if ( tcPr != null ) { return ColorHelper.getFillColor( tcPr.getShd() ); } return null; } }
/** * 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; }
/** * 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; }
/** * 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 = getTcPr(); CTShd ctshd = tcpr.isSetShd() ? tcpr.getShd() : tcpr.addNewShd(); ctshd.setColor("auto"); ctshd.setVal(STShd.CLEAR); ctshd.setFill(rgbStr); }
/** * 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); }
CTShd shd = tcPr.getShd(); if ( shd != null )
CTShd shd = tcPr.getShd(); String hexColor = null; if ( shd != null )