Bug 539769 - [JFace] ContentProposalAdapter: allow proposal updates while the proposal popup is opened
Summary: [JFace] ContentProposalAdapter: allow proposal updates while the proposal pop...
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.9   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: 4.10 M3   Edit
Assignee: Fabian Pfaff CLA
QA Contact:
URL:
Whiteboard:
Keywords: noteworthy
Depends on:
Blocks:
 
Reported: 2018-10-03 15:25 EDT by Fabian Pfaff CLA
Modified: 2018-10-17 06:52 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Fabian Pfaff CLA 2018-10-03 15:25:36 EDT
Currently the only way to force ContentProposalAdapter to retrieve proposals
from the IContentProposalProvider seems to be to close and reopen the
proposal pop-up. (`createDialogArea()` retrieves the proposals)
I'm currently working on an issue[0] that would really benefit from the ability
to update the proposals while the pop-up is open. 

I have two suggestions for a possible solution:
1. Add a flag/toggle that lets the ContentProposalAdapter register a listener
   on the IContentProposalProvider, that gets triggered when
   IContentProposalProvider#setProposals gets called.
   The listener then calls recomputeProposals().
2. Make recomputeProposals() protected, like it is already the case for
   openProposalPopup() and closeProposalPopup(). This way extending classes
   can implement behavior as they see fit.

What do you think?

[0] https://bugs.eclipse.org/bugs/show_bug.cgi?id=538480#c5
    https://bugs.eclipse.org/bugs/attachment.cgi?id=276099
Comment 1 Lars Vogel CLA 2018-10-08 06:18:51 EDT
Viewer has the #refresh method. I suggest adding a refresh method ContentProposalAdapter which calls into recomputeProposals().

WDYT?
Comment 2 Eclipse Genie CLA 2018-10-08 09:43:39 EDT
New Gerrit change created: https://git.eclipse.org/r/130622
Comment 4 Lars Vogel CLA 2018-10-16 15:53:33 EDT
Thanks, Fabian.
Comment 5 Eclipse Genie CLA 2018-10-16 15:57:40 EDT
New Gerrit change created: https://git.eclipse.org/r/131017
Comment 7 Andrey Loskutov CLA 2018-10-17 04:57:09 EDT
I see API errors now. Please fix org.eclipse.jface version and @Since on org.eclipse.jface.fieldassist.ContentProposalAdapter.refresh()
Comment 8 Eclipse Genie CLA 2018-10-17 05:23:44 EDT
New Gerrit change created: https://git.eclipse.org/r/131042
Comment 9 Andrey Loskutov CLA 2018-10-17 05:24:20 EDT
(In reply to Andrey Loskutov from comment #7)
> I see API errors now. Please fix org.eclipse.jface version and @Since on
> org.eclipse.jface.fieldassist.ContentProposalAdapter.refresh()

(In reply to Eclipse Genie from comment #8)
> New Gerrit change created: https://git.eclipse.org/r/131042

I can't see it, I need UI projects error free.
Comment 10 Lars Vogel CLA 2018-10-17 05:29:13 EDT
(In reply to Andrey Loskutov from comment #9)
> (In reply to Andrey Loskutov from comment #7)
> > I see API errors now. Please fix org.eclipse.jface version and @Since on
> > org.eclipse.jface.fieldassist.ContentProposalAdapter.refresh()
> I can't see it, I need UI projects error free.

I'm unable to get an API baseline error with Build id: I20181007-1800. Even after several clean builds. API baseline points to 4.9. I see several API related fixes in PDE in the history, will update to yesterdays build.
Comment 11 Andrey Loskutov CLA 2018-10-17 05:49:10 EDT
A new method was added to an API class, so it must be minor segment update.
Comment 12 Lars Vogel CLA 2018-10-17 05:51:26 EDT
(In reply to Lars Vogel from comment #10)
> (In reply to Andrey Loskutov from comment #9)
> > (In reply to Andrey Loskutov from comment #7)

> I'm unable to get an API baseline error with Build id: I20181007-1800. Even
> after several clean builds. API baseline points to 4.9. I see several API
> related fixes in PDE in the history, will update to yesterdays build.

Build id: I20181016-1800 shows the error also for me.