Class Notifier
- java.lang.Object
-
- org.eclipse.nebula.widgets.opal.notifier.Notifier
-
public class Notifier extends java.lang.ObjectThis class provides a notifier window, which is a window that appears in the bottom of the screen and slides.
-
-
Field Summary
Fields Modifier and Type Field Description private static intDISPLAY_TIMEprivate static intFADE_OUT_STEPprivate static intFADE_TIMERprivate static intFONT_SIZEprivate static intMAX_DURATION_FOR_OPENINGprivate static intSTEP
-
Constructor Summary
Constructors Constructor Description Notifier()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description private static voidcreateBackground(org.eclipse.swt.widgets.Shell shell, NotifierColors colors)Creates the background of the windowprivate static voidcreateCloseAction(org.eclipse.swt.widgets.Shell shell)Add a listener to the shell in order to handle the clicks on the close buttonprivate static voidcreateImage(org.eclipse.swt.widgets.Shell shell, org.eclipse.swt.graphics.Image image)Creates the image part of the windowprotected static org.eclipse.swt.widgets.ShellcreateNotificationWindow(org.eclipse.swt.graphics.Image image, java.lang.String title, java.lang.String text, NotifierColors colors)Creates a notification windowprivate static voidcreateText(org.eclipse.swt.widgets.Shell shell, java.lang.String text, NotifierColors colors)Creates the text part of the windowprivate static voidcreateTitle(org.eclipse.swt.widgets.Shell shell, java.lang.String title, NotifierColors colors)Creates the title part of the windowprivate static java.lang.RunnablefadeOut(org.eclipse.swt.widgets.Shell shell, boolean fast)protected static voidmakeShellAppears(org.eclipse.swt.widgets.Shell shell)static voidnotify(java.lang.String title, java.lang.String text)Starts a notification.static voidnotify(java.lang.String title, java.lang.String text, NotifierColorsFactory.NotifierTheme theme)Starts a notification.static voidnotify(org.eclipse.swt.graphics.Image image, java.lang.String title, java.lang.String text)Starts a notification.static voidnotify(org.eclipse.swt.graphics.Image image, java.lang.String title, java.lang.String text, NotifierColorsFactory.NotifierTheme theme)Starts a notification.
-
-
-
Field Detail
-
FONT_SIZE
private static final int FONT_SIZE
- See Also:
- Constant Field Values
-
MAX_DURATION_FOR_OPENING
private static final int MAX_DURATION_FOR_OPENING
- See Also:
- Constant Field Values
-
DISPLAY_TIME
private static final int DISPLAY_TIME
- See Also:
- Constant Field Values
-
FADE_TIMER
private static final int FADE_TIMER
- See Also:
- Constant Field Values
-
FADE_OUT_STEP
private static final int FADE_OUT_STEP
- See Also:
- Constant Field Values
-
STEP
private static final int STEP
- See Also:
- Constant Field Values
-
-
Method Detail
-
notify
public static void notify(java.lang.String title, java.lang.String text)Starts a notification. A window will appear in the bottom of the screen, then will disappear after 4.5 s- Parameters:
title- the title of the popup windowtext- the text of the notification
-
notify
public static void notify(org.eclipse.swt.graphics.Image image, java.lang.String title, java.lang.String text)Starts a notification. A window will appear in the bottom of the screen, then will disappear after 4.5 s- Parameters:
image- the image to display (ifnull, a default image is displayed)title- the title of the popup windowtext- the text of the notification
-
notify
public static void notify(java.lang.String title, java.lang.String text, NotifierColorsFactory.NotifierTheme theme)Starts a notification. A window will appear in the bottom of the screen, then will disappear after 4.5 s- Parameters:
title- the title of the popup windowtext- the text of the notificationtheme- the graphical theme. Ifnull, the yellow theme is used- See Also:
NotifierColorsFactory.NotifierTheme
-
notify
public static void notify(org.eclipse.swt.graphics.Image image, java.lang.String title, java.lang.String text, NotifierColorsFactory.NotifierTheme theme)Starts a notification. A window will appear in the bottom of the screen, then will disappear after 4.5 s- Parameters:
image- the image to display (ifnull, a default image is displayed)title- the title of the popup windowtext- the text of the notificationtheme- the graphical theme. Ifnull, the yellow theme is used- See Also:
NotifierColorsFactory.NotifierTheme
-
createNotificationWindow
protected static org.eclipse.swt.widgets.Shell createNotificationWindow(org.eclipse.swt.graphics.Image image, java.lang.String title, java.lang.String text, NotifierColors colors)Creates a notification window- Parameters:
image- image. Ifnull, a default image is usedtitle- title, the title of the windowtext- text of the windowcolors- color set- Returns:
- the notification window as a shell object
-
createTitle
private static void createTitle(org.eclipse.swt.widgets.Shell shell, java.lang.String title, NotifierColors colors)Creates the title part of the window- Parameters:
shell- the windowtitle- the titlecolors- the color set
-
createImage
private static void createImage(org.eclipse.swt.widgets.Shell shell, org.eclipse.swt.graphics.Image image)Creates the image part of the window- Parameters:
shell- the windowimage- the image
-
createText
private static void createText(org.eclipse.swt.widgets.Shell shell, java.lang.String text, NotifierColors colors)Creates the text part of the window- Parameters:
shell- the windowtext- the textcolors- the color set
-
createBackground
private static void createBackground(org.eclipse.swt.widgets.Shell shell, NotifierColors colors)Creates the background of the window- Parameters:
shell- the windowcolors- the color set of the window
-
makeShellAppears
protected static void makeShellAppears(org.eclipse.swt.widgets.Shell shell)
- Parameters:
shell- shell that will appear
-
fadeOut
private static java.lang.Runnable fadeOut(org.eclipse.swt.widgets.Shell shell, boolean fast)- Parameters:
shell- shell that will disappearfast- if true, the fading is much faster- Returns:
- a runnable
-
createCloseAction
private static void createCloseAction(org.eclipse.swt.widgets.Shell shell)
Add a listener to the shell in order to handle the clicks on the close button- Parameters:
shell- associated shell
-
-