Clarify implementation-specific APIs
[lgpl/argeo-commons.git] / swt / rap / org.argeo.cms.e4.rap / src / org / argeo / cms / e4 / rap / CmsLoginLifecycle.java
index cdd4899289e59d3ce83751eaff39402a8ed115c1..cdd87fd3f54696688270d7751349efbe1b761b96 100644 (file)
@@ -2,17 +2,20 @@ package org.argeo.cms.e4.rap;
 
 import java.security.AccessController;
 import java.util.UUID;
+import java.util.concurrent.Callable;
 
+import javax.inject.Inject;
 import javax.security.auth.Subject;
 import javax.security.auth.login.LoginContext;
 import javax.security.auth.login.LoginException;
 
 import org.argeo.api.cms.CmsAuth;
+import org.argeo.api.cms.CmsContext;
 import org.argeo.api.cms.CmsLog;
 import org.argeo.api.cms.ux.CmsImageManager;
 import org.argeo.api.cms.ux.CmsView;
 import org.argeo.api.cms.ux.UxContext;
-import org.argeo.cms.auth.CurrentUser;
+import org.argeo.cms.CurrentUser;
 import org.argeo.cms.swt.CmsSwtUtils;
 import org.argeo.cms.swt.SimpleSwtUxContext;
 import org.argeo.cms.swt.acr.AcrSwtImageManager;
@@ -34,6 +37,9 @@ import org.osgi.service.event.EventHandler;
 public class CmsLoginLifecycle implements CmsView {
        private final static CmsLog log = CmsLog.getLog(CmsLoginLifecycle.class);
 
+       @Inject
+       private CmsContext cmsContext;
+       
        private UxContext uxContext;
        private CmsImageManager imageManager;
 
@@ -62,8 +68,7 @@ public class CmsLoginLifecycle implements CmsView {
                Subject subject = Subject.getSubject(AccessController.getContext());
                Display display = Display.getCurrent();
 //             UiContext.setData(CmsView.KEY, this);
-               // FIXME get CMS context
-               CmsLoginShell loginShell = new CmsLoginShell(this, null);
+               CmsLoginShell loginShell = new CmsLoginShell(this, cmsContext);
                CmsSwtUtils.registerCmsView(loginShell.getShell(), this);
                loginShell.setSubject(subject);
                try {
@@ -141,7 +146,7 @@ public class CmsLoginLifecycle implements CmsView {
        public void exception(Throwable e) {
                String msg = "Unexpected exception in Eclipse 4 RAP";
                log.error(msg, e);
-               CmsFeedback.show(msg, e);
+               CmsFeedback.error(msg, e);
        }
 
        @Override
@@ -180,4 +185,9 @@ public class CmsLoginLifecycle implements CmsView {
                return state;
        }
 
+       @Override
+       public <T> T doAs(Callable<T> action) {
+               throw new UnsupportedOperationException();
+       }
+
 }