Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Table, continu text on next line of row
Table, continu text on next line of row [message #441348] Fri, 13 August 2004 08:41 Go to next message
Eclipse UserFriend
Originally posted by: peter.clueless.be

Hello there,

Is there an option so the text in a row will continu on the next line?

My TableItem shows:

+--------------------+
| This is a text ... |
+--------------------+

I would like to have:

+--------------------+
| This is a text |
| that doesn't fit |
| on one line. |
+--------------------+

Thanks!

--
Peter
Re: Table, continu text on next line of row [message #441349 is a reply to message #441348] Fri, 13 August 2004 08:41 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: peter.clueless.be

Peter Billen wrote:

> Is there an option so the text in a row will continu on the next line?

Oops I forgot to add my code:

Table table = new Table(shell, SWT.BORDER | SWT.FULL_SELECTION); //
SWT.SINGLE,
// SWT.MULTI,
table.setHeaderVisible(true);
table.setLinesVisible(false);


TableColumn tableColumn = null;

tableColumn = new TableColumn(table, SWT.LEFT);
tableColumn.setText("Description");
tableColumn.setWidth(180);
tableColumn.setResizable(false);

tableColumn = new TableColumn(table, SWT.LEFT);
tableColumn.setText("Distance & Time");
tableColumn.setWidth(100);
tableColumn.setResizable(false);

// table.getColumn(0).pack();
// table.getColumn(1).pack();

GridData data = new GridData();
data.horizontalAlignment = GridData.FILL;
data.verticalAlignment = GridData.FILL;
data.grabExcessHorizontalSpace = true;
data.grabExcessVerticalSpace = true;
table.setLayoutData(data);

Regards,

--
Peter
Re: Table, continu text on next line of row [message #441403 is a reply to message #441349] Fri, 13 August 2004 16:55 Go to previous messageGo to next message
Steve Northover is currently offline Steve NorthoverFriend
Messages: 1636
Registered: July 2009
Senior Member
Sorry, the Windows table only supports one line of text in a cell.

"Peter Billen" <peter@clueless.be> wrote in message
news:cfhusk$goh$1@eclipse.org...
> Peter Billen wrote:
>
> > Is there an option so the text in a row will continu on the next line?
>
> Oops I forgot to add my code:
>
> Table table = new Table(shell, SWT.BORDER | SWT.FULL_SELECTION); //
> SWT.SINGLE,
> // SWT.MULTI,
> table.setHeaderVisible(true);
> table.setLinesVisible(false);
>
>
> TableColumn tableColumn = null;
>
> tableColumn = new TableColumn(table, SWT.LEFT);
> tableColumn.setText("Description");
> tableColumn.setWidth(180);
> tableColumn.setResizable(false);
>
> tableColumn = new TableColumn(table, SWT.LEFT);
> tableColumn.setText("Distance & Time");
> tableColumn.setWidth(100);
> tableColumn.setResizable(false);
>
> // table.getColumn(0).pack();
> // table.getColumn(1).pack();
>
> GridData data = new GridData();
> data.horizontalAlignment = GridData.FILL;
> data.verticalAlignment = GridData.FILL;
> data.grabExcessHorizontalSpace = true;
> data.grabExcessVerticalSpace = true;
> table.setLayoutData(data);
>
> Regards,
>
> --
> Peter
>
>
Re: Table, continu text on next line of row [message #441433 is a reply to message #441403] Mon, 16 August 2004 06:59 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: peter.clueless.be

Steve Northover wrote:
> Sorry, the Windows table only supports one line of text in a cell.

Okay thanks for the answer; too bad :(

Is there some kind of walkarround out? I can create multiple rows to be
able to display all the text, but then I have the borders in between..

thanks a lot,

--
Peter
Re: Table, continu text on next line of row [message #441510 is a reply to message #441433] Mon, 16 August 2004 14:32 Go to previous message
Andrew Brampton is currently offline Andrew BramptonFriend
Messages: 8
Registered: July 2009
Junior Member
I've recently encountered this problem and my solution was to write a custom
control which renders its own text.

It didn't take me too long.

Another idea might be to draw images in the table's cells... You can easily
create a GC and a Image, draw two lines of text, and then place it in the
table.

Andrew

"Peter Billen" <peter@clueless.be> wrote in message
news:cfplrp$jad$1@eclipse.org...
| Steve Northover wrote:
| > Sorry, the Windows table only supports one line of text in a cell.
|
| Okay thanks for the answer; too bad :(
|
| Is there some kind of walkarround out? I can create multiple rows to be
| able to display all the text, but then I have the borders in between..
|
| thanks a lot,
|
| --
| Peter
Previous Topic:Is it possible to add caption and menue to viewform?
Next Topic:Is it possible to change Font weight?
Goto Forum:
  


Current Time: Fri Apr 26 23:02:25 GMT 2024

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

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

Back to the top