public class InCellLists extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
InCellLists.MultiLevelListItem
An instance of this inner class models an item or element in a
multi-level list.
|
| Constructor and Description |
|---|
InCellLists() |
| Modifier and Type | Method and Description |
|---|---|
void |
bulletedItemInCell(HSSFWorkbook workbook,
String listItem,
HSSFCell cell)
Inserts a single bulleted item into a cell.
|
void |
bulletedListInCell(HSSFWorkbook workbook,
List<String> listItems,
HSSFCell cell)
Insert a bulleted list into a cell.
|
void |
demonstrateMethodCalls(String outputFilename)
Call each of the list creation methods.
|
void |
listInCell(HSSFWorkbook workbook,
List<String> listItems,
HSSFCell cell)
Inserts a list of plain items - that is items that are neither
numbered or bulleted - into a single cell.
|
static void |
main(String[] args)
The main entry point to the program.
|
void |
multiLevelBulletedListInCell(HSSFWorkbook workbook,
List<InCellLists.MultiLevelListItem> multiLevelListItems,
HSSFCell cell)
Insert a bulleted multi-level list into a cell.
|
void |
multiLevelListInCell(HSSFWorkbook workbook,
List<InCellLists.MultiLevelListItem> multiLevelListItems,
HSSFCell cell)
Insert a multi-level list into a cell.
|
void |
multiLevelNumberedListInCell(HSSFWorkbook workbook,
List<InCellLists.MultiLevelListItem> multiLevelListItems,
HSSFCell cell,
int highLevelStartingValue,
int highLevelIncrement,
int lowLevelStartingValue,
int lowLevelIncrement)
Insert a multi-level list into a cell.
|
void |
numberedListInCell(HSSFWorkbook workbook,
List<String> listItems,
HSSFCell cell,
int startingValue,
int increment)
Inserts a numbered list into a single cell.
|
public void demonstrateMethodCalls(String outputFilename)
outputFilename - A String that encapsulates the name of and path to
the Excel spreadsheet file this code will create.public void bulletedItemInCell(HSSFWorkbook workbook, String listItem, HSSFCell cell)
workbook - A reference to the HSSFWorkbook that 'contains' the
cell.listItem - An instance of the String class encapsulating the
items text.cell - An instance of the HSSFCell class that encapsulates a
reference to the spreadsheet cell into which the list item
will be written.public void listInCell(HSSFWorkbook workbook, List<String> listItems, HSSFCell cell)
workbook - A reference to the HSSFWorkbook that 'contains' the
cell.listItems - An ArrayList whose elements encapsulate the text for
the list's items.cell - An instance of the HSSFCell class that encapsulates a
reference to the spreadsheet cell into which the list
will be written.public void numberedListInCell(HSSFWorkbook workbook, List<String> listItems, HSSFCell cell, int startingValue, int increment)
workbook - A reference to the HSSFWorkbook that 'contains' the
cell.listItems - An ArrayList whose elements encapsulate the text for
the lists items.cell - An instance of the HSSFCell class that encapsulates a
reference to the spreadsheet cell into which the list
will be written.startingValue - A primitive int containing the number for the first
item in the list.increment - A primitive int containing the value that should be used
to calculate subsequent item numbers.public void bulletedListInCell(HSSFWorkbook workbook, List<String> listItems, HSSFCell cell)
workbook - A reference to the HSSFWorkbook that 'contains' the
cell.listItems - An ArrayList whose elements encapsulate the text for
the lists items.cell - An instance of the HSSFCell class that encapsulates a
reference to the spreadsheet cell into which the list
will be written.public void multiLevelListInCell(HSSFWorkbook workbook, List<InCellLists.MultiLevelListItem> multiLevelListItems, HSSFCell cell)
workbook - A reference to the HSSFWorkbook that 'contains' the
cell.multiLevelListItems - An ArrayList whose elements contain instances
of the MultiLevelListItem class. Each element
encapsulates the text for the high level item
along with an ArrayList. Each element of this
ArrayList encapsulates the text for a lower
level item.cell - An instance of the HSSFCell class that encapsulates a
reference to the spreadsheet cell into which the list
will be written.public void multiLevelNumberedListInCell(HSSFWorkbook workbook, List<InCellLists.MultiLevelListItem> multiLevelListItems, HSSFCell cell, int highLevelStartingValue, int highLevelIncrement, int lowLevelStartingValue, int lowLevelIncrement)
workbook - A reference to the HSSFWorkbook that 'contains' the
cell.multiLevelListItems - An ArrayList whose elements contain instances
of the MultiLevelListItem class. Each element
encapsulates the text for the high level item
along with an ArrayList. Each element of this
ArrayList encapsulates the text for a lower
level item.cell - An instance of the HSSFCell class that encapsulates a
reference to the spreadsheet cell into which the list
will be written.highLevelStartingValue - A primitive int containing the number
for the first high level item in the list.highLevelIncrement - A primitive int containing the value that
should be used to calculate the number of
subsequent high level item.lowLevelStartingValue - A primitive int will containing the number
for the first low level item associated
with a high level item.lowLevelIncrement - A primitive int containing the value that
should be used to calculate the number of
subsequent low level item.public void multiLevelBulletedListInCell(HSSFWorkbook workbook, List<InCellLists.MultiLevelListItem> multiLevelListItems, HSSFCell cell)
workbook - A reference to the HSSFWorkbook that 'contains' the
cell.multiLevelListItems - An ArrayList whose elements contain instances
of the MultiLevelListItem class. Each element
encapsulates the text for the high level item
along with an ArrayList. Each element of this
ArrayList encapsulates the text for a lower
level item.cell - An instance of the HSSFCell class that encapsulates a
reference to the spreadsheet cell into which the list
will be written.public static void main(String[] args) throws IOException
args - the command line arguments.IOException