I prefer the static properties in the Messages class unless anyone feels strongly about getString.
Greg On Sep 3, 2008, at 11:03 AM, Hong Chang Lin wrote: Re: The former is better if Greg's suggestion is adopted; the latter one is good for Daniel's - Will we use a getString (or similar) method to read the string for a given key? Or will we use the "public class Messages extends NLS" as adopted by Eclipse Platform (each message is a static property in the Messages class that extends NLS, and all are strings automatically read from the properties file once the class is referenced for the first time)? Best Regards, ------ Hongchang Lin <graycol.gif>Daniel Felix Ferber <dfferber@xxxxxxxxxxxxxxxxxx> | <ecblank.gif> To | <ecblank.gif> Parallel Tools Platform general developers <ptp-dev@xxxxxxxxxxx> | <ecblank.gif> cc | <ecblank.gif> | <ecblank.gif> Subject | <ecblank.gif> Re: [ptp-dev] Externalized messages on PTP | <ecblank.gif> | <ecblank.gif> | | I still prefer using Eclipse tool to externalize strings. (right clicking over the package or source file and then Source->Externalize Strings). By default, it externalizes strings into a messages.properties and a Messages.java file inside the same package. Fortunately, it is also possible to change setting of the externalize dialog to put messages into a messages.properties and a Messages.java from another package. That would fit the approach described by Greg. However, the dialog needs to be re-configured for every java file that it analyses. Unfortunately, the dialog does not remember the settings, nor are there preferences. Therefore, Gregs suggestion would be fine for me, since it also works with the automatic externalization tool, although in a more cumbersome way. I think there are other decisions to be taken: - Will we use a getString (or similar) method to read the string for a given key? Or will we use the "public class Messages extends NLS" as adopted by Eclipse Platform (each message is a static property in the Messages class that extends NLS, and all are strings automatically read from the properties file once the class is referenced for the first time)? - Are we going to use a prefix for the keys that identify the strings? By default, the externalization dialog uses the class name as prefix, other other (including none) prefixes are possible. Best regards, Daniel Felix Ferber Greg Watson wrote: _______________________________________________ ptp-dev mailing list ptp-dev@xxxxxxxxxxx https://dev.eclipse.org/mailman/listinfo/ptp-dev _______________________________________________ ptp-dev mailing list ptp-dev@xxxxxxxxxxx https://dev.eclipse.org/mailman/listinfo/ptp-dev
|