TableItem

Instances of this class represent a selectable user interface object that represents an item in a table. <dl> <dt><b>Styles:</b></dt> <dd>(none)</dd> <dt><b>Events:</b></dt> <dd>(none)</dd> </dl> <p> IMPORTANT: This class is <em>not</em> intended to be subclassed. </p>

@see <a href="http://www.eclipse.org/swt/snippets/#table">Table, TableItem, TableColumn snippets</a> @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>

Constructors

this
this(Table parent, int style, int index)

Constructs a new instance of this class given its parent (which must be a <code>Table</code>), a style value describing its behavior and appearance, and the index at which to place it in the items maintained by its parent. <p> The style value is either one of the style constants defined in class <code>SWT</code> which is applicable to instances of this class, or must be built by <em>bitwise OR</em>'ing together (that is, using the <code>int</code> "|" operator) two or more of those <code>SWT</code> style constants. The class description lists the style constants that are applicable to the class. Style bits are also inherited from superclasses. </p>

this
this(Table parent, int style)

Constructs a new instance of this class given its parent (which must be a <code>Table</code>) and a style value describing its behavior and appearance. The item is added to the end of the items maintained by its parent. <p> The style value is either one of the style constants defined in class <code>SWT</code> which is applicable to instances of this class, or must be built by <em>bitwise OR</em>'ing together (that is, using the <code>int</code> "|" operator) two or more of those <code>SWT</code> style constants. The class description lists the style constants that are applicable to the class. Style bits are also inherited from superclasses. </p>

Members

Functions

getBackground
Color getBackground()

Returns the receiver's background color.

getBackground
Color getBackground(int index)

Returns the background color at the given column index in the receiver.

getBounds
Rectangle getBounds()

Returns a rectangle describing the receiver's size and location relative to its parent.

getBounds
Rectangle getBounds(int index)

Returns a rectangle describing the receiver's size and location relative to its parent at a column in the table.

getChecked
bool getChecked()

Returns <code>true</code> if the receiver is checked, and false otherwise. When the parent does not have the <code>CHECK</code> style, return false.

getFont
Font getFont()

Returns the font that the receiver will use to paint textual information for this item.

getFont
Font getFont(int index)

Returns the font that the receiver will use to paint textual information for the specified cell in this item.

getForeground
Color getForeground()

Returns the foreground color that the receiver will use to draw.

getForeground
Color getForeground(int index)

Returns the foreground color at the given column index in the receiver.

getGrayed
bool getGrayed()

Returns <code>true</code> if the receiver is grayed, and false otherwise. When the parent does not have the <code>CHECK</code> style, return false.

getImage
Image getImage(int index)

Returns the image stored at the given column index in the receiver, or null if the image has not been set or if the column does not exist.

getImageBounds
Rectangle getImageBounds(int index)

Returns a rectangle describing the size and location relative to its parent of an image at a column in the table. An empty rectangle is returned if index exceeds the index of the table's last column.

getImageIndent
int getImageIndent()

Gets the image indent.

getParent
Table getParent()

Returns the receiver's parent, which must be a <code>Table</code>.

getText
String getText(int index)

Returns the text stored at the given column index in the receiver, or empty string if the text has not been set.

getTextBounds
Rectangle getTextBounds(int index)

Returns a rectangle describing the size and location relative to its parent of the text at a column in the table. An empty rectangle is returned if index exceeds the index of the table's last column.

setBackground
void setBackground(Color color)

Sets the receiver's background color to the color specified by the argument, or to the default system color for the item if the argument is null.

setBackground
void setBackground(int index, Color color)

Sets the background color at the given column index in the receiver to the color specified by the argument, or to the default system color for the item if the argument is null.

setChecked
void setChecked(bool checked)

Sets the checked state of the checkbox for this item. This state change only applies if the Table was created with the SWT.CHECK style.

setFont
void setFont(Font font)

Sets the font that the receiver will use to paint textual information for this item to the font specified by the argument, or to the default font for that kind of control if the argument is null.

setFont
void setFont(int index, Font font)

Sets the font that the receiver will use to paint textual information for the specified cell in this item to the font specified by the argument, or to the default font for that kind of control if the argument is null.

setForeground
void setForeground(Color color)

Sets the receiver's foreground color to the color specified by the argument, or to the default system color for the item if the argument is null.

setForeground
void setForeground(int index, Color color)

Sets the foreground color at the given column index in the receiver to the color specified by the argument, or to the default system color for the item if the argument is null.

setGrayed
void setGrayed(bool grayed)

Sets the grayed state of the checkbox for this item. This state change only applies if the Table was created with the SWT.CHECK style.

setImage
void setImage(int index, Image image)

Sets the receiver's image at a column.

setImage
void setImage(Image[] images)

Sets the image for multiple columns in the table.

setImageIndent
void setImageIndent(int indent)

Sets the indent of the first column's image, expressed in terms of the image's width.

setText
void setText(int index, String string)

Sets the receiver's text at a column

setText
void setText(String[] strings)

Sets the text for multiple columns in the table.

Inherited Members

From Item

getImage
Image getImage()

Returns the receiver's image if it has one, or null if it does not.

getText
String getText()

Returns the receiver's text, which will be an empty string if it has never been set.

setImage
void setImage(Image image)

Sets the receiver's image to the argument, which may be null indicating that no image should be displayed.

setText
void setText(String string)

Sets the receiver's text.

Meta