本文整理汇总了Java中org.odftoolkit.odfdom.incubator.doc.office.OdfOfficeAutomaticStyles类的典型用法代码示例。如果您正苦于以下问题:Java OdfOfficeAutomaticStyles类的具体用法?Java OdfOfficeAutomaticStyles怎么用?Java OdfOfficeAutomaticStyles使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
OdfOfficeAutomaticStyles类属于org.odftoolkit.odfdom.incubator.doc.office包,在下文中一共展示了OdfOfficeAutomaticStyles类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setUpCoreStyle
import org.odftoolkit.odfdom.incubator.doc.office.OdfOfficeAutomaticStyles; //导入依赖的package包/类
private void setUpCoreStyle() throws Throwable {
OdfOfficeAutomaticStyles styles = doc.getContentDom().getOrCreateAutomaticStyles();
OdfStyle style = styles.newStyle(OdfStyleFamily.TableCell);
style.setProperty(OdfTableCellProperties.Border, "0.035cm solid #000000");
style.setProperty(OdfTableCellProperties.WrapOption, "wrap");
style.setProperty(OdfTableCellProperties.BackgroundColor, "#ffffff");
style.setProperty(OdfTableCellProperties.VerticalAlign, "middle");
style.setProperty(OdfParagraphProperties.TextAlign, "left");
style.setProperty(OdfParagraphProperties.MarginBottom, "0.2cm");
style.setProperty(OdfParagraphProperties.MarginTop, "0.2cm");
style.setProperty(OdfTableCellProperties.PaddingTop, "0.2cm");
style.setProperty(OdfTableCellProperties.PaddingBottom, "0.2cm");
style.setProperty(OdfTableCellProperties.PaddingLeft, "0.2cm");
style.setProperty(OdfTextProperties.FontWeight, "Regular");
style.setProperty(OdfTextProperties.FontSize, "10pt");
coreCellStyle = style.getStyleNameAttribute();
}
示例2: prepareCoreStyle
import org.odftoolkit.odfdom.incubator.doc.office.OdfOfficeAutomaticStyles; //导入依赖的package包/类
public static String prepareCoreStyle(final SpreadsheetDocument doc) throws Throwable {
OdfOfficeAutomaticStyles styles = doc.getContentDom().getOrCreateAutomaticStyles();
OdfStyle style = styles.newStyle(OdfStyleFamily.TableCell);
for (OdfStyleProperty property : styleMap.keySet()) {
style.setProperty(property, styleMap.get(property));
}
coreStyleName = style.getStyleNameAttribute();
return coreStyleName;
}