Support for NLS.bind

SWT Designer allows you to create the views, editors, perspectives, pref pages, composites, etc. that comprise Eclipse SWT & RCP applications and plug-ins.

Moderators: Konstantin.Scheglov, gnebling, Alexander.Mitin, jwren, Eric Clayberg

Support for NLS.bind

Postby ralf.ebert » Thu Dec 02, 2010 5:38 am

When writing code using NLS.bind to replace placeholders like "It's {0} now\!" in message values, like:

String date = String.valueOf(new Date());
Button button1 = new Button(parent, SWT.NONE);
button1.setText(NLS.bind(Messages.Date, date));

Window Builder interprets this and offers to edit the bound/formatted String like "It's Thu Dec 02 14:42:18 CET 2010 now!" in Design mode. The i18n documentation chapter says nothing about this, is there some support for format strings/property placeholders?
Posts: 1
Joined: Thu Dec 02, 2010 5:27 am

Re: Support for NLS.bind

Postby Eric Clayberg » Mon Dec 06, 2010 4:48 am

WindowBuilder does not support that pattern, so you would need to edit that code by hand.
Eric Clayberg
Software Engineering Manager

Author: "Eclipse Plug-ins"
Eric Clayberg
Posts: 4503
Joined: Tue Sep 30, 2003 6:39 am
Location: Boston, MA USA

Return to SWT Designer

Who is online

Users browsing this forum: Bing [Bot] and 1 guest