Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » TableColumn.setText - doesnt display '&' within String(TableColumn.setText - doesnt display '&' within String)
TableColumn.setText - doesnt display '&' within String [message #527243] Wed, 14 April 2010 14:54 Go to next message
Jatin is currently offline Jatin
Messages: 7
Registered: April 2010
Location: United States
Junior Member
String [] columns = new String [] {"id", "Text(Editable)","button","Text&(NoEdit)", "combo", "spinner", "progress"};

for (int i = 0; i < columns.length; ++i) {
final String colName = columns[i];
logger.debug("Adding Col "+colName);
TableColumn col = new TableColumn(table, SWT.NONE);
col.setAlignment(SWT.CENTER);
col.setText(colName);
col.setAlignment(SWT.LEFT);
}

creates table with column names:
id, Text(Editable),button,Text(NoEdit), combo, spinner, progress

My Logger does display Adding Col: Text&(NoEdit). But created table have column name as Text(NoEdit).
Please help me to fix this.

Thanks
Jatin Vasa
Re: TableColumn.setText - doesnt display '&' within String [message #527249 is a reply to message #527243] Wed, 14 April 2010 15:07 Go to previous messageGo to next message
Daniel Krügler is currently offline Daniel Krügler
Messages: 853
Registered: July 2009
Senior Member
On 14.04.2010 16:54, Jatin wrote:
> String [] columns = new String [] {"id",
> "Text(Editable)","button","Text&(NoEdit)", "combo", "spinner", "progress"};
>
> for (int i = 0; i < columns.length; ++i) {
> final String colName = columns[i];
> logger.debug("Adding Col "+colName);
> TableColumn col = new TableColumn(table, SWT.NONE);
> col.setAlignment(SWT.CENTER);
> col.setText(colName);
> col.setAlignment(SWT.LEFT);
> }
>
> creates table with column names:
> id, Text(Editable),button,Text(NoEdit), combo, spinner, progress
>
> My Logger does display Adding Col: Text&(NoEdit). But created table have
> column name as Text(NoEdit). Please help me to fix this.

You need to write && instead of &, if I remember correctly.

HTH & Greetings from Bremen,

Daniel Krügler
Re: TableColumn.setText - doesnt display '&' within String [message #527259 is a reply to message #527249] Wed, 14 April 2010 15:30 Go to previous messageGo to next message
Jatin is currently offline Jatin
Messages: 7
Registered: April 2010
Location: United States
Junior Member
Thanks Daniel

I tried that before. It doesn't work.

Thanks
Jatin Vasa
Re: TableColumn.setText - doesnt display '&' within String [message #527378 is a reply to message #527259] Thu, 15 April 2010 06:09 Go to previous messageGo to next message
Daniel Krügler is currently offline Daniel Krügler
Messages: 853
Registered: July 2009
Senior Member
On 14.04.2010 17:30, Jatin wrote:
> Thanks Daniel
>
> I tried that before. It doesn't work.

You are right, I just found that there is a open issue with this,
so vote for

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

Greetings from Bremen,

Daniel Krügler
Re: TableColumn.setText - doesnt display '&' within String [message #538538 is a reply to message #527378] Mon, 07 June 2010 21:58 Go to previous message
Jatin is currently offline Jatin
Messages: 7
Registered: April 2010
Location: United States
Junior Member
Hi Daniel

Any luck on above '&' issue. I am trying to display '&' on TableColumn. It doesn't show up.

Please help me if you have any turn around solution to this.

Regards
Jatin Vasa
Previous Topic:Whatever happend to the book "SWT: The Standard Widget Toolkit, Volume 2"?
Next Topic:Removing columns from viewers
Goto Forum:
  


Current Time: Fri Oct 31 05:56:32 GMT 2014

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

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