]> git.argeo.org Git - gpl/argeo-suite.git/blob - core/org.argeo.suite.ui/src/org/argeo/suite/ui/DefaultDashboard.java
Use " instead of ' in map.
[gpl/argeo-suite.git] / core / org.argeo.suite.ui / src / org / argeo / suite / ui / DefaultDashboard.java
1 package org.argeo.suite.ui;
2
3 import javax.jcr.Node;
4 import javax.jcr.RepositoryException;
5
6 import org.argeo.cms.auth.CurrentUser;
7 import org.argeo.cms.ui.CmsUiProvider;
8 import org.argeo.cms.ui.CmsView;
9 import org.eclipse.swt.SWT;
10 import org.eclipse.swt.layout.GridLayout;
11 import org.eclipse.swt.widgets.Composite;
12 import org.eclipse.swt.widgets.Control;
13 import org.eclipse.swt.widgets.Label;
14
15 /** Provides a dashboard. */
16 public class DefaultDashboard implements CmsUiProvider {
17
18 @Override
19 public Control createUi(Composite parent, Node context) throws RepositoryException {
20 parent.setLayout(new GridLayout());
21 CmsView cmsView = CmsView.getCmsView(parent);
22 if (cmsView.isAnonymous())
23 throw new IllegalStateException("No user is not logged in");
24
25 Label lbl = new Label(parent, SWT.NONE);
26 lbl.setText("Welcome " + CurrentUser.getDisplayName() + "!");
27
28 return lbl;
29 }
30
31 }