mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-06-08 18:26:01 +02:00
Bug 472329: URI to path conversion in RemoteResourceBrowserWidget
Change-Id: I30987936c889c593d1ca14dff97fefe441708b1e Signed-off-by: Markus Schorn <markus.schorn@windriver.com>
This commit is contained in:
parent
db74024720
commit
a09aefd312
1 changed files with 790 additions and 785 deletions
|
@ -12,6 +12,7 @@
|
|||
package org.eclipse.remote.ui.widgets;
|
||||
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.net.URI;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
|
@ -185,7 +186,7 @@ public class RemoteResourceBrowserWidget extends Composite {
|
|||
private String fDialogLabel;
|
||||
|
||||
private boolean fShowHidden;
|
||||
private final List<IFileStore> fResources = new ArrayList<IFileStore>();
|
||||
private final List<IFileStore> fResources = new ArrayList<>();
|
||||
private String fResource;
|
||||
private String fInitialPath;
|
||||
private IPath fRootPath;
|
||||
|
@ -304,7 +305,7 @@ public class RemoteResourceBrowserWidget extends Composite {
|
|||
TreePath treePath = treePaths[0];
|
||||
if (treePath.getLastSegment() instanceof DeferredFileStore) {
|
||||
DeferredFileStore element = ((DeferredFileStore) treePath.getLastSegment());
|
||||
String path = element.getFileStore().toURI().getPath();
|
||||
String path = toPath(element.getFileStore().toURI());
|
||||
String newPath = createNewFolder(path);
|
||||
if (newPath != null) {
|
||||
fTreeViewer.expandToLevel(element, 1);
|
||||
|
@ -322,7 +323,7 @@ public class RemoteResourceBrowserWidget extends Composite {
|
|||
}
|
||||
} else {
|
||||
DeferredFileStore root = (DeferredFileStore) fTreeViewer.getInput();
|
||||
String path = root.getFileStore().toURI().getPath();
|
||||
String path = toPath(root.getFileStore().toURI());
|
||||
String newPath = createNewFolder(path);
|
||||
if (newPath != null) {
|
||||
fTreeViewer.refresh();
|
||||
|
@ -372,7 +373,7 @@ public class RemoteResourceBrowserWidget extends Composite {
|
|||
}
|
||||
}
|
||||
if (fResources.size() > 0) {
|
||||
fRemotePathText.setText(fResources.get(0).toURI().getPath());
|
||||
fRemotePathText.setText(toPath(fResources.get(0).toURI()));
|
||||
}
|
||||
updateEnablement();
|
||||
notifySelectionChangedListeners(event);
|
||||
|
@ -421,6 +422,10 @@ public class RemoteResourceBrowserWidget extends Composite {
|
|||
updateEnablement();
|
||||
}
|
||||
|
||||
private String toPath(URI uri) {
|
||||
return getConnection().getService(IRemoteFileService.class).toPath(uri);
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a listener that will be notified when the selection is changed.
|
||||
*
|
||||
|
|
Loading…
Add table
Reference in a new issue