Methods Summary |
---|
public java.lang.String | getNameName()gets the name of the named range
String result = name.getNameText();
return result;
|
public java.lang.String | getReference()gets the reference of the named range
String result;
result = name.getAreaReference(book);
return result;
|
public java.lang.String | getSheetName()Get the sheets name which this named range is referenced to
String result ;
short indexToExternSheet = name.getExternSheetNumber();
result = book.findSheetNameFromExternSheet(indexToExternSheet);
return result;
|
public void | setNameName(java.lang.String nameName)sets the name of the named range
name.setNameText(nameName);
name.setNameTextLength((byte)nameName.length());
//Check to ensure no other names have the same case-insensitive name
for ( int i = book.getNumNames()-1; i >=0; i-- )
{
NameRecord rec = book.getNameRecord(i);
if (rec != name) {
if (rec.getNameText().equalsIgnoreCase(getNameName()))
throw new IllegalArgumentException("The workbook already contains this name (case-insensitive)");
}
}
|
public void | setReference(java.lang.String ref)sets the reference of this named range
RangeAddress ra = new RangeAddress(ref);
String sheetName = ra.getSheetName();
if (ra.hasSheetName()) {
setSheetName(sheetName);
}
//allow the poi utilities to parse it out
name.setAreaReference(ref);
|
private void | setSheetName(java.lang.String sheetName)sets the sheet name which this named range referenced to
int sheetNumber = book.getSheetIndex(sheetName);
short externSheetNumber = book.checkExternSheet(sheetNumber);
name.setExternSheetNumber(externSheetNumber);
// name.setIndexToSheet(externSheetNumber);
|