views:

847

answers:

1

Hey Folks,

I just found out, that its somehow impossible to align an image in a swt tableviewer. Creating a TableColumn with SWT.RIGHT (for instance) has no effect on that column if its labelprovider returns an image for it. Question: Is there any other way to align an image instead of modifiying the image file itself and put some extra pixel into it?

+2  A: 

I believe that you're running into a limitation of the underlying platform (or something to that effect). You can have total control over what goes into the cell if you draw it yourself. There is a snippet that shows you how to do this.

http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet230.java?view=co

Of course, you'll also have to draw any text you want in the cell.

Wayne Beaton
Thanks a lot, wayne. I guess thats the way it has to be then. Was hoping to avoid adding some custom drawing to handle image alignment. Thanks for the link.
pimpf0r