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 03:20 Go to next message
Eclipse User
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 10:35 Go to previous messageGo to next message
Veronika Irvine is currently offline Veronika Irvine
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] Wed, 23 November 2005 20:37 Go to previous message
Daniel Spiewak is currently offline Daniel Spiewak
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: Tue Jul 22 17:52:05 EDT 2014

Powered by FUDForum. Page generated in 0.01970 seconds