diff options
author | Nick Burch <nick@apache.org> | 2017-06-07 13:33:58 +0000 |
---|---|---|
committer | Nick Burch <nick@apache.org> | 2017-06-07 13:33:58 +0000 |
commit | c8973d9ed54313f89c86f952c4fbf0684f66b74f (patch) | |
tree | 997dfe7aa644e8e20d80cd166fd85f3bae9965a7 | |
parent | 9a4caae61e00db6fde9e6008914212c689b0e1d8 (diff) | |
download | poi-c8973d9ed54313f89c86f952c4fbf0684f66b74f.tar.gz poi-c8973d9ed54313f89c86f952c4fbf0684f66b74f.zip |
Permit table style modifications, needed for CreateTable
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1797922 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r-- | src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFTableStyleInfo.java | 36 |
1 files changed, 29 insertions, 7 deletions
diff --git a/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFTableStyleInfo.java b/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFTableStyleInfo.java index 5e4e04a37a..fc515e6edb 100644 --- a/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFTableStyleInfo.java +++ b/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFTableStyleInfo.java @@ -26,12 +26,13 @@ import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTTableStyleInfo; * Wrapper for the CT class, to cache values and add style lookup */ public class XSSFTableStyleInfo implements TableStyleInfo { - - private final boolean columnStripes; - private final boolean rowStripes; - private final boolean firstColumn; - private final boolean lastColumn; - private final TableStyle style; + private final CTTableStyleInfo styleInfo; + private final StylesTable stylesTable; + private TableStyle style; + private boolean columnStripes; + private boolean rowStripes; + private boolean firstColumn; + private boolean lastColumn; /** * @param stylesTable @@ -43,30 +44,51 @@ public class XSSFTableStyleInfo implements TableStyleInfo { this.firstColumn = tableStyleInfo.getShowFirstColumn(); this.lastColumn = tableStyleInfo.getShowLastColumn(); this.style = stylesTable.getTableStyle(tableStyleInfo.getName()); + this.stylesTable = stylesTable; + this.styleInfo = tableStyleInfo; } public boolean isShowColumnStripes() { return columnStripes; } + public void setShowColumnStripes(boolean show) { + this.columnStripes = show; + styleInfo.setShowColumnStripes(show); + } public boolean isShowRowStripes() { return rowStripes; } + public void setShowRowStripes(boolean show) { + this.rowStripes = show; + styleInfo.setShowRowStripes(show); + } public boolean isShowFirstColumn() { return firstColumn; } + public void setFirstColumn(boolean showFirstColumn) { + this.firstColumn = showFirstColumn; + styleInfo.setShowFirstColumn(showFirstColumn); + } public boolean isShowLastColumn() { return lastColumn; } + public void setLastColumn(boolean showLastColumn) { + this.lastColumn = showLastColumn; + styleInfo.setShowLastColumn(showLastColumn); + } public String getName() { return style.getName(); } + public void setName(String name) { + styleInfo.setName(name); + style = stylesTable.getTableStyle(name); + } public TableStyle getStyle() { return style; } - } |