Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Remote Application Platform (RAP) » Problem with TableViewer setAlignment on column
Problem with TableViewer setAlignment on column [message #522986] Wed, 24 March 2010 16:47 Go to next message
rollo is currently offline rolloFriend
Messages: 117
Registered: July 2009
Senior Member
Hi,

There is a problem with the TableViewer.

I set the alignment of a TableColumn (column.setAlignment( SWT.CENTER );)

This works when put some text in the cell. (cell.setText( "someText" );)
But I put an image it the cell (cell.setImage( image );), the image will
always displayed left.

Is this a bug???

to reproduce see rap.demo #controls #Table-Tab

Roland
Re: Problem with TableViewer setAlignment on column [message #522988 is a reply to message #522986] Wed, 24 March 2010 16:55 Go to previous messageGo to next message
Rüdiger Herrmann is currently offline Rüdiger HerrmannFriend
Messages: 581
Registered: July 2009
Senior Member
Roland,

if I'm not entirely mistaken, this behaviour is intended. The rule of
thumb is, if it works in SWT/RCP, it should work the same in RWT/RAP.
Hence, if you can prove that SWT behaves differently, then please file a
bugzilla.

HTH
Rüdiger
--
Rüdiger Herrmann
http://eclipsesource.com

On 24.03.2010 17:47, Roland wrote:
> Hi,
>
> There is a problem with the TableViewer.
>
> I set the alignment of a TableColumn (column.setAlignment( SWT.CENTER );)
>
> This works when put some text in the cell. (cell.setText( "someText" );)
> But I put an image it the cell (cell.setImage( image );), the image will
> always displayed left.
>
> Is this a bug???
>
> to reproduce see rap.demo #controls #Table-Tab
>
> Roland
Re: Problem with TableViewer setAlignment on column [message #523114 is a reply to message #522988] Thu, 25 March 2010 07:49 Go to previous messageGo to next message
rollo is currently offline rolloFriend
Messages: 117
Registered: July 2009
Senior Member
Hi,

I have tested it in SWT and you're right. It shows the same behavior as
in RAP.

But the JavaDoc says:

Controls how text and *images* will be displayed in the receiver. The
argument should be one of LEFT, RIGHT or CENTER.

Strange.

Roland

Am 24.03.2010 17:55, schrieb Rüdiger Herrmann:
> Roland,
>
> if I'm not entirely mistaken, this behaviour is intended. The rule of
> thumb is, if it works in SWT/RCP, it should work the same in RWT/RAP.
> Hence, if you can prove that SWT behaves differently, then please file a
> bugzilla.
>
> HTH
> Rüdiger
Re: Problem with TableViewer setAlignment on column [message #523116 is a reply to message #523114] Thu, 25 March 2010 08:14 Go to previous messageGo to next message
Rüdiger Herrmann is currently offline Rüdiger HerrmannFriend
Messages: 581
Registered: July 2009
Senior Member
On 25.03.2010 08:49, Roland wrote:
> Hi,
>
> I have tested it in SWT and you're right. It shows the same behavior as
> in RAP.
>
> But the JavaDoc says:
>
> Controls how text and *images* will be displayed in the receiver. The
> argument should be one of LEFT, RIGHT or CENTER.
>
> Strange.
It may be that SWT behaves differently on different platforms. However,
it could also be a bug in the documentation. If you want to be sure,
search for a bug or newsgroup entry in SWT.

>
> Roland
>
> Am 24.03.2010 17:55, schrieb Rüdiger Herrmann:
>> Roland,
>>
>> if I'm not entirely mistaken, this behaviour is intended. The rule of
>> thumb is, if it works in SWT/RCP, it should work the same in RWT/RAP.
>> Hence, if you can prove that SWT behaves differently, then please file a
>> bugzilla.
>>
>> HTH
>> Rüdiger


--
Rüdiger Herrmann
http://eclipsesource.com
Re: Problem with TableViewer setAlignment on column [message #909827 is a reply to message #523116] Fri, 07 September 2012 21:51 Go to previous messageGo to next message
Ronald So is currently offline Ronald SoFriend
Messages: 198
Registered: April 2011
Senior Member
I hit into the same problem too. Is there a way to align images also in the table cell? The image inside the table is always left-aligned.

Thanks.
Re: Problem with TableViewer setAlignment on column [message #909968 is a reply to message #909827] Sat, 08 September 2012 07:39 Go to previous message
Ralf Sternberg is currently offline Ralf SternbergFriend
Messages: 1313
Registered: July 2009
Senior Member

On 09/07/2012 11:51 PM, Ronald So wrote:
> I hit into the same problem too. Is there a way to align images also in
> the table cell? The image inside the table is always left-aligned.

No. This is not possible in the SWT table and it isn't in RAP. But maybe
the markup support added in 1.5 can be an alternative? When you enable
markup for a Table, you can put <img> tags into its text.

HTH, Ralf

--
Ralf Sternberg

Twitter: @EclipseRAP
Blog: http://eclipsesource.com/blogs/

Professional services for RAP and RCP?
http://eclipsesource.com/services/rap/
Previous Topic:TreeViewer with SWT.VIRTUAL and a ILazyTreeContentProvider weird behaviour
Next Topic:Minimizing, maximizing and restoring views, editors programatically
Goto Forum:
  


Current Time: Thu Apr 18 05:03:09 GMT 2024

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

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

Back to the top