Java - Eclipse: Externalize Strings?

constants, eclipse, ide, java

Solution

Select a literal, right click, Refactor -> Extract Constant... proceed with the wizard.

Problem

It looks like the "Externalize Strings" feature takes everything, makes a `Messages` class, and a .txt file in which to store the Strings themselves. This is interesting, but I've got another way to store constants: ``` public final class Constants { //for parsing commands public static final String REGEX_COMMAND = "(\\w*) *= *\"(.*)\""; //Regex for a command from a data file //etc } ``` Is there any way to get Eclipse to automatically move Strings and other values to here for me?

Original source