/** * Load user details by {@link BaseEntity#getCreatedBy()} and format the * user name. Use {@link UserDetailsFormatter#loadAndFormatUsername(String)} * * @param baseEntity * the entity * @return the formatted 'created at user name' (max 100 characters) cannot * be <null> */ public static String loadAndFormatCreatedBy(final BaseEntity baseEntity) { if (baseEntity == null || baseEntity.getCreatedBy() == null) { return ""; } return loadAndFormatUsername(baseEntity.getCreatedBy()); }
/** * Load user details by {@link BaseEntity#getCreatedBy()} and format the * user name. Use {@link UserDetailsFormatter#loadAndFormatUsername(String)} * * @param baseEntity * the entity * @return the formatted 'created at user name' (max 100 characters) cannot * be <null> */ public static String loadAndFormatCreatedBy(final BaseEntity baseEntity) { if (baseEntity == null || baseEntity.getCreatedBy() == null) { return ""; } return loadAndFormatUsername(baseEntity.getCreatedBy()); }
/** * Create label which represents the {@link BaseEntity#getCreatedBy()} by * user name * * @param i18n * the i18n * @param baseEntity * the entity * @return the label */ public static Label createCreatedByLabel(final VaadinMessageSource i18n, final BaseEntity baseEntity) { return createUsernameLabel(i18n.getMessage("label.created.by"), baseEntity == null ? "" : baseEntity.getCreatedBy()); }
/** * Create label which represents the {@link BaseEntity#getCreatedBy()} by * user name * * @param i18n * the i18n * @param baseEntity * the entity * @return the label */ public static Label createCreatedByLabel(final VaadinMessageSource i18n, final BaseEntity baseEntity) { return createUsernameLabel(i18n.getMessage("label.created.by"), baseEntity == null ? "" : baseEntity.getCreatedBy()); }