ColumnHeader Class

ColumnHeader Class

This Package | All Packages

public class ColumnHeader

Encapsulates the settings on a column in a ListView control. These settings include the width of the column, the image associated with it, its width, and its index within the group of columns associated with a given ListView.

Methods
Name Description
equals(Object obj) Retrieves a boolean value that indicates whether the specified object is equivalent to this ColumnHeader object.
getFormat() Retreives the current format settings for this column header.
getImageIndex() Retrieves the zero-based index of the image associated with this column header.
getIndex() Retrieves the index of this column header.
getListView() Retrieves the ListView object associated with this column header.
getSubItemIndex() Retrieves the subitem index for this column header.
getText() Retrieves the text associated with this column header.
getWidth() Retrieves the width of this column header.
hashCode() Retrieves a hashcode for this object.
setFormat(int format) Sets the format for this ColumnHeader object.
setImageIndex(int image) Specifies the index of the image associated with this ColumnHeader object.
setSubItemIndex(int index) Specifies the ColumnHeader's subitem index.
setText(String str) Specifies the text for this ColumnHeader object.
setWidth(int width) Specifies the width for this ColumnHeader object.
toString() Retrieves a String object that contains the current settings on this ColumnHeader object.

Methods

ColumnHeader.equals

Syntax
public boolean equals( Object obj );
Parameters
obj
The object to compare to this ColumnHeader object.
Return Value

Returns true if obj is equivalent to this ColumnHeader object; otherwise, returns false.

Description

Retrieves a boolean value that indicates whether the specified object is equivalent to this ColumnHeader object.

ColumnHeader.getFormat

Syntax
public int getFormat();
Return Value

Returns a constant that identifies the format for this column header. Possible values include the following: comctl32.LVCFMT_LEFT comctl32.LVCFMT_RIGHT comctl32.LVCFMT_CENTER comctl32.LVCFMT_BITMAP_ON_RIGHT comctl32.LVCFMT_COL_HAS_IMAGES comctl32.LVCFMT_IMAGE

Description

Retreives the current format settings for this column header.

ColumnHeader.getImageIndex

Syntax
public int getImageIndex();
Return Value

Returns the index of the image if one has been set; otherwise, returns -1.

Description

Retrieves the zero-based index of the image associated with this column header.

ColumnHeader.getIndex

Syntax
public int getIndex();
Return Value

Returns the zero-based index of the column header.

Description

Retrieves the index of this column header.

ColumnHeader.getListView

Syntax
public ListView getListView();
Return Value

Returns the ListView object associated with this column header.

Description

Retrieves the ListView object associated with this column header.

ColumnHeader.getSubItemIndex

Syntax
public int getSubItemIndex();
Return Value

Returns the zero-based subitem index for this ColumnHeader.

Description

Retrieves the subitem index for this column header.

ColumnHeader.getText

Syntax
public String getText();
Return Value

Returns a String object that contains the text associated with this column header.

Description

Retrieves the text associated with this column header.

ColumnHeader.getWidth

Syntax
public int getWidth();
Return Value

Returns the width, in pixels, of this ColumnHeader object.

Description

Retrieves the width of this column header.

ColumnHeader.hashCode

Syntax
public int hashCode();
Return Value

Returns an integer that contains the hashcode.

Description

Retrieves a hashcode for this object.

ColumnHeader.setFormat

Syntax
public void setFormat( int format );
Parameters
format
An integer that specifies the ColumnHeader format. The format can be one of the following: comctl32.LVCFMT_LEFT comctl32.LVCFMT_RIGHT comctl32.LVCFMT_CENTER comctl32.LVCFMT_BITMAP_ON_RIGHT comctl32.LVCFMT_COL_HAS_IMAGES comctl32.LVCFMT_IMAGE
Description

Sets the format for this ColumnHeader object.

Exceptions

IllegalArgumentException thrown if the format argument does not evaluate to one of the previously listed constant.

ColumnHeader.setImageIndex

Syntax
public void setImageIndex( int image );
Parameters
image
The zero-based index of the image in the ListView's ImageList.
Description

Specifies the index of the image associated with this ColumnHeader object. This index references the ImageList associated with the ColumnHeader's ListView.

ColumnHeader.setSubItemIndex

Syntax
public void setSubItemIndex( int index );
Parameters
index
The subitem index for this ColumnHeader object.
Description

Specifies the ColumnHeader's subitem index.

ColumnHeader.setText

Syntax
public void setText( String str );
Parameters
str
The ColumnHeader text.
Description

Specifies the text for this ColumnHeader object.

ColumnHeader.setWidth

Syntax
public void setWidth( int width );
Parameters
width
The width of the ColumnHeader.
Description

Specifies the width for this ColumnHeader object.

ColumnHeader.toString

Syntax
public String toString();
Return Value

Returns a String object that contains the ColumnHeader settings.

Description

Retrieves a String object that contains the current settings on this ColumnHeader object.