View | Details | Raw Unified | Return to bug 181563 | Differences between
and this patch

Collapse All | Expand All

(-)src/org/eclipse/rse/shells/ui/view/SystemCommandEditor.java (-74 / +4 lines)
Lines 1-5 Link Here
1
/********************************************************************************
1
/********************************************************************************
2
 * Copyright (c) 2002, 2007 IBM Corporation and others. All rights reserved.
2
 * Copyright (c) 2002, 2008 IBM Corporation and others. All rights reserved.
3
 * This program and the accompanying materials are made available under the terms
3
 * This program and the accompanying materials are made available under the terms
4
 * of the Eclipse Public License v1.0 which accompanies this distribution, and is 
4
 * of the Eclipse Public License v1.0 which accompanies this distribution, and is 
5
 * available at http://www.eclipse.org/legal/epl-v10.html
5
 * available at http://www.eclipse.org/legal/epl-v10.html
Lines 14-19 Link Here
14
 * Martin Oberhuber (Wind River) - fix 158765: content assist miss disables enter
14
 * Martin Oberhuber (Wind River) - fix 158765: content assist miss disables enter
15
 * David Dykstal (IBM) - [186589] move user types, user actions, and compile commands
15
 * David Dykstal (IBM) - [186589] move user types, user actions, and compile commands
16
 *                                API to the user actions plugin
16
 *                                API to the user actions plugin
17
 * Radoslav Gerganov (ProSyst)   - [181563] DBCS3.3: Hardcoded "Ctrl + Space" for content assist function of remote shell                                
17
 ********************************************************************************/
18
 ********************************************************************************/
18
19
19
package org.eclipse.rse.shells.ui.view;
20
package org.eclipse.rse.shells.ui.view;
Lines 37-43 Link Here
37
import org.eclipse.jface.text.ITextViewer;
38
import org.eclipse.jface.text.ITextViewer;
38
import org.eclipse.jface.text.IWidgetTokenKeeper;
39
import org.eclipse.jface.text.IWidgetTokenKeeper;
39
import org.eclipse.jface.text.TextEvent;
40
import org.eclipse.jface.text.TextEvent;
40
import org.eclipse.jface.text.source.ISourceViewer;
41
import org.eclipse.jface.text.source.SourceViewer;
41
import org.eclipse.jface.text.source.SourceViewer;
42
import org.eclipse.jface.text.source.SourceViewerConfiguration;
42
import org.eclipse.jface.text.source.SourceViewerConfiguration;
43
import org.eclipse.jface.viewers.ISelectionChangedListener;
43
import org.eclipse.jface.viewers.ISelectionChangedListener;
Lines 46-57 Link Here
46
import org.eclipse.rse.internal.ui.view.SystemViewMenuListener;
46
import org.eclipse.rse.internal.ui.view.SystemViewMenuListener;
47
import org.eclipse.rse.services.clientserver.messages.SystemMessage;
47
import org.eclipse.rse.services.clientserver.messages.SystemMessage;
48
import org.eclipse.rse.ui.validators.ISystemValidator;
48
import org.eclipse.rse.ui.validators.ISystemValidator;
49
import org.eclipse.swt.SWT;
50
import org.eclipse.swt.custom.StyledText;
49
import org.eclipse.swt.custom.StyledText;
51
import org.eclipse.swt.custom.VerifyKeyListener;
52
import org.eclipse.swt.events.KeyAdapter;
53
import org.eclipse.swt.events.KeyEvent;
54
import org.eclipse.swt.events.VerifyEvent;
55
import org.eclipse.swt.layout.GridData;
50
import org.eclipse.swt.layout.GridData;
56
import org.eclipse.swt.widgets.Composite;
51
import org.eclipse.swt.widgets.Composite;
57
import org.eclipse.swt.widgets.Control;
52
import org.eclipse.swt.widgets.Control;
Lines 143-186 Link Here
143
				fireModifyEvents(cmdText, errorMessage);
138
				fireModifyEvents(cmdText, errorMessage);
144
			}
139
			}
145
		});
140
		});
146
		getTextWidget().addKeyListener(new KeyAdapter()
147
		{
148
			public void keyReleased(KeyEvent e)
149
			{
150
	
151
				if (!e.doit)
152
					return;
153
					
154
				if (e.stateMask == SWT.CTRL)
155
				{
156
					// DKM - using this now since SWT isn't providing statemask with verify key events
157
					switch (e.character)
158
					{
159
						case ' ' :
160
							//bug 158765: enter may be disabled only when the widget is shown,
161
							//not if content assist is requested (since results may be empty)
162
							//setInCodeAssist(true);
163
							doOperation(ISourceViewer.CONTENTASSIST_PROPOSALS);
164
							//e.doit = false;
165
							break;
166
167
						case 'z' - 'a' + 1 :
168
							// CTRL-Z
169
							doOperation(ITextOperationTarget.UNDO);
170
							//e.doit = false;
171
							break;
172
					}
173
				}
174
175
			}
176
		});
177
		prependVerifyKeyListener(new VerifyKeyListener()
178
		{
179
			public void verifyKey(VerifyEvent event)
180
			{
181
				handleVerifyKeyPressed(event);
182
			}
183
		});
184
		initializeActions();
141
		initializeActions();
185
	}
142
	}
186
	public String getCommandText()
143
	public String getCommandText()
Lines 257-264 Link Here
257
		menu.appendToGroup(
214
		menu.appendToGroup(
258
			ITextEditorActionConstants.GROUP_EDIT,
215
			ITextEditorActionConstants.GROUP_EDIT,
259
			(IAction) fGlobalActions.get(ITextEditorActionConstants.SELECT_ALL));
216
			(IAction) fGlobalActions.get(ITextEditorActionConstants.SELECT_ALL));
260
		menu.add(new Separator("group.generate")); //$NON-NLS-1$
217
		menu.add(new Separator(ITextEditorActionConstants.GROUP_GENERATE));
261
		menu.appendToGroup("group.generate", (IAction) fGlobalActions.get("ContentAssistProposal")); //$NON-NLS-1$ //$NON-NLS-2$
218
		menu.appendToGroup(ITextEditorActionConstants.GROUP_GENERATE, (IAction) fGlobalActions.get("ContentAssistProposal")); //$NON-NLS-1$
262
	}
219
	}
263
	private IActionBars getActionBars()
220
	private IActionBars getActionBars()
264
	{
221
	{
Lines 303-309 Link Here
303
		_caAction.setEnabled(true);
260
		_caAction.setEnabled(true);
304
		fGlobalActions.put("ContentAssistProposal", _caAction); //$NON-NLS-1$
261
		fGlobalActions.put("ContentAssistProposal", _caAction); //$NON-NLS-1$
305
		
262
		
306
		
307
		setActionHandlers();
263
		setActionHandlers();
308
		 
264
		 
309
		fSelectionActions.add(ITextEditorActionConstants.CUT);
265
		fSelectionActions.add(ITextEditorActionConstants.CUT);
Lines 379-410 Link Here
379
				 ((IUpdate) action).update();
335
				 ((IUpdate) action).update();
380
		}
336
		}
381
	}
337
	}
382
	private void handleVerifyKeyPressed(VerifyEvent event)
383
	{		
384
		if (!event.doit)
385
			return;
386
			
387
		// DKM - moved to key press handler since for some reason SWT doesn't provide statemask anymore
388
			/*
389
		if (event.character == 0 && (event.keyCode & SWT.KEYCODE_BIT) == 0)
390
		{
391
			return;
392
		}
393
		switch (event.character)
394
		{
395
			case ' ' :
396
				doOperation(ISourceViewer.CONTENTASSIST_PROPOSALS);
397
				event.doit = false;
398
				break;
399
				// CTRL-Z
400
			case (int) 'z' - (int) 'a' + 1 :
401
				doOperation(ITextOperationTarget.UNDO);
402
				event.doit = false;
403
				break;
404
		}
405
	*/
406
	}
407
	
408
	
338
	
409
	public void setInCodeAssist(boolean flag)
339
	public void setInCodeAssist(boolean flag)
410
	{
340
	{
(-)META-INF/MANIFEST.MF (-1 / +2 lines)
Lines 19-25 Link Here
19
 org.eclipse.rse.subsystems.shells.core;bundle-version="[3.0.0,4.0.0)",
19
 org.eclipse.rse.subsystems.shells.core;bundle-version="[3.0.0,4.0.0)",
20
 org.eclipse.rse.subsystems.files.core;bundle-version="[3.0.0,4.0.0)",
20
 org.eclipse.rse.subsystems.files.core;bundle-version="[3.0.0,4.0.0)",
21
 org.eclipse.rse.core;bundle-version="[3.0.0,4.0.0)",
21
 org.eclipse.rse.core;bundle-version="[3.0.0,4.0.0)",
22
 org.eclipse.rse.ui;bundle-version="[3.0.0,4.0.0)"
22
 org.eclipse.rse.ui;bundle-version="[3.0.0,4.0.0)",
23
 org.eclipse.core.expressions
23
Bundle-ActivationPolicy: lazy
24
Bundle-ActivationPolicy: lazy
24
Eclipse-LazyStart: true
25
Eclipse-LazyStart: true
25
Export-Package: org.eclipse.rse.internal.shells.ui;x-internal:=true,
26
Export-Package: org.eclipse.rse.internal.shells.ui;x-internal:=true,
(-)src/org/eclipse/rse/internal/shells/ui/view/CommandsViewPage.java (-1 / +6 lines)
Lines 1-5 Link Here
1
/********************************************************************************
1
/********************************************************************************
2
 * Copyright (c) 2002, 2007 IBM Corporation and others. All rights reserved.
2
 * Copyright (c) 2002, 2008 IBM Corporation and others. All rights reserved.
3
 * This program and the accompanying materials are made available under the terms
3
 * This program and the accompanying materials are made available under the terms
4
 * of the Eclipse Public License v1.0 which accompanies this distribution, and is 
4
 * of the Eclipse Public License v1.0 which accompanies this distribution, and is 
5
 * available at http://www.eclipse.org/legal/epl-v10.html
5
 * available at http://www.eclipse.org/legal/epl-v10.html
Lines 20-25 Link Here
20
 * Martin Oberhuber (Wind River) - [186773] split ISystemRegistryUI from ISystemRegistry
20
 * Martin Oberhuber (Wind River) - [186773] split ISystemRegistryUI from ISystemRegistry
21
 * Kevin Doyle		(IBM)		 - [212940] Duplicate Help Context Identifiers
21
 * Kevin Doyle		(IBM)		 - [212940] Duplicate Help Context Identifiers
22
 * 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
22
 * 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
23
 * Radoslav Gerganov (ProSyst)   - [181563] DBCS3.3: Hardcoded "Ctrl + Space" for content assist function of remote shell
23
 ********************************************************************************/
24
 ********************************************************************************/
24
25
25
package org.eclipse.rse.internal.shells.ui.view;
26
package org.eclipse.rse.internal.shells.ui.view;
Lines 536-541 Link Here
536
	{
537
	{
537
		return _viewer;
538
		return _viewer;
538
	}
539
	}
540
	
541
	SystemCommandEditor getEditor() {
542
	  return _inputEntry;
543
	}
539
544
540
	public void updateOutput()
545
	public void updateOutput()
541
	{
546
	{
(-)src/org/eclipse/rse/internal/shells/ui/view/SystemCommandsViewPart.java (-3 / +28 lines)
Lines 1-5 Link Here
1
/********************************************************************************
1
/********************************************************************************
2
 * Copyright (c) 2002, 2007 IBM Corporation and others. All rights reserved.
2
 * Copyright (c) 2002, 2008 IBM Corporation and others. All rights reserved.
3
 * This program and the accompanying materials are made available under the terms
3
 * This program and the accompanying materials are made available under the terms
4
 * of the Eclipse Public License v1.0 which accompanies this distribution, and is 
4
 * of the Eclipse Public License v1.0 which accompanies this distribution, and is 
5
 * available at http://www.eclipse.org/legal/epl-v10.html
5
 * available at http://www.eclipse.org/legal/epl-v10.html
Lines 18-23 Link Here
18
 * Martin Oberhuber (Wind River) - [186640] Add IRSESystemType.testProperty() 
18
 * Martin Oberhuber (Wind River) - [186640] Add IRSESystemType.testProperty() 
19
 * David McKnight   (IBM)        - [165680] "Show in Remote Shell View" does not work
19
 * David McKnight   (IBM)        - [165680] "Show in Remote Shell View" does not work
20
 * Kevin Doyle 		(IBM)		 - [198534] Shell Menu Enablement Issue's
20
 * Kevin Doyle 		(IBM)		 - [198534] Shell Menu Enablement Issue's
21
 * Radoslav Gerganov (ProSyst)   - [181563] DBCS3.3: Hardcoded "Ctrl + Space" for content assist function of remote shell
21
 ********************************************************************************/
22
 ********************************************************************************/
22
23
23
package org.eclipse.rse.internal.shells.ui.view;
24
package org.eclipse.rse.internal.shells.ui.view;
Lines 36-42 Link Here
36
import org.eclipse.jface.action.IToolBarManager;
37
import org.eclipse.jface.action.IToolBarManager;
37
import org.eclipse.jface.action.MenuManager;
38
import org.eclipse.jface.action.MenuManager;
38
import org.eclipse.jface.action.Separator;
39
import org.eclipse.jface.action.Separator;
40
import org.eclipse.jface.commands.ActionHandler;
39
import org.eclipse.jface.resource.ImageDescriptor;
41
import org.eclipse.jface.resource.ImageDescriptor;
42
import org.eclipse.jface.text.source.ISourceViewer;
40
import org.eclipse.jface.viewers.ISelection;
43
import org.eclipse.jface.viewers.ISelection;
41
import org.eclipse.jface.viewers.ISelectionChangedListener;
44
import org.eclipse.jface.viewers.ISelectionChangedListener;
42
import org.eclipse.jface.viewers.SelectionChangedEvent;
45
import org.eclipse.jface.viewers.SelectionChangedEvent;
Lines 54-59 Link Here
54
import org.eclipse.rse.internal.ui.SystemResources;
57
import org.eclipse.rse.internal.ui.SystemResources;
55
import org.eclipse.rse.services.clientserver.messages.SystemMessage;
58
import org.eclipse.rse.services.clientserver.messages.SystemMessage;
56
import org.eclipse.rse.shells.ui.RemoteCommandHelpers;
59
import org.eclipse.rse.shells.ui.RemoteCommandHelpers;
60
import org.eclipse.rse.shells.ui.view.SystemCommandEditor;
57
import org.eclipse.rse.shells.ui.view.SystemViewRemoteOutputAdapter;
61
import org.eclipse.rse.shells.ui.view.SystemViewRemoteOutputAdapter;
58
import org.eclipse.rse.subsystems.files.core.subsystems.IRemoteFileSubSystem;
62
import org.eclipse.rse.subsystems.files.core.subsystems.IRemoteFileSubSystem;
59
import org.eclipse.rse.subsystems.shells.core.subsystems.IRemoteCmdSubSystem;
63
import org.eclipse.rse.subsystems.shells.core.subsystems.IRemoteCmdSubSystem;
Lines 78-85 Link Here
78
import org.eclipse.ui.ISelectionListener;
82
import org.eclipse.ui.ISelectionListener;
79
import org.eclipse.ui.ISelectionService;
83
import org.eclipse.ui.ISelectionService;
80
import org.eclipse.ui.IWorkbenchPart;
84
import org.eclipse.ui.IWorkbenchPart;
85
import org.eclipse.ui.handlers.IHandlerService;
81
import org.eclipse.ui.part.CellEditorActionHandler;
86
import org.eclipse.ui.part.CellEditorActionHandler;
82
import org.eclipse.ui.part.ViewPart;
87
import org.eclipse.ui.part.ViewPart;
88
import org.eclipse.ui.texteditor.ITextEditorActionDefinitionIds;
83
89
84
/**
90
/**
85
 * This is the desktop view wrapper of the System View viewer.
91
 * This is the desktop view wrapper of the System View viewer.
Lines 132-139 Link Here
132
		}
138
		}
133
	}
139
	}
134
140
135
141
	/**
136
	
142
	 * Content assist action for all remote shells. It is activated with
143
	 * the default key binding for content assistance used in the workbench.
144
	 */
145
	class ContentAssistAction extends Action {
146
	  
147
	  public void run() {
148
	    if (_folder != null) {
149
	      CommandsViewPage currentTabItem = _folder.getCurrentTabItem();
150
	      if (currentTabItem != null) {
151
	        SystemCommandEditor editor = currentTabItem.getEditor();
152
	        editor.doOperation(ISourceViewer.CONTENTASSIST_PROPOSALS);
153
	      }
154
	    }
155
	  }
156
	}
137
157
138
	public class ShellAction extends BrowseAction
158
	public class ShellAction extends BrowseAction
139
	{
159
	{
Lines 321-326 Link Here
321
		ISelectionService selectionService = getSite().getWorkbenchWindow().getSelectionService();
341
		ISelectionService selectionService = getSite().getWorkbenchWindow().getSelectionService();
322
		selectionService.addSelectionListener(this);
342
		selectionService.addSelectionListener(this);
323
		
343
		
344
		IHandlerService handlerService = (IHandlerService) getSite().getService(IHandlerService.class);
345
		ContentAssistAction caAction = new ContentAssistAction();
346
		caAction.setActionDefinitionId(ITextEditorActionDefinitionIds.CONTENT_ASSIST_PROPOSALS);
347
		// the handler is automatically deactivated in the dispose() method of this view
348
    handlerService.activateHandler(ITextEditorActionDefinitionIds.CONTENT_ASSIST_PROPOSALS, new ActionHandler(caAction));
324
349
325
		SystemWidgetHelpers.setHelp(_folder, RSEUIPlugin.HELPPREFIX + "ucmd0000"); //$NON-NLS-1$
350
		SystemWidgetHelpers.setHelp(_folder, RSEUIPlugin.HELPPREFIX + "ucmd0000"); //$NON-NLS-1$
326
351
(-)UI/org/eclipse/rse/internal/ui/SystemResources.properties (-1 / +2 lines)
Lines 17-22 Link Here
17
# 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
17
# 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
18
# David Dykstal (IBM) - [181331] new filter wizard title should be "New Filter"
18
# David Dykstal (IBM) - [181331] new filter wizard title should be "New Filter"
19
# David Dykstal (IBM) - [142452] copy operations for connections, filterpools, and filters should be named "Copy..."
19
# David Dykstal (IBM) - [142452] copy operations for connections, filterpools, and filters should be named "Copy..."
20
# Radoslav Gerganov (ProSyst)   - [181563] DBCS3.3: Hardcoded "Ctrl + Space" for content assist function of remote shell
20
################################################################################
21
################################################################################
21
22
22
# NLS_MESSAGEFORMAT_VAR
23
# NLS_MESSAGEFORMAT_VAR
Lines 1119-1125 Link Here
1119
##############################################################
1120
##############################################################
1120
# Content Assist action
1121
# Content Assist action
1121
##############################################################
1122
##############################################################
1122
ACTION_CONTENT_ASSIST=Content Assist@Ctrl+SPACE
1123
ACTION_CONTENT_ASSIST=Content Assist
1123
ACTION_SHOW_TOOLTIP_INFORMATION=Show Tooltip Description@F2
1124
ACTION_SHOW_TOOLTIP_INFORMATION=Show Tooltip Description@F2
1124
1125
1125
##############################################################
1126
##############################################################

Return to bug 181563