Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeff Johnston2011-10-14 18:40:18 +0000
committerJeff Johnston2011-10-14 18:40:18 +0000
commitc79ee6a2824ece6475224b92cacbbe95167b71a7 (patch)
treee62498aaa910122860bdefba8f4c12a0fe401b1e
parentfc712dc45fde17fc7b2f4b142d13b2843f9154cd (diff)
downloadorg.eclipse.linuxtools-c79ee6a2824ece6475224b92cacbbe95167b71a7.tar.gz
org.eclipse.linuxtools-c79ee6a2824ece6475224b92cacbbe95167b71a7.tar.xz
org.eclipse.linuxtools-c79ee6a2824ece6475224b92cacbbe95167b71a7.zip
Fix remote file access for Autotools UI plug-in.
* src/org/eclipse/linuxtools/cdt/autotools/ui/editors/IAutotoolsEditor.java (getAdaptor): Remove since it is already part of interfaces extended. * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/actions/InvokeAction.java: Rewrite file accesses to not use getLocation() and instead use getLocationURI() since the former returns null for remote files.
-rw-r--r--autotools/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/IAutotoolsEditor.java2
-rw-r--r--autotools/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/actions/InvokeAction.java24
2 files changed, 14 insertions, 12 deletions
diff --git a/autotools/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/IAutotoolsEditor.java b/autotools/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/IAutotoolsEditor.java
index 0a2c73061b..99b8ed3b34 100644
--- a/autotools/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/IAutotoolsEditor.java
+++ b/autotools/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/IAutotoolsEditor.java
@@ -6,8 +6,6 @@ import org.eclipse.ui.texteditor.ITextEditor;
public interface IAutotoolsEditor extends ITextEditor {
- public Object getAdapter(Class<?> key);
-
/**
* Adds the given listener.
* Has no effect if an identical listener was not already registered.
diff --git a/autotools/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/actions/InvokeAction.java b/autotools/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/actions/InvokeAction.java
index 96d90c4f0c..b491033c17 100644
--- a/autotools/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/actions/InvokeAction.java
+++ b/autotools/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/actions/InvokeAction.java
@@ -14,6 +14,7 @@ import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.lang.reflect.InvocationTargetException;
+import java.net.URI;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.StringTokenizer;
@@ -51,6 +52,7 @@ import org.eclipse.linuxtools.cdt.autotools.ui.AutotoolsUIPlugin;
import org.eclipse.linuxtools.internal.cdt.autotools.core.AutotoolsNewMakeGenerator;
import org.eclipse.linuxtools.profiling.launch.IProcess;
import org.eclipse.linuxtools.profiling.launch.IRemoteCommandLauncher;
+import org.eclipse.linuxtools.profiling.launch.IRemoteFileProxy;
import org.eclipse.linuxtools.profiling.launch.RemoteProxyManager;
import org.eclipse.swt.widgets.Shell;
@@ -209,24 +211,26 @@ public abstract class InvokeAction extends AbstractTargetAction {
protected IPath getExecDir(IContainer container) {
int type = container.getType();
+ URI containerURI = container.getLocationURI();
+ String containerPath = "";
+ IRemoteFileProxy proxy;
+ try {
+ proxy = RemoteProxyManager.getInstance().getFileProxy(container.getProject());
+ containerPath = proxy.toPath(containerURI);
+ } catch (CoreException e) {
+ return null;
+ }
IPath execDir = null;
if (type == IContainer.FILE) {
- execDir = container.getLocation().removeLastSegments(1);
+ execDir = new Path(containerPath).removeLastSegments(1);
} else {
- execDir = container.getLocation();
+ execDir = new Path(containerPath);
}
return execDir;
}
protected IPath getCWD(IContainer container) {
- int type = container.getType();
- IPath cwd = null;
- if (type == IContainer.FILE) {
- cwd = container.getFullPath().removeLastSegments(1);
- } else {
- cwd = container.getFullPath();
- }
- return cwd;
+ return getExecDir(container);
}
private class ExecuteProgressDialog implements IRunnableWithProgress {

Back to the top