From 3864980d94e85196b8819f500adfb371a5012eb1 Mon Sep 17 00:00:00 2001 From: Roland Haeder Date: Thu, 14 Apr 2016 17:24:25 +0200 Subject: [PATCH] Added CSS style class for being used in JSF pages like: styleClass="#{user.userAccountStatus.styleClass}" --- .../model/user/status/UserAccountStatus.java | 31 ++++++++++++++----- 1 file changed, 24 insertions(+), 7 deletions(-) diff --git a/src/org/mxchange/jusercore/model/user/status/UserAccountStatus.java b/src/org/mxchange/jusercore/model/user/status/UserAccountStatus.java index 328f124..61c968b 100644 --- a/src/org/mxchange/jusercore/model/user/status/UserAccountStatus.java +++ b/src/org/mxchange/jusercore/model/user/status/UserAccountStatus.java @@ -28,39 +28,56 @@ public enum UserAccountStatus implements Serializable { /** * Unconfirmed (default) */ - UNCONFIRMED("USER_ACCOUNT_STATUS_UNCONFIRMED"), //NOI18N + UNCONFIRMED("USER_ACCOUNT_STATUS_UNCONFIRMED", "user_status_unconfirmed"), //NOI18N /** * Confirmed (email address validated) */ - CONFIRMED("USER_ACCOUNT_STATUS_CONFIRMED"), //NOI18N + CONFIRMED("USER_ACCOUNT_STATUS_CONFIRMED", "user_status_confirmed"), //NOI18N /** * Locked (maybe violated T&C) */ - LOCKED("USER_ACCOUNT_STATUS_LOCKED"); //NOI18N + LOCKED("USER_ACCOUNT_STATUS_LOCKED", "user_status_locked"); //NOI18N /** * Message key */ private final String messageKey; + /** + * CSS style class + */ + private final String styleClass; + /** * Constructor with i18n translation key *

- * @param messageKey Message key (i18n) + * @param messageKey Message key (i18n) + * @param styyleClass CSS style class */ - private UserAccountStatus (final String messageKey) { + private UserAccountStatus (final String messageKey, final String styleClass) { // Set it here this.messageKey = messageKey; + this.styleClass = styleClass; } /** - * Output value (for messages) + * Getter for message key *

- * @return the messageKey + * @return Message key (i18n) */ public String getMessageKey () { return this.messageKey; } + + /** + * Getter for CSS style class + *

+ * @return CSS style class + */ + public String getStyleClass () { + return this.styleClass; + } + } -- 2.39.5