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

Fix bug 158765: content assist miss disables enter

This commit is contained in:
Martin Oberhuber 2006-10-28 23:54:31 +00:00
parent af1c35305e
commit 3bf8db48fc

View file

@ -1,5 +1,5 @@
/******************************************************************************** /********************************************************************************
* Copyright (c) 2002, 2006 IBM Corporation. All rights reserved. * Copyright (c) 2002, 2006 IBM Corporation and others. All rights reserved.
* This program and the accompanying materials are made available under the terms * 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 * of the Eclipse Public License v1.0 which accompanies this distribution, and is
* available at http://www.eclipse.org/legal/epl-v10.html * available at http://www.eclipse.org/legal/epl-v10.html
@ -11,7 +11,7 @@
* Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley. * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
* *
* Contributors: * Contributors:
* {Name} (company) - description of contribution. * Martin Oberhuber (Wind River) - fix 158765: content assist miss disables enter
********************************************************************************/ ********************************************************************************/
package org.eclipse.rse.shells.ui.view; package org.eclipse.rse.shells.ui.view;
@ -155,7 +155,9 @@ public class SystemCommandEditor extends SourceViewer
switch (e.character) switch (e.character)
{ {
case ' ' : case ' ' :
setInCodeAssist(true); //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); doOperation(ISourceViewer.CONTENTASSIST_PROPOSALS);
//e.doit = false; //e.doit = false;
break; break;
@ -416,6 +418,14 @@ public class SystemCommandEditor extends SourceViewer
} }
return result; return result;
} }
public boolean requestWidgetToken(IWidgetTokenKeeper requester, int priority)
{
boolean result = super.requestWidgetToken(requester, priority);
if (result) {
setInCodeAssist(true);
}
return result;
}
public void releaseWidgetToken(IWidgetTokenKeeper tokenKeeper) public void releaseWidgetToken(IWidgetTokenKeeper tokenKeeper)
{ {
super.releaseWidgetToken(tokenKeeper); super.releaseWidgetToken(tokenKeeper);
@ -483,10 +493,12 @@ public class SystemCommandEditor extends SourceViewer
public void doOperation(int operation) public void doOperation(int operation)
{ {
if (operation == CONTENTASSIST_PROPOSALS) //bug 158765: enter may be disabled only when the widget is shown,
{ //not if content assist is requested (since results may be empty)
isInCodeAssist = true; //if (operation == CONTENTASSIST_PROPOSALS)
} //{
// isInCodeAssist = true;
//}
super.doOperation(operation); super.doOperation(operation);
} }
} }