Package org.openl.rules.table.xls
Class XlsSheetGridModel
- java.lang.Object
-
- org.openl.rules.table.AGrid
-
- org.openl.rules.table.xls.XlsSheetGridModel
-
- All Implemented Interfaces:
IGrid,IWritableGrid
public class XlsSheetGridModel extends AGrid implements IWritableGrid
- Author:
- snshor
-
-
Field Summary
-
Fields inherited from class org.openl.rules.table.AGrid
RANGE_SEPARATOR
-
Fields inherited from interface org.openl.rules.table.IGrid
CELL_TYPE_BLANK, CELL_TYPE_BOOLEAN, CELL_TYPE_ERROR, CELL_TYPE_FORMULA, CELL_TYPE_NUMERIC, CELL_TYPE_STRING
-
-
Constructor Summary
Constructors Constructor Description XlsSheetGridModel(XlsSheetSourceCodeModule sheetSource)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intaddMergedRegion(IGridRegion reg)voidclearCell(int col, int row)voidclearCellValue(int col, int row)voidcopyCell(int colFrom, int rowFrom, int colTo, int rowTo)voidcreateCell(int col, int row, Object value, String formula, ICellStyle style, String comment, String prevCommentAuthor)IGridRegionfindEmptyRect(int width, int height)Finds a rectangular area of given width and height on the grid that can be used for writing.ICellgetCell(int column, int row)AXlsCellWritergetCellWriter(Object value)intgetColumnWidth(int col)intgetMaxColumnIndex(int rownum)intgetMaxRowIndex()IGridRegiongetMergedRegion(int i)intgetMinColumnIndex(int rownum)intgetMinRowIndex()StringgetName()intgetNumberOfMergedRegions()StringgetRangeUri(IGridRegion region)Gets the URI to the table by table region.IGridRegiongetRegionContaining(int x, int y)XlsSheetSourceCodeModulegetSheetSource()SpreadsheetConstantsgetSpreadsheetConstants()StringgetUri()booleanisEmpty(int x, int y)voidremoveMergedRegion(int x, int y)voidremoveMergedRegion(IGridRegion remove)voidsetCellAlignment(int col, int row, org.apache.poi.ss.usermodel.HorizontalAlignment alignment)voidsetCellBorderStyle(int col, int row, ICellStyle style)voidsetCellComment(int col, int row, String comment, String prevCommentAuthor)voidsetCellFillColor(int col, int row, short[] color)voidsetCellFontBold(int col, int row, boolean bold)voidsetCellFontColor(int col, int row, short[] color)voidsetCellFontItalic(int col, int row, boolean italic)voidsetCellFontUnderline(int col, int row, boolean underlined)voidsetCellFormula(int col, int row, String formula)voidsetCellIndent(int col, int row, int indent)voidsetCellStringValue(int col, int row, String value)voidsetCellStyle(int col, int row, ICellStyle style)voidsetCellValue(int col, int row, Object value)-
Methods inherited from class org.openl.rules.table.AGrid
getRangeUri, getRegionStartingAt, getTables, isInOneMergedRegion, isPartOfTheMergedRegion, isTopLeftCellInMergedRegion
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.openl.rules.table.IGrid
getRangeUri, getRegionStartingAt, getTables, isInOneMergedRegion, isPartOfTheMergedRegion, isTopLeftCellInMergedRegion
-
-
-
-
Constructor Detail
-
XlsSheetGridModel
public XlsSheetGridModel(XlsSheetSourceCodeModule sheetSource)
-
-
Method Detail
-
addMergedRegion
public int addMergedRegion(IGridRegion reg)
- Specified by:
addMergedRegionin interfaceIWritableGrid
-
clearCellValue
public void clearCellValue(int col, int row)
-
clearCell
public void clearCell(int col, int row)- Specified by:
clearCellin interfaceIWritableGrid
-
copyCell
public void copyCell(int colFrom, int rowFrom, int colTo, int rowTo)- Specified by:
copyCellin interfaceIWritableGrid
-
createCell
public void createCell(int col, int row, Object value, String formula, ICellStyle style, String comment, String prevCommentAuthor)- Specified by:
createCellin interfaceIWritableGrid
-
findEmptyRect
public IGridRegion findEmptyRect(int width, int height)
Description copied from interface:IWritableGridFinds a rectangular area of given width and height on the grid that can be used for writing. The returned region should not intersect with or touch existing not empty cells.- Specified by:
findEmptyRectin interfaceIWritableGrid- Parameters:
width- rectangle widthheight- rectangle height- Returns:
- region representing required rectangle or
nullif not found
-
getColumnWidth
public int getColumnWidth(int col)
- Specified by:
getColumnWidthin interfaceIGrid
-
getMaxColumnIndex
public int getMaxColumnIndex(int rownum)
- Specified by:
getMaxColumnIndexin interfaceIGrid
-
getMaxRowIndex
public int getMaxRowIndex()
- Specified by:
getMaxRowIndexin interfaceIGrid
-
getMergedRegion
public IGridRegion getMergedRegion(int i)
- Specified by:
getMergedRegionin interfaceIGrid
-
getMinColumnIndex
public int getMinColumnIndex(int rownum)
- Specified by:
getMinColumnIndexin interfaceIGrid
-
getMinRowIndex
public int getMinRowIndex()
- Specified by:
getMinRowIndexin interfaceIGrid
-
getName
public String getName()
-
getNumberOfMergedRegions
public int getNumberOfMergedRegions()
- Specified by:
getNumberOfMergedRegionsin interfaceIGrid
-
getRangeUri
public String getRangeUri(IGridRegion region)
Gets the URI to the table by table region. Just callsAGrid.getRangeUri(int, int, int, int).- Parameters:
region- Table region.- Returns:
- URI to the table in the sheet. (e.g.
file:D:\work\Workspace\org.openl.tablets.tutorial4\rules \main&wbName=Tutorial_4.xls&wsName=Vehicle-Scoring&range=B3:D12)
-
getRegionContaining
public IGridRegion getRegionContaining(int x, int y)
- Specified by:
getRegionContainingin interfaceIGrid- Overrides:
getRegionContainingin classAGrid- Returns:
- Merged region containing cell specified by coordinates or
null
-
getSheetSource
public XlsSheetSourceCodeModule getSheetSource()
-
removeMergedRegion
public void removeMergedRegion(IGridRegion remove)
- Specified by:
removeMergedRegionin interfaceIWritableGrid
-
removeMergedRegion
public void removeMergedRegion(int x, int y)- Specified by:
removeMergedRegionin interfaceIWritableGrid
-
setCellValue
public void setCellValue(int col, int row, Object value)- Specified by:
setCellValuein interfaceIWritableGrid
-
setCellStringValue
public void setCellStringValue(int col, int row, String value)- Specified by:
setCellStringValuein interfaceIWritableGrid
-
setCellFormula
public void setCellFormula(int col, int row, String formula)- Specified by:
setCellFormulain interfaceIWritableGrid
-
setCellStyle
public void setCellStyle(int col, int row, ICellStyle style)- Specified by:
setCellStylein interfaceIWritableGrid
-
setCellBorderStyle
public void setCellBorderStyle(int col, int row, ICellStyle style)- Specified by:
setCellBorderStylein interfaceIWritableGrid
-
setCellAlignment
public void setCellAlignment(int col, int row, org.apache.poi.ss.usermodel.HorizontalAlignment alignment)- Specified by:
setCellAlignmentin interfaceIWritableGrid
-
setCellIndent
public void setCellIndent(int col, int row, int indent)- Specified by:
setCellIndentin interfaceIWritableGrid
-
setCellFillColor
public void setCellFillColor(int col, int row, short[] color)- Specified by:
setCellFillColorin interfaceIWritableGrid
-
setCellFontColor
public void setCellFontColor(int col, int row, short[] color)- Specified by:
setCellFontColorin interfaceIWritableGrid
-
setCellFontBold
public void setCellFontBold(int col, int row, boolean bold)- Specified by:
setCellFontBoldin interfaceIWritableGrid
-
setCellFontItalic
public void setCellFontItalic(int col, int row, boolean italic)- Specified by:
setCellFontItalicin interfaceIWritableGrid
-
setCellFontUnderline
public void setCellFontUnderline(int col, int row, boolean underlined)- Specified by:
setCellFontUnderlinein interfaceIWritableGrid
-
setCellComment
public void setCellComment(int col, int row, String comment, String prevCommentAuthor)- Specified by:
setCellCommentin interfaceIWritableGrid
-
getCellWriter
public AXlsCellWriter getCellWriter(Object value)
-
getSpreadsheetConstants
public SpreadsheetConstants getSpreadsheetConstants()
-
-