Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » JFace Table - truncated image size in ITableLabelProvider
JFace Table - truncated image size in ITableLabelProvider [message #449465] Tue, 25 January 2005 01:13 Go to next message
Bill Ewing is currently offline Bill EwingFriend
Messages: 49
Registered: July 2009
Member
When using a JFace table, you use a class that implements
ITableLabelProvider.

Within this, we override the getColumnImage() method to generate an image
from scratch and return it. Our reason for doing this is to draw the
entire contents of the cell.

We got this code to work (remembering to do gc.dispose was critical), but
now have a weird problem:

Column 1 has a width of 20. We generate an image with this width and it
works great.

Column 2 has a width of 30. No matter what we do, the image we generate
for this is never wider than 20.

(We avoid using column 0 like the plague due to several Windows platform
bugs that SWT does not solve)

The getColumnImage method gets called for each column individually. We do
not maintain any instantiations of the images created-- they are all local
and go out of scope when the method exits.

As a sanity check, we made all of the variables associated with column 1
and column 2 have different names. We still see a truncation of the image
size in column 2.

Any ideas on what the problem may be?

All suggestions/comments appreciated.
Re: JFace Table - truncated image size in ITableLabelProvider [message #449477 is a reply to message #449465] Tue, 25 January 2005 12:44 Go to previous message
Veronika Irvine is currently offline Veronika IrvineFriend
Messages: 1272
Registered: July 2009
Senior Member
The Table uses an image list. All images in the list are of the same size.
The first image you place in the list determines the size of all subsequent
images. This is just the way the native widget works.

> (We avoid using column 0 like the plague due to several Windows platform
> bugs that SWT does not solve)

Have you entered bug reports about these issues? What are they?


"Bill Ewing" <ewing@irori.com> wrote in message
news:ct46fr$5kp$1@www.eclipse.org...
> When using a JFace table, you use a class that implements
> ITableLabelProvider.
> Within this, we override the getColumnImage() method to generate an image
> from scratch and return it. Our reason for doing this is to draw the
> entire contents of the cell.
>
> We got this code to work (remembering to do gc.dispose was critical), but
> now have a weird problem:
>
> Column 1 has a width of 20. We generate an image with this width and it
> works great.
>
> Column 2 has a width of 30. No matter what we do, the image we generate
> for this is never wider than 20.
>
> (We avoid using column 0 like the plague due to several Windows platform
> bugs that SWT does not solve)
>
> The getColumnImage method gets called for each column individually. We do
> not maintain any instantiations of the images created-- they are all local
> and go out of scope when the method exits.
> As a sanity check, we made all of the variables associated with column 1
> and column 2 have different names. We still see a truncation of the image
> size in column 2.
>
> Any ideas on what the problem may be?
>
> All suggestions/comments appreciated.
>
>
Previous Topic:Table Columns with mutiple lines of data
Next Topic:How to make a custom drag and drop tracker image
Goto Forum:
  


Current Time: Fri Nov 22 10:11:22 GMT 2019

Powered by FUDForum. Page generated in 0.02875 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top