Put Eclipse and JCR components in subdirs in order to clarify indirect
[lgpl/argeo-commons.git] / org.argeo.cms.e4 / src / org / argeo / cms / e4 / parts / EgoDashboard.java
diff --git a/org.argeo.cms.e4/src/org/argeo/cms/e4/parts/EgoDashboard.java b/org.argeo.cms.e4/src/org/argeo/cms/e4/parts/EgoDashboard.java
deleted file mode 100644 (file)
index 5a805d1..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-package org.argeo.cms.e4.parts;
-
-import java.security.AccessController;
-import java.time.ZonedDateTime;
-
-import javax.annotation.PostConstruct;
-import javax.security.auth.Subject;
-
-import org.argeo.api.cms.CmsSession;
-import org.argeo.cms.auth.CurrentUser;
-import org.argeo.cms.osgi.CmsOsgiUtils;
-import org.argeo.cms.swt.CmsSwtUtils;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.osgi.framework.BundleContext;
-import org.osgi.framework.FrameworkUtil;
-
-/** A canonical view of the logged in user. */
-public class EgoDashboard {
-       private BundleContext bc = FrameworkUtil.getBundle(EgoDashboard.class).getBundleContext();
-
-       @PostConstruct
-       public void createPartControl(Composite p) {
-               p.setLayout(new GridLayout());
-               String username = CurrentUser.getUsername();
-
-               CmsSwtUtils.lbl(p, "<strong>" + CurrentUser.getDisplayName() + "</strong>");
-               CmsSwtUtils.txt(p, username);
-               CmsSwtUtils.lbl(p, "Roles:");
-               roles: for (String role : CurrentUser.roles()) {
-                       if (username.equals(role))
-                               continue roles;
-                       CmsSwtUtils.txt(p, role);
-               }
-
-               Subject subject = Subject.getSubject(AccessController.getContext());
-               if (subject != null) {
-                       CmsSession cmsSession = CmsOsgiUtils.getCmsSession(bc, subject);
-                       ZonedDateTime loggedIndSince = cmsSession.getCreationTime();
-                       CmsSwtUtils.lbl(p, "Session:");
-                       CmsSwtUtils.txt(p, cmsSession.getUuid().toString());
-                       CmsSwtUtils.lbl(p, "Logged in since:");
-                       CmsSwtUtils.txt(p, loggedIndSince.toString());
-               }
-       }
-}