Package org.eclipse.jface.notifications
Class NotificationPopup
java.lang.Object
org.eclipse.jface.window.Window
org.eclipse.jface.notifications.AbstractNotificationPopup
org.eclipse.jface.notifications.NotificationPopup
- All Implemented Interfaces:
IShellProvider
NotificationPopup is a default implementation of
AbstractNotificationPopup
. Instances can be created with a fluent
NotificationPopup.Builder
api.
It covers use cases such as setting a title and/or a text as content. Also
functions can be passed to create the title and/or content. More complex
cases with e.g. several SWT controls should still be created by extending
AbstractNotificationPopup
.
Example:
NotificationPopup.forDisplay(Display.getDefault()).text("A problem occurred.").title("Warning", true).open();
- Since:
- 0.4
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
The Builder to create NotificationPopup instances.Nested classes/interfaces inherited from class org.eclipse.jface.window.Window
Window.IExceptionHandler
-
Field Summary
Fields inherited from class org.eclipse.jface.notifications.AbstractNotificationPopup
resources
Fields inherited from class org.eclipse.jface.window.Window
CANCEL, OK, resizeHasOccurred
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
createContentArea
(Composite parent) Override to populate with notifications.protected void
createTitleArea
(Composite parent) Override to customize the title barstatic NotificationPopup.Builder
forDisplay
(Display display) Creates a new builder instance.static NotificationPopup.Builder
Creates a new builder instance using a shell.Methods inherited from class org.eclipse.jface.notifications.AbstractNotificationPopup
addWindowActivationHelper, close, closeFade, configureShell, create, createContents, createWindowActivationHelper, getDelayClose, getPopupShellImage, getPopupShellTitle, getTitleForeground, initializeBounds, isFadingEnabled, open, scheduleAutoClose, setDelayClose, setFadingEnabled, setParentShell
Methods inherited from class org.eclipse.jface.window.Window
canHandleShellCloseEvent, constrainShellSize, createShell, getConstrainedShellBounds, getContents, getDefaultImage, getDefaultImages, getDefaultOrientation, getInitialLocation, getInitialSize, getLayout, getParentShell, getReturnCode, getShell, getShellListener, getShellStyle, getWindowManager, handleFontChange, handleShellCloseEvent, setBlockOnOpen, setDefaultImage, setDefaultImages, setDefaultModalParent, setDefaultOrientation, setExceptionHandler, setReturnCode, setShellStyle, setWindowManager
-
Method Details
-
forDisplay
Creates a new builder instance.- Parameters:
display
- the display to use- Returns:
- the builder instance
-
forShell
Creates a new builder instance using a shell.The shell is set as parent shell in the notification popup.
- Parameters:
shell
- the shell to use- Returns:
- the builder instance
- Since:
- 0.7
- See Also:
-
createTitleArea
Description copied from class:AbstractNotificationPopup
Override to customize the title bar- Overrides:
createTitleArea
in classAbstractNotificationPopup
-
createContentArea
Description copied from class:AbstractNotificationPopup
Override to populate with notifications.- Overrides:
createContentArea
in classAbstractNotificationPopup
- Parameters:
parent
- Parent for this component.
-