How do I find out if the content assist popup window is currently showing? [message #514044] |
Fri, 12 February 2010 09:51 |
Jan Koehnlein Messages: 760 Registered: July 2009 Location: Hamburg |
Senior Member |
|
|
I am implementing a text editor that is closed when ESC is pressed. But
if the content assist popup window is showing, ESC should only close
this popup.
The main problem is that the
org.eclipse.jface.text.contentassist.CompletionProposalPopup .verifyKey(VerifyEvent)
returns true when ESC is pressed, thus handing the key event through to
the KeyListener that closes the editor.
My current workaround is a combined VerifyKeyListener / KeyListener that
sets a flag in verifyKey() if ESC is pressed and
ContentAssistant.hasProposalPopupFocus() returns true. If the flag is
set, the keyPressed() method ignores the next ESC. But that ugly
workaround only works if the popup is *focussed*.
I cannot add another IContentAssistListener to the ContentAssistant that
returns false in this case, as the add method is package private. I
guess that'd be a problem anyway, as I cannot make sure in which order
the IContentAssistListeners are registered / executed.
Any ideas?
--
Need professional support for Eclipse Modeling?
Go visit: http://xtext.itemis.com
---
Get professional support from the Xtext committers at www.typefox.io
|
|
|
|
Powered by
FUDForum. Page generated in 0.02867 seconds