Use of app.framework.options.EnumOption.getDialogText
We have
/**
* Returns the text to use for the radio button for the given option value, in the option dialog.
*
* <p>
* For options that are not shown in the option dialog, just return a dummy value ({@code null} for instance).
* </p>
*
* <p>
* Example text: {@code "Abc solver"}.
* </p>
*
* @param value The option value.
* @return The text to use for the radio button.
*/
protected abstract String getDialogText(T value);
It suggests that a text should be provided for a given enum value without limitations. In the interest of keeping command-line and GUI related, one would likely want to use the same values at both spots.
The command-line version however does hard-coded resolving of option values against the text of the enum value with some rewriting. There is no room for picking a nice name there other than by changing the enum value name.
So in my view, the current getDialogText
is practically useless, and in fact counter-productive as you have to manually keep names in sync between enum value names and names provided by implementing the getDialogText
. function.
I can see two paths to fix this. One path is to discard the above function and do a reverse rewriting to get the text-name. The other path is to discard the current resolve mechanism, and replace it by using text returned by this function instead.