static Color forName(String name) { for (BackgroundColor bg : BackgroundColor.values()) { if (bg.name.equals(name)) { return bg.color; } } return null; }
@Override protected Color getRequestedBackgroundColor(HttpServletRequest req) { String str = req != null ? getRequestParameter(req, QPARAM_NAME_BGCOLOR) : null; if (str != null && !str.isEmpty()) { Color named = BackgroundColor.forName(str); return named != null ? named : super.getRequestedBackgroundColor(req); } return null; }