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
public class NotificationPopup extends AbstractNotificationPopup
NotificationPopup is a default implementation ofAbstractNotificationPopup
. Instances can be created with a fluentNotificationPopup.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 Classes Modifier and Type Class Description static class
NotificationPopup.Builder
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
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected 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.-
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 Detail
-
forDisplay
public static NotificationPopup.Builder forDisplay(Display display)
Creates a new builder instance.- Parameters:
display
- the display to use- Returns:
- the builder instance
-
createTitleArea
protected void createTitleArea(Composite parent)
Description copied from class:AbstractNotificationPopup
Override to customize the title bar- Overrides:
createTitleArea
in classAbstractNotificationPopup
-
createContentArea
protected void createContentArea(Composite parent)
Description copied from class:AbstractNotificationPopup
Override to populate with notifications.- Overrides:
createContentArea
in classAbstractNotificationPopup
- Parameters:
parent
- Parent for this component.
-
-