diff options
author | Markus Keller | 2013-10-07 15:48:07 +0000 |
---|---|---|
committer | Markus Keller | 2013-10-07 15:48:07 +0000 |
commit | 83fa9c2e1bea835f2530836e6bf202b5f216dd95 (patch) | |
tree | bab712ad7458229279ec6b3bc51815d82de030f2 | |
parent | ca55c2ddd83036c310b4752de0f2791b82eb4b0f (diff) | |
download | eclipse.platform.ui-83fa9c2e1bea835f2530836e6bf202b5f216dd95.tar.gz eclipse.platform.ui-83fa9c2e1bea835f2530836e6bf202b5f216dd95.tar.xz eclipse.platform.ui-83fa9c2e1bea835f2530836e6bf202b5f216dd95.zip |
Bug 107436 comment 39: [IDE] navigator: show file/folder in "Windows Explorer", Finder, Nautilus, ...
- Bad command name in menus (requires bug 418836)
- Preference page violated UI guidelines
- Added "system explorer" to
- Didn't work at all on Windows. Fixed bad usage of regex replace in ShowInSystemExplorerHandler.
5 files changed, 19 insertions, 8 deletions
diff --git a/bundles/org.eclipse.ui.ide/plugin.properties b/bundles/org.eclipse.ui.ide/plugin.properties index 91aecfdfe04..5656bc9b81f 100644 --- a/bundles/org.eclipse.ui.ide/plugin.properties +++ b/bundles/org.eclipse.ui.ide/plugin.properties @@ -196,6 +196,8 @@ command.showResourceByPath.description= Show a resource in the Navigator given i commandParameter.showResourceByPath.resourcePath.name= Resource Path command.showInSystemExplorer.name = Show In (System Explorer) +command.showInSystemExplorer.menu.name = System Explorer +command.showInSystemExplorer.menu.mnemonic = s command.showInSystemExplorer.description = Show in system's explorer (file manager) KeyBindingActionSet.label = Keyboard Shortcuts @@ -219,7 +221,7 @@ PreferenceKeywords.Dirty = dirty PreferenceKeywords.Keys = binding command scheme emacs shortcut PreferenceKeywords.Perspectives = open view switch PreferenceKeywords.StartupAndShutdown = workbench plug-in plugin refresh -PreferenceKeywords.Workspace = build refresh save automatically open project line delimiter +PreferenceKeywords.Workspace = build refresh save automatically name system explorer open project line delimiter PreferenceKeywords.LinkedResources = path PreferenceKeywords.Animations = animations PreferenceKeywords.Restore = restore diff --git a/bundles/org.eclipse.ui.ide/plugin.xml b/bundles/org.eclipse.ui.ide/plugin.xml index eaae206e978..3cb0e05bd2a 100644 --- a/bundles/org.eclipse.ui.ide/plugin.xml +++ b/bundles/org.eclipse.ui.ide/plugin.xml @@ -2044,6 +2044,8 @@ locationURI="popup:org.eclipse.ui.menus.showInMenu"> <command commandId="org.eclipse.ui.ide.showInSystemExplorer" + label="%command.showInSystemExplorer.menu.name" + mnemonic="%command.showInSystemExplorer.menu.mnemonic" style="push"> </command> </menuContribution> diff --git a/bundles/org.eclipse.ui.ide/src/org/eclipse/ui/internal/ide/dialogs/IDEWorkspacePreferencePage.java b/bundles/org.eclipse.ui.ide/src/org/eclipse/ui/internal/ide/dialogs/IDEWorkspacePreferencePage.java index 957be9d57b6..e478182d55d 100644 --- a/bundles/org.eclipse.ui.ide/src/org/eclipse/ui/internal/ide/dialogs/IDEWorkspacePreferencePage.java +++ b/bundles/org.eclipse.ui.ide/src/org/eclipse/ui/internal/ide/dialogs/IDEWorkspacePreferencePage.java @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 2000, 2011 IBM Corporation and others. + * Copyright (c) 2000, 2013 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -347,6 +347,9 @@ public class IDEWorkspacePreferencePage extends PreferencePage systemExplorer = new StringFieldEditor(IDEInternalPreferences.WORKBENCH_SYSTEM_EXPLORER, IDEWorkbenchMessages.IDEWorkbenchPreference_workbenchSystemExplorer, 40, groupComposite); + gd = (GridData) systemExplorer.getTextControl(groupComposite).getLayoutData(); + gd.horizontalAlignment = GridData.FILL; + gd.grabExcessHorizontalSpace = true; systemExplorer.setPreferenceStore(getIDEPreferenceStore()); systemExplorer.setPage(this); 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 3016943c1ca..eb77b0cdcf3 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 @@ -43,8 +43,8 @@ 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$ + private static final String VARIABLE_RESOURCE = "${selected_resource_loc}"; //$NON-NLS-1$ + private static final String VARIABLE_FOLDER = "${selected_resource_parent}"; //$NON-NLS-1$ /* * (non-Javadoc) @@ -142,8 +142,12 @@ public class ShowInSystemExplorerHandler extends AbstractHandler { private String formShowInSytemExplorerCommand(File path) throws IOException { String command = IDEWorkbenchPlugin.getDefault().getPreferenceStore() .getString(IDEInternalPreferences.WORKBENCH_SYSTEM_EXPLORER); - command = command.replaceAll(VARIABLE_RE, path.getCanonicalPath()); - return command.replaceAll(VARIABLE_FOLDER, path.getParentFile().getCanonicalPath()); + command = Util.replaceAll(command, VARIABLE_RESOURCE, path.getCanonicalPath()); + File parent = path.getParentFile(); + if (parent != null) { + command = Util.replaceAll(command, VARIABLE_FOLDER, parent.getCanonicalPath()); + } + return command; } /** 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 c82807fdc12..0dc81337346 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 @@ -488,10 +488,10 @@ IDEWorkspacePreference_relatedLink = See <a>''{0}''</a> for workspace startup an IDEWorkspacePreference_openReferencedProjects = Open referenced projects when a project is opened IDEWorkspacePreference_closeUnrelatedProjectsToolTip = Close unrelated projects without prompt IDEWorkspacePreference_workspaceName=Wor&kspace name (shown in window title): -IDEWorkbenchPreference_workbenchSystemExplorer=Command for launching system explorer. +IDEWorkbenchPreference_workbenchSystemExplorer=Command for launching system e&xplorer: ShowInSystemExplorerHandler_LinuxDefaultCommand=nautilus file://${selected_resource_parent} -ShowInSystemExplorerHandler_Win32DefaultCommand=explorer /E,/select=${selected_resource_loc} +ShowInSystemExplorerHandler_Win32DefaultCommand=explorer /E,/select=${selected_resource_loc} ShowInSystemExplorerHandler_MacOSXDefaultCommand=open -R '${selected_resource_loc}' # --- Linked Resources --- |