user166566
user166566

Reputation:

Align an image in a SWT TableViewer

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?

Upvotes: 3

Views: 5506

Answers (1)

Wayne Beaton
Wayne Beaton

Reputation: 306

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.

Table example snippet: draw images on right side of table item

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

Upvotes: 2

Related Questions