+
+ static private <E extends Enum<E>> String idToName(E id, E prefix) {
+ String name = id.toString();
+ if (prefix != null && name.startsWith(prefix.toString())) {
+ name = name.substring(prefix.toString().length());
+ }
+
+ if (name.length() > 0) {
+ name = name.substring(0, 1).toUpperCase()
+ + name.substring(1).toLowerCase();
+ }
+
+ name = name.replace("_", " ");
+
+ return name.trim();
+ }