[Title]Fix overwrite dialog bug with yes-to-all case
authorhyunsik.noh <hyunsik.noh@samsung.com>
Wed, 17 Oct 2012 11:23:29 +0000 (20:23 +0900)
committerhyunsik.noh <hyunsik.noh@samsung.com>
Thu, 18 Oct 2012 06:24:35 +0000 (15:24 +0900)
[Type]bugfix
[Module]common
[Redmine#]6892

Change-Id: I4967f93c68df52e2649f7085ef48c2dbb45bcfb0

org.tizen.common.connection/src/org/tizen/common/connection/ddmuilib/FileDialogUtils.java
org.tizen.common.connection/src/org/tizen/common/connection/explorer/ConnectionExplorerPanel.java
org.tizen.common.connection/src/org/tizen/common/connection/sdblib/dnd/FileEntryDropAdapter.java

index a6af7cb..1c2c41b 100644 (file)
@@ -36,11 +36,16 @@ import org.tizen.common.connection.explorer.Messages;
 
 public class FileDialogUtils
 {
+    public static final int YES_ID = 0;
+    public static final int YES_TO_ALL_ID = 1;
+    public static final int NO_ID = 2;
+    public static final int CANCEL_ID = 3;
+    
     public static int checkOverwrite(final String filename)
     {
         String message = NLS.bind(Messages.getString("FileDialogUtils.overwrite.message"), filename);
-        String[] labels = new String[] { IDialogConstants.YES_LABEL, IDialogConstants.YES_TO_ALL_LABEL, IDialogConstants.NO_LABEL,
-                IDialogConstants.CANCEL_LABEL };
+        String[] labels = new String[] {
+                IDialogConstants.YES_LABEL, IDialogConstants.YES_TO_ALL_LABEL, IDialogConstants.NO_LABEL, IDialogConstants.CANCEL_LABEL};
         int type = MessageDialog.QUESTION;
         return openFileDialog(labels, message, type);
     }
@@ -103,4 +108,4 @@ public class FileDialogUtils
         PlatformUI.getWorkbench().getDisplay().syncExec(query);
         return resultAtomicInteger.get();
     }
-}
\ No newline at end of file
+}
index e58c334..501286f 100755 (executable)
@@ -933,15 +933,15 @@ public class ConnectionExplorerPanel extends Panel implements IDeviceChangeListe
                     } else
                     {
                         ret = FileDialogUtils.checkOverwrite(f.getName());
-                        switch (ret)
+                        switch (ret )
                         {
-                        case IDialogConstants.CANCEL_ID:
+                        case FileDialogUtils.CANCEL_ID:
                             return null;
-                        case IDialogConstants.NO_ID:
+                        case FileDialogUtils.NO_ID:
                             continue;
-                        case IDialogConstants.YES_TO_ALL_ID:
+                        case FileDialogUtils.YES_TO_ALL_ID:
                             yesAll = true;
-                        case IDialogConstants.YES_ID:
+                        case FileDialogUtils.YES_ID:
                             break;
                         default:
                             break;
index 55f0d12..d116656 100755 (executable)
@@ -33,7 +33,6 @@ import org.eclipse.core.resources.ResourcesPlugin;
 import org.eclipse.core.runtime.CoreException;
 import org.eclipse.core.runtime.IAdaptable;
 import org.eclipse.core.runtime.IPath;
-import org.eclipse.jface.dialogs.IDialogConstants;
 import org.eclipse.ui.part.IDropActionDelegate;
 import org.tizen.common.connection.ConnectionPlugin;
 import org.tizen.common.connection.ddmuilib.FileDialogUtils;
@@ -100,12 +99,12 @@ public class FileEntryDropAdapter implements IDropActionDelegate {
                                        if (isAlwayCopy == false) {
                                                int ret = FileDialogUtils.checkOverwrite(f.getName());
                                                switch (ret) {
-                                                       case IDialogConstants.CANCEL_ID :
+                                                       case FileDialogUtils.CANCEL_ID :
                                                                return false;
-                                                       case IDialogConstants.YES_TO_ALL_ID :
+                                                       case FileDialogUtils.YES_TO_ALL_ID :
                                                                isAlwayCopy = true;
                                                                break;
-                                                       case IDialogConstants.NO_ID :
+                                                       case FileDialogUtils.NO_ID :
                                                                continue;
                                                        default:
                                                }