Class AbstractNotificationPopup

    • Constructor Detail

      • AbstractNotificationPopup

        public AbstractNotificationPopup​(Display display)
      • AbstractNotificationPopup

        public AbstractNotificationPopup​(Display display,
                                         int style)
    • 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.

        setParentShell in class Window
        newParentShell - The new parent shell; this value may be null 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.

        parentShell - parent shell for this popup
        null if no window activation should be added to the popup
      • 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 calling createContents), then initializes this window's shell bounds (by calling initializeBounds).

        create in class Window
      • 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 and CANCEL.

        open in class Window
        the return code
        See Also:
      • 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 result ShellListeners will not receive a shellClosed event.

        close in class Window
        true if the window is (or was already) closed, and false if it is still open
      • 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.
        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.
        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.

        configureShell in class Window
        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

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

        createContents in class Window
        parent - the parent composite for the controls in this window. The type of layout used is determined by getLayout()
        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 calls getInitialSize and getInitialLocation and passes the results to Shell.setBounds. This is only done if the bounds of the shell have not already been modified. Subclasses may extend or reimplement.

        initializeBounds in class Window