Index: src/org/eclipse/team/internal/ui/sync/actions/RefactorActionGroup.java =================================================================== RCS file: /home/eclipse/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/sync/actions/RefactorActionGroup.java,v retrieving revision 1.1 diff -u -r1.1 RefactorActionGroup.java --- src/org/eclipse/team/internal/ui/sync/actions/RefactorActionGroup.java 4 Sep 2003 18:01:11 -0000 1.1 +++ src/org/eclipse/team/internal/ui/sync/actions/RefactorActionGroup.java 11 Sep 2003 20:20:36 -0000 @@ -17,20 +17,19 @@ import org.eclipse.jface.action.IMenuManager; import org.eclipse.jface.action.MenuManager; import org.eclipse.jface.viewers.IStructuredSelection; -import org.eclipse.swt.SWT; import org.eclipse.swt.dnd.Clipboard; -import org.eclipse.swt.events.KeyEvent; import org.eclipse.swt.widgets.Shell; +import org.eclipse.team.internal.ui.Policy; import org.eclipse.team.internal.ui.sync.views.SynchronizeView; import org.eclipse.ui.IActionBars; +import org.eclipse.ui.IKeyBindingService; import org.eclipse.ui.ISharedImages; -import org.eclipse.ui.IWorkbenchActionConstants; +import org.eclipse.ui.IWorkbenchPartSite; import org.eclipse.ui.PlatformUI; import org.eclipse.ui.actions.DeleteResourceAction; import org.eclipse.ui.actions.MoveResourceAction; import org.eclipse.ui.actions.RenameResourceAction; import org.eclipse.ui.actions.TextActionHandler; -import org.eclipse.team.internal.ui.Policy; /** * This action group is modeled after the class of the same name in @@ -92,26 +91,15 @@ textActionHandler.setCopyAction(copyAction); textActionHandler.setPasteAction(pasteAction); textActionHandler.setDeleteAction(deleteAction); - renameAction.setTextActionHandler(textActionHandler); - - actionBars.setGlobalActionHandler(IWorkbenchActionConstants.MOVE, moveAction); - actionBars.setGlobalActionHandler(IWorkbenchActionConstants.RENAME, renameAction); - actionBars.setGlobalActionHandler(IWorkbenchActionConstants.DELETE, deleteAction); - } - - /** - * Handles a key pressed event by invoking the appropriate action. - */ - public void handleKeyPressed(KeyEvent event) { - if (event.character == SWT.DEL && event.stateMask == 0) { - if (deleteAction.isEnabled()) { - deleteAction.run(); - } - } + renameAction.setTextActionHandler(textActionHandler); } protected void makeActions() { - Shell shell = getSyncView().getSite().getShell(); + // Get the key binding service for registering actions with commands. + final IWorkbenchPartSite site = getSyncView().getSite(); + final IKeyBindingService keyBindingService = site.getKeyBindingService(); + + Shell shell = site.getShell(); clipboard = new Clipboard(shell.getDisplay()); pasteAction = new PasteAction(shell, clipboard); @@ -132,6 +120,12 @@ deleteAction.setDisabledImageDescriptor(images.getImageDescriptor(ISharedImages.IMG_TOOL_DELETE_DISABLED)); deleteAction.setImageDescriptor(images.getImageDescriptor(ISharedImages.IMG_TOOL_DELETE)); deleteAction.setHoverImageDescriptor(images.getImageDescriptor(ISharedImages.IMG_TOOL_DELETE_HOVER)); + /* NOTE: This is defined in "plugin.xml" in "org.eclipse.ui". It is + * only publicly declared in code in IWorkbenchActionDefinitionIds in + * "org.eclipse.ui.workbench.texteditor". + */ + deleteAction.setActionDefinitionId("org.eclipse.ui.edit.delete"); //$NON-NLS-1$ + keyBindingService.registerAction(deleteAction); } public void updateActionBars() { Index: src/org/eclipse/team/internal/ui/sync/actions/SyncViewerActions.java =================================================================== RCS file: /home/eclipse/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/sync/actions/SyncViewerActions.java,v retrieving revision 1.23 diff -u -r1.23 SyncViewerActions.java --- src/org/eclipse/team/internal/ui/sync/actions/SyncViewerActions.java 11 Sep 2003 17:45:31 -0000 1.23 +++ src/org/eclipse/team/internal/ui/sync/actions/SyncViewerActions.java 11 Sep 2003 20:20:36 -0000 @@ -17,7 +17,6 @@ import org.eclipse.jface.action.Separator; import org.eclipse.jface.util.IPropertyChangeListener; import org.eclipse.jface.util.PropertyChangeEvent; -import org.eclipse.swt.events.KeyEvent; import org.eclipse.team.core.TeamException; import org.eclipse.team.internal.ui.Policy; import org.eclipse.team.internal.ui.Utils; @@ -297,9 +296,5 @@ PlatformUI.getWorkbench().getWorkingSetManager().addRecentWorkingSet(workingSet); } workingSetGroup.setWorkingSet(workingSet); - } - - public void handleKeyPressed(KeyEvent event) { - refactoringActions.handleKeyPressed(event); } } Index: src/org/eclipse/team/internal/ui/sync/views/SynchronizeView.java =================================================================== RCS file: /home/eclipse/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/sync/views/SynchronizeView.java,v retrieving revision 1.10 diff -u -r1.10 SynchronizeView.java --- src/org/eclipse/team/internal/ui/sync/views/SynchronizeView.java 10 Sep 2003 19:24:01 -0000 1.10 +++ src/org/eclipse/team/internal/ui/sync/views/SynchronizeView.java 11 Sep 2003 20:20:36 -0000 @@ -42,8 +42,6 @@ import org.eclipse.jface.viewers.TableViewer; import org.eclipse.jface.viewers.TreeViewer; import org.eclipse.swt.SWT; -import org.eclipse.swt.events.KeyEvent; -import org.eclipse.swt.events.KeyListener; import org.eclipse.swt.events.SelectionListener; import org.eclipse.swt.graphics.Image; import org.eclipse.swt.layout.GridData; @@ -305,14 +303,6 @@ handleOpen(event); } }); - viewer.getControl().addKeyListener(new KeyListener() { - public void keyPressed(KeyEvent event) { - handleKeyPressed(event); - } - public void keyReleased(KeyEvent event) { - // do nothing - } - }); } protected void initializeActions() { actions = new SyncViewerActions(this); @@ -462,14 +452,6 @@ } } - } - - /** - * Handles a key press event from the viewer. - * Delegates to the action group. - */ - protected void handleKeyPressed(KeyEvent event) { - actions.handleKeyPressed(event); } public void activateSubscriber(TeamSubscriber subscriber) {