Permit table style modifications, needed for CreateTable
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1797922 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
fd0e150a94
commit
7b38f8c5f1
@ -26,12 +26,13 @@ import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTTableStyleInfo;
|
|||||||
* Wrapper for the CT class, to cache values and add style lookup
|
* Wrapper for the CT class, to cache values and add style lookup
|
||||||
*/
|
*/
|
||||||
public class XSSFTableStyleInfo implements TableStyleInfo {
|
public class XSSFTableStyleInfo implements TableStyleInfo {
|
||||||
|
private final CTTableStyleInfo styleInfo;
|
||||||
private final boolean columnStripes;
|
private final StylesTable stylesTable;
|
||||||
private final boolean rowStripes;
|
private TableStyle style;
|
||||||
private final boolean firstColumn;
|
private boolean columnStripes;
|
||||||
private final boolean lastColumn;
|
private boolean rowStripes;
|
||||||
private final TableStyle style;
|
private boolean firstColumn;
|
||||||
|
private boolean lastColumn;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param stylesTable
|
* @param stylesTable
|
||||||
@ -43,30 +44,51 @@ public class XSSFTableStyleInfo implements TableStyleInfo {
|
|||||||
this.firstColumn = tableStyleInfo.getShowFirstColumn();
|
this.firstColumn = tableStyleInfo.getShowFirstColumn();
|
||||||
this.lastColumn = tableStyleInfo.getShowLastColumn();
|
this.lastColumn = tableStyleInfo.getShowLastColumn();
|
||||||
this.style = stylesTable.getTableStyle(tableStyleInfo.getName());
|
this.style = stylesTable.getTableStyle(tableStyleInfo.getName());
|
||||||
|
this.stylesTable = stylesTable;
|
||||||
|
this.styleInfo = tableStyleInfo;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isShowColumnStripes() {
|
public boolean isShowColumnStripes() {
|
||||||
return columnStripes;
|
return columnStripes;
|
||||||
}
|
}
|
||||||
|
public void setShowColumnStripes(boolean show) {
|
||||||
|
this.columnStripes = show;
|
||||||
|
styleInfo.setShowColumnStripes(show);
|
||||||
|
}
|
||||||
|
|
||||||
public boolean isShowRowStripes() {
|
public boolean isShowRowStripes() {
|
||||||
return rowStripes;
|
return rowStripes;
|
||||||
}
|
}
|
||||||
|
public void setShowRowStripes(boolean show) {
|
||||||
|
this.rowStripes = show;
|
||||||
|
styleInfo.setShowRowStripes(show);
|
||||||
|
}
|
||||||
|
|
||||||
public boolean isShowFirstColumn() {
|
public boolean isShowFirstColumn() {
|
||||||
return firstColumn;
|
return firstColumn;
|
||||||
}
|
}
|
||||||
|
public void setFirstColumn(boolean showFirstColumn) {
|
||||||
|
this.firstColumn = showFirstColumn;
|
||||||
|
styleInfo.setShowFirstColumn(showFirstColumn);
|
||||||
|
}
|
||||||
|
|
||||||
public boolean isShowLastColumn() {
|
public boolean isShowLastColumn() {
|
||||||
return lastColumn;
|
return lastColumn;
|
||||||
}
|
}
|
||||||
|
public void setLastColumn(boolean showLastColumn) {
|
||||||
|
this.lastColumn = showLastColumn;
|
||||||
|
styleInfo.setShowLastColumn(showLastColumn);
|
||||||
|
}
|
||||||
|
|
||||||
public String getName() {
|
public String getName() {
|
||||||
return style.getName();
|
return style.getName();
|
||||||
}
|
}
|
||||||
|
public void setName(String name) {
|
||||||
|
styleInfo.setName(name);
|
||||||
|
style = stylesTable.getTableStyle(name);
|
||||||
|
}
|
||||||
|
|
||||||
public TableStyle getStyle() {
|
public TableStyle getStyle() {
|
||||||
return style;
|
return style;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user