[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.platform.swt] Re: How to center a image in a SWT table column

daniela@xxxxxxxxxxxxxxxx wrote:
Hi,

I have implemented a SWT table with checkboxes in the 3 column. Since it is not possible to add a real checkbox to a table column other than to the 1.column, I'm using normal images that display the checked/unchecked checkbox. The default horizontal alignment of the images is left, but I would like to have them centered. How can I do this? Can this be done somewhere in the TableLabelProvider?

This JFace snippets page has an example that demonstrates how to do it: http://wiki.eclipse.org/index.php/JFaceSnippets#Snippet051TableCenteredImage

Also, see this blog post that deals specifically with simulated checkbox columns:
http://tom-eclipse-dev.blogspot.com/2007/01/tableviewers-and-nativelooking.html


Hope this helps,
	Eric