Class Notifier


  • public class Notifier
    extends java.lang.Object
    This class provides a notifier window, which is a window that appears in the bottom of the screen and slides.
    • Constructor Summary

      Constructors 
      Constructor Description
      Notifier()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      private static void createBackground​(org.eclipse.swt.widgets.Shell shell, NotifierColors colors)
      Creates the background of the window
      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
      private static void createImage​(org.eclipse.swt.widgets.Shell shell, org.eclipse.swt.graphics.Image image)
      Creates the image part of the window
      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
      private static void createText​(org.eclipse.swt.widgets.Shell shell, java.lang.String text, NotifierColors colors)
      Creates the text part of the window
      private static void createTitle​(org.eclipse.swt.widgets.Shell shell, java.lang.String title, NotifierColors colors)
      Creates the title part of the window
      private static java.lang.Runnable fadeOut​(org.eclipse.swt.widgets.Shell shell, boolean fast)  
      protected static void makeShellAppears​(org.eclipse.swt.widgets.Shell shell)  
      static void notify​(java.lang.String title, java.lang.String text)
      Starts a notification.
      static void notify​(java.lang.String title, java.lang.String text, NotifierColorsFactory.NotifierTheme theme)
      Starts a notification.
      static void notify​(org.eclipse.swt.graphics.Image image, java.lang.String title, java.lang.String text)
      Starts a notification.
      static void notify​(org.eclipse.swt.graphics.Image image, java.lang.String title, java.lang.String text, NotifierColorsFactory.NotifierTheme theme)
      Starts a notification.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Notifier

        public Notifier()
    • 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 window
        text - 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 (if null, a default image is displayed)
        title - the title of the popup window
        text - 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 window
        text - the text of the notification
        theme - the graphical theme. If null, 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 (if null, a default image is displayed)
        title - the title of the popup window
        text - the text of the notification
        theme - the graphical theme. If null, 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. If null, a default image is used
        title - title, the title of the window
        text - text of the window
        colors - 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 window
        title - the title
        colors - 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 window
        image - 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 window
        text - the text
        colors - 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 window
        colors - 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 disappear
        fast - 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