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
.argeo
.node
.NodeUtils
;
31 import org
.eclipse
.swt
.SWT
;
32 import org
.eclipse
.swt
.widgets
.Composite
;
34 /** Browse the node file system. */
35 public class NodeFsBrowserView
{
36 // public final static String ID = WorkbenchUiPlugin.PLUGIN_ID +
37 // ".nodeFsBrowserView";
40 FileSystemProvider nodeFileSystemProvider
;
43 public void createPartControl(Composite parent
) {
45 //URI uri = new URI("node://root:demo@localhost:7070/");
46 URI uri
= new URI("node:///");
47 FileSystem fileSystem
= nodeFileSystemProvider
.getFileSystem(uri
);
48 if (fileSystem
== null)
49 fileSystem
= nodeFileSystemProvider
.newFileSystem(uri
, null);
50 Path nodePath
= fileSystem
.getPath("~");
52 Path localPath
= Paths
.get(System
.getProperty("user.home"));
54 SimpleFsBrowser browser
= new SimpleFsBrowser(parent
, SWT
.NO_FOCUS
);
55 browser
.setInput(nodePath
, localPath
);
56 // AdvancedFsBrowser browser = new AdvancedFsBrowser();
57 // browser.createUi(parent, localPath);
58 } catch (Exception e
) {
59 throw new CmsException("Cannot open file system browser", e
);
63 public void setFocus() {