public class SheetImpl extends AbstractSheetAdv
SSheet.SheetVisible
Constructor and Description |
---|
SheetImpl(AbstractBookAdv book,
String id) |
Modifier and Type | Method and Description |
---|---|
SChart |
addChart(SChart.ChartType type,
ViewAnchor anchor) |
SConditionalFormatting |
addConditionalFormatting(CellRegion srcrgn,
CellRegion dstrgn,
SConditionalFormatting src,
int rowOff,
int colOff)
Paste from src a new ConditionalFormatting at the specified region.
|
void |
addConditionalFormatting(SConditionalFormatting scf) |
SDataValidation |
addDataValidation(CellRegion region) |
SDataValidation |
addDataValidation(CellRegion region,
SDataValidation src) |
void |
addDirectlyMergedRegion(CellRegion region) |
void |
addMergedRegion(CellRegion region)
Add a merged area, you can't assign a area that overlaps existed merged area.
|
SPicture |
addPicture(int picDataIndex,
ViewAnchor anchor)
Add a picture into the sheet with known picture data index.
|
SPicture |
addPicture(SPicture.Format format,
byte[] data,
ViewAnchor anchor)
Add a picture into this sheet with raw picture data and format.
|
void |
addTable(STable table)
Add a new table
|
CellRegion |
checkMergedRegion(CellRegion region) |
void |
checkOrphan() |
protected void |
checkOwnership(SChart chart) |
protected void |
checkOwnership(SDataValidation validation) |
protected void |
checkOwnership(SPicture picture) |
void |
clearAutoFilter()
Clear auto filter if there is.
|
void |
clearCell(CellRegion region)
Clear cells in specified region
|
void |
clearCell(int rowIdx,
int columnIdx,
int rowIdx2,
int columnIdx2) |
void |
clearTables() |
SAutoFilter |
createAutoFilter(CellRegion region)
Creates a new auto filter, the old one will be drop directly.
|
void |
deleteAutoFilter()
Delete current autofilter if it has
|
void |
deleteCell(CellRegion region,
boolean horizontal)
Delete a region of cells and shift existing cells.
|
void |
deleteCell(int rowIdx,
int columnIdx,
int lastRowIdx,
int lastColumnIdx,
boolean horizontal) |
void |
deleteChart(SChart chart) |
void |
deleteColumn(int columnIdx,
int lastColumnIdx)
delete columns specified by first and last index
|
void |
deleteConditionalFormatting(SConditionalFormatting cfmt)
Delete a conditional formatting from this sheet.
|
List<SConditionalFormatting> |
deleteConditionalFormattingRegion(CellRegion region)
Delete a region from conditional formatting and return the deleted
conditional formatting.
|
void |
deleteDataValidation(SDataValidation validationid) |
List<SDataValidation> |
deleteDataValidationRegion(CellRegion region)
Delete data validations that are covered by the specified region.
|
void |
deletePicture(SPicture picture) |
void |
deleteRow(int rowIdx,
int lastRowIdx)
delete rows specified by first and last index
|
void |
destroy()
Destroy / release this model object, for example all the dependency, parent linking.
|
void |
dump(StringBuilder builder) |
String |
getAlgName() |
Object |
getAttribute(String name)
Get the runtime custom attribute that stored in this sheet
|
Map<String,Object> |
getAttributes()
Get the unmodifiable runtime attributes map
|
SAutoFilter |
getAutoFilter()
Gets the auto filter information if there is.
|
SBook |
getBook()
Get the owner book
|
SCell |
getCell(int rowIdx,
int columnIdx)
This method always returns not-null cell object.
|
SCell |
getCell(String cellRef) |
Iterator<SCell> |
getCellIterator(int row) |
SChart |
getChart(int idx) |
SChart |
getChart(String picid) |
List<SChart> |
getCharts() |
SColumn |
getColumn(int columnIdx) |
SColumnArray |
getColumnArray(int columnIdx) |
Iterator<SColumnArray> |
getColumnArrayIterator() |
Iterator<SColumn> |
getColumnIterator() |
SConditionalFormatting |
getConditionalFormatting(int id) |
SConditionalFormatting |
getConditionalFormatting(int row,
int col) |
List<SConditionalFormatting> |
getConditionalFormattings()
Returns the conditional formatting applied to this sheet.
|
ConditionalStyleImpl |
getConditionalFormattingStyle(int row,
int col) |
List<CellRegion> |
getContainsMergedRegions(CellRegion region)
Get the merged region that are contained by region.
|
CellRegion |
getDataRegion()
Returns the region which contains data(including chart, picture, and
fills) in this sheet; return null if empty sheet.
|
SDataValidation |
getDataValidation(int idx) |
SDataValidation |
getDataValidation(int rowIdx,
int columnIdx) |
SDataValidation |
getDataValidation(String validationid) |
List<SDataValidation> |
getDataValidations() |
int |
getDefaultColumnWidth() |
int |
getDefaultRowHeight() |
int |
getEndCellIndex(int rowIdx) |
int |
getEndColumnIndex() |
int |
getEndRowIndex() |
short |
getHashedPassword()
Internal Use only.
|
String |
getHashValue() |
String |
getId() |
CellRegion |
getMergedRegion(int idx) |
CellRegion |
getMergedRegion(int row,
int column) |
CellRegion |
getMergedRegion(String cellRef) |
List<CellRegion> |
getMergedRegions() |
int |
getMergeOutOfSync() |
int |
getNumOfChart() |
int |
getNumOfDataValidation() |
int |
getNumOfMergedRegion() |
int |
getNumOfPicture() |
List<CellRegion> |
getOverlapsMergedRegions(CellRegion region,
boolean excludeContains)
Get the merged region that overlapped the region
|
SPicture |
getPicture(int idx) |
SPicture |
getPicture(String picid) |
List<SPicture> |
getPictures() |
SPrintSetup |
getPrintSetup() |
SRow |
getRow(int rowIdx) |
Iterator<SRow> |
getRowIterator() |
Iterator<SRow> |
getRowIterator(int start,
int end) |
String |
getSaltValue() |
String |
getSheetName()
Get the sheet name
|
SSheetProtection |
getSheetProtection()
Gets enhanced protection.
|
SSheet.SheetVisible |
getSheetVisible()
Get the sheet current visible state.
|
String |
getSpinCount() |
int |
getStartCellIndex(int rowIdx) |
int |
getStartColumnIndex() |
int |
getStartRowIndex() |
STable |
getTableByRowCol(int rowIdx,
int colIdx) |
List<STable> |
getTables()
Get tables in this sheet
|
SSheetViewInfo |
getViewInfo() |
void |
insertCell(CellRegion region,
boolean horizontal)
Insert a region of cells and shift existing cells.
|
void |
insertCell(int rowIdx,
int columnIdx,
int lastRowIdx,
int lastColumnIdx,
boolean horizontal) |
void |
insertColumn(int columnIdx,
int lastColumnIdx)
insert columns specified by first and last index
|
void |
insertRow(int rowIdx,
int lastRowIdx)
insert rows specified by first and last index
|
boolean |
isFiltered() |
boolean |
isHidden(int rowIdx,
int colIdx) |
boolean |
isProtected()
Check if the sheet is protected
|
boolean |
isRowHidden(int rowIdx) |
void |
moveCell(CellRegion region,
int rowOffset,
int columnOffset)
Move one or more cells.
|
void |
moveCell(int rowIdx,
int columnIdx,
int lastRowIdx,
int lastColumnIdx,
int rowOffset,
int columnOffset)
Move a region of cells specified by 4 indexes.
|
int |
nextConditionalId() |
CellRegion |
pasteCell(SheetRegion src,
CellRegion dest,
PasteOption option)
paste cell from src sheet to this sheet, the sheets must in same book
|
void |
removeConditionalFormatting(SConditionalFormatting scf) |
void |
removeConditionalFormattingRegion(CellRegion region)
Remove a region from conditional formatting.
|
void |
removeDataValidationRegion(CellRegion region) |
void |
removeMergedRegion(CellRegion region,
boolean removeOverlaps)
Remove the merged area that are contained by region
|
void |
removeTable(STable table) |
void |
removeTable(String name)
Remove the table of the specified table name.
|
void |
removeTables(Set<String> tableNames) |
void |
setAlgName(String algName)
New way of hashing sheet protection password.
|
Object |
setAttribute(String name,
Object value)
Set the runtime custom attribute to stored in this sheet, the attribute is only use for developer to stored runtime data in the sheet,
values will not stored to excel when exporting.
|
void |
setDefaultColumnWidth(int width)
set default column width in pixels
|
void |
setDefaultRowHeight(int height)
set default row height in pixels
|
void |
setHashedPassword(short hashpass)
Internal User only.
|
void |
setHashValue(String hashValue)
New way of hashing sheet protection password.
|
void |
setMergeOutOfSync(int state) |
void |
setPassword(String password)
Sets password to protect sheet, set null to unprotect it.
|
void |
setSaltValue(String saltValue)
New way of hashing sheet protection password.
|
void |
setSheetVisible(SSheet.SheetVisible state)
Set the sheet current visible state.
|
void |
setSpinCount(String spinCount)
New way of hashing sheet protection password.
|
SColumnArray |
setupColumnArray(int index,
int lastIndex)
Set up a column array, if one array range overlaps another, it throws IllegalStateException.
|
public SheetImpl(AbstractBookAdv book, String id)
protected void checkOwnership(SPicture picture)
protected void checkOwnership(SChart chart)
protected void checkOwnership(SDataValidation validation)
public SBook getBook()
SSheet
public String getSheetName()
SSheet
public SRow getRow(int rowIdx)
public SColumn getColumn(int columnIdx)
public SColumnArray getColumnArray(int columnIdx)
SSheet.setupColumnArray(int, int)
public SColumnArray setupColumnArray(int index, int lastIndex)
SSheet
index
- index of the starting columnlastIndex
- index of the end columnpublic SCell getCell(int rowIdx, int columnIdx)
SSheet
SCell.isNull()
to know it's null (blank) or not.public SCell getCell(String cellRef)
SSheet.getCell(int, int)
public int getStartRowIndex()
public int getEndRowIndex()
public int getStartColumnIndex()
public int getEndColumnIndex()
public int getStartCellIndex(int rowIdx)
public int getEndCellIndex(int rowIdx)
public void clearCell(CellRegion region)
SSheet
public void clearCell(int rowIdx, int columnIdx, int rowIdx2, int columnIdx2)
SSheet.clearCell(CellRegion)
public void insertRow(int rowIdx, int lastRowIdx)
SSheet
public void deleteRow(int rowIdx, int lastRowIdx)
SSheet
public void insertCell(CellRegion region, boolean horizontal)
SSheet
region
- the region of cells to inserthorizontal
- TRUE for shifting right, FALSE for shifting downpublic void insertCell(int rowIdx, int columnIdx, int lastRowIdx, int lastColumnIdx, boolean horizontal)
SSheet.insertCell(CellRegion, boolean)
public void deleteCell(CellRegion region, boolean horizontal)
SSheet
region
- the region of cells to deletehorizontal
- TRUE for shifting left, FALSE for shifting uppublic void deleteCell(int rowIdx, int columnIdx, int lastRowIdx, int lastColumnIdx, boolean horizontal)
SSheet.deleteCell(CellRegion, boolean)
public void dump(StringBuilder builder)
public void insertColumn(int columnIdx, int lastColumnIdx)
SSheet
public void deleteColumn(int columnIdx, int lastColumnIdx)
SSheet
public void moveCell(CellRegion region, int rowOffset, int columnOffset)
SSheet
region
- the region of cells to moverowOffset
- positive number to move down, negative to move upcolumnOffset
- positive number to move right, negative to move leftpublic void moveCell(int rowIdx, int columnIdx, int lastRowIdx, int lastColumnIdx, int rowOffset, int columnOffset)
SSheet
SSheet.moveCell(CellRegion, int, int)
public void checkOrphan()
public void destroy()
LinkedModelObject
public String getId()
public SPicture addPicture(SPicture.Format format, byte[] data, ViewAnchor anchor)
SSheet
format
- picture format as specified in SPicture.Format
data
- raw byte data of the pictureanchor
- where to anchor this pictureSPicture
public SPicture addPicture(int picDataIndex, ViewAnchor anchor)
SSheet
picDataIndex
- SPictureData
indexanchor
- where to anchor this pictureSPicture
addedpublic void deletePicture(SPicture picture)
public int getNumOfPicture()
public SPicture getPicture(int idx)
public SChart addChart(SChart.ChartType type, ViewAnchor anchor)
public void deleteChart(SChart chart)
public int getNumOfChart()
public SChart getChart(int idx)
public List<CellRegion> getMergedRegions()
public void removeMergedRegion(CellRegion region, boolean removeOverlaps)
SSheet
public void addMergedRegion(CellRegion region)
SSheet
public List<CellRegion> getOverlapsMergedRegions(CellRegion region, boolean excludeContains)
SSheet
public List<CellRegion> getContainsMergedRegions(CellRegion region)
SSheet
public CellRegion getMergedRegion(String cellRef)
public CellRegion getMergedRegion(int row, int column)
public Object getAttribute(String name)
SSheet
name
- the attribute namepublic Object setAttribute(String name, Object value)
SSheet
name
- name the attribute namevalue
- the attribute valuepublic Map<String,Object> getAttributes()
SSheet
public Iterator<SRow> getRowIterator()
public Iterator<SRow> getRowIterator(int start, int end)
start
- the start indexend
- then end indexpublic Iterator<SColumnArray> getColumnArrayIterator()
public Iterator<SColumn> getColumnIterator()
public int getDefaultRowHeight()
public int getDefaultColumnWidth()
public void setDefaultRowHeight(int height)
SSheet
public void setDefaultColumnWidth(int width)
SSheet
public int getNumOfMergedRegion()
public CellRegion getMergedRegion(int idx)
public boolean isProtected()
SSheet
public void setPassword(String password)
SSheet
public short getHashedPassword()
SSheet
public SSheetViewInfo getViewInfo()
public SPrintSetup getPrintSetup()
public SDataValidation addDataValidation(CellRegion region)
public SDataValidation addDataValidation(CellRegion region, SDataValidation src)
public SDataValidation getDataValidation(String validationid)
public void deleteDataValidation(SDataValidation validationid)
public void removeDataValidationRegion(CellRegion region)
public List<SDataValidation> deleteDataValidationRegion(CellRegion region)
SSheet
region
- the cover regionpublic List<SDataValidation> getDataValidations()
public int getNumOfDataValidation()
public SDataValidation getDataValidation(int idx)
public SDataValidation getDataValidation(int rowIdx, int columnIdx)
public SAutoFilter getAutoFilter()
SSheet
public SAutoFilter createAutoFilter(CellRegion region)
SSheet
region
- the auto filter regionpublic void deleteAutoFilter()
SSheet
public void clearAutoFilter()
SSheet
public CellRegion pasteCell(SheetRegion src, CellRegion dest, PasteOption option)
SSheet
src
- src sheet and it's region to pastedest
- destination region in this sheetoption
- the copy optionpublic SSheetProtection getSheetProtection()
SSheet
public void setHashedPassword(short hashpass)
SSheet
public SSheet.SheetVisible getSheetVisible()
SSheet
public void setSheetVisible(SSheet.SheetVisible state)
SSheet
public void addTable(STable table)
SSheet
public List<STable> getTables()
SSheet
public void removeTable(String name)
SSheet
public STable getTableByRowCol(int rowIdx, int colIdx)
getTableByRowCol
in class AbstractSheetAdv
public boolean isHidden(int rowIdx, int colIdx)
isHidden
in class AbstractSheetAdv
public boolean isRowHidden(int rowIdx)
isRowHidden
in class AbstractSheetAdv
public boolean isFiltered()
isFiltered
in class AbstractSheetAdv
public void removeTables(Set<String> tableNames)
removeTables
in class AbstractSheetAdv
public void removeTable(STable table)
removeTable
in class AbstractSheetAdv
public void clearTables()
clearTables
in class AbstractSheetAdv
public void setHashValue(String hashValue)
SSheet
public String getHashValue()
public void setSpinCount(String spinCount)
SSheet
public String getSpinCount()
public void setSaltValue(String saltValue)
SSheet
public String getSaltValue()
public void setAlgName(String algName)
SSheet
public String getAlgName()
public CellRegion checkMergedRegion(CellRegion region)
public void addDirectlyMergedRegion(CellRegion region)
public List<SConditionalFormatting> getConditionalFormattings()
SSheet
public void addConditionalFormatting(SConditionalFormatting scf)
addConditionalFormatting
in class AbstractSheetAdv
public void setMergeOutOfSync(int state)
setMergeOutOfSync
in class AbstractSheetAdv
public int getMergeOutOfSync()
getMergeOutOfSync
in class AbstractSheetAdv
public CellRegion getDataRegion()
SSheet
public ConditionalStyleImpl getConditionalFormattingStyle(int row, int col)
getConditionalFormattingStyle
in class AbstractSheetAdv
public void removeConditionalFormatting(SConditionalFormatting scf)
removeConditionalFormatting
in class AbstractSheetAdv
public SConditionalFormatting addConditionalFormatting(CellRegion srcrgn, CellRegion dstrgn, SConditionalFormatting src, int rowOff, int colOff)
AbstractSheetAdv
addConditionalFormatting
in class AbstractSheetAdv
public int nextConditionalId()
nextConditionalId
in class AbstractSheetAdv
public SConditionalFormatting getConditionalFormatting(int id)
getConditionalFormatting
in class AbstractSheetAdv
public SConditionalFormatting getConditionalFormatting(int row, int col)
getConditionalFormatting
in class AbstractSheetAdv
public void deleteConditionalFormatting(SConditionalFormatting cfmt)
AbstractSheetAdv
deleteConditionalFormatting
in class AbstractSheetAdv
public void removeConditionalFormattingRegion(CellRegion region)
AbstractSheetAdv
removeConditionalFormattingRegion
in class AbstractSheetAdv
public List<SConditionalFormatting> deleteConditionalFormattingRegion(CellRegion region)
AbstractSheetAdv
deleteConditionalFormattingRegion
in class AbstractSheetAdv
Copyright © 2020. All rights reserved.