2 * Copyright (C) 2007-2012 Argeo GmbH
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
16 package org
.argeo
.cms
.e4
.files
;
19 import java
.nio
.file
.FileSystem
;
20 import java
.nio
.file
.Path
;
21 import java
.nio
.file
.Paths
;
22 import java
.nio
.file
.spi
.FileSystemProvider
;
24 import javax
.annotation
.PostConstruct
;
25 import javax
.inject
.Inject
;
27 import org
.argeo
.cms
.CmsException
;
28 import org
.argeo
.eclipse
.ui
.fs
.AdvancedFsBrowser
;
29 import org
.argeo
.eclipse
.ui
.fs
.SimpleFsBrowser
;
30 import org
.eclipse
.swt
.SWT
;
31 import org
.eclipse
.swt
.widgets
.Composite
;
33 /** Browse the node file system. */
34 public class NodeFsBrowserView
{
35 // public final static String ID = WorkbenchUiPlugin.PLUGIN_ID +
36 // ".nodeFsBrowserView";
39 FileSystemProvider nodeFileSystemProvider
;
42 public void createPartControl(Composite parent
) {
44 //URI uri = new URI("node://root:demo@localhost:7070/");
45 URI uri
= new URI("node:///");
46 FileSystem fileSystem
= nodeFileSystemProvider
.getFileSystem(uri
);
47 if (fileSystem
== null)
48 fileSystem
= nodeFileSystemProvider
.newFileSystem(uri
, null);
49 Path nodePath
= fileSystem
.getPath("/");
51 Path localPath
= Paths
.get(System
.getProperty("user.home"));
53 SimpleFsBrowser browser
= new SimpleFsBrowser(parent
, SWT
.NO_FOCUS
);
54 browser
.setInput(nodePath
, localPath
);
55 // AdvancedFsBrowser browser = new AdvancedFsBrowser();
56 // browser.createUi(parent, localPath);
57 } catch (Exception e
) {
58 throw new CmsException("Cannot open file system browser", e
);
62 public void setFocus() {