Bug 182505 - [FieldAssist] API - ContentProposalAdapter needs hasProposalPopupFocus() method
Summary: [FieldAssist] API - ContentProposalAdapter needs hasProposalPopupFocus() method
Status: VERIFIED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.2   Edit
Hardware: PC All
: P3 normal (vote)
Target Milestone: 3.4 M1   Edit
Assignee: Susan McCourt CLA
QA Contact:
URL:
Whiteboard:
Keywords: api
Depends on:
Blocks:
 
Reported: 2007-04-16 03:41 EDT by Michael Seele CLA
Modified: 2007-08-07 16:42 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Seele CLA 2007-04-16 03:41:22 EDT
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.
Comment 1 Susan McCourt CLA 2007-04-16 11:24:00 EDT
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.
Comment 2 Michael Seele CLA 2007-04-17 01:47:57 EDT
is there no chance to get it in 3.3??? the ContentProposalAdapter is useless for me without this method...
Comment 3 Susan McCourt CLA 2007-04-17 13:30:14 EDT
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.
Comment 4 Michael Seele CLA 2007-04-18 02:29:12 EDT
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!? 
Comment 5 Susan McCourt CLA 2007-04-18 18:02:09 EDT
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?
Comment 6 Michael Seele CLA 2007-04-20 05:07:53 EDT
yes that works (but it's a big big hack!!!)
Comment 7 Susan McCourt CLA 2007-04-20 11:35:49 EDT
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.
Comment 8 Susan McCourt CLA 2007-06-26 14:25:50 EDT
Released to HEAD (3.4 stream) >20070626.
Comment 9 Susan McCourt CLA 2007-06-26 15:52:19 EDT
whoops, forgot to mark this as fixed.
Comment 10 Michael Seele CLA 2007-06-27 02:01:46 EDT
great! thank you :-)
Comment 11 Susan McCourt CLA 2007-08-07 16:42:11 EDT
verified on WinXP, I20070807-0010