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 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 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

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 bar
`static NotificationPopup.Builder`
`forDisplay(Display display)`
Creates a new builder instance.
`static NotificationPopup.Builder`
`forShell(Shell shell)`
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`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Method Details

### forDisplay

public static NotificationPopup.Builder forDisplay(Display display)
Creates a new builder instance.

Parameters:
  `display` - the display to use
Returns:
  the builder instance

### forShell

public static NotificationPopup.Builder forShell(Shell shell)
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:
  - `AbstractNotificationPopup.setParentShell(Shell)`

### createTitleArea

protected void createTitleArea(Composite parent)
Description copied from class: `AbstractNotificationPopup`
Override to customize the title bar

Overrides:
  `createTitleArea` in class `AbstractNotificationPopup`

### createContentArea

protected void createContentArea(Composite parent)
Description copied from class: `AbstractNotificationPopup`
Override to populate with notifications.

Overrides:
  `createContentArea` in class `AbstractNotificationPopup`
Parameters:
  `parent` - Parent for this component.