本文整理匯總了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;
}