Package org.eclipse.jface.notifications
Class NotificationPopup.Builder
java.lang.Object
org.eclipse.jface.notifications.NotificationPopup.Builder
- Enclosing class:
- NotificationPopup
The Builder to create NotificationPopup instances. It has a fluent API (every
method returns the same builder instance).
- Since:
- 0.4
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Creates the notification popup with all parameters set in the builder.Sets the function to create the main content of the notification popup in the given composite.delay
(long delay) Sets the visible time of the popup before it disappears.fadeIn
(boolean fadeIn) Sets whether the popup should fade in or just appear.int
open()
Creates and opens the popup.Sets the content text.Sets the title text.Sets the function to create the title area's content of the notification popup in the given composite.titleImage
(Image image) Sets the title image.
-
Method Details
-
content
Sets the function to create the main content of the notification popup in the given composite. Is called when the content is created.- Parameters:
contentCreator
- the content creation function- Returns:
- this
-
text
Sets the content text. A label is created to show the given text.- Parameters:
text
- the content text- Returns:
- this
-
title
public NotificationPopup.Builder title(Function<Composite, Control> titleCreator, boolean hasCloseButton) Sets the function to create the title area's content of the notification popup in the given composite. Is called when the title is created.- Parameters:
titleCreator
- the title creation functionhasCloseButton
- whether to show or not to show a close image- Returns:
- this
-
title
Sets the title text. A label is created to show the given title.- Parameters:
title
- the title texthasCloseButton
- whether to show or not to show a close image- Returns:
- this
-
titleImage
Sets the title image.- Parameters:
image
- the title image- Returns:
- this
-
delay
Sets the visible time of the popup before it disappears.- Parameters:
delay
- the time in milliseconds- Returns:
- this
-
fadeIn
Sets whether the popup should fade in or just appear.- Parameters:
fadeIn
- whether or not to fade in- Returns:
- this
-
open
public int open()Creates and opens the popup. This is a shorthand for:NotificationPopup popup = builder.build(); int open = popup.open();
- Returns:
- the return code of open()
-
build
Creates the notification popup with all parameters set in the builder.- Returns:
- the notification popup
-