progress dialog: add a new type without cancel button
authorhyeran74.kim <hyeran74.kim@samsung.com>
Tue, 6 Oct 2015 02:01:00 +0000 (11:01 +0900)
committerJaewon Lim <jaewon81.lim@samsung.com>
Tue, 6 Oct 2015 09:24:22 +0000 (18:24 +0900)
Change-Id: I178286f7850c94e54992ff67927f4496fad8376b
Signed-off-by: hyeran74.kim <hyeran74.kim@samsung.com>
org.tizen.dynamicanalyzer.appearance/src/org/tizen/dynamicanalyzer/widgets/da/base/ProgressDialog.java

index 267405a..ed91247 100644 (file)
@@ -46,7 +46,6 @@ import org.eclipse.swt.widgets.Display;
 import org.eclipse.swt.widgets.Event;
 import org.eclipse.swt.widgets.Label;
 import org.eclipse.swt.widgets.Listener;
-import org.eclipse.swt.widgets.Monitor;
 import org.eclipse.swt.widgets.Shell;
 import org.tizen.dynamicanalyzer.resources.ColorResources;
 import org.tizen.dynamicanalyzer.resources.FontResources;
@@ -59,14 +58,15 @@ import org.tizen.dynamicanalyzer.widgets.button.DACustomButtonClickEventListener
 import org.tizen.dynamicanalyzer.widgets.progress.Progress;
 
 public class ProgressDialog {
-       public static final int PROGRESS_STYLE_CANCEL = 0; // default
-       public static final int PROGRESS_STYLE_WARNING = 1; 
+       public static final int PROGRESS_STYLE_DEFAULT = 0;// default
+       public static final int PROGRESS_STYLE_CANCEL = 1; 
+       public static final int PROGRESS_STYLE_WARNING = 2; 
        
        public static final int DIALOG_TYPE_SMALL = 0;  // default, 41 letters in 1 line (max 3 line)
        public static final int DIALOG_TYPE_MIDDLE = 1;         // 41 letters in 1 line (max 6 line)
        public static final int DIALOG_TYPE_LARGE = 2;  // 41 letters in 1 line (max 10 line)
        
-       private int progressStyle = PROGRESS_STYLE_CANCEL;
+       private int progressStyle = PROGRESS_STYLE_DEFAULT;
        private int dialogType = DIALOG_TYPE_SMALL;
        
        private Shell parent = null;
@@ -141,6 +141,7 @@ public class ProgressDialog {
 
        public void open() {
                switch (progressStyle) {
+               case PROGRESS_STYLE_DEFAULT:
                case PROGRESS_STYLE_CANCEL:
                        // create progress dialog
                        createProgress();
@@ -255,11 +256,14 @@ public class ProgressDialog {
                cancelData.height = 22;
 
                // cancel button
-               cancelButton = createButton(progressComp, "Cancel", cancelData);
-               cancelButton.setLayoutData(cancelData);
-               if (cancelButtonListener != null) {
-                       cancelButton.addClickListener(cancelButtonListener);
+               if(progressStyle == PROGRESS_STYLE_CANCEL) {
+                       cancelButton = createButton(progressComp, "Cancel", cancelData);
+                       cancelButton.setLayoutData(cancelData);
+                       if (cancelButtonListener != null) {
+                               cancelButton.addClickListener(cancelButtonListener);
+                       }
                }
+       
        }
        
        public void createWarningProgress() {