本文整理汇总了Java中org.docx4j.wml.R.getRPr方法的典型用法代码示例。如果您正苦于以下问题:Java R.getRPr方法的具体用法?Java R.getRPr怎么用?Java R.getRPr使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.docx4j.wml.R
的用法示例。
在下文中一共展示了R.getRPr方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: extractFormattingData
import org.docx4j.wml.R; //导入方法依赖的package包/类
/**
* Updates the provided formatting data map based on the provided data about the text run.
*
* @param run
* The provided text run
* @param childRange
* The text range this run covers
* @param formattingData
* The formatting data map to update
* @param paragraphProperties
* The docx4j paragraph properties object
* @param styleMap
* The extracted styles of the main document.
* @param mainDoc
* The main document object
*/
private void extractFormattingData(final R run, final TextRange childRange, final Map<FormattingType, Set<TextRange>> formattingData,
final PPr paragraphProperties, final Map<String, Style> styleMap, final MainDocumentPart mainDoc) {
final RPr runProperties = run.getRPr();
final BooleanDefaultTrue isBold = getRunProperty(runProperties, paragraphProperties, RPr::getB, styleMap, mainDoc);
final BooleanDefaultTrue isItalics = getRunProperty(runProperties, paragraphProperties, RPr::getI, styleMap, mainDoc);
final U underlining = getRunProperty(runProperties, paragraphProperties, RPr::getU, styleMap, mainDoc);
if (isBold != null && isBold.isVal()) {
formattingData.get(FormattingType.BOLD).add(childRange);
}
if (isItalics != null && isItalics.isVal()) {
formattingData.get(FormattingType.ITALICS).add(childRange);
}
if (underlining != null && underlining.getVal() != UnderlineEnumeration.NONE) {
formattingData.get(FormattingType.UNDERLINE).add(childRange);
}
}
示例2: addHyperlinkCellStyle
import org.docx4j.wml.R; //导入方法依赖的package包/类
private void addHyperlinkCellStyle(Tc tableCell, BandElement be, P hyperlink, Map<String, Object> style) {
setCellMargins(tableCell, style);
setBackground(tableCell, style);
setVerticalAlignment(tableCell, style);
setHorizontalAlignment(hyperlink, style);
setCellBorders(tableCell, style);
R run = (R) ((org.docx4j.wml.P.Hyperlink)hyperlink.getContent().get(0)).getContent().get(0);
RPr runProperties = run.getRPr();
setFont(tableCell, style, runProperties);
if (be != null) {
setTextDirection(tableCell, be.getTextRotation());
}
tableCell.getContent().add(hyperlink);
}