diff options
author | Michael Valenta | 2007-04-11 14:29:54 +0000 |
---|---|---|
committer | Michael Valenta | 2007-04-11 14:29:54 +0000 |
commit | aeb150c60fe4d48b8ad27830fc0c2af1c7f34052 (patch) | |
tree | a4f1b9c2a968bda0b90709bccf8f1450c09fd6cf /bundles/org.eclipse.team.cvs.ui | |
parent | d9a415e77831744b0516e26d0e7b92888ce563ff (diff) | |
download | eclipse.platform.team-aeb150c60fe4d48b8ad27830fc0c2af1c7f34052.tar.gz eclipse.platform.team-aeb150c60fe4d48b8ad27830fc0c2af1c7f34052.tar.xz eclipse.platform.team-aeb150c60fe4d48b8ad27830fc0c2af1c7f34052.zip |
Bug 178236 [Repo View] Discarding repository location should be confirmed
Diffstat (limited to 'bundles/org.eclipse.team.cvs.ui')
3 files changed, 28 insertions, 4 deletions
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSUIMessages.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSUIMessages.java index ace7310f9..6eaf1ad24 100644 --- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSUIMessages.java +++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSUIMessages.java @@ -79,6 +79,9 @@ public class CVSUIMessages extends NLS { public static String PasswordManagementPreferencePage_4; public static String PasswordManagementPreferencePage_5; public static String PasswordManagementPreferencePage_6; + public static String RemoveRootAction_RepositoryRemovalDialogMessageMultiple; + public static String RemoveRootAction_RepositoryRemovalDialogMessageSingle; + public static String RemoveRootAction_RepositoryRemovalDialogTitle; public static String ReplaceWithLatestRevisionAction_error; public static String ShowAnnotationOperation_QDAnnotateMessage; public static String ShowAnnotationOperation_QDAnnotateTitle; diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/messages.properties b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/messages.properties index 3c6829f6c..9d505d6bc 100644 --- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/messages.properties +++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/messages.properties @@ -665,6 +665,7 @@ RemoteLogOperation_0=Fetching log information from {0} RemoteLogOperation_1=Fetching log information RemoveDateTagAction_0=&Remove RemoteRootAction_Unable_to_Discard_Location_1=Unable to Discard Location +RemoveRootAction_RepositoryRemovalDialogTitle=Confirm Discard RemoteRootAction_Projects_in_the_local_workspace_are_shared_with__2=Projects in the local workspace are shared with {0}. This location cannot be discarded until all local projects are disconnected from it. RemoteRootAction_The_projects_that_are_shared_with_the_above_repository_are__4=The projects that are shared with the above repository are: @@ -1161,3 +1162,5 @@ AnnotatePreferencePage_AnnotatePrefPageBinaryFileMessage=Attempt to annotate a & DiffOperation_CreatePatchConflictTitle=Patch Already Being Created DiffOperation_CreatePatchConflictMessage=A patch is already in the process of being written to {0}. Do you want to cancel the previous patch creation and continue with this one? ClipboardDiffOperation_Clipboard=the clipboard +RemoveRootAction_RepositoryRemovalDialogMessageSingle=Are you sure you want to discard ''{0}''? +RemoveRootAction_RepositoryRemovalDialogMessageMultiple=Are you sure you want to discard these {0} repositories? diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/repo/RemoveRootAction.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/repo/RemoveRootAction.java index b9da7a315..432222c57 100644 --- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/repo/RemoveRootAction.java +++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/repo/RemoveRootAction.java @@ -17,9 +17,10 @@ import java.util.Iterator; import org.eclipse.core.resources.IProject; import org.eclipse.core.resources.ResourcesPlugin; import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.core.runtime.Platform; import org.eclipse.core.runtime.jobs.ISchedulingRule; +import org.eclipse.core.runtime.jobs.Job; import org.eclipse.jface.dialogs.Dialog; +import org.eclipse.jface.dialogs.MessageDialog; import org.eclipse.jface.operation.IRunnableWithProgress; import org.eclipse.jface.viewers.IStructuredSelection; import org.eclipse.osgi.util.NLS; @@ -75,8 +76,25 @@ public class RemoveRootAction extends SelectionListenerAction { } public void run() { - ICVSRepositoryLocation[] roots = getSelectedRemoteRoots(); + final ICVSRepositoryLocation[] roots = getSelectedRemoteRoots(); if (roots.length == 0) return; + final boolean[] proceed = new boolean[1]; + shell.getDisplay().syncExec(new Runnable(){ + public void run() { + String message; + if(roots.length == 1){ + message = NLS.bind(CVSUIMessages.RemoveRootAction_RepositoryRemovalDialogMessageSingle, roots[0].getLocation(true)); + } else { + message = NLS.bind(CVSUIMessages.RemoveRootAction_RepositoryRemovalDialogMessageMultiple, new Integer(roots.length)); + } + proceed[0] = MessageDialog.openQuestion(shell, + CVSUIMessages.RemoveRootAction_RepositoryRemovalDialogTitle, + message); + } + }); + if(!proceed[0]){ + return; + } for (int i = 0; i < roots.length; i++) { final ICVSRepositoryLocation root = roots[i]; try { @@ -116,11 +134,11 @@ public class RemoveRootAction extends SelectionListenerAction { public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException { final ISchedulingRule rule = new RepositoryLocationSchedulingRule(root); try { - Platform.getJobManager().beginRule(rule, monitor); + Job.getJobManager().beginRule(rule, monitor); view.getContentProvider().cancelJobs(root); KnownRepositories.getInstance().disposeRepository(root); } finally { - Platform.getJobManager().endRule(rule); + Job.getJobManager().endRule(rule); } } |