Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Can I put more than one images in a jface table view's cell?
Can I put more than one images in a jface table view's cell? [message #456833] Fri, 10 June 2005 08:42 Go to next message
nielinjie is currently offline nielinjieFriend
Messages: 13
Registered: July 2009
Junior Member
Hi all,
I just want to put a few images into a jface table view's cell, (they are
all 16*16).
But ITableLabelProvider only allow one image for a cell, can you help me?
And also, I tried to create a new image to put in (new image is
16*numOfImages*16), this image displayed in the cell, but it is stretched
to 16*16. Can jface table view display a non-square image?

thanks
Re: Can I put more than one images in a jface table view's cell? [message #456841 is a reply to message #456833] Fri, 10 June 2005 16:41 Go to previous message
Emil Crumhorn is currently offline Emil CrumhornFriend
Messages: 169
Registered: July 2009
Senior Member
You can't add more than one image to a table cell, but you can combine
images (remember however, that the image that is first set determines the
size for the rest, so overlaying stuff later which would make an image wider
is not an option. In that case, use transparent image for overlay).

I've attached code to create an OverlayIcon (combined image of other
images). It was posted somewhere a long time ago in this newsgroup, I think.

Basically, you use it by:

ImageDescriptor firstImage = your first image...
ImageDescriptor secondImage = second image...
(and more images if you want)

OverlayIcon oc = new OverlayIcon(firstImage, new ImageDescriptor [] {
secondImage }, new int [] { OverlayIcon.TOP_RIGHT }, new Point(32, 16));
Image putInCell = oc.createImage();

As you can probably tell, that'll combine the first image with the second,
putting the second in the top right, and the image is now 32x16 pixels.

Hope that's what you're after.

Emil

"jason, nie" <nielinjie@sohu.com> wrote in message
news:cc660c21bb592923882cdc5dcd18e623$1@www.eclipse.org...
> Hi all,
> I just want to put a few images into a jface table view's cell, (they are
> all 16*16).
> But ITableLabelProvider only allow one image for a cell, can you help me?
> And also, I tried to create a new image to put in (new image is
> 16*numOfImages*16), this image displayed in the cell, but it is stretched
> to 16*16. Can jface table view display a non-square image?
>
> thanks
>


Previous Topic:Animated GIF with ImageLoader
Next Topic:Fancy: Emulation of ghosted drag image in SWT
Goto Forum:
  


Current Time: Thu Apr 25 23:57:31 GMT 2024

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

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

Back to the top