public class NamedRange extends java.lang.Object implements INotifyPropertyValueChanged, IHasName
| Constructor and Description |
|---|
NamedRange(java.lang.String name,
java.lang.String cellRange)
Initializes a new instance of the
NamedRange class. |
NamedRange(java.lang.String name,
java.lang.String sheetName,
int topLeftColumn,
int topLeftRow,
int bottomRightColumn,
int bottomRightRow)
Initializes a new instance of the
NamedRange class. |
| Modifier and Type | Method and Description |
|---|---|
void |
addPropertyChangedListener(java.beans.PropertyChangeListener listener)
Registers listener so that it will receive events from the named range.
|
java.lang.String |
getCellRange()
Gets the cell or range of cells associated with this named range.
|
CellRef |
getCellRef() |
java.lang.String |
getName()
Gets the name of the named range.
|
java.lang.String |
getWorksheetName()
Gets the name of the worksheet represented by this named range.
|
static boolean |
isValidName(java.lang.String value)
Checks if the specified value is a valid
NamedRange name. |
protected void |
onPropertyValueChanged(java.beans.PropertyChangeEvent e)
Raises the
propertyChange event. |
void |
removePropertyChangedListener(java.beans.PropertyChangeListener listener)
Unregisters listener so that it will no longer receive named range events.
|
void |
setCellRange(java.lang.String value)
Sets the cell or range of cells associated with this named range.
|
void |
setName(java.lang.String value)
Sets the name of the named range.
|
public NamedRange(java.lang.String name,
java.lang.String cellRange)
NamedRange class.name - The initial name of the range.cellRange - The initial cell range.public NamedRange(java.lang.String name,
java.lang.String sheetName,
int topLeftColumn,
int topLeftRow,
int bottomRightColumn,
int bottomRightRow)
NamedRange class.name - The initial name of the range.sheetName - The name of the sheet of the initial cell range.topLeftColumn - The column of the top-left cell of the initial range.topLeftRow - The row of the top-left cell of the initial range.bottomRightColumn - The column of the bottom-right cell of the initial range.bottomRightRow - The row of the bottom-right cell of the initial range.public void addPropertyChangedListener(java.beans.PropertyChangeListener listener)
addPropertyChangedListener in interface INotifyPropertyValueChangedlistener - An object implementing the PropertyChangeListener interface.public void removePropertyChangedListener(java.beans.PropertyChangeListener listener)
removePropertyChangedListener in interface INotifyPropertyValueChangedlistener - An object implementing the PropertyChangeListener interface.protected void onPropertyValueChanged(java.beans.PropertyChangeEvent e)
propertyChange event.e - An object providing the event data.public static boolean isValidName(java.lang.String value)
NamedRange name.public java.lang.String getName()
public void setName(java.lang.String value)
The name of a named range must be unique (ignoring case) amongst all named ranges in a Workbook.
It must not be a valid cell or cell range reference (for example, A1). It needs to be a proper identifier,
that is, it must start with a letter and contain only letters, numbers and underscore characters.
Lastly, the name must not coincide with the built-in identifiers 'true' and 'false'. If any of these
requirements are violated, an exception will be thrown.
public java.lang.String getCellRange()
Specifying an invalid or incomplete cell range will throw an exception. A cell range without sheet name is considered incomplete.
public void setCellRange(java.lang.String value)
Specifying an invalid or incomplete cell range will throw an exception. A cell range without sheet name is considered incomplete.
public java.lang.String getWorksheetName()
public CellRef getCellRef()