// optional subject to be set explicitly
private Subject subject = null;
- public CmsLogin(CmsView cmsView) {
+ private CmsContext cmsContext;
+
+ public CmsLogin(CmsView cmsView, CmsContext cmsContext) {
this.cmsView = cmsView;
- CmsContext nodeState = null;// = Activator.getNodeState();
- // FIXME reactivate locales
- if (nodeState != null) {
- defaultLocale = nodeState.getDefaultLocale();
- List<Locale> locales = nodeState.getLocales();
+ this.cmsContext = cmsContext;
+ if (this.cmsContext != null) {
+ defaultLocale = this.cmsContext.getDefaultLocale();
+ List<Locale> locales = this.cmsContext.getLocales();
if (locales != null)
localeChoice = new LocaleChoice(locales, defaultLocale);
} else {
package org.argeo.cms.swt.auth;
+import org.argeo.api.cms.CmsContext;
import org.argeo.api.cms.CmsView;
import org.argeo.cms.swt.CmsSwtUtils;
import org.eclipse.swt.SWT;
public class CmsLoginShell extends CmsLogin {
private final Shell shell;
- public CmsLoginShell(CmsView cmsView) {
- super(cmsView);
+ public CmsLoginShell(CmsView cmsView, CmsContext cmsContext) {
+ super(cmsView, cmsContext);
shell = createShell();
// createUi(shell);
}
public Shell getShell() {
return shell;
}
-
- public void createUi(){
+
+ public void createUi() {
createUi(shell);
}
}
private final Node context;
public UserMenu(Control source, Node context) {
- super(CmsUiUtils.getCmsView());
+ // FIXME pass CMS context
+ super(CmsUiUtils.getCmsView(), null);
this.context = context;
createUi();
if (source == null)
Subject subject = Subject.getSubject(AccessController.getContext());
Display display = Display.getCurrent();
// UiContext.setData(CmsView.KEY, this);
- CmsLoginShell loginShell = new CmsLoginShell(this);
+ // FIXME get CMS context
+ CmsLoginShell loginShell = new CmsLoginShell(this, null);
CmsSwtUtils.registerCmsView(loginShell.getShell(), this);
loginShell.setSubject(subject);
try {