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
Nested ClassesModifier and TypeClassDescriptionstatic classThe 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
resourcesFields inherited from class org.eclipse.jface.window.Window
CANCEL, OK, resizeHasOccurred -
Method Summary
Modifier and TypeMethodDescriptionprotected voidcreateContentArea(Composite parent) Override to populate with notifications.protected voidcreateTitleArea(Composite parent) Override to customize the title barstatic NotificationPopup.BuilderforDisplay(Display display) Creates a new builder instance.static NotificationPopup.BuilderCreates 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, setParentShellMethods 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:AbstractNotificationPopupOverride to customize the title bar- Overrides:
createTitleAreain classAbstractNotificationPopup
-
createContentArea
Description copied from class:AbstractNotificationPopupOverride to populate with notifications.- Overrides:
createContentAreain classAbstractNotificationPopup- Parameters:
parent- Parent for this component.
-