Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Table Column: displaying the & character
Table Column: displaying the & character [message #464409] Wed, 23 November 2005 08:20 Go to next message
Eclipse UserFriend
Originally posted by: matthew1801.hotmail.com

Hi,

I am using an SWT Table, trying to display an '&' character in a table
column. I have tried the following without success:

TableColumn col = new TableColumn(table, SWT.LEFT);

col.setText("A&B"); --> displays "AB"
col.setText("A&&B"); --> displays "A B"
col.setText("A\&B"); --> displays "AB"
col.setText("A\&&B"); --> displays "A B"

Is it possible to display the '&' character in a TableColumn? Or is this
a bug with the SWT Table?

Thanks in advance.

Matthew
Re: Table Column: displaying the & character [message #464504 is a reply to message #464409] Wed, 23 November 2005 15:35 Go to previous messageGo to next message
Veronika Irvine is currently offline Veronika IrvineFriend
Messages: 1272
Registered: July 2009
Senior Member
From TableColumn.setText() for Windows:

/*
* Bug in Windows. When a column header contains a
* mnemonic character, Windows does not measure the
* text properly. This causes '...' to always appear
* at the end of the text. The fix is to remove
* mnemonic characters and replace doubled mnemonics
* with spaces.
*/

"Matthew Ma" <matthew1801@hotmail.com> wrote in message
news:4bf994fab5717e467cf89f5b9805bfb4$1@www.eclipse.org...
> Hi,
>
> I am using an SWT Table, trying to display an '&' character in a table
> column. I have tried the following without success:
>
> TableColumn col = new TableColumn(table, SWT.LEFT);
>
> col.setText("A&B"); --> displays "AB"
> col.setText("A&&B"); --> displays "A B"
> col.setText("A\&B"); --> displays "AB"
> col.setText("A\&&B"); --> displays "A B"
>
> Is it possible to display the '&' character in a TableColumn? Or is this
> a bug with the SWT Table?
>
> Thanks in advance.
>
> Matthew
>
>
Re: Table Column: displaying the & character [message #464536 is a reply to message #464409] Thu, 24 November 2005 01:37 Go to previous message
Daniel Spiewak is currently offline Daniel SpiewakFriend
Messages: 263
Registered: July 2009
Senior Member
For the '&' character, use '&&'.
Previous Topic:JFace outside eclipse still needs eclipse core runtime?
Next Topic:Problems with syncExec on Windows Mobile 2005
Goto Forum:
  


Current Time: Thu Apr 25 04:32:39 GMT 2024

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

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

Back to the top