]>
git.argeo.org Git - lgpl/argeo-commons.git/blob - RoleIconLP.java
f482a16eba5469cd8112cf11be19ec32c7a4fee7
1 package org
.argeo
.cms
.ui
.workbench
.internal
.useradmin
.providers
;
3 import org
.argeo
.cms
.ui
.workbench
.internal
.useradmin
.SecurityAdminImages
;
4 import org
.argeo
.node
.NodeConstants
;
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(NodeConstants
.ROLES_BASEDN
))
23 return SecurityAdminImages
.ICON_ROLE
;
24 else if (user
.getType() == Role
.GROUP
)
25 return SecurityAdminImages
.ICON_GROUP
;
27 return SecurityAdminImages
.ICON_USER
;