]>
git.argeo.org Git - lgpl/argeo-commons.git/blob - providers/RoleIconLP.java
1 package org
.argeo
.security
.ui
.admin
.internal
.providers
;
3 import org
.argeo
.cms
.auth
.AuthConstants
;
4 import org
.argeo
.security
.ui
.admin
.SecurityAdminImages
;
5 import org
.eclipse
.swt
.graphics
.Image
;
6 import org
.osgi
.service
.useradmin
.Role
;
7 import org
.osgi
.service
.useradmin
.User
;
9 /** Provide a bundle specific image depending on the current user type */
10 public class RoleIconLP
extends UserAdminAbstractLP
{
11 private static final long serialVersionUID
= 6550449442061090388L;
14 public String
getText(User user
) {
19 public Image
getImage(Object element
) {
20 User user
= (User
) element
;
21 String dn
= user
.getName();
22 if (dn
.endsWith(AuthConstants
.ROLES_BASEDN
))
23 return SecurityAdminImages
.ICON_ROLE
;
24 else if (user
.getType() == Role
.GROUP
)
25 return SecurityAdminImages
.ICON_GROUP
;
27 return SecurityAdminImages
.ICON_USER
;