mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-02 22:55:26 +02:00
[248922] [dnd] display error message when copy operation hits exception
This commit is contained in:
parent
d97b8d1ac0
commit
7788549911
1 changed files with 6 additions and 13 deletions
|
@ -75,7 +75,6 @@ import org.eclipse.swt.widgets.Shell;
|
|||
import org.eclipse.ui.PlatformUI;
|
||||
import org.eclipse.ui.ide.undo.CopyResourcesOperation;
|
||||
import org.eclipse.ui.ide.undo.WorkspaceUndoUtil;
|
||||
import org.eclipse.ui.internal.ide.IDEWorkbenchMessages;
|
||||
import org.eclipse.ui.progress.UIJob;
|
||||
|
||||
|
||||
|
@ -404,14 +403,16 @@ public class SystemDNDTransferRunnable extends WorkspaceJob
|
|||
PlatformUI.getWorkbench().getOperationSupport()
|
||||
.getOperationHistory().execute(op, monitor,adaptable);
|
||||
} catch (ExecutionException e) {
|
||||
SystemMessage errorMessage = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_EXCEPTION_OCCURRED);
|
||||
if (e.getCause() instanceof CoreException) {
|
||||
SystemBasePlugin.logError(e.getMessage(), e);
|
||||
displayError(e.getCause().getMessage());
|
||||
SystemBasePlugin.logError(e.getMessage(), e);
|
||||
errorMessage.makeSubstitution(e.getCause().getMessage());
|
||||
} else {
|
||||
SystemBasePlugin.logError(e.getMessage(), e);
|
||||
displayError(e.getMessage());
|
||||
errorMessage.makeSubstitution(e.getMessage());
|
||||
}
|
||||
|
||||
showErrorMessage(errorMessage);
|
||||
operationFailed(monitor);
|
||||
return false;
|
||||
}
|
||||
|
@ -420,15 +421,7 @@ public class SystemDNDTransferRunnable extends WorkspaceJob
|
|||
return true;
|
||||
}
|
||||
|
||||
private void displayError(final String message) {
|
||||
PlatformUI.getWorkbench().getDisplay().syncExec(new Runnable() {
|
||||
public void run() {
|
||||
Shell shell = PlatformUI.getWorkbench().getDisplay().getActiveShell();
|
||||
MessageDialog.openError(shell, IDEWorkbenchMessages.CopyFilesAndFoldersOperation_copyFailedTitle,
|
||||
message);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private int checkOverwrite(final IResource source, final IResource destination) {
|
||||
final int[] result = new int[1]; // using array since you can't change a final int
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue