/** * Get the underline setting for the run. * * @return the Underline pattern applied to this run * @see (@link UnderlinePatterns} */ public UnderlinePatterns getUnderline() { UnderlinePatterns value = UnderlinePatterns.NONE; CTUnderline underline = getCTUnderline(false); if (underline != null) { STUnderline.Enum baseValue = underline.getVal(); if (baseValue != null) { value = UnderlinePatterns.valueOf(baseValue.intValue()); } } return value; }
/** * Specifies that the contents of this run should be displayed along with an * underline appearing directly below the character height. * <p> * If this element is not present, the default value is to leave the * formatting applied at previous level in the style hierarchy. If this * element is never applied in the style hierarchy, then an underline shall * not be applied to the contents of this run. * </p> * * @param value - * underline type * @see {@link UnderlinePatterns} : all possible patterns that could be applied */ public void setUnderline(UnderlinePatterns value) { CTUnderline underline = getCTUnderline(true); underline.setVal(STUnderline.Enum.forInt(value.getValue())); }
/** * Get the underline color for the run's underline, if any. * * @return The RGB color value as as a string of hexadecimal digits (e.g., "A0B2F1") or "auto". * @since 4.0.0 */ public String getUnderlineColor() { CTUnderline underline = getCTUnderline(true); String colorName = "auto"; Object rawValue = underline.getColor(); if (rawValue != null) { if (rawValue instanceof String) { colorName = (String)rawValue; } else { byte[] rgbColor = (byte[])rawValue; colorName = HexDump.toHex(rgbColor[0]) + HexDump.toHex(rgbColor[1]) + HexDump.toHex(rgbColor[2]); } } return colorName; }
/** * Set the underline theme color for the run's underline, if any. * * @param themeColor A theme color name (see {@link STThemeColor.Enum}). * @since 4.0.0 */ public void setUnderlineThemeColor(String themeColor) { CTUnderline underline = getCTUnderline(true); STThemeColor.Enum val = STThemeColor.Enum.forString(themeColor); if (val != null) { underline.setThemeColor(val); } }
/** * Get the underline theme color for the run's underline, if any. * * @return The {@link STThemeColor.Enum}. * @since 4.0.0 */ public STThemeColor.Enum getUnderlineThemeColor() { CTUnderline underline = getCTUnderline(false); STThemeColor.Enum color = STThemeColor.NONE; if (underline != null) { color = underline.getThemeColor(); } return color; }
/** * Set the underline color for the run's underline, if any. * * @param color An RGB color value (e.g, "a0C6F3") or "auto". * @since 4.0.0 */ public void setUnderlineColor(String color) { CTUnderline underline = getCTUnderline(true); SimpleValue svColor = null; if (color.equals("auto")) { STHexColorAuto hexColor = STHexColorAuto.Factory.newInstance(); hexColor.set(STHexColorAuto.Enum.forString(color)); svColor = (SimpleValue) hexColor; } else { STHexColorRGB rgbColor = STHexColorRGB.Factory.newInstance(); rgbColor.setStringValue(color); svColor = (SimpleValue) rgbColor; } underline.setColor(svColor); }
/** * Set the underline theme color for the run's underline, if any. * * @param themeColor A theme color name (see {@link STThemeColor.Enum}). * @since 4.0.0 */ public void setUnderlineThemeColor(String themeColor) { CTUnderline underline = getCTUnderline(true); STThemeColor.Enum val = STThemeColor.Enum.forString(themeColor); if (val != null) { underline.setThemeColor(val); } }
/** * Get the underline theme color for the run's underline, if any. * * @return The {@link STThemeColor.Enum}. * @since 4.0.0 */ public STThemeColor.Enum getUnderlineThemeColor() { CTUnderline underline = getCTUnderline(false); STThemeColor.Enum color = STThemeColor.NONE; if (underline != null) { color = underline.getThemeColor(); } return color; }
/** * Set the underline color for the run's underline, if any. * * @param color An RGB color value (e.g, "a0C6F3") or "auto". * @since 4.0.0 */ public void setUnderlineColor(String color) { CTUnderline underline = getCTUnderline(true); SimpleValue svColor = null; if (color.equals("auto")) { STHexColorAuto hexColor = STHexColorAuto.Factory.newInstance(); hexColor.set(STHexColorAuto.Enum.forString(color)); svColor = (SimpleValue) hexColor; } else { STHexColorRGB rgbColor = STHexColorRGB.Factory.newInstance(); rgbColor.setStringValue(color); svColor = (SimpleValue) rgbColor; } underline.setColor(svColor); }
/** * Get the underline setting for the run. * * @return the Underline pattern applied to this run * @see (@link UnderlinePatterns} */ public UnderlinePatterns getUnderline() { UnderlinePatterns value = UnderlinePatterns.NONE; CTUnderline underline = getCTUnderline(false); if (underline != null) { STUnderline.Enum baseValue = underline.getVal(); if (baseValue != null) { value = UnderlinePatterns.valueOf(baseValue.intValue()); } } return value; }
/** * Specifies that the contents of this run should be displayed along with an * underline appearing directly below the character height. * <p> * If this element is not present, the default value is to leave the * formatting applied at previous level in the style hierarchy. If this * element is never applied in the style hierarchy, then an underline shall * not be applied to the contents of this run. * </p> * * @param value - * underline type * @see {@link UnderlinePatterns} : all possible patterns that could be applied */ public void setUnderline(UnderlinePatterns value) { CTUnderline underline = getCTUnderline(true); underline.setVal(STUnderline.Enum.forInt(value.getValue())); }
/** * Get the underline color for the run's underline, if any. * * @return The RGB color value as as a string of hexadecimal digits (e.g., "A0B2F1") or "auto". * @since 4.0.0 */ public String getUnderlineColor() { CTUnderline underline = getCTUnderline(true); String colorName = "auto"; Object rawValue = underline.getColor(); if (rawValue != null) { if (rawValue instanceof String) { colorName = (String)rawValue; } else { byte[] rgbColor = (byte[])rawValue; colorName = HexDump.toHex(rgbColor[0]) + HexDump.toHex(rgbColor[1]) + HexDump.toHex(rgbColor[2]); } } return colorName; }
@Override public UnderlinePatterns getValue( CTRPr rPr, XWPFStylesDocument stylesDocument) { return ( rPr != null && rPr.isSetU() ) ? UnderlinePatterns.valueOf( rPr.getU().getVal().intValue() ) : null; } }
/** * Specifies that the contents of this run should be displayed along with an * underline appearing directly below the character heigh * <p/> * <p/> * If this element is not present, the default value is to leave the * formatting applied at previous level in the style hierarchy. If this * element is never applied in the style hierarchy, then an underline shall * not be applied to the contents of this run. * </p> * * @param value - * underline type * @see UnderlinePatterns : all possible patterns that could be applied */ public void setUnderline(UnderlinePatterns value) { CTRPr pr = run.isSetRPr() ? run.getRPr() : run.addNewRPr(); CTUnderline underline = (pr.getU() == null) ? pr.addNewU() : pr.getU(); underline.setVal(STUnderline.Enum.forInt(value.getValue())); }
@Override public UnderlinePatterns getValue( CTParaRPr rPr, XWPFStylesDocument stylesDocument ) { return ( rPr != null && rPr.isSetU() ) ? UnderlinePatterns.valueOf( rPr.getU().getVal().intValue() ) : null; } }
@Override public UnderlinePatterns getValue( CTRPr rPr, XWPFStylesDocument stylesDocument ) { return ( rPr != null && rPr.isSetU() ) ? UnderlinePatterns.valueOf( rPr.getU().getVal().intValue() ) : null; }
@Override public UnderlinePatterns getValue( CTParaRPr rPr, XWPFStylesDocument stylesDocument ) { return ( rPr != null && rPr.isSetU() ) ? UnderlinePatterns.valueOf( rPr.getU().getVal().intValue() ) : null; } }
@Override public UnderlinePatterns getValue( CTRPr rPr, XWPFStylesDocument stylesDocument) { return ( rPr != null && rPr.isSetU() ) ? UnderlinePatterns.valueOf( rPr.getU().getVal().intValue() ) : null; } }
@Override public UnderlinePatterns getValue( CTRPr rPr, XWPFStylesDocument stylesDocument ) { return ( rPr != null && rPr.isSetU() ) ? UnderlinePatterns.valueOf( rPr.getU().getVal().intValue() ) : null; }
/** * Specifies that the contents of this run should be displayed along with an * underline appearing directly below the character heigh * * @return the Underline pattern applyed to this run * @see UnderlinePatterns */ public UnderlinePatterns getUnderline() { CTRPr pr = run.getRPr(); return (pr != null && pr.isSetU()) ? UnderlinePatterns.valueOf(pr .getU().getVal().intValue()) : UnderlinePatterns.NONE; }