+ private class CmsEntryPointFactory implements EntryPointFactory {
+ private final CmsUiProvider page;
+ private final Repository repository;
+ private final String workspace;
+ private final Map<String, String> properties;
+
+ public CmsEntryPointFactory(CmsUiProvider page, Repository repository,
+ String workspace, Map<String, String> properties) {
+ this.page = page;
+ this.repository = repository;
+ this.workspace = workspace;
+ this.properties = properties;
+ }
+
+ @Override
+ public EntryPoint create() {
+ CmsEntryPoint entryPoint = new CmsEntryPoint(repository, workspace,
+ page, properties);
+ entryPoint.setState("");
+ CmsSession.current.set(entryPoint);
+ return entryPoint;
+ }
+
+ }
+
+ private class CmsEntryPoint extends AbstractCmsEntryPoint {
+ private Composite headerArea;
+ private Composite bodyArea;
+ private final CmsUiProvider uiProvider;
+
+ public CmsEntryPoint(Repository repository, String workspace,
+ CmsUiProvider uiProvider, Map<String, String> factoryProperties) {
+ super(repository, workspace, factoryProperties);
+ this.uiProvider = uiProvider;
+ }
+
+ @Override
+ protected void createContents(Composite parent) {
+ try {
+ getShell().getDisplay().setData(CmsSession.KEY, this);
+
+ parent.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true,
+ true));
+ parent.setLayout(CmsUtils.noSpaceGridLayout());
+
+ headerArea = new Composite(parent, SWT.NONE);
+ headerArea.setLayout(new FillLayout());
+ GridData headerData = new GridData(SWT.FILL, SWT.FILL, false,
+ false);
+ headerData.heightHint = headerHeight;
+ headerArea.setLayoutData(headerData);
+ refreshHeader();
+
+ bodyArea = new Composite(parent, SWT.NONE);
+ bodyArea.setData(RWT.CUSTOM_VARIANT, CmsStyles.CMS_BODY);
+ bodyArea.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true,
+ true));
+ // Should not be set here: it then prevent all children
+ // composite to define a background color via CSS
+ // bodyArea.setBackgroundMode(SWT.INHERIT_DEFAULT);
+ bodyArea.setLayout(CmsUtils.noSpaceGridLayout());
+ refreshBody();
+ } catch (Exception e) {
+ throw new CmsException("Cannot create entrypoint contents", e);
+ }
+ }
+
+ @Override
+ protected void refreshHeader() {
+ if (headerArea == null)
+ return;
+ for (Control child : headerArea.getChildren())
+ child.dispose();
+ try {
+ header.createUi(headerArea, getNode());
+ } catch (RepositoryException e) {
+ throw new CmsException("Cannot refresh header", e);
+ }
+ headerArea.layout(true, true);
+ }