1 package org
.argeo
.cms
.swt
.app
;
3 import java
.util
.HashSet
;
6 import org
.argeo
.api
.acr
.Content
;
7 import org
.argeo
.api
.acr
.ContentRepository
;
8 import org
.argeo
.api
.cms
.CmsContext
;
9 import org
.argeo
.api
.cms
.CmsUi
;
10 import org
.argeo
.api
.cms
.CmsView
;
11 import org
.argeo
.cms
.AbstractCmsApp
;
12 import org
.argeo
.cms
.swt
.CmsSwtUi
;
13 import org
.argeo
.cms
.swt
.CmsSwtUtils
;
14 import org
.argeo
.cms
.swt
.acr
.AcrContentTreeView
;
15 import org
.argeo
.cms
.swt
.auth
.CmsLogin
;
16 import org
.eclipse
.swt
.SWT
;
17 import org
.eclipse
.swt
.widgets
.Composite
;
19 public class CmsUserApp
extends AbstractCmsApp
{
20 private ContentRepository contentRepository
;
23 public Set
<String
> getUiNames() {
24 Set
<String
> uiNames
= new HashSet
<>();
31 public CmsUi
initUi(Object uiParent
) {
32 Composite parent
= (Composite
) uiParent
;
33 String uiName
= parent
.getData(UI_NAME_PROPERTY
) != null ? parent
.getData(UI_NAME_PROPERTY
).toString() : null;
34 CmsSwtUi cmsUi
= new CmsSwtUi(parent
, SWT
.NONE
);
35 if ("login".equals(uiName
)) {
36 CmsView cmsView
= CmsSwtUtils
.getCmsView(cmsUi
);
37 CmsLogin cmsLogin
= new CmsLogin(cmsView
, getCmsContext());
38 cmsLogin
.createUi(cmsUi
);
40 } else if ("data".equals(uiName
)) {
41 Content rootContent
= contentRepository
.get().get("/");
42 AcrContentTreeView view
= new AcrContentTreeView(cmsUi
, 0, rootContent
);
43 view
.setLayoutData(CmsSwtUtils
.fillAll());
50 public void refreshUi(CmsUi cmsUi
, String state
) {
54 public void setState(CmsUi cmsUi
, String state
) {
55 // TODO Auto-generated method stub
59 public void setContentRepository(ContentRepository contentRepository
) {
60 this.contentRepository
= contentRepository
;