Fix glitches
[gpl/argeo-suite.git] / org.argeo.suite.web / src / org / argeo / suite / fs / MyFilesBrowserPage.java
1 package org.argeo.suite.fs;
2
3 import java.nio.file.spi.FileSystemProvider;
4
5 import javax.jcr.Node;
6 import javax.jcr.RepositoryException;
7
8 import org.argeo.cms.auth.CurrentUser;
9 import org.argeo.cms.ui.CmsUiProvider;
10 import org.argeo.cms.ui.fs.CmsFsBrowser;
11 import org.argeo.eclipse.ui.EclipseUiUtils;
12 import org.eclipse.swt.SWT;
13 import org.eclipse.swt.widgets.Composite;
14 import org.eclipse.swt.widgets.Control;
15
16 /** Default file browser page for the CMS */
17 public class MyFilesBrowserPage implements CmsUiProvider {
18
19 private FileSystemProvider nodeFileSystemProvider;
20
21 public MyFilesBrowserPage(FileSystemProvider nodeFileSystemProvider) {
22 this.nodeFileSystemProvider = nodeFileSystemProvider;
23 }
24
25 @Override
26 public Control createUi(Composite parent, Node context) throws RepositoryException {
27 parent.setLayout(EclipseUiUtils.noSpaceGridLayout());
28
29 if (CurrentUser.isAnonymous())
30 // TODO implement public file display
31 return null;
32
33 CmsFsBrowser browser = new CmsFsBrowser(parent, SWT.NO_FOCUS, context, nodeFileSystemProvider);
34 browser.setLayoutData(EclipseUiUtils.fillAll());
35
36 // TODO set input on the default home folder parent for one user's
37 // files
38 return browser;
39 }
40 }