Community
Participate
Working Groups
Please implement a method ContentProposalAdapter.hasProposalPopupFocus() like org.eclipse.jface.text.contentassist.ContentAssistant.hasProposalPopupFocus(). The method should return a boolean whether the content assistant proposal popup has the focus or not.
We are in API freeze for 3.3, so this is unlikely to be addressed, unless it is a critical problem. Will look at this for 3.4. Marking API in the title and keywords.
is there no chance to get it in 3.3??? the ContentProposalAdapter is useless for me without this method...
I need to understand the use case...what makes it useless. API changes can still be made, but require high prio and PMC approval. The implementation of this method is straightforward and low risk. But if I am to argue for this change, I need to understand the scenario.
we use the content assist in a text field that have to content one of the strings of content assist or an empty string but no a half typed string or strings which are not in content assist. for this reason we install a focusListener which check the string in the text field every time the focus lost. if the string is not one of the strings in the list (which content assist displays), we remove the string from the text field. but we don't want to remove the string when the content assist pops-up. so we have to check in the focusLost event if ContentProposalAdapter.hasProposalPopupFocus()... i hope you understand my problem!?
yes, I understand the problem. Here is a workaround, which is admittedly a hack, but may get you by for now. Where you would normally use the proposed API, instead use this check: if ((event.display.getFocusControl().getShell().getStyle() & SWT.ON_TOP) == 0) This will tell you if the control getting focus is a hover-style popup, which includes the proposal popup. The down side is that you might not strip the text if some other SWT.ON_TOP shell gets focus. Depending on how many of these style shells you have in your app, this workaround may be reasonable until we can get the real API in. What do you think?
yes that works (but it's a big big hack!!!)
I know (blush), I'm just trying to get you by in the meantime. Marking 3.4 so we can address this early on. After 3.3 I'll take a pass over bugs marked 3.4 and release changes like these before triaging the backlog.
Released to HEAD (3.4 stream) >20070626.
whoops, forgot to mark this as fixed.
great! thank you :-)
verified on WinXP, I20070807-0010