Class AbstractNotificationPopup
- java.lang.Object
-
- org.eclipse.jface.window.Window
-
- org.eclipse.jface.notifications.AbstractNotificationPopup
-
- All Implemented Interfaces:
IShellProvider
- Direct Known Subclasses:
NotificationPopup
public abstract class AbstractNotificationPopup extends Window
- Since:
- 0.2
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.eclipse.jface.window.Window
Window.IExceptionHandler
-
-
Field Summary
Fields Modifier and Type Field Description protected LocalResourceManager
resources
-
Fields inherited from class org.eclipse.jface.window.Window
CANCEL, OK, resizeHasOccurred
-
-
Constructor Summary
Constructors Constructor Description AbstractNotificationPopup(Display display)
AbstractNotificationPopup(Display display, int style)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
addWindowActivationHelper(Control control)
Allows to add activation listener to custom control.boolean
close()
Closes this window, disposes its shell, and removes this window from its window manager (if it has one).void
closeFade()
protected void
configureShell(Shell newShell)
Configures the given shell in preparation for opening this window in it.void
create()
Creates this window's widgetry in a new top-level shell.protected void
createContentArea(Composite parent)
Override to populate with notifications.protected Control
createContents(Composite parent)
Creates and returns this window's contents.protected void
createTitleArea(Composite parent)
Override to customize the title barprotected MouseListener
createWindowActivationHelper(Shell parentShell)
Creates listener that shows and activates the main Eclipse window by clicking on the popup control if it was not in foreground.long
getDelayClose()
protected Image
getPopupShellImage(int maximumHeight)
protected String
getPopupShellTitle()
Override to return a customized name.protected Color
getTitleForeground()
protected void
initializeBounds()
Initializes the location and size of this window's SWT shell after it has been created.boolean
isFadingEnabled()
int
open()
Opens this window, creating it first if it has not yet been created.protected void
scheduleAutoClose()
void
setDelayClose(long delayClose)
void
setFadingEnabled(boolean fadingEnabled)
protected void
setParentShell(Shell newParentShell)
Overrides default implementation to add window activation helper.-
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
-
-
-
-
Field Detail
-
resources
protected LocalResourceManager resources
-
-
Method Detail
-
setParentShell
protected void setParentShell(Shell newParentShell)
Overrides default implementation to add window activation helper.Changes the parent shell. This is only safe to use when the shell is not yet realized (i.e., created). Once the shell is created, it must be disposed (i.e., closed) before this method can be called.
- Overrides:
setParentShell
in classWindow
- Parameters:
newParentShell
- The new parent shell; this value may benull
if there is to be no parent.
-
createWindowActivationHelper
protected MouseListener createWindowActivationHelper(Shell parentShell)
Creates listener that shows and activates the main Eclipse window by clicking on the popup control if it was not in foreground.Clients can override if the window activation shouldn't be added to the popup or a different behavior is desired by clicking on the popup.
- Parameters:
parentShell
- parent shell for this popup- Returns:
null
if no window activation should be added to the popup- Since:
- 0.5
-
isFadingEnabled
public boolean isFadingEnabled()
-
setFadingEnabled
public void setFadingEnabled(boolean fadingEnabled)
-
create
public void create()
Description copied from class:Window
Creates this window's widgetry in a new top-level shell.The default implementation of this framework method creates this window's shell (by calling
createShell
), and its controls (by callingcreateContents
), then initializes this window's shell bounds (by callinginitializeBounds
).
-
open
public int open()
Description copied from class:Window
Opens this window, creating it first if it has not yet been created.If this window has been configured to block on open (
setBlockOnOpen
), this method waits until the window is closed by the end user, and then it returns the window's return code; otherwise, this method returns immediately. A window's return codes are window-specific, although two standard return codes are predefined:OK
andCANCEL
.- Overrides:
open
in classWindow
- Returns:
- the return code
- See Also:
Window.create()
-
close
public boolean close()
Description copied from class:Window
Closes this window, disposes its shell, and removes this window from its window manager (if it has one).This framework method may be extended (
super.close
must be called).Note that in order to prevent recursive calls to this method it does not call
Shell#close()
. As a resultShellListener
s will not receive ashellClosed
event.
-
getDelayClose
public long getDelayClose()
-
setDelayClose
public void setDelayClose(long delayClose)
-
closeFade
public void closeFade()
-
getPopupShellTitle
protected String getPopupShellTitle()
Override to return a customized name. Default is to return the name of the product, specified by the -name (e.g. "Eclipse SDK") command line parameter that's associated with the product ID (e.g. "org.eclipse.sdk.ide"). Strips the trailing "SDK" for any name, since this part of the label is considered visual noise.- Returns:
- the name to be used in the title of the popup.
-
getPopupShellImage
protected Image getPopupShellImage(int maximumHeight)
-
createContentArea
protected void createContentArea(Composite parent)
Override to populate with notifications.- Parameters:
parent
- Parent for this component.
-
createTitleArea
protected void createTitleArea(Composite parent)
Override to customize the title bar
-
getTitleForeground
protected Color getTitleForeground()
-
configureShell
protected void configureShell(Shell newShell)
Description copied from class:Window
Configures the given shell in preparation for opening this window in it.The default implementation of this framework method sets the shell's image and gives it a grid layout. Subclasses may extend or reimplement.
- Overrides:
configureShell
in classWindow
- Parameters:
newShell
- the shell
-
scheduleAutoClose
protected void scheduleAutoClose()
-
addWindowActivationHelper
protected void addWindowActivationHelper(Control control)
Allows to add activation listener to custom control. The listener shows and activates the main Eclipse window by clicking on the control if the window was not in foreground.Clients can override to disable window activation on popup clicking
- Since:
- 0.5
-
createContents
protected Control createContents(Composite parent)
Description copied from class:Window
Creates and returns this window's contents. Subclasses may attach any number of children to the parent. As a convenience, the return value of this method will be remembered and returned by subsequent calls to getContents(). Subclasses may modify the parent's layout if they overload getLayout() to return null.It is common practice to create and return a single composite that contains the entire window contents.
The default implementation of this framework method creates an instance of
Composite
. Subclasses may override.- Overrides:
createContents
in classWindow
- Parameters:
parent
- the parent composite for the controls in this window. The type of layout used is determined by getLayout()- Returns:
- the control that will be returned by subsequent calls to getContents()
-
initializeBounds
protected void initializeBounds()
Description copied from class:Window
Initializes the location and size of this window's SWT shell after it has been created.This framework method is called by the
create
framework method. The default implementation callsgetInitialSize
andgetInitialLocation
and passes the results toShell.setBounds
. This is only done if the bounds of the shell have not already been modified. Subclasses may extend or reimplement.- Overrides:
initializeBounds
in classWindow
-
-