public class XWPFStyles
extends org.apache.poi.ooxml.POIXMLDocumentPart
XWPFRun
Constructor and Description |
---|
XWPFStyles()
Construct XWPFStyles from scratch for a new document.
|
XWPFStyles(PackagePart part)
Construct XWPFStyles from a package part
|
Modifier and Type | Method and Description |
---|---|
void |
addStyle(XWPFStyle style)
add a style to the document
|
XWPFDefaultParagraphStyle |
getDefaultParagraphStyle()
Get the default paragraph style which applies to the document
|
XWPFDefaultRunStyle |
getDefaultRunStyle()
Get the default style which applies text runs in the document
|
XWPFLatentStyles |
getLatentStyles()
Get the definition of all the Latent Styles
|
int |
getNumberOfStyles() |
XWPFStyle |
getStyle(String styleID)
Get style by a styleID
|
XWPFStyle |
getStyleWithName(String styleName)
Get the style with the specified name, if any.
|
XWPFStyle |
getStyleWithSameName(XWPFStyle style)
get the style with the same name
if this style is not existing, return null
|
List<XWPFStyle> |
getUsedStyleList(XWPFStyle style)
get the styles which are related to the parameter style and their relatives
this method can be used to copy all styles from one document to another document
|
void |
setDefaultFonts(CTFonts fonts)
Sets the default font on ctStyles DocDefaults parameter
TODO Replace this with specific setters for each type, possibly
on XWPFDefaultRunStyle
|
void |
setEastAsia(String strEastAsia)
Sets the default East Asia spelling language on ctStyles DocDefaults parameter
|
void |
setSpellingLanguage(String strSpellingLanguage)
Sets the default spelling language on ctStyles DocDefaults parameter
|
void |
setStyles(CTStyles styles)
Sets the ctStyles
|
boolean |
styleExist(String styleID)
checks whether style with styleID exist
|
_invokeOnDocumentRead, addRelation, createRelationship, createRelationship, createRelationship, getPackagePart, getParent, getRelationById, getRelationId, getRelationPartById, getRelationParts, getRelations, isCommited, isCommitted, setCommited, setCommitted, toString
public XWPFStyles(PackagePart part) throws IOException, OpenXML4JException
part
- the package part holding the data of the styles,IOException
OpenXML4JException
public XWPFStyles()
public void setStyles(CTStyles styles)
styles
- public boolean styleExist(String styleID)
styleID
- styleID of the Style in the style-Documentpublic void addStyle(XWPFStyle style)
style
- IOException
public XWPFStyle getStyle(String styleID)
styleID
- styleID of the searched stylepublic int getNumberOfStyles()
public List<XWPFStyle> getUsedStyleList(XWPFStyle style)
style
- public void setSpellingLanguage(String strSpellingLanguage)
strSpellingLanguage
- public void setEastAsia(String strEastAsia)
strEastAsia
- public void setDefaultFonts(CTFonts fonts)
public XWPFStyle getStyleWithSameName(XWPFStyle style)
public XWPFDefaultRunStyle getDefaultRunStyle()
public XWPFDefaultParagraphStyle getDefaultParagraphStyle()
public XWPFLatentStyles getLatentStyles()
Copyright © 2010 - 2020 Adobe. All Rights Reserved