public class ColHandle extends Object
get a handle to the Cells in a columnNote: for a discussion of Column widths see: http://support.microsoft.com/?kbid=214123
set the default formatting for a column
WorkBookHandle,
WorkSheetHandle,
FormulaHandle| Modifier and Type | Field and Description |
|---|---|
static int |
COL_UNITS_TO_PIXELS |
static int |
DEFAULT_COLWIDTH |
static double |
DEFAULT_ZERO_CHAR_WIDTH |
| Modifier | Constructor and Description |
|---|---|
protected |
ColHandle(Colinfo c,
WorkSheetHandle sheet)
creates a new ColHandle from a Colinfo Object and reference to a worksheet (WorkSheetHandle Object)
|
| Modifier and Type | Method and Description |
|---|---|
void |
autoFit()
resizes this column to fit the width of all displayed, non-wrapped text.
|
boolean |
containsMergeRange()
determines if this Column passes through i.e.
|
CellHandle[] |
getCells()
returns the array of Cells in this Column
|
int |
getColFirst()
returns the first Column referenced by this column handle
NOTE: A Column handle may in some circumstances refer to a range of columns |
int |
getColLast()
returns the last Column referenced by this column handle
NOTE: A Column handle may in some circumstances refer to a range of columns |
FormatHandle |
getFormatHandle()
returns the FormatHandle (a Format Object describing visual properties) for this Column
NOTE: The Column format record describes the default formatting for each cell contained within the column |
int |
getFormatId()
returns the format ID (the index to the format record) for this Column
The Column format is the default formatting for each cell contained within the column |
int |
getOutlineLevel()
Returns the Outline level (depth) of this Column
|
int |
getWidth()
returns the width of this Column in internal units
defined as follows:
default width of the columns in 1/256 of the width of the zero character, using default font. |
static int |
getWidth(Boundsheet sheet,
int col)
static utility method to return the Column width of an existing column
in the units as follows:
default width of the columns in 1/256 of the width of the zero character, using default font. |
int |
getWidthInChars()
returns the width of this Column in Characters or regular Excel units
NOTE: this value is a calculated value that should be close but still is an approximation of Excel units |
boolean |
isCollapsed()
returns true if this Column is collapsed
|
boolean |
isHidden()
returns true if this Column is hidden
|
void |
setCollapsed(boolean b)
sets whether to collapse this Column
|
void |
setFormatId(int i)
sets the format id (an index to a Format record) for this Column
This sets the default formatting for the Column such that any cell that does not specifically set it's own formatting will display this Column formatting |
void |
setHidden(boolean b)
sets whether to hide or show this Column
|
void |
setOutlineLevel(int x)
Set the Outline level (depth) of this Column
|
void |
setWidth(int newWidth)
sets the width of this Column in internal units, described as follows:
default width of the columns in 1/256 of the width of the zero character, using default font. |
void |
setWidthInChars(int newWidth)
sets the width of this Column in Characters or Excel units.
|
public static final double DEFAULT_ZERO_CHAR_WIDTH
public static final int COL_UNITS_TO_PIXELS
public static final int DEFAULT_COLWIDTH
protected ColHandle(Colinfo c, WorkSheetHandle sheet)
c - sheet - public void autoFit()
public void setWidthInChars(int newWidth)
int - i - desired Column width in Characters (Excel units)public void setWidth(int newWidth)
NOTE: The last Cell in the column having its width set will be the resulting width of the column
int - i - desired Column width in internal unitspublic int getWidth()
public int getWidthInChars()
public static int getWidth(Boundsheet sheet, int col)
Boundsheet - sheet - source Worksheetint - col - 0-based Column numberpublic void setFormatId(int i)
int - i - ID representing the Format to set this ColumnFormatHandlepublic int getFormatId()
FormatHandlepublic FormatHandle getFormatHandle()
public int getColFirst()
public int getColLast()
public CellHandle[] getCells()
public boolean containsMergeRange()
public void setCollapsed(boolean b)
boolean - b - true to collapse this Columnpublic void setHidden(boolean b)
boolean - b - true to hide this Column, false to showpublic void setOutlineLevel(int x)
int - x - outline levelpublic int getOutlineLevel()
public boolean isCollapsed()
public boolean isHidden()
Copyright © 2002–2019 Starter Inc.. All rights reserved.