Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Remote Application Platform (RAP) » Runtime issue on rendering images in table?(Dynamically generated image, that fits the column's width, is not drawn correctly.)
Runtime issue on rendering images in table? [message #656208] Thu, 24 February 2011 15:00 Go to next message
Bassspieler  is currently offline Bassspieler Friend
Messages: 40
Registered: April 2010
Location: Germany
Member
Hi RAP-Addicts!

I've got an interesting challenge. I've got a table with a special column. On this column I've added a label provider that overides 'getImage'. The returned image is dynamically created based on the column's width.

The interesting point is, that I have added a listener on the column to get notified, when the user resizes the column. When that is the case, I refresh the table viewer. This re-calls the label provider's getImage-method and a new image with the adjusted width is created and returned.

Sadly, this doesn't work quite well. At the end of the process, the column is wider or smaller and also the image that is returned has the correct size. But it seems that somehow the RAP-part that is drawing the cell did not recognize, that the size of the image changed. So the space the image takes within the cell stays the same, although the widths of column and image have changed.
This looks quite awkward, because the new bigger image is rendered centered in the provided space/place for the image.

Did I oversee something important? Or is this some case of RAP-bug?

The fact that made me think the fault is on my side is, that my table is not that simple. There are lots of columns that contain these dynamic images and the described resizing bug of the table is there, but on the first dynamic-image-column everything works as I expected it to be. So technically my code seems to work. But it doesn't for the rest of dynamic-image-columns.

So maybe it's some kind of runtime issue with rendering images of columns of a table?
Re: Runtime issue on rendering images in table? [message #656222 is a reply to message #656208] Thu, 24 February 2011 15:22 Go to previous messageGo to next message
Ivan Furnadjiev is currently offline Ivan FurnadjievFriend
Messages: 2426
Registered: July 2009
Location: Sofia, Bulgaria
Senior Member
Hi Bassspieler,
did you run your code in RCP (SWT) :-)? I think that you will get the
same results there. This is a know behavior of SWT (Windows) Table and
for good or bad RAP tries to behave the same. The space for the image is
calculated when you set the image for the first time (in one TableItem)
and it is not changed later if you set a bigger or smaller image. There
is one possible solution - call Table#clearAll() before setting the new
image. Of course, you have to populate all TableItems data again - text,
images, checked and greyed states.
HTH,
Ivan

On 2/24/2011 5:00 PM, Bassspieler wrote:
> Hi RAP-Addicts!
>
> I've got an interesting challenge. I've got a table with a special
> column. On this column I've added a label provider that overides
> 'getImage'. The returned image is dynamically created based on the
> column's width.
>
> The interesting point is, that I have added a listener on the column
> to get notified, when the user resizes the column. When that is the
> case, I refresh the table viewer. This re-calls the label provider's
> getImage-method and a new image with the adjusted width is created and
> returned.
>
> Sadly, this doesn't work quite well. At the end of the process, the
> column is wider or smaller and also the image that is returned has the
> correct size. But it seems that somehow the RAP-part that is drawing
> the cell did not recognize, that the size of the image changed. So the
> space the image takes within the cell stays the same, although the
> widths of column and image have changed.
> This looks quite awkward, because the new bigger image is rendered
> centered in the provided space/place for the image.
>
> Did I oversee something important? Or is this some case of RAP-bug?
>
> The fact that made me think the fault is on my side is, that my table
> is not that simple. There are lots of columns that contain these
> dynamic images and the described resizing bug of the table is there,
> but on the first dynamic-image-column everything works as I expected
> it to be. So technically my code seems to work. But it doesn't for the
> rest of dynamic-image-columns.
>
> So maybe it's some kind of runtime issue with rendering images of
> columns of a table?
Re: Runtime issue on rendering images in table? [message #656336 is a reply to message #656222] Fri, 25 February 2011 08:10 Go to previous message
Bassspieler  is currently offline Bassspieler Friend
Messages: 40
Registered: April 2010
Location: Germany
Member
Thank you Ivan!

I just inserted the clearAll() and do refresh my underlying table model. E voila, everything looks fine.

Thank you once more,
Bassspieler
Previous Topic:Problem with RAP+BIRT target platform
Next Topic:E-Mail link
Goto Forum:
  


Current Time: Thu Apr 25 07:19:11 GMT 2024

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

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

Back to the top