### Eclipse Workspace Patch 1.0 #P org.eclipse.rse.shells.ui Index: src/org/eclipse/rse/shells/ui/view/SystemCommandEditor.java =================================================================== RCS file: /cvsroot/dsdp/org.eclipse.tm.rse/plugins/org.eclipse.rse.shells.ui/src/org/eclipse/rse/shells/ui/view/SystemCommandEditor.java,v retrieving revision 1.8 diff -u -r1.8 SystemCommandEditor.java --- src/org/eclipse/rse/shells/ui/view/SystemCommandEditor.java 5 Jun 2007 01:39:29 -0000 1.8 +++ src/org/eclipse/rse/shells/ui/view/SystemCommandEditor.java 29 Feb 2008 08:11:14 -0000 @@ -1,5 +1,5 @@ /******************************************************************************** - * Copyright (c) 2002, 2007 IBM Corporation and others. All rights reserved. + * Copyright (c) 2002, 2008 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 http://www.eclipse.org/legal/epl-v10.html @@ -14,6 +14,7 @@ * Martin Oberhuber (Wind River) - fix 158765: content assist miss disables enter * David Dykstal (IBM) - [186589] move user types, user actions, and compile commands * API to the user actions plugin + * Radoslav Gerganov (ProSyst) - [181563] DBCS3.3: Hardcoded "Ctrl + Space" for content assist function of remote shell ********************************************************************************/ package org.eclipse.rse.shells.ui.view; @@ -37,7 +38,6 @@ import org.eclipse.jface.text.ITextViewer; import org.eclipse.jface.text.IWidgetTokenKeeper; import org.eclipse.jface.text.TextEvent; -import org.eclipse.jface.text.source.ISourceViewer; import org.eclipse.jface.text.source.SourceViewer; import org.eclipse.jface.text.source.SourceViewerConfiguration; import org.eclipse.jface.viewers.ISelectionChangedListener; @@ -46,12 +46,7 @@ import org.eclipse.rse.internal.ui.view.SystemViewMenuListener; import org.eclipse.rse.services.clientserver.messages.SystemMessage; import org.eclipse.rse.ui.validators.ISystemValidator; -import org.eclipse.swt.SWT; import org.eclipse.swt.custom.StyledText; -import org.eclipse.swt.custom.VerifyKeyListener; -import org.eclipse.swt.events.KeyAdapter; -import org.eclipse.swt.events.KeyEvent; -import org.eclipse.swt.events.VerifyEvent; import org.eclipse.swt.layout.GridData; import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Control; @@ -143,44 +138,6 @@ fireModifyEvents(cmdText, errorMessage); } }); - getTextWidget().addKeyListener(new KeyAdapter() - { - public void keyReleased(KeyEvent e) - { - - if (!e.doit) - return; - - if (e.stateMask == SWT.CTRL) - { - // DKM - using this now since SWT isn't providing statemask with verify key events - switch (e.character) - { - case ' ' : - //bug 158765: enter may be disabled only when the widget is shown, - //not if content assist is requested (since results may be empty) - //setInCodeAssist(true); - doOperation(ISourceViewer.CONTENTASSIST_PROPOSALS); - //e.doit = false; - break; - - case 'z' - 'a' + 1 : - // CTRL-Z - doOperation(ITextOperationTarget.UNDO); - //e.doit = false; - break; - } - } - - } - }); - prependVerifyKeyListener(new VerifyKeyListener() - { - public void verifyKey(VerifyEvent event) - { - handleVerifyKeyPressed(event); - } - }); initializeActions(); } public String getCommandText() @@ -257,8 +214,8 @@ menu.appendToGroup( ITextEditorActionConstants.GROUP_EDIT, (IAction) fGlobalActions.get(ITextEditorActionConstants.SELECT_ALL)); - menu.add(new Separator("group.generate")); //$NON-NLS-1$ - menu.appendToGroup("group.generate", (IAction) fGlobalActions.get("ContentAssistProposal")); //$NON-NLS-1$ //$NON-NLS-2$ + menu.add(new Separator(ITextEditorActionConstants.GROUP_GENERATE)); + menu.appendToGroup(ITextEditorActionConstants.GROUP_GENERATE, (IAction) fGlobalActions.get("ContentAssistProposal")); //$NON-NLS-1$ } private IActionBars getActionBars() { @@ -303,7 +260,6 @@ _caAction.setEnabled(true); fGlobalActions.put("ContentAssistProposal", _caAction); //$NON-NLS-1$ - setActionHandlers(); fSelectionActions.add(ITextEditorActionConstants.CUT); @@ -379,32 +335,6 @@ ((IUpdate) action).update(); } } - private void handleVerifyKeyPressed(VerifyEvent event) - { - if (!event.doit) - return; - - // DKM - moved to key press handler since for some reason SWT doesn't provide statemask anymore - /* - if (event.character == 0 && (event.keyCode & SWT.KEYCODE_BIT) == 0) - { - return; - } - switch (event.character) - { - case ' ' : - doOperation(ISourceViewer.CONTENTASSIST_PROPOSALS); - event.doit = false; - break; - // CTRL-Z - case (int) 'z' - (int) 'a' + 1 : - doOperation(ITextOperationTarget.UNDO); - event.doit = false; - break; - } - */ - } - public void setInCodeAssist(boolean flag) { Index: META-INF/MANIFEST.MF =================================================================== RCS file: /cvsroot/dsdp/org.eclipse.tm.rse/plugins/org.eclipse.rse.shells.ui/META-INF/MANIFEST.MF,v retrieving revision 1.19 diff -u -r1.19 MANIFEST.MF --- META-INF/MANIFEST.MF 26 Feb 2008 01:33:46 -0000 1.19 +++ META-INF/MANIFEST.MF 29 Feb 2008 08:11:14 -0000 @@ -19,7 +19,8 @@ org.eclipse.rse.subsystems.shells.core;bundle-version="[3.0.0,4.0.0)", org.eclipse.rse.subsystems.files.core;bundle-version="[3.0.0,4.0.0)", org.eclipse.rse.core;bundle-version="[3.0.0,4.0.0)", - org.eclipse.rse.ui;bundle-version="[3.0.0,4.0.0)" + org.eclipse.rse.ui;bundle-version="[3.0.0,4.0.0)", + org.eclipse.core.expressions Bundle-ActivationPolicy: lazy Eclipse-LazyStart: true Export-Package: org.eclipse.rse.internal.shells.ui;x-internal:=true, Index: src/org/eclipse/rse/internal/shells/ui/view/CommandsViewPage.java =================================================================== RCS file: /cvsroot/dsdp/org.eclipse.tm.rse/plugins/org.eclipse.rse.shells.ui/src/org/eclipse/rse/internal/shells/ui/view/CommandsViewPage.java,v retrieving revision 1.12 diff -u -r1.12 CommandsViewPage.java --- src/org/eclipse/rse/internal/shells/ui/view/CommandsViewPage.java 20 Feb 2008 21:24:20 -0000 1.12 +++ src/org/eclipse/rse/internal/shells/ui/view/CommandsViewPage.java 29 Feb 2008 08:11:14 -0000 @@ -1,5 +1,5 @@ /******************************************************************************** - * Copyright (c) 2002, 2007 IBM Corporation and others. All rights reserved. + * Copyright (c) 2002, 2008 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 http://www.eclipse.org/legal/epl-v10.html @@ -20,6 +20,7 @@ * Martin Oberhuber (Wind River) - [186773] split ISystemRegistryUI from ISystemRegistry * Kevin Doyle (IBM) - [212940] Duplicate Help Context Identifiers * David McKnight (IBM) - [216252] [api][nls] Resource Strings specific to subsystems should be moved from rse.ui into files.ui / shells.ui / processes.ui where possible + * Radoslav Gerganov (ProSyst) - [181563] DBCS3.3: Hardcoded "Ctrl + Space" for content assist function of remote shell ********************************************************************************/ package org.eclipse.rse.internal.shells.ui.view; @@ -536,6 +537,10 @@ { return _viewer; } + + SystemCommandEditor getEditor() { + return _inputEntry; + } public void updateOutput() { Index: src/org/eclipse/rse/internal/shells/ui/view/SystemCommandsViewPart.java =================================================================== RCS file: /cvsroot/dsdp/org.eclipse.tm.rse/plugins/org.eclipse.rse.shells.ui/src/org/eclipse/rse/internal/shells/ui/view/SystemCommandsViewPart.java,v retrieving revision 1.14 diff -u -r1.14 SystemCommandsViewPart.java --- src/org/eclipse/rse/internal/shells/ui/view/SystemCommandsViewPart.java 26 Oct 2007 14:57:26 -0000 1.14 +++ src/org/eclipse/rse/internal/shells/ui/view/SystemCommandsViewPart.java 29 Feb 2008 08:11:14 -0000 @@ -1,5 +1,5 @@ /******************************************************************************** - * Copyright (c) 2002, 2007 IBM Corporation and others. All rights reserved. + * Copyright (c) 2002, 2008 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 http://www.eclipse.org/legal/epl-v10.html @@ -18,6 +18,7 @@ * Martin Oberhuber (Wind River) - [186640] Add IRSESystemType.testProperty() * David McKnight (IBM) - [165680] "Show in Remote Shell View" does not work * Kevin Doyle (IBM) - [198534] Shell Menu Enablement Issue's + * Radoslav Gerganov (ProSyst) - [181563] DBCS3.3: Hardcoded "Ctrl + Space" for content assist function of remote shell ********************************************************************************/ package org.eclipse.rse.internal.shells.ui.view; @@ -36,7 +37,9 @@ import org.eclipse.jface.action.IToolBarManager; import org.eclipse.jface.action.MenuManager; import org.eclipse.jface.action.Separator; +import org.eclipse.jface.commands.ActionHandler; import org.eclipse.jface.resource.ImageDescriptor; +import org.eclipse.jface.text.source.ISourceViewer; import org.eclipse.jface.viewers.ISelection; import org.eclipse.jface.viewers.ISelectionChangedListener; import org.eclipse.jface.viewers.SelectionChangedEvent; @@ -54,6 +57,7 @@ import org.eclipse.rse.internal.ui.SystemResources; import org.eclipse.rse.services.clientserver.messages.SystemMessage; import org.eclipse.rse.shells.ui.RemoteCommandHelpers; +import org.eclipse.rse.shells.ui.view.SystemCommandEditor; import org.eclipse.rse.shells.ui.view.SystemViewRemoteOutputAdapter; import org.eclipse.rse.subsystems.files.core.subsystems.IRemoteFileSubSystem; import org.eclipse.rse.subsystems.shells.core.subsystems.IRemoteCmdSubSystem; @@ -78,8 +82,10 @@ import org.eclipse.ui.ISelectionListener; import org.eclipse.ui.ISelectionService; import org.eclipse.ui.IWorkbenchPart; +import org.eclipse.ui.handlers.IHandlerService; import org.eclipse.ui.part.CellEditorActionHandler; import org.eclipse.ui.part.ViewPart; +import org.eclipse.ui.texteditor.ITextEditorActionDefinitionIds; /** * This is the desktop view wrapper of the System View viewer. @@ -132,8 +138,22 @@ } } - - + /** + * Content assist action for all remote shells. It is activated with + * the default key binding for content assistance used in the workbench. + */ + class ContentAssistAction extends Action { + + public void run() { + if (_folder != null) { + CommandsViewPage currentTabItem = _folder.getCurrentTabItem(); + if (currentTabItem != null) { + SystemCommandEditor editor = currentTabItem.getEditor(); + editor.doOperation(ISourceViewer.CONTENTASSIST_PROPOSALS); + } + } + } + } public class ShellAction extends BrowseAction { @@ -321,6 +341,11 @@ ISelectionService selectionService = getSite().getWorkbenchWindow().getSelectionService(); selectionService.addSelectionListener(this); + IHandlerService handlerService = (IHandlerService) getSite().getService(IHandlerService.class); + ContentAssistAction caAction = new ContentAssistAction(); + caAction.setActionDefinitionId(ITextEditorActionDefinitionIds.CONTENT_ASSIST_PROPOSALS); + // the handler is automatically deactivated in the dispose() method of this view + handlerService.activateHandler(ITextEditorActionDefinitionIds.CONTENT_ASSIST_PROPOSALS, new ActionHandler(caAction)); SystemWidgetHelpers.setHelp(_folder, RSEUIPlugin.HELPPREFIX + "ucmd0000"); //$NON-NLS-1$ #P org.eclipse.rse.ui Index: UI/org/eclipse/rse/internal/ui/SystemResources.properties =================================================================== RCS file: /cvsroot/dsdp/org.eclipse.tm.rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/internal/ui/SystemResources.properties,v retrieving revision 1.14 diff -u -r1.14 SystemResources.properties --- UI/org/eclipse/rse/internal/ui/SystemResources.properties 8 Feb 2008 21:18:49 -0000 1.14 +++ UI/org/eclipse/rse/internal/ui/SystemResources.properties 29 Feb 2008 08:11:19 -0000 @@ -17,6 +17,7 @@ # David McKnight (IBM) - [216252] [nls] Resource Strings specific to subsystems should be moved from rse.ui into files.ui / shells.ui / processes.ui where possible # David Dykstal (IBM) - [181331] new filter wizard title should be "New Filter" # David Dykstal (IBM) - [142452] copy operations for connections, filterpools, and filters should be named "Copy..." +# Radoslav Gerganov (ProSyst) - [181563] DBCS3.3: Hardcoded "Ctrl + Space" for content assist function of remote shell ################################################################################ # NLS_MESSAGEFORMAT_VAR @@ -1119,7 +1120,7 @@ ############################################################## # Content Assist action ############################################################## -ACTION_CONTENT_ASSIST=Content Assist@Ctrl+SPACE +ACTION_CONTENT_ASSIST=Content Assist ACTION_SHOW_TOOLTIP_INFORMATION=Show Tooltip Description@F2 ##############################################################