public class RangeImpl extends Object implements Range, Serializable
isSheetProtected()
and getSheetProtection()
, you can handle
it easily.Range.ApplyBorderType, Range.AutoFillType, Range.AutoFilterOperation, Range.CellAttribute, Range.CellStyleHelper, Range.DeleteShift, Range.InsertCopyOrigin, Range.InsertShift, Range.PasteOperation, Range.PasteType, Range.SheetVisible, Range.SortDataOption, Range.SyncLevel
Constructor and Description |
---|
RangeImpl(SRange range,
Book book) |
RangeImpl(SRange range,
Sheet sheet) |
Modifier and Type | Method and Description |
---|---|
Chart |
addChart(SheetAnchor anchor,
Chart.Type type,
Chart.Grouping grouping,
Chart.LegendPosition pos)
Adds chart to sheet
|
Picture |
addPicture(SheetAnchor anchor,
byte[] image,
Picture.Format format)
Adds picture to sheet
|
void |
applyAutoFilter()
re-apply existing criteria of filters
|
void |
applyBorders(Range.ApplyBorderType type,
CellStyle.BorderType borderType,
String htmlColor)
apply borders
|
void |
applyBordersAround(CellStyle.BorderType borderType,
String htmlColor) |
String |
asString()
get formatted string of this range
|
void |
autoFill(Range dest,
Range.AutoFillType fillType)
According to current range, fills data to destination range automatically
|
void |
clearAll()
Clears contents, styles and unmerge this range.
|
void |
clearContents()
Clears contents
|
void |
clearStyles()
Clears styles
|
Sheet |
cloneSheet(String name)
Clone this sheet; create a sheet and copy the contents of this sheet; then add to the end of the book.
|
Sheet |
cloneSheetFrom(String name,
Sheet sheet)
Clone from the specified source sheet to the owner book of this range.
|
void |
createName(String nameName)
Create a
Name that refer to this range. |
Sheet |
createSheet(String name)
Creates a new sheet
|
void |
delete(Range.DeleteShift shift)
Delete cells of the range.
|
void |
deleteChart(Chart chart)
Deletes chart
|
void |
deletePicture(Picture picture)
Deletes picture that in sheet
|
void |
deleteSheet()
Deletes sheet.
|
void |
deleteValidation()
Delete the
Validation associated in the specified range. |
void |
enableAutoFilter(boolean enable)
enable/disable autofilter of the sheet
|
void |
enableAutoFilter(int field,
Range.AutoFilterOperation filterOp,
Object criteria1,
Object criteria2,
Boolean showButton)
enable filter with condition
|
boolean |
equals(Object obj) |
void |
fillDown()
Fills cells by copying from first/top row data
|
void |
fillLeft()
Fills cells by copying from last/right column data
|
void |
fillRight()
Fills cells by copying from first/left column data
|
void |
fillUp()
Fills cells by copying from bottom row data
|
Range |
findAutoFilterRange()
To find a range of cells for applying auto filter according to this range.
|
Book |
getBook()
Gets the book of this range
|
CellData |
getCellData()
Gets the first cell(top-left) data of this range
|
String |
getCellDataFormat()
Gets the first cell(top-left) format of this range
|
String |
getCellEditText()
Gets the first cell(top-left) edit text of this range
|
String |
getCellFormatText()
Gets the first cell(top-left) formatted text of this range
|
Hyperlink |
getCellHyperlink()
Gets the first cell(top-left)
Hyperlink object of this range. |
String |
getCellRichText()
Returns text in html format; null if not a rich text.
|
CellStyle |
getCellStyle()
get the first cell style of this range
|
Range.CellStyleHelper |
getCellStyleHelper()
Gets cell-style-helper, this helper helps you to create new style, font or color
|
Object |
getCellValue()
Gets the first cell(top-left) value of this this range
|
int |
getColumn()
Gets the left column of this range
|
int |
getColumnCount()
Gets the column count of this range
|
String |
getCommentRichText()
Return the comment rich edit text of the left top cell of this Range.
|
CellRegion |
getDataRegion()
Returns the region which contains data(including chart, picture, and
fills) in the sheet of this Range; return null if empty sheet.
|
SRange |
getInternalRange()
Get internal range implementation
|
int |
getLastColumn()
Gets the right/last column of this range
|
int |
getLastRow()
Gets the bottom/last row of this range
|
RangeImpl |
getLeftTop()
get the top-left cell range of this range
|
ReadWriteLock |
getLock() |
CellRegion |
getMergedRegion()
Returns the merged region of the left top cell of this Range if any;
otherwise, returns null if not a merged region.
|
SRange |
getNative() |
Font |
getOrCreateFont(Font.Boldweight boldweight,
Color color,
int fontHeight,
String fontName,
boolean italic,
boolean strikeout,
Font.TypeOffset typeOffset,
Font.Underline underline)
Get font if exists or create font if not exists from the book of this
range and return it.
|
int |
getRow()
Gets the top row of this range
|
int |
getRowCount()
Gets the row count of this range
|
Sheet |
getSheet()
Gets the sheet of this range
|
String |
getSheetName()
Gets the sheet name
|
int |
getSheetOrder()
Gets the sheet order
|
SheetProtection |
getSheetProtection()
Gets
SheetProtection which tells what are allowed operations for
a protected sheet of this range. |
List<Validation> |
getValidations()
Gets read only
Validation associated with the left-top cell
of this range; return null if no associated validation. |
int |
hashCode() |
boolean |
hasMergedCell() |
void |
insert(Range.InsertShift shift,
Range.InsertCopyOrigin copyOrigin)
Insert new cells to the area of this range.
To insert a row, you have to call Range.toRowRange() first, to insert a column, you have to call Range.toColumnRange() first. |
boolean |
isAnyCellProtected() |
boolean |
isAutoFilterEnabled()
check if auto filter is enable or not.
|
boolean |
isCommentVisible()
Returns whether the comment is always visible at the left top cell of
this range; if no comment at the cell, it returns false.
|
boolean |
isDisplaySheetGridlines() |
boolean |
isMergedCell() |
boolean |
isProtected() |
boolean |
isSheetProtected() |
boolean |
isWholeColumn()
Check if this range represents a whole column, which mean all rows are included,
|
boolean |
isWholeRow()
Check if this range represents a whole row, which mean all column are included,
|
boolean |
isWholeSheet()
Check if this range represents a whole sheet, which mean all column and row are included,
|
void |
merge(boolean across)
Merges the range
|
void |
moveChart(SheetAnchor anchor,
Chart chart)
Moves chart to new location
|
void |
movePicture(SheetAnchor anchor,
Picture picture)
Moves picture
|
void |
notifyChange()
Notify this range has been changed.
|
void |
notifyChange(Range.CellAttribute cellAttr)
Notify this range has been changed on the specifield attribute.
|
void |
notifyChange(String[] variables)
Notify the whole book of specified variables change.
|
Range |
paste(Range dest)
Pastes to destination
|
Range |
paste(Range dest,
boolean cut)
Cut and paste to destination
|
Range |
pasteSpecial(Range dest,
Range.PasteType type,
Range.PasteOperation op,
boolean skipBlanks,
boolean transpose)
Pastes to destination
|
void |
protectSheet(SheetProtection protection)
Protect a
Sheet so that it cannot be modified. |
void |
protectSheet(String password)
Deprecated.
|
void |
protectSheet(String password,
boolean allowSelectingLockedCells,
boolean allowSelectingUnlockedCells,
boolean allowFormattingCells,
boolean allowFormattingColumns,
boolean allowFormattingRows,
boolean allowInsertColumns,
boolean allowInsertRows,
boolean allowInsertingHyperlinks,
boolean allowDeletingColumns,
boolean allowDeletingRows,
boolean allowSorting,
boolean allowFiltering,
boolean allowUsingPivotTables,
boolean drawingObjects,
boolean scenarios)
Protect a
Sheet so that it cannot be modified. |
void |
refresh(boolean includeDependants)
Enforce evaluation(if not cached) and refresh UI of this range and its
dependent cells if the includeDependents is true.
|
void |
refresh(boolean includeDependants,
boolean clearCache,
boolean enforceEval)
Update data model and refresh UI of this range and its dependent cells
if the argument includeDependents is true.
|
void |
resetAutoFilter()
clear criteria of all filters, show all the data
|
boolean |
setAutoRefresh(boolean auto)
Turn on(true)/off(false) of auto refresh of this range and return
previous on/off status; default is true.
|
void |
setCellEditText(String editText)
Sets cell editText, applies it to all cells of this range
|
void |
setCellHyperlink(Hyperlink.HyperlinkType type,
String address,
String display)
Sets cell hyperlink, applies it too all cells
|
void |
setCellRichText(String html)
Set into the left top cell of this Range the specified text in html format.
|
void |
setCellStyle(CellStyle nstyle)
Sets cell style, applies it to all cells of this range
|
void |
setCellValue(Object value)
Sets cell data value, applies it to all cells
|
void |
setColumnWidth(int widthPx)
Sets the width(in pixel) of column in this range, it effect to whole column.
|
void |
setCommentRichText(String html)
Set comment rich text into the left top cell of this range; null to
delete it.
|
void |
setCommentVisible(boolean visible)
Set comment visibility into the left top cell of this range; if no
comment at the cell, it simply ignored.
|
void |
setDisplaySheetGridlines(boolean enable)
Displays sheet grid-lines or not
|
void |
setFreezePanel(int rowfreeze,
int columnfreeze)
Set the freeze panel
|
void |
setHidden(boolean hidden)
Hide or unhide rows or columns.
To hide/unhide a row, you have to call Range.toRowRange() first, to hide/un-hide a column, you have to call Range.toColumnRange()
or a whole column range. |
void |
setNameName(String namename,
String newname)
Set(Rename) the name of the Name(or Table) as specified in this
Range(a Book or a Sheet).
|
void |
setRowHeight(int heightPx)
Sets the height(in pixel) of row in this range, it effect to whole row.
|
void |
setRowHeight(int heightPx,
boolean isCustom)
Sets the height(in pixel) of row in this range and specify it's custom size or not.
|
void |
setSheetName(String name)
Sets the sheet name
|
void |
setSheetOrder(int pos)
Sets the sheet order
|
void |
setSheetVisible(Range.SheetVisible visible)
Setup sheet's visibility; can be VISIBLE, HIDDEN, or VERY_HIDDEN.
|
void |
setStringValue(String text)
Save the specified value into this range as a String no matter the value
is prefixed with '=' or not.
|
void |
setSyncLevel(Range.SyncLevel syncLevel)
Deprecated.
since 3.5 it is always synchronized on book by a read write lock.
|
void |
setValidation(Validation.ValidationType validationType,
boolean ignoreBlank,
Validation.OperatorType operatorType,
boolean inCellDropDown,
String formula1,
String formula2,
boolean showInput,
String inputTitle,
String inputMessage,
boolean showError,
Validation.AlertStyle alertStyle,
String errorTitle,
String errorMessage)
Add if not exist or modify an existing
Validation to this range. |
void |
shift(int rowOffset,
int colOffset)
shift this range with a offset row and column
|
void |
sort(boolean desc)
Sort range
|
void |
sort(boolean desc,
boolean hasHeader,
boolean matchCase,
boolean sortByRows,
Range.SortDataOption dataOption)
Sort range
|
void |
sort(Range key1,
boolean desc1,
Range.SortDataOption dataOption1,
Range key2,
boolean desc2,
Range.SortDataOption dataOption2,
Range key3,
boolean desc3,
Range.SortDataOption dataOption3,
boolean header,
boolean matchCase,
boolean sortByRows)
Sort range
|
void |
sync(RangeRunner run)
Runs runer under synchronization protection
|
RangeImpl |
toCellRange(int rowOffset,
int colOffset)
Returns a new range having on cell according to the offset
|
RangeImpl |
toColumnRange()
Return a range that represents all rows and between the first-column and last-column of this range
|
RangeImpl |
toRowRange()
Return a range that represents all columns and between the first-row and last-row of this range
|
RangeImpl |
toShiftedRange(int rowOffset,
int colOffset)
Return a new range that shift it row and column according to the offset, but has same height and width of original range.
|
String |
toString() |
void |
unmerge()
Unmerge the range
|
boolean |
unprotectSheet(String password)
Removes protection from a sheet.
|
void |
updateChart(Chart chart)
Notify the component that a chart has change, e.g.
|
Validation |
validate(String editText)
validate the user's input.
|
void |
visit(CellVisitor visitor)
visit all cells in this range, make sure you call this in a limited range,
don't use it for all row/column selection, it will spend much time to iterate the cell
|
public void setSyncLevel(Range.SyncLevel syncLevel)
Range
setSyncLevel
in interface Range
public ReadWriteLock getLock()
public Range.CellStyleHelper getCellStyleHelper()
Range
getCellStyleHelper
in interface Range
public CellData getCellData()
Range
getCellData
in interface Range
public SRange getNative()
public boolean isProtected()
isProtected
in interface Range
public boolean isSheetProtected()
isSheetProtected
in interface Range
public boolean isAnyCellProtected()
public Range paste(Range dest, boolean cut)
Range
public Range pasteSpecial(Range dest, Range.PasteType type, Range.PasteOperation op, boolean skipBlanks, boolean transpose)
Range
pasteSpecial
in interface Range
dest
- the destinationtype
- the paste typeop
- the paste operationskipBlanks
- skip blanks or nottranspose
- transpose the cell or notpublic void clearContents()
Range
clearContents
in interface Range
public void clearAll()
Range
public Sheet getSheet()
Range
public void clearStyles()
Range
clearStyles
in interface Range
public void setCellStyle(CellStyle nstyle)
Range
setCellStyle
in interface Range
nstyle
- new cell styleRange.getCellStyleHelper()
,
Range.getCellStyle()
public int getColumn()
Range
public int getRow()
Range
public int getLastColumn()
Range
getLastColumn
in interface Range
public int getLastRow()
Range
getLastRow
in interface Range
public void sync(RangeRunner run)
Range
sync
in interface Range
run
- the runnerRange.setSyncLevel(SyncLevel)
public void visit(CellVisitor visitor)
visit
in interface Range
visitor
- the visitorRange.setSyncLevel(SyncLevel)
public void applyBordersAround(CellStyle.BorderType borderType, String htmlColor)
public void applyBorders(Range.ApplyBorderType type, CellStyle.BorderType borderType, String htmlColor)
Range
applyBorders
in interface Range
type
- the apply typeborderType
- the border typehtmlColor
- the color (#rgb-hex-code, e.x #FF00FF)public boolean hasMergedCell()
hasMergedCell
in interface Range
public boolean isMergedCell()
isMergedCell
in interface Range
public CellRegion getMergedRegion()
Range
getMergedRegion
in interface Range
public CellRegion getDataRegion()
Range
getDataRegion
in interface Range
public void merge(boolean across)
Range
public void unmerge()
Range
public RangeImpl toShiftedRange(int rowOffset, int colOffset)
Range
toShiftedRange
in interface Range
rowOffset
- row offset of the new range, zero basecolOffset
- column offset of the new range, zero basepublic RangeImpl toCellRange(int rowOffset, int colOffset)
Range
toCellRange
in interface Range
rowOffset
- row offset of the cell, zero basecolOffset
- column offset of the cell, zero basepublic RangeImpl getLeftTop()
public RangeImpl toRowRange()
toRowRange
in interface Range
public RangeImpl toColumnRange()
toColumnRange
in interface Range
public boolean isWholeColumn()
isWholeColumn
in interface Range
public boolean isWholeRow()
isWholeRow
in interface Range
public boolean isWholeSheet()
isWholeSheet
in interface Range
public void insert(Range.InsertShift shift, Range.InsertCopyOrigin copyOrigin)
Range
Range.toRowRange()
first, to insert a column, you have to call Range.toColumnRange()
first.public void delete(Range.DeleteShift shift)
Range
Range.toRowRange()
first, to delete a column, you have to call Range.toColumnRange()
first.public void sort(boolean desc)
Range
public void sort(boolean desc, boolean hasHeader, boolean matchCase, boolean sortByRows, Range.SortDataOption dataOption)
Range
public void sort(Range key1, boolean desc1, Range.SortDataOption dataOption1, Range key2, boolean desc2, Range.SortDataOption dataOption2, Range key3, boolean desc3, Range.SortDataOption dataOption3, boolean header, boolean matchCase, boolean sortByRows)
Range
sort
in interface Range
key1
- the sort index 1desc1
- true for descent, false for ascent of index 1dataOption1
- data option 1 for sortkey2
- the sort index 2desc2
- true for descent, false for ascent of index 2dataOption2
- data option 2 for sortkey3
- the sort index 3desc3
- true for descent, false for ascent of index 3dataOption3
- data option31 for sortheader
- includes header or notmatchCase
- matches character chase of notsortByRows
- sorts by row or notpublic boolean isAutoFilterEnabled()
isAutoFilterEnabled
in interface Range
public Range findAutoFilterRange()
Range
findAutoFilterRange
in interface Range
public void enableAutoFilter(boolean enable)
enableAutoFilter
in interface Range
enable
- true to enablepublic void enableAutoFilter(int field, Range.AutoFilterOperation filterOp, Object criteria1, Object criteria2, Boolean showButton)
enableAutoFilter
in interface Range
field
- the filed index (according to current range, 1 base)filterOp
- auto filter operationcriteria1
- criteria for autofiltercriteria2
- criteria for autofiltershowButton
- true/false for show/hide dropdown button, null will keep the original setting.public void resetAutoFilter()
resetAutoFilter
in interface Range
public void applyAutoFilter()
applyAutoFilter
in interface Range
@Deprecated public void protectSheet(String password)
protectSheet
in interface Range
public void autoFill(Range dest, Range.AutoFillType fillType)
Range
public void fillDown()
Range
public void fillLeft()
Range
public void fillUp()
Range
public void fillRight()
Range
public void shift(int rowOffset, int colOffset)
public String getCellEditText()
Range
getCellEditText
in interface Range
CellData.getEditText()
public void setCellEditText(String editText)
Range
setCellEditText
in interface Range
editText
- the eidtText, it could be a string, integer string, date string or a formula (start with '=')public String getCellFormatText()
Range
getCellFormatText
in interface Range
CellData.getFormatText()
public String getCellDataFormat()
Range
getCellDataFormat
in interface Range
public Object getCellValue()
Range
getCellValue
in interface Range
CellData.getValue()
public void setDisplaySheetGridlines(boolean enable)
Range
setDisplaySheetGridlines
in interface Range
enable
- true to displaypublic boolean isDisplaySheetGridlines()
isDisplaySheetGridlines
in interface Range
public void setHidden(boolean hidden)
Range
Range.toRowRange()
first, to hide/un-hide a column, you have to call Range.toColumnRange()
or a whole column range.public void setCellHyperlink(Hyperlink.HyperlinkType type, String address, String display)
Range
setCellHyperlink
in interface Range
type
- the hyperlink typeaddress
- the address, e.x http://www.zkoss.orgdisplay
- the label to displaypublic Hyperlink getCellHyperlink()
Range
Hyperlink
object of this range.getCellHyperlink
in interface Range
public void setSheetName(String name)
Range
setSheetName
in interface Range
name
- new sheet name, it must be not same as another sheet name in it's owner book.public String getSheetName()
Range
getSheetName
in interface Range
public void setSheetOrder(int pos)
Range
setSheetOrder
in interface Range
pos
- the positionpublic int getSheetOrder()
Range
getSheetOrder
in interface Range
public void setCellValue(Object value)
Range
setCellValue
in interface Range
value
- the cell value, could be null, String, Number, Date or Booleanpublic CellStyle getCellStyle()
getCellStyle
in interface Range
public Picture addPicture(SheetAnchor anchor, byte[] image, Picture.Format format)
Range
addPicture
in interface Range
anchor
- the anchor for pictureimage
- the image binary arrayformat
- the image formatpublic void deletePicture(Picture picture)
Range
deletePicture
in interface Range
public void movePicture(SheetAnchor anchor, Picture picture)
Range
movePicture
in interface Range
anchor
- the anchor to re-allocatepicture
- the picture to re-allocatepublic Chart addChart(SheetAnchor anchor, Chart.Type type, Chart.Grouping grouping, Chart.LegendPosition pos)
Range
public void deleteChart(Chart chart)
Range
deleteChart
in interface Range
chart
- the chart to deletepublic void moveChart(SheetAnchor anchor, Chart chart)
Range
public void updateChart(Chart chart)
Range
updateChart
in interface Range
chart
- the chart that contains changepublic Sheet createSheet(String name)
Range
createSheet
in interface Range
name
- the sheet name, it must not be same as another sheet name in book of this rangepublic Sheet cloneSheet(String name)
Range
cloneSheet
in interface Range
name
- the sheet name, it must not be the same as another sheet name in book of this rangepublic void deleteSheet()
Range
deleteSheet
in interface Range
public void setColumnWidth(int widthPx)
Range
setColumnWidth
in interface Range
widthPx
- width in pixelRange.toColumnRange()
public void setRowHeight(int heightPx)
Range
setRowHeight
in interface Range
heightPx
- height in pixelRange.toRowRange()
public void setRowHeight(int heightPx, boolean isCustom)
Range
setRowHeight
in interface Range
heightPx
- height in pixelisCustom
- true if it's set by users manually, false if it's determined by the system automaticallypublic void notifyChange()
notifyChange
in interface Range
public void notifyChange(String[] variables)
Range
notifyChange
in interface Range
variables
- changed variablespublic void setFreezePanel(int rowfreeze, int columnfreeze)
Range
setFreezePanel
in interface Range
rowfreeze
- the number of row to freeze, 0 means no freezecolumnfreeze
- the number of column to freeze, 0 means no freezepublic int getRowCount()
Range
getRowCount
in interface Range
public int getColumnCount()
Range
getColumnCount
in interface Range
public String asString()
Range
public SRange getInternalRange()
Range
getInternalRange
in interface Range
public void createName(String nameName)
Range
Name
that refer to this range.createName
in interface Range
nameName
- name of the Name
that you can refer in formulas.public void protectSheet(String password, boolean allowSelectingLockedCells, boolean allowSelectingUnlockedCells, boolean allowFormattingCells, boolean allowFormattingColumns, boolean allowFormattingRows, boolean allowInsertColumns, boolean allowInsertRows, boolean allowInsertingHyperlinks, boolean allowDeletingColumns, boolean allowDeletingRows, boolean allowSorting, boolean allowFiltering, boolean allowUsingPivotTables, boolean drawingObjects, boolean scenarios)
Range
Sheet
so that it cannot be modified. You can call
this method on a protected sheet to change its allowed options if the
same password is supplied; otherwise, it is ignored. A protected sheet
can be unprotected by calling Range.unprotectSheet(String password)
.
change the protection options; make sure provideprotectSheet
in interface Range
password
- a case-sensitive password for the sheet; null or empty string means protect the sheet without password.allowSelectingLockedCells
- true to allow select locked cells; default to true.allowSelectingUnlockedCells
- true to allow select unlocked cells; default to true.allowFormattingCells
- true to allow user to format any cell on the protected sheet; default false.allowFormattingColumns
- true to allow user to format any columns on the protected sheet; default false.allowFormattingRows
- true to allow user to format any rows on the protected sheet; default false.allowInsertColumns
- true to allow user to insert columns on the protected sheet; default false.allowInsertRows
- true to allow user to insert rows on the protected sheet; default false.allowInsertingHyperlinks
- true to allow user to insert hyperlinks on the protected sheet; default false.allowDeletingColumns
- true to allow user to delete columns on the protected sheet; default false.allowDeletingRows
- true to allow user to delete rows on the protected sheet; default false.allowSorting
- true to allow user to sort on the protected sheet; default false.allowFiltering
- true to allow user to set filters on the protected sheet; default false.allowUsingPivotTables
- true to allow user to use pivot table reports on the protected sheet; default false.drawingObjects
- true to protect objects; default to false.scenarios
- true to protect scenarios; default to true.Range.unprotectSheet(String password)
,
Range.isProtected()
public void protectSheet(SheetProtection protection)
Range
Sheet
so that it cannot be modified.protectSheet
in interface Range
SheetProtection
public boolean unprotectSheet(String password)
Range
unprotectSheet
in interface Range
password
- a case-sensitive password used to unprotect the sheet. If
the sheet isn't protected with a password, this argument is ignored. If you
omit this argument for a sheet that is protected with a password, you'll
be prompted for the password.public SheetProtection getSheetProtection()
Range
SheetProtection
which tells what are allowed operations for
a protected sheet of this range.getSheetProtection
in interface Range
public Validation validate(String editText)
Range
public void setValidation(Validation.ValidationType validationType, boolean ignoreBlank, Validation.OperatorType operatorType, boolean inCellDropDown, String formula1, String formula2, boolean showInput, String inputTitle, String inputMessage, boolean showError, Validation.AlertStyle alertStyle, String errorTitle, String errorMessage)
Range
Validation
to this range.
There are two ways to input list items for data validation in argument
"formula1" and "formula2". One is to specify a range via a formula such
as "=A1:A4" where the values in the cells of the range is the constrained
value list; another is to input literally the constrained value list
delimited by comma such as "1, 2, 3, 4". Note that when you input a
formula, must lead the formula with an equal sign('=').setValidation
in interface Range
validationType
- the type of this validationignoreBlank
- true if blank values are permitted.operatorType
- the operator for this validationinCellDropDown
- true if want to display dropdown list for acceptable values.formula1
- the value or expression associated with conditional format or data validation.formula2
- the 2nd part of a conditional format or data validation. Useful only when operatorType is BETWEEN or NOT_BETWEEN.showInput
- true to show the input message.inputTitle
- title for the data-validation input dialog box.inputMessage
- message for the data-validation input dialog box.showError
- true to show the error message.alertStyle
- validation alert style.errorTitle
- title of the data validation error dialog.errorMessage
- data validation error message.public List<Validation> getValidations()
Range
Validation
associated with the left-top cell
of this range; return null if no associated validation.public void deleteValidation()
Range
Validation
associated in the specified range.deleteValidation
in interface Range
public void setCellRichText(String html)
Range
setCellRichText
in interface Range
public String getCellRichText()
Range
getCellRichText
in interface Range
public Font getOrCreateFont(Font.Boldweight boldweight, Color color, int fontHeight, String fontName, boolean italic, boolean strikeout, Font.TypeOffset typeOffset, Font.Underline underline)
Range
getOrCreateFont
in interface Range
public void refresh(boolean includeDependants)
Range
Range.refresh(boolean includeDependents, boolean false, boolean true)
.public boolean setAutoRefresh(boolean auto)
Range
setAutoRefresh
in interface Range
auto
- whether refresh automaticallypublic void refresh(boolean includeDependants, boolean clearCache, boolean enforceEval)
Range
public void setSheetVisible(Range.SheetVisible visible)
Range
setSheetVisible
in interface Range
Range.SheetVisible
public String getCommentRichText()
Range
getCommentRichText
in interface Range
public void setCommentRichText(String html)
Range
setCommentRichText
in interface Range
public void setCommentVisible(boolean visible)
Range
setCommentVisible
in interface Range
public boolean isCommentVisible()
Range
isCommentVisible
in interface Range
public void notifyChange(Range.CellAttribute cellAttr)
Range
notifyChange
in interface Range
public void setNameName(String namename, String newname)
Range
setNameName
in interface Range
namename
- name of the Name(or Table)newname
- new name for the Name(or Table)public void setStringValue(String text)
Range
setStringValue
in interface Range
public Sheet cloneSheetFrom(String name, Sheet sheet)
Range
cloneSheetFrom
in interface Range
name
- the name of the new created sheet; null would try to use
the sheet name of the specified source sheet; if the same sheet name
already used in the owner book of this range then use default "SheetX"
name where X is the next sheet number of the owner book of this range.sheet
- the source sheet to clone from to the owner book of this
range.Copyright © 2020. All rights reserved.