Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Webster2013-10-04 20:42:25 +0000
committerPaul Webster2013-10-04 20:42:25 +0000
commita899e51514c46fba96d0467a5d913fb72de7866f (patch)
treede1a225c8dcec6b7d6131a69f977a69e73883c54
parent3bf83231daed635a149b9878c15a6ed83b93ea13 (diff)
downloadeclipse.platform.ui-change/16726/6.tar.gz
eclipse.platform.ui-change/16726/6.tar.xz
eclipse.platform.ui-change/16726/6.zip
Bug 107436 - [IDE] navigator: show file/folder in "Windows Explorer",change/16726/6
Finder, Nautilus Changed pattern for nautilus on linux
-rw-r--r--bundles/org.eclipse.ui.ide/src/org/eclipse/ui/internal/ide/handlers/ShowInSystemExplorerHandler.java13
-rw-r--r--bundles/org.eclipse.ui.ide/src/org/eclipse/ui/internal/ide/messages.properties2
2 files changed, 8 insertions, 7 deletions
diff --git a/bundles/org.eclipse.ui.ide/src/org/eclipse/ui/internal/ide/handlers/ShowInSystemExplorerHandler.java b/bundles/org.eclipse.ui.ide/src/org/eclipse/ui/internal/ide/handlers/ShowInSystemExplorerHandler.java
index 87eb6b31a44..3016943c1ca 100644
--- a/bundles/org.eclipse.ui.ide/src/org/eclipse/ui/internal/ide/handlers/ShowInSystemExplorerHandler.java
+++ b/bundles/org.eclipse.ui.ide/src/org/eclipse/ui/internal/ide/handlers/ShowInSystemExplorerHandler.java
@@ -44,6 +44,7 @@ public class ShowInSystemExplorerHandler extends AbstractHandler {
public static final String ID = "org.eclipse.ui.showIn.systemExplorer"; //$NON-NLS-1$
private static final String VARIABLE_RE = "\\$\\{selected_resource_loc\\}"; //$NON-NLS-1$
+ private static final String VARIABLE_FOLDER = "\\$\\{selected_resource_parent\\}"; //$NON-NLS-1$
/*
* (non-Javadoc)
@@ -78,7 +79,7 @@ public class ShowInSystemExplorerHandler extends AbstractHandler {
}
try {
- String canonicalPath = getSystemExplorerPath(item);
+ File canonicalPath = getSystemExplorerPath(item);
if (canonicalPath == null) {
ErrorDialog
.openError(
@@ -138,10 +139,11 @@ public class ShowInSystemExplorerHandler extends AbstractHandler {
* the path to show
* @return the command that shows the path
*/
- private String formShowInSytemExplorerCommand(String path) {
+ private String formShowInSytemExplorerCommand(File path) throws IOException {
String command = IDEWorkbenchPlugin.getDefault().getPreferenceStore()
.getString(IDEInternalPreferences.WORKBENCH_SYSTEM_EXPLORER);
- return command.replaceAll(VARIABLE_RE, path);
+ command = command.replaceAll(VARIABLE_RE, path.getCanonicalPath());
+ return command.replaceAll(VARIABLE_FOLDER, path.getParentFile().getCanonicalPath());
}
/**
@@ -156,12 +158,11 @@ public class ShowInSystemExplorerHandler extends AbstractHandler {
* @throws IOException
* if an I/O error occurs while trying to determine the path
*/
- private String getSystemExplorerPath(IResource resource) throws IOException {
+ private File getSystemExplorerPath(IResource resource) throws IOException {
IPath location = resource.getLocation();
if (location == null)
return null;
- File f = location.toFile();
- return f.getCanonicalPath();
+ return location.toFile();
}
/**
diff --git a/bundles/org.eclipse.ui.ide/src/org/eclipse/ui/internal/ide/messages.properties b/bundles/org.eclipse.ui.ide/src/org/eclipse/ui/internal/ide/messages.properties
index cdc9bffea0a..c82807fdc12 100644
--- a/bundles/org.eclipse.ui.ide/src/org/eclipse/ui/internal/ide/messages.properties
+++ b/bundles/org.eclipse.ui.ide/src/org/eclipse/ui/internal/ide/messages.properties
@@ -490,7 +490,7 @@ IDEWorkspacePreference_closeUnrelatedProjectsToolTip = Close unrelated projects
IDEWorkspacePreference_workspaceName=Wor&kspace name (shown in window title):
IDEWorkbenchPreference_workbenchSystemExplorer=Command for launching system explorer.
-ShowInSystemExplorerHandler_LinuxDefaultCommand=gdbus call -e -d org.freedesktop.FileManager1 -o /org/freedesktop/FileManager1 -m org.freedesktop.FileManager1.ShowItems ['file://${selected_resource_loc}'] ''
+ShowInSystemExplorerHandler_LinuxDefaultCommand=nautilus file://${selected_resource_parent}
ShowInSystemExplorerHandler_Win32DefaultCommand=explorer /E,/select=${selected_resource_loc}
ShowInSystemExplorerHandler_MacOSXDefaultCommand=open -R '${selected_resource_loc}'

Back to the top