Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » set Column width to show complete text
set Column width to show complete text [message #502498] Tue, 08 December 2009 14:38 Go to next message
kai guo is currently offline kai guoFriend
Messages: 6
Registered: July 2009
Junior Member
hello everyone,

I have a table with only one column, every cell contains very long text. I set the column width big enough (e.g. 10000), and the table is also scrollable, but the text was still not completely displayed.

maybe could someone help me to solve this problem

kind regard
kai
Re: set Column width to show complete text [message #502756 is a reply to message #502498] Wed, 09 December 2009 15:51 Go to previous messageGo to next message
Daniel Krügler is currently offline Daniel KrüglerFriend
Messages: 853
Registered: July 2009
Senior Member
kai guo wrote:
> hello everyone,
>
> I have a table with only one column, every cell contains very long text.
> I set the column width big enough (e.g. 10000), and the table is also
> scrollable, but the text was still not completely displayed.
> maybe could someone help me to solve this problem

You cannot use native widgets (SWT) for this, because of platform
limitations. You probably hit

https://bugs.eclipse.org/bugs/show_bug.cgi?id=259013

HTH & Greetings from Bremen,

Daniel Krügler
Re: set Column width to show complete text [message #502773 is a reply to message #502756] Wed, 09 December 2009 16:40 Go to previous messageGo to next message
kai guo is currently offline kai guoFriend
Messages: 6
Registered: July 2009
Junior Member
thanks for your replay.

I replace this table with list, maybe there is a way to set the background of every list element?

kind regard kai
Re: set Column width to show complete text [message #502876 is a reply to message #502773] Thu, 10 December 2009 07:41 Go to previous messageGo to next message
Daniel Krügler is currently offline Daniel KrüglerFriend
Messages: 853
Registered: July 2009
Senior Member
kai guo wrote:
> thanks for your replay.
>
> I replace this table with list, maybe there is a way to set the
> background of every list element?

Are you sure that the list does not show the same kind of restrictions
as the table?

Problem is, that list does not support as much features as table, e.g.
I'm pretty sure that you have much more limitations in regard to
customized drawing options.

E.g. with a jface TableViewer with the jface 3.3 API using owner-drawing
label provider you can do this:

http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.jface.s nippets/Eclipse%20JFace%20Snippets/org/eclipse/jface/snippet s/viewers/Snippet049StyledCellLabelProvider.java?view=markup

I doubt that this is possible with list.

HTH & Greetings from Bremen,

Daniel Krügler
Re: set Column width to show complete text [message #503059 is a reply to message #502498] Thu, 10 December 2009 17:41 Go to previous message
Grant Gayed is currently offline Grant GayedFriend
Messages: 2151
Registered: July 2009
Senior Member
Hi Kai,

After setting your item texts you should pack() the column, which will make
it the minimum width that's required to fit the texts. The platform
limitation is reached if your column width wants to exceed 32767, but if you
think that 10000 pixels is wide enough then this should not be the issue.
Are you able to provide a snippet that shows the problem? There are many
example Table snippets at http://www.eclipse.org/swt/snippets#table that you
could use as a starting point.

Grant


"kai guo" <kai.guo@afra.de> wrote in message
news:hflod3$bs2$1@build.eclipse.org...
> hello everyone,
>
> I have a table with only one column, every cell contains very long text. I
set the column width big enough (e.g. 10000), and the table is also
scrollable, but the text was still not completely displayed.
>
> maybe could someone help me to solve this problem
>
> kind regard
> kai
Previous Topic:empty link displayed in 2 lines on Windows
Next Topic:Cocoa, SWT.Password and listeners
Goto Forum:
  


Current Time: Mon Nov 24 03:15:22 GMT 2014

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

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