summaryrefslogtreecommitdiffstatsabout
diff options
context:
space:
mode:
authorJens Baumgart2010-09-21 12:55:55 (EDT)
committer Jens Baumgart2010-09-21 12:55:55 (EDT)
commit713fa7faeda7f44964634268ee2d3647d18976e9 (patch)
tree5389d7067ce2daef1d21445a9641a9aa71565a02
parent2b1814e12235a968ccfffc14231ddd491b43ecdc (diff)
downloadegit-713fa7faeda7f44964634268ee2d3647d18976e9.zip
egit-713fa7faeda7f44964634268ee2d3647d18976e9.tar.gz
egit-713fa7faeda7f44964634268ee2d3647d18976e9.tar.bz2
Fix error on repository deletionrefs/changes/37/1637/1
Obtain seletion in UI thread instead of obtaining selection in execution job. Bug: 325861 Change-Id: Ie5de9d0315c8d9569ee4f7b89f2b9cee2d5681ce Signed-off-by: Jens Baumgart <jens.baumgart@sap.com>
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/tree/command/RemoveCommand.java59
1 files changed, 26 insertions, 33 deletions
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/tree/command/RemoveCommand.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/tree/command/RemoveCommand.java
index e24e936..fcc7fa3 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/tree/command/RemoveCommand.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/tree/command/RemoveCommand.java
@@ -66,32 +66,33 @@ public class RemoveCommand extends
IWorkbenchSiteProgressService service = (IWorkbenchSiteProgressService) activeSite
.getService(IWorkbenchSiteProgressService.class);
- if (delete)
- try {
- List<RepositoryNode> selectedNodes = getSelectedNodes(event);
- String title = UIText.RemoveCommand_DeleteConfirmTitle;
- if (selectedNodes.size() > 1) {
- String message = NLS.bind(
- UIText.RemoveCommand_DeleteConfirmSingleMessage,
- Integer.valueOf(selectedNodes.size()));
- if (!MessageDialog.openConfirm(getShell(event), title,
- message))
- return;
- } else if (selectedNodes.size() == 1) {
- String name = org.eclipse.egit.core.Activator.getDefault()
- .getRepositoryUtil().getRepositoryName(
- selectedNodes.get(0).getObject());
- String message = NLS.bind(
- UIText.RemoveCommand_DeleteConfirmMultiMessage,
- name);
- if (!MessageDialog.openConfirm(getShell(event), title,
- message))
- return;
- }
- } catch (ExecutionException e) {
- Activator.handleError(e.getMessage(), e, false);
- return;
+ // get selected nodes
+ final List<RepositoryNode> selectedNodes;
+ try {
+ selectedNodes = getSelectedNodes(event);
+ } catch (ExecutionException e) {
+ Activator.handleError(e.getMessage(), e, true);
+ return;
+ }
+
+ if (delete) {
+ String title = UIText.RemoveCommand_DeleteConfirmTitle;
+ if (selectedNodes.size() > 1) {
+ String message = NLS.bind(
+ UIText.RemoveCommand_DeleteConfirmSingleMessage,
+ Integer.valueOf(selectedNodes.size()));
+ if (!MessageDialog.openConfirm(getShell(event), title, message))
+ return;
+ } else if (selectedNodes.size() == 1) {
+ String name = org.eclipse.egit.core.Activator.getDefault()
+ .getRepositoryUtil()
+ .getRepositoryName(selectedNodes.get(0).getObject());
+ String message = NLS.bind(
+ UIText.RemoveCommand_DeleteConfirmMultiMessage, name);
+ if (!MessageDialog.openConfirm(getShell(event), title, message))
+ return;
}
+ }
Job job = new Job("Remove Repositories Job") { //$NON-NLS-1$
@@ -102,14 +103,6 @@ public class RemoveCommand extends
monitor
.setTaskName(UIText.RepositoriesView_DeleteRepoDeterminProjectsMessage);
- List<RepositoryNode> selectedNodes;
- try {
- selectedNodes = getSelectedNodes(event);
- } catch (ExecutionException e) {
- Activator.logError(e.getMessage(), e);
- return new Status(IStatus.ERROR, Activator.getPluginId(), e
- .getMessage(), e);
- }
for (RepositoryNode node : selectedNodes) {
if (node.getRepository().isBare())
continue;