org.apache.poi.hssf.record
Class NameRecord

java.lang.Object
  extended by org.apache.poi.hssf.record.RecordBase
      extended by org.apache.poi.hssf.record.Record
          extended by org.apache.poi.hssf.record.StandardRecord
              extended by org.apache.poi.hssf.record.NameRecord

public final class NameRecord
extends StandardRecord

Title: DEFINEDNAME Record (0x0018)

Description: Defines a named range within a workbook.

REFERENCE:

Author:
Libin Roman (Vista Portal LDT. Developer), Sergei Kozello (sergeikozello at mail.ru), Glen Stampoultzis (glens at apache.org), Petr Udalau - added method setFunction(boolean)

Field Summary
static byte BUILTIN_AUTO_ACTIVATE
          Included for completeness sake, not implemented
static byte BUILTIN_AUTO_CLOSE
          Included for completeness sake, not implemented
static byte BUILTIN_AUTO_DEACTIVATE
          Included for completeness sake, not implemented
static byte BUILTIN_AUTO_OPEN
          Included for completeness sake, not implemented
static byte BUILTIN_CONSOLIDATE_AREA
          Included for completeness sake, not implemented
static byte BUILTIN_CRITERIA
          Included for completeness sake, not implemented
static byte BUILTIN_DATA_FORM
          Included for completeness sake, not implemented
static byte BUILTIN_DATABASE
          Included for completeness sake, not implemented
static byte BUILTIN_FILTER_DB
           
static byte BUILTIN_PRINT_AREA
           
static byte BUILTIN_PRINT_TITLE
           
static byte BUILTIN_RECORDER
          Included for completeness sake, not implemented
static byte BUILTIN_SHEET_TITLE
          Included for completeness sake, not implemented
static short sid
           
 
Constructor Summary
NameRecord()
          Creates new NameRecord
NameRecord(byte builtin, int sheetNumber)
          Constructor to create a built-in named region
NameRecord(RecordInputStream ris)
          called by the constructor, should set class level fields.
 
Method Summary
 byte getBuiltInName()
          Gets the Built In Name
 java.lang.String getCustomMenuText()
          get the custom menu text
protected  int getDataSize()
           
 java.lang.String getDescriptionText()
          gets the description text
 int getExternSheetNumber()
          gets the extern sheet number
 byte getFnGroup()
           
 java.lang.String getHelpTopicText()
          get the help topic text
 byte getKeyboardShortcut()
          returns the keyboard shortcut
 Ptg[] getNameDefinition()
          gets the definition, reference (Formula)
 java.lang.String getNameText()
          gets the name
 short getOptionFlag()
          gets the option flag
 int getSheetNumber()
          For named ranges, and built-in names
 short getSid()
          return the non static version of the id for this record.
 java.lang.String getStatusBarText()
          gets the status bar text
 boolean hasFormula()
           
 boolean isBuiltInName()
          Convenience Function to determine if the name is a built-in name
 boolean isCommandName()
           
 boolean isComplexFunction()
           
 boolean isFunctionName()
           
 boolean isHiddenName()
           
 boolean isMacro()
           
 void serialize(LittleEndianOutput out)
          Write the data content of this BIFF record.
 void setCustomMenuText(java.lang.String text)
          sets the custom menu text
 void setDescriptionText(java.lang.String text)
          sets the description text
 void setFunction(boolean function)
          Indicates that the defined name refers to a user-defined function.
 void setHelpTopicText(java.lang.String text)
          sets the help topic text
 void setHidden(boolean b)
           
 void setKeyboardShortcut(byte shortcut)
          sets the keyboard shortcut
 void setNameDefinition(Ptg[] ptgs)
           
 void setNameText(java.lang.String name)
          sets the name of the named range
 void setOptionFlag(short flag)
          sets the option flag for the named range
 void setSheetNumber(int value)
           
 void setStatusBarText(java.lang.String text)
          sets the status bar text
 java.lang.String toString()
          get a string representation of the record (for biffview/debugging)
 
Methods inherited from class org.apache.poi.hssf.record.StandardRecord
getRecordSize, serialize
 
Methods inherited from class org.apache.poi.hssf.record.Record
clone, cloneViaReserialise, serialize
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

sid

public static final short sid
See Also:
Constant Field Values

BUILTIN_CONSOLIDATE_AREA

public static final byte BUILTIN_CONSOLIDATE_AREA
Included for completeness sake, not implemented

See Also:
Constant Field Values

BUILTIN_AUTO_OPEN

public static final byte BUILTIN_AUTO_OPEN
Included for completeness sake, not implemented

See Also:
Constant Field Values

BUILTIN_AUTO_CLOSE

public static final byte BUILTIN_AUTO_CLOSE
Included for completeness sake, not implemented

See Also:
Constant Field Values

BUILTIN_DATABASE

public static final byte BUILTIN_DATABASE
Included for completeness sake, not implemented

See Also:
Constant Field Values

BUILTIN_CRITERIA

public static final byte BUILTIN_CRITERIA
Included for completeness sake, not implemented

See Also:
Constant Field Values

BUILTIN_PRINT_AREA

public static final byte BUILTIN_PRINT_AREA
See Also:
Constant Field Values

BUILTIN_PRINT_TITLE

public static final byte BUILTIN_PRINT_TITLE
See Also:
Constant Field Values

BUILTIN_RECORDER

public static final byte BUILTIN_RECORDER
Included for completeness sake, not implemented

See Also:
Constant Field Values

BUILTIN_DATA_FORM

public static final byte BUILTIN_DATA_FORM
Included for completeness sake, not implemented

See Also:
Constant Field Values

BUILTIN_AUTO_ACTIVATE

public static final byte BUILTIN_AUTO_ACTIVATE
Included for completeness sake, not implemented

See Also:
Constant Field Values

BUILTIN_AUTO_DEACTIVATE

public static final byte BUILTIN_AUTO_DEACTIVATE
Included for completeness sake, not implemented

See Also:
Constant Field Values

BUILTIN_SHEET_TITLE

public static final byte BUILTIN_SHEET_TITLE
Included for completeness sake, not implemented

See Also:
Constant Field Values

BUILTIN_FILTER_DB

public static final byte BUILTIN_FILTER_DB
See Also:
Constant Field Values
Constructor Detail

NameRecord

public NameRecord()
Creates new NameRecord


NameRecord

public NameRecord(byte builtin,
                  int sheetNumber)
Constructor to create a built-in named region

Parameters:
builtin - Built-in byte representation for the name record, use the public constants

NameRecord

public NameRecord(RecordInputStream ris)
called by the constructor, should set class level fields. Should throw runtime exception for bad/icomplete data.

Parameters:
ris - the RecordInputstream to read the record from
Method Detail

setOptionFlag

public void setOptionFlag(short flag)
sets the option flag for the named range

Parameters:
flag - option flag

setKeyboardShortcut

public void setKeyboardShortcut(byte shortcut)
sets the keyboard shortcut

Parameters:
shortcut - keyboard shortcut

getSheetNumber

public int getSheetNumber()
For named ranges, and built-in names

Returns:
the 1-based sheet number.

getFnGroup

public byte getFnGroup()
Returns:
function group
See Also:
FnGroupCountRecord

setSheetNumber

public void setSheetNumber(int value)

setNameText

public void setNameText(java.lang.String name)
sets the name of the named range

Parameters:
name - named range name

setCustomMenuText

public void setCustomMenuText(java.lang.String text)
sets the custom menu text

Parameters:
text - custom menu text

setDescriptionText

public void setDescriptionText(java.lang.String text)
sets the description text

Parameters:
text - the description text

setHelpTopicText

public void setHelpTopicText(java.lang.String text)
sets the help topic text

Parameters:
text - help topix text

setStatusBarText

public void setStatusBarText(java.lang.String text)
sets the status bar text

Parameters:
text - status bar text

getOptionFlag

public short getOptionFlag()
gets the option flag

Returns:
option flag

getKeyboardShortcut

public byte getKeyboardShortcut()
returns the keyboard shortcut

Returns:
keyboard shortcut

isHiddenName

public boolean isHiddenName()
Returns:
true if name is hidden

setHidden

public void setHidden(boolean b)

isFunctionName

public boolean isFunctionName()
Returns:
true if name is a function

setFunction

public void setFunction(boolean function)
Indicates that the defined name refers to a user-defined function. This attribute is used when there is an add-in or other code project associated with the file.

Parameters:
function - true indicates the name refers to a function.

hasFormula

public boolean hasFormula()
Returns:
true if name has a formula (named range or defined value)

isCommandName

public boolean isCommandName()
Returns:
true if name is a command

isMacro

public boolean isMacro()
Returns:
true if function macro or command macro

isComplexFunction

public boolean isComplexFunction()
Returns:
true if array formula or user defined

isBuiltInName

public boolean isBuiltInName()
Convenience Function to determine if the name is a built-in name


getNameText

public java.lang.String getNameText()
gets the name

Returns:
name

getBuiltInName

public byte getBuiltInName()
Gets the Built In Name

Returns:
the built in Name

getNameDefinition

public Ptg[] getNameDefinition()
gets the definition, reference (Formula)

Returns:
the name formula. never null

setNameDefinition

public void setNameDefinition(Ptg[] ptgs)

getCustomMenuText

public java.lang.String getCustomMenuText()
get the custom menu text

Returns:
custom menu text

getDescriptionText

public java.lang.String getDescriptionText()
gets the description text

Returns:
description text

getHelpTopicText

public java.lang.String getHelpTopicText()
get the help topic text

Returns:
gelp topic text

getStatusBarText

public java.lang.String getStatusBarText()
gets the status bar text

Returns:
status bar text

serialize

public void serialize(LittleEndianOutput out)
Description copied from class: StandardRecord
Write the data content of this BIFF record. The 'ushort sid' and 'ushort size' header fields have already been written by the superclass.
The subclass must write the exact number of bytes as reported by RecordBase.getRecordSize()}

Specified by:
serialize in class StandardRecord

getDataSize

protected int getDataSize()
Specified by:
getDataSize in class StandardRecord

getExternSheetNumber

public int getExternSheetNumber()
gets the extern sheet number

Returns:
extern sheet index

getSid

public short getSid()
return the non static version of the id for this record.

Specified by:
getSid in class Record

toString

public java.lang.String toString()
Description copied from class: Record
get a string representation of the record (for biffview/debugging)

Overrides:
toString in class Record


Copyright 2010 The Apache Software Foundation or its licensors, as applicable.