title: Configuring string externalization in Eclipse to use ${key} as field name
body: <p>Suppose I have a simple code like this:</p>
  
  <pre><code>public class ExternalizeStringDemo {
      public static void main(String[] args) {
          System.out.println("Hello world");
      }
  }
  </code></pre>
  
  <p>Now, I want to externalize the greeting, perhaps to facilitate internationalization/localization/etc. Using Eclipse, I can use the String Externalization wizard (Source/Externalize Strings), and configure it like this:</p>
  
  <p><img src="https://i.stack.imgur.com/q1zGO.png" alt="alt text"></p>
  
  <p>I can proceed with the wizard and it will propose these changes:</p>
  
  <ul>
  <li>Create file <code>Personal Toys/src/Messages.java</code></li>
  <li>Create file <code>Personal Toys/src/messages.properties</code></li>
  <li>Edit <code>ExternalizeStringDemo.java</code>
  
  <ul>
  <li><code>"Hello World"</code> becomes <code>Messages.getString("DEMO_GREETING")</code></li>
  </ul></li>
  </ul>
  
  <p>My question is simple: can I ask Eclipse to externalize the access to use the key as field names instead? That is, I want the access to be e.g. <code>Messages.DEMO_GREETING</code>.</p>
  
  <p>Note: if the <code>[Substitution pattern]</code> is simple <code>${key}</code>, then the generated code is <code>Messages."DEMO_GREETING"</code>, which is not a valid Java code.</p>
  
  <hr>
  
  <p>If this is not possible, then what's the next best thing? (I'm thinking Eclipse regex find/replace?).</p>