TableColumn

Instances of this class represent a column in a table widget. <p><dl> <dt><b>Styles:</b></dt> <dd>LEFT, RIGHT, CENTER</dd> <dt><b>Events:</b></dt> <dd> Move, Resize, Selection</dd> </dl> </p><p> Note: Only one of the styles LEFT, RIGHT and CENTER may be specified. </p><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)

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>

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> <p> Note that due to a restriction on some platforms, the first column is always left aligned. </p> @param parent a composite control which will be the parent of the new instance (cannot be null) @param style the style of control to construct @param index the zero-relative index to store the receiver in its parent

Members

Functions

addControlListener
void addControlListener(ControlListener listener)

Adds the listener to the collection of listeners who will be notified when the control is moved or resized, by sending it one of the messages defined in the <code>ControlListener</code> interface.

addSelectionListener
void addSelectionListener(SelectionListener listener)

Adds the listener to the collection of listeners who will be notified when the control is selected by the user, by sending it one of the messages defined in the <code>SelectionListener</code> interface. <p> <code>widgetSelected</code> is called when the column header is selected. <code>widgetDefaultSelected</code> is not called. </p>

getAlignment
int getAlignment()

Returns a value which describes the position of the text or image in the receiver. The value will be one of <code>LEFT</code>, <code>RIGHT</code> or <code>CENTER</code>.

getMoveable
bool getMoveable()

Gets the moveable attribute. A column that is not moveable cannot be reordered by the user by dragging the header but may be reordered by the programmer.

getParent
Table getParent()

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

getResizable
bool getResizable()

Gets the resizable attribute. A column that is not resizable cannot be dragged by the user but may be resized by the programmer.

getToolTipText
String getToolTipText()

Returns the receiver's tool tip text, or null if it has not been set.

getWidth
int getWidth()

Gets the width of the receiver.

pack
void pack()

Causes the receiver to be resized to its preferred size. For a composite, this involves computing the preferred size from its layout, if there is one.

removeControlListener
void removeControlListener(ControlListener listener)

Removes the listener from the collection of listeners who will be notified when the control is moved or resized.

removeSelectionListener
void removeSelectionListener(SelectionListener listener)

Removes the listener from the collection of listeners who will be notified when the control is selected by the user.

setAlignment
void setAlignment(int alignment)

Controls how text and images will be displayed in the receiver. The argument should be one of <code>LEFT</code>, <code>RIGHT</code> or <code>CENTER</code>. <p> Note that due to a restriction on some platforms, the first column is always left aligned. </p> @param alignment the new alignment

setMoveable
void setMoveable(bool moveable)

Sets the moveable attribute. A column that is moveable can be reordered by the user by dragging the header. A column that is not moveable cannot be dragged by the user but may be reordered by the programmer.

setResizable
void setResizable(bool resizable)

Sets the resizable attribute. A column that is resizable can be resized by the user dragging the edge of the header. A column that is not resizable cannot be dragged by the user but may be resized by the programmer.

setToolTipText
void setToolTipText(String string)

Sets the receiver's tool tip text to the argument, which may be null indicating that no tool tip text should be shown.

setWidth
void setWidth(int width)

Sets the width of the receiver.

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