Bug 575091 - Provide Builder API for Notication
Summary: Provide Builder API for Notication
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.17   Edit
Hardware: PC Windows 10
: P3 normal (vote)
Target Milestone: 4.22 M1   Edit
Assignee: Marcus Höpfner CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 576696
  Show dependency tree
 
Reported: 2021-07-28 07:41 EDT by Lars Vogel CLA
Modified: 2022-02-21 03:10 EST (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Lars Vogel CLA 2021-07-28 07:41:21 EDT
Currently the usage of the AbstractNotificationPopuprequires that you extend the abstract class. 

I would be nice to have a simple builder api for creating notications.
Comment 1 Lars Vogel CLA 2021-07-28 07:42:53 EDT
Marcus, something for you? This API was contributed by your colleague Matthias Becker.
Comment 2 Marcus Höpfner CLA 2021-08-10 03:29:56 EDT
Nice idea. But actually the NotifcationPopup is like a dialog or view.
It has a createContentArea method like Dialogs, editors and views have.

I understand your use case I guess. E.g. one just wants to set up a quick notification, maybe just a text or a link.
But I'm not sure how a e.g. a builder pattern should be implemented here.
I would need more uses cases to understand what the typical case is. Is it e.g. usually just a text?
I can only find two occurrences of AbstractNotificationPopup, thats not enough to see the typical usage.
Comment 3 Lars Vogel CLA 2021-08-10 03:36:51 EDT
(In reply to Marcus Höpfner from comment #2)
> Nice idea. But actually the NotifcationPopup is like a dialog or view.
> It has a createContentArea method like Dialogs, editors and views have.
> 
> I understand your use case I guess. E.g. one just wants to set up a quick
> notification, maybe just a text or a link.
> But I'm not sure how a e.g. a builder pattern should be implemented here.
> I would need more uses cases to understand what the typical case is. Is it
> e.g. usually just a text?
> I can only find two occurrences of AbstractNotificationPopup, thats not
> enough to see the typical usage.

I think one of the reasons why is it not used a lot is that it is new and hard to use. A builder for just a link or text would be great.


Maybe something like the following:

NotifyBuilder.for(shell).text("Message").title("Title").delay(2000).open();

NotifyBuilder.for(shell).text("Message").title("Title").link(linkWidget).delay(2000).open();
Comment 4 Eclipse Genie CLA 2021-08-11 05:57:47 EDT
New Gerrit change created: https://git.eclipse.org/r/c/platform/eclipse.platform.ui/+/183888
Comment 6 Eclipse Genie CLA 2022-02-21 02:59:19 EST
New Gerrit change created: https://git.eclipse.org/r/c/www.eclipse.org/eclipse/news/+/190992