[Title] Added fade effect option of NotifierDialog
authorchanghyun1.lee <changhyun1.lee@samsung.com>
Fri, 2 Nov 2012 09:36:39 +0000 (18:36 +0900)
committerchanghyun1.lee <changhyun1.lee@samsung.com>
Fri, 2 Nov 2012 09:36:39 +0000 (18:36 +0900)
[Desc.]
[Issue] Redmine-7372

Change-Id: Iaba216055315966caf41fd5bbd045ee2046aa3b6

org.tizen.common/src/org/tizen/common/util/NotifierDialog.java

index 3944a19..f42caca 100644 (file)
@@ -93,12 +93,24 @@ public class NotifierDialog {
 
     /**
      * Creates and shows a notification dialog with a specific title, message and icon
-     * 
+     *
      * @param title
      * @param message
      * @param type
      */
     public static void notify(String title, String message, NotificationType type) {
+        notify(title, message, type, true);
+    }
+
+    /**
+     * Creates and shows a notification dialog with a specific title, message, icon and fade effect
+     *
+     * @param title
+     * @param message
+     * @param type
+     * @param fade
+     */
+    public static void notify(String title, String message, NotificationType type, boolean fade) {
         Shell eclipseShell = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell();
         _shell = new Shell(eclipseShell, SWT.NO_FOCUS | SWT.NO_TRIM);
         //_shell = new Shell(Display.getDefault().getActiveShell(), SWT.NO_FOCUS | SWT.NO_TRIM);
@@ -250,7 +262,7 @@ public class NotifierDialog {
 
         _activeShells.add(_shell);
 
-        fadeIn(_shell);
+        fadeIn(_shell, fade);
     }
 
     private static void addLabelButtonListner (Label button) {
@@ -296,7 +308,7 @@ public class NotifierDialog {
         }
     }
 
-    private static void fadeIn(final Shell _shell) {
+    private static void fadeIn(final Shell _shell, final boolean fade) {
         Runnable run = new Runnable() {
 
             @Override
@@ -309,7 +321,9 @@ public class NotifierDialog {
 
                     if (cur > FINAL_ALPHA) {
                         _shell.setAlpha(FINAL_ALPHA);
-                        startTimer(_shell);
+                        if (fade) {
+                            startTimer(_shell);
+                        }
                         return;
                     }