import javax.naming.InvalidNameException;
import javax.naming.ldap.LdapName;
+import org.argeo.ArgeoException;
+import org.argeo.osgi.useradmin.LdifName;
import org.argeo.security.ui.admin.internal.UiAdminUtils;
import org.argeo.security.ui.admin.internal.UserAdminConstants;
import org.eclipse.jface.resource.JFaceResources;
try {
LdapName selfUserName = UiAdminUtils.getLdapName();
String userName = UiAdminUtils.getProperty((User) element,
- UserAdminConstants.KEY_DN);
+ LdifName.dn.name());
LdapName userLdapName = new LdapName(userName);
- if (userLdapName.equals(selfUserName))
+ if (userLdapName.equals(selfUserName)) {
+ if (bold == null)
+ bold = JFaceResources.getFontRegistry()
+ .defaultFontDescriptor().setStyle(SWT.BOLD)
+ .createFont(Display.getCurrent());
return bold;
+ }
} catch (InvalidNameException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
+ throw new ArgeoException("cannot parse dn for " + element, e);
}
// Disabled as Italic
// italic = JFaceResources.getFontRegistry().defaultFontDescriptor()
// .setStyle(SWT.ITALIC).createFont(display);
bold = JFaceResources.getFontRegistry().defaultFontDescriptor()
- .setStyle(SWT.BOLD).createFont(display);
+ .setStyle(SWT.BOLD).createFont(Display.getCurrent());
}
public abstract String getText(User user);