1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-04 07:35:24 +02:00

[fix] Set global action definition ids to enable keyboard shortcuts for common actions

This commit is contained in:
Uwe Stieber 2007-03-13 09:26:35 +00:00
parent d2b750e0fd
commit 511bae1cb6
4 changed files with 22 additions and 45 deletions

View file

@ -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;
}

View file

@ -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);

View file

@ -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$
}
/**

View file

@ -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$
}
}