Message Bundles | |
Description Standard Java ResourceBundles have quite inefficient space characteristics. Since a running Eclipse tends to have many externalized messages we have implemented a new message bundle story to be used in Eclipse. The mechanism is quite simple and completely generic - it can be used anywhere. Summary of the new approach:
When creating a new message:
|
|
File Formats | |
Client Code Old Code:
New Code:
|
|
Messages.java Old Code:
New Code:
|
|
messages.properties Old Code:
New Code:
|
|
Performance | |
Time
|
|
Memory Footprint
|
|
Other benefits
|
|
Drawbacks
|
|
Tools | |
Conversion We have written a tool which aids in converting from the basic Java resource bundle look-up mechanism, to the new format. There is no requirement to do this conversion unless you want to take advantage of the new mechanism. Note that the message bundle access class is replaced when the tool is run. If you define extra code, constants, etc in that class then please read the notes below to ensure that you don't have problems. Here are the steps to use when converting your code.
Notes: When using the NLS tooling from previous Eclipse releases, the java file
which was created had the format of the "old" Messages.java
file as described above. (basic class with Essentially what you want to do is get your java file into the basic template form. This is possible via using existing refactorings. For instance, if your class defines a method like this:
Then you want to do the following:
|
Eclipse 3.1: Think Fast!