From 511bae1cb68e7d5b068e27de8afbc659386db1df Mon Sep 17 00:00:00 2001 From: Uwe Stieber Date: Tue, 13 Mar 2007 09:26:35 +0000 Subject: [PATCH] [fix] Set global action definition ids to enable keyboard shortcuts for common actions --- .../rse/internal/ui/view/SystemView.java | 10 +++++ .../ui/view/SystemViewConnectionAdapter.java | 13 ++++-- .../ui/actions/SystemNewConnectionAction.java | 3 +- ...onnectionFromExistingConnectionAction.java | 41 ------------------- 4 files changed, 22 insertions(+), 45 deletions(-) delete mode 100644 rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemNewConnectionFromExistingConnectionAction.java diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/internal/ui/view/SystemView.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/internal/ui/view/SystemView.java index d22c5ba0e20..c3b90bf3054 100644 --- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/internal/ui/view/SystemView.java +++ b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/internal/ui/view/SystemView.java @@ -146,11 +146,13 @@ import org.eclipse.ui.IWorkbench; import org.eclipse.ui.IWorkbenchPart; import org.eclipse.ui.IWorkbenchWindow; import org.eclipse.ui.PlatformUI; +import org.eclipse.ui.actions.ActionFactory; import org.eclipse.ui.dialogs.PropertyDialogAction; import org.eclipse.ui.part.EditorInputTransfer; import org.eclipse.ui.part.PluginTransfer; import org.eclipse.ui.progress.PendingUpdateAdapter; import org.eclipse.ui.progress.UIJob; +import org.eclipse.ui.texteditor.IWorkbenchActionDefinitionIds; import org.eclipse.ui.views.framelist.GoIntoAction; /** @@ -613,6 +615,8 @@ ISelectionChangedListener, ITreeViewerListener, ISystemResourceChangeEvents, ISy */ public IAction getRefreshAction() { if (refreshAction == null) refreshAction = new SystemRefreshAction(getShell()); + refreshAction.setId(ActionFactory.REFRESH.getId()); + refreshAction.setActionDefinitionId("org.eclipse.ui.file.refresh"); //$NON-NLS-1$ return refreshAction; } @@ -639,6 +643,8 @@ ISelectionChangedListener, ITreeViewerListener, ISystemResourceChangeEvents, ISy public PropertyDialogAction getPropertyDialogAction() { if (propertyDialogAction == null) { propertyDialogAction = new PropertyDialogAction(new SameShellProvider(getShell()), this); + propertyDialogAction.setId(ActionFactory.PROPERTIES.getId()); + propertyDialogAction.setActionDefinitionId(IWorkbenchActionDefinitionIds.PROPERTIES); //propertyDialogAction.setToolTipText(" "); } @@ -663,6 +669,8 @@ ISelectionChangedListener, ITreeViewerListener, ISystemResourceChangeEvents, ISy */ public IAction getRenameAction() { if (renameAction == null) renameAction = new SystemCommonRenameAction(getShell(), this); + renameAction.setId(ActionFactory.RENAME.getId()); + renameAction.setActionDefinitionId(IWorkbenchActionDefinitionIds.RENAME); return renameAction; } @@ -672,6 +680,8 @@ ISelectionChangedListener, ITreeViewerListener, ISystemResourceChangeEvents, ISy */ public IAction getDeleteAction() { if (deleteAction == null) deleteAction = new SystemCommonDeleteAction(getShell(), this); + deleteAction.setId(ActionFactory.DELETE.getId()); + deleteAction.setActionDefinitionId(IWorkbenchActionDefinitionIds.DELETE); return deleteAction; } diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/internal/ui/view/SystemViewConnectionAdapter.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/internal/ui/view/SystemViewConnectionAdapter.java index 53c4fa49c17..3821f3d1bf3 100644 --- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/internal/ui/view/SystemViewConnectionAdapter.java +++ b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/internal/ui/view/SystemViewConnectionAdapter.java @@ -46,7 +46,7 @@ import org.eclipse.rse.ui.actions.SystemDisconnectAllSubSystemsAction; import org.eclipse.rse.ui.actions.SystemMoveConnectionAction; import org.eclipse.rse.ui.actions.SystemMoveDownConnectionAction; import org.eclipse.rse.ui.actions.SystemMoveUpConnectionAction; -import org.eclipse.rse.ui.actions.SystemNewConnectionFromExistingConnectionAction; +import org.eclipse.rse.ui.actions.SystemNewConnectionAction; import org.eclipse.rse.ui.actions.SystemOpenExplorerPerspectiveAction; import org.eclipse.rse.ui.actions.SystemRefreshAction; import org.eclipse.rse.ui.actions.SystemShowInMonitorAction; @@ -73,7 +73,7 @@ public class SystemViewConnectionAdapter extends AbstractSystemViewAdapter implements IRSEUserIdConstants { - private SystemNewConnectionFromExistingConnectionAction anotherConnectionAction = null; + private SystemNewConnectionAction anotherConnectionAction = null; //private SystemUpdateConnectionAction updateAction = null; private SystemMoveUpConnectionAction upAction = null; private SystemMoveDownConnectionAction downAction = null; @@ -188,7 +188,14 @@ public class SystemViewConnectionAdapter private void createActions() { - anotherConnectionAction = new SystemNewConnectionFromExistingConnectionAction(null); + anotherConnectionAction = new SystemNewConnectionAction(null, + SystemResources.ACTION_ANOTHERCONN_LABEL, + SystemResources.ACTION_ANOTHERCONN_TOOLTIP, + false, + true, + null); + anotherConnectionAction.setHelp(RSEUIPlugin.HELPPREFIX+"actn0015"); //$NON-NLS-1$ + //updateAction = new SystemUpdateConnectionAction(null); upAction = new SystemMoveUpConnectionAction(null); downAction = new SystemMoveDownConnectionAction(null); diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemNewConnectionAction.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemNewConnectionAction.java index efcc288b3a7..446d5c22dd5 100644 --- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemNewConnectionAction.java +++ b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemNewConnectionAction.java @@ -11,7 +11,7 @@ * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley. * * Contributors: - * {Name} (company) - description of contribution. + * Uwe Stieber (Wind River) - Set action id for identification from plugin.xml menu extensions. ********************************************************************************/ package org.eclipse.rse.ui.actions; @@ -101,6 +101,7 @@ public class SystemNewConnectionAction extends SystemBaseWizardAction { this.fromPopupMenu = fromPopupMenu; this.sp = sp; setHelp(RSEUIPlugin.HELPPREFIX + "actn0000"); //$NON-NLS-1$ + setId("org.eclipse.rse.ui.action.newconnection"); //$NON-NLS-1$ } /** diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemNewConnectionFromExistingConnectionAction.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemNewConnectionFromExistingConnectionAction.java deleted file mode 100644 index 939bb6acfbe..00000000000 --- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemNewConnectionFromExistingConnectionAction.java +++ /dev/null @@ -1,41 +0,0 @@ -/******************************************************************************** - * Copyright (c) 2002, 2006 IBM Corporation. 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 http://www.eclipse.org/legal/epl-v10.html - * - * Initial Contributors: - * The following IBM employees contributed to the Remote System Explorer - * component that contains this file: David McKnight, Kushal Munir, - * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson, - * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley. - * - * Contributors: - * {Name} (company) - description of contribution. - ********************************************************************************/ - -package org.eclipse.rse.ui.actions; -import org.eclipse.rse.ui.ISystemContextMenuConstants; -import org.eclipse.rse.ui.RSEUIPlugin; -import org.eclipse.rse.ui.SystemResources; -import org.eclipse.swt.widgets.Shell; - - -/** - * The action that displays the Create Another Connection wizard - */ -public class SystemNewConnectionFromExistingConnectionAction extends SystemNewConnectionAction - -{ - - /** - * Constructor - * @param shell The parent shell to host the new wizard - */ - public SystemNewConnectionFromExistingConnectionAction(Shell shell) - { - super(shell, SystemResources.ACTION_ANOTHERCONN_LABEL, SystemResources.ACTION_ANOTHERCONN_TOOLTIP, false, true, null); - setContextMenuGroup(ISystemContextMenuConstants.GROUP_NEW); - setHelp(RSEUIPlugin.HELPPREFIX+"actn0015"); //$NON-NLS-1$ - } -} \ No newline at end of file