Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorashi2017-04-26 07:11:30 +0000
committerMartin Oberhuber2017-05-18 15:46:31 +0000
commit14b06556b56820167c11462ff9ee8314207632ba (patch)
tree2ee616f5509eac9cfb81940ca55e6dc8044e2376
parenteebcde1a7e617bc224ee3aae170fe456fc2ecb39 (diff)
downloadorg.eclipse.tcf-14b06556b56820167c11462ff9ee8314207632ba.tar.gz
org.eclipse.tcf-14b06556b56820167c11462ff9ee8314207632ba.tar.xz
org.eclipse.tcf-14b06556b56820167c11462ff9ee8314207632ba.zip
Bug 515665 - show full path when download conflict.
Change-Id: I534ffda96ea9b453819217d8a46cd76219d5988c Signed-off-by: ashi <Aijun.Shi@windriver.com>
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.ui/src/org/eclipse/tcf/te/tcf/filesystem/ui/internal/handlers/MoveCopyCallback.java11
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.ui/src/org/eclipse/tcf/te/tcf/filesystem/ui/nls/Messages.properties4
2 files changed, 12 insertions, 3 deletions
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.ui/src/org/eclipse/tcf/te/tcf/filesystem/ui/internal/handlers/MoveCopyCallback.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.ui/src/org/eclipse/tcf/te/tcf/filesystem/ui/internal/handlers/MoveCopyCallback.java
index b47d4e898..b7059ffd3 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.ui/src/org/eclipse/tcf/te/tcf/filesystem/ui/internal/handlers/MoveCopyCallback.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.ui/src/org/eclipse/tcf/te/tcf/filesystem/ui/internal/handlers/MoveCopyCallback.java
@@ -44,6 +44,7 @@ public class MoveCopyCallback implements IConfirmCallback {
@Override
public int confirms(Object object) {
final boolean isDirectory = isDirectory(object);
+ final String path = getAbsolutePath(object);
final String name = getName(object);
final int[] results = new int[1];
Display display = PlatformUI.getWorkbench().getDisplay();
@@ -52,7 +53,7 @@ public class MoveCopyCallback implements IConfirmCallback {
public void run() {
Shell parent = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell();
String title = isDirectory ? Messages.FSOperation_ConfirmFolderReplaceTitle : Messages.FSOperation_ConfirmFileReplace;
- String message = NLS.bind(isDirectory ? Messages.FSOperation_ConfirmFolderReplaceMessage : Messages.FSOperation_ConfirmFileReplaceMessage, name);
+ String message = NLS.bind(isDirectory ? Messages.FSOperation_ConfirmFolderReplaceMessage : Messages.FSOperation_ConfirmFileReplaceMessage, path, name);
final Image titleImage = UIPlugin.getImage(ImageConsts.REPLACE_FOLDER_CONFIRM);
MessageDialog qDialog = new MessageDialog(parent, title, null, message, MessageDialog.QUESTION, new String[] { Messages.FSOperation_ConfirmDialogYes, Messages.FSOperation_ConfirmDialogYesToAll, Messages.FSOperation_ConfirmDialogNo, Messages.FSOperation_ConfirmDialogCancel }, 0) {
@Override
@@ -74,6 +75,14 @@ public class MoveCopyCallback implements IConfirmCallback {
return String.valueOf(object);
}
+ private String getAbsolutePath(Object object) {
+ if (object instanceof IFSTreeNode)
+ return ((IFSTreeNode) object).getLocation();
+ if (object instanceof File)
+ return ((File) object).getAbsolutePath();
+ return String.valueOf(object);
+ }
+
private boolean isDirectory(Object object) {
if (object instanceof IFSTreeNode)
return ((IFSTreeNode) object).isDirectory();
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.ui/src/org/eclipse/tcf/te/tcf/filesystem/ui/nls/Messages.properties b/target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.ui/src/org/eclipse/tcf/te/tcf/filesystem/ui/nls/Messages.properties
index b3feec316..e96bc0fe6 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.ui/src/org/eclipse/tcf/te/tcf/filesystem/ui/nls/Messages.properties
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.ui/src/org/eclipse/tcf/te/tcf/filesystem/ui/nls/Messages.properties
@@ -77,8 +77,8 @@ FSOperation_ConfirmDialogNo=&No
FSOperation_ConfirmDialogYes=&Yes
FSOperation_ConfirmDialogYesToAll=Yes to &All
FSOperation_ConfirmFileReplace=Confirm File Replace
-FSOperation_ConfirmFileReplaceMessage=This folder already contains a file named {0}.\n\n If the files in the existing folder have the same name as files in the folder you are moving or copying, they will be replaced. Do you still want to move or copy the file?
-FSOperation_ConfirmFolderReplaceMessage=This folder already contains a folder named {0}.\n\n If the files in the existing folder have the same name as files in the folder you are moving or copying, they will be replaced. Do you still want to move or copy the folder?
+FSOperation_ConfirmFileReplaceMessage=Folder ''{0}'' already contains a file named ''{1}''.\n\nIf the files in the existing folder have the same name as files in the folder you are moving or copying, they will be replaced. Do you still want to move or copy the file?
+FSOperation_ConfirmFolderReplaceMessage=Folder ''{0}'' already contains a folder named ''{1}''.\n\nIf the files in the existing folder have the same name as files in the folder you are moving or copying, they will be replaced. Do you still want to move or copy the folder?
FSOperation_ConfirmFolderReplaceTitle=Confirm Folder Replace
OpenFileHandler_OpeningBinaryNotSupported=Opening a binary file is not supported yet.
OpenFileHandler_Warning=Warning

Back to the top