Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Valenta2002-05-17 14:35:31 -0400
committerMichael Valenta2002-05-17 14:35:31 -0400
commit4bff32bf7c9c28c071a22b54a4d1201e094cb35d (patch)
tree4d34ccffa04b9fec72ca90753b27c33b548e31c7
parentf36940139e02c8226561b391d361a25a95acc2e1 (diff)
downloadeclipse.platform.team-4bff32bf7c9c28c071a22b54a4d1201e094cb35d.tar.gz
eclipse.platform.team-4bff32bf7c9c28c071a22b54a4d1201e094cb35d.tar.xz
eclipse.platform.team-4bff32bf7c9c28c071a22b54a4d1201e094cb35d.zip
16268: Tag Action no longer show progree monitor dialog
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSUIPlugin.java25
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/CheckoutAction.java7
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/TagAction.java2
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/TagInRepositoryAction.java2
4 files changed, 28 insertions, 8 deletions
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSUIPlugin.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSUIPlugin.java
index 69627a5c9..24dd41f06 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSUIPlugin.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSUIPlugin.java
@@ -11,10 +11,10 @@
package org.eclipse.team.internal.ccvs.ui;
+import java.util.Hashtable;
import java.lang.reflect.InvocationTargetException;
import java.net.MalformedURLException;
import java.net.URL;
-import java.util.Hashtable;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.IResourceStatus;
@@ -25,6 +25,7 @@ import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.Status;
import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.jface.dialogs.ProgressMonitorDialog;
import org.eclipse.jface.operation.IRunnableWithProgress;
import org.eclipse.jface.preference.IPreferenceStore;
import org.eclipse.jface.preference.PreferenceConverter;
@@ -39,15 +40,15 @@ import org.eclipse.team.internal.ccvs.core.CVSProviderPlugin;
import org.eclipse.team.internal.ccvs.core.ICVSRemoteFile;
import org.eclipse.team.internal.ccvs.core.ICVSRemoteFolder;
import org.eclipse.team.internal.ccvs.core.ICVSRepositoryLocation;
-import org.eclipse.team.internal.ccvs.core.client.Command.KSubstOption;
import org.eclipse.team.internal.ccvs.core.util.AddDeleteMoveListener;
+import org.eclipse.team.internal.ccvs.core.client.Command.KSubstOption;
import org.eclipse.team.internal.ccvs.ui.model.CVSAdapterFactory;
import org.eclipse.team.internal.ui.TeamUIPlugin;
import org.eclipse.team.ui.TeamUI;
import org.eclipse.ui.IWorkbenchPage;
import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.plugin.AbstractUIPlugin;
import org.eclipse.ui.texteditor.WorkbenchChainedTextFontFieldEditor;
+import org.eclipse.ui.plugin.AbstractUIPlugin;
/**
* UI Plugin for CVS provider-specific workbench functionality.
@@ -219,7 +220,7 @@ public class CVSUIPlugin extends AbstractUIPlugin implements IPropertyChangeList
}
/**
- * Creates a progress monitor and runs the specified runnable.
+ * Creates a busy cursor and runs the specified runnable.
* May be called from a non-UI thread.
*
* @param parent the parent Shell for the dialog
@@ -235,6 +236,22 @@ public class CVSUIPlugin extends AbstractUIPlugin implements IPropertyChangeList
}
/**
+ * Creates a progress monitor and runs the specified runnable.
+ *
+ * @param parent the parent Shell for the dialog
+ * @param cancelable if true, the dialog will support cancelation
+ * @param runnable the runnable
+ *
+ * @exception InvocationTargetException when an exception is thrown from the runnable
+ * @exception InterruptedException when the progress monitor is cancelled
+ */
+ public static void runWithProgressDialog(Shell parent, boolean cancelable,
+ final IRunnableWithProgress runnable) throws InvocationTargetException, InterruptedException {
+
+ new ProgressMonitorDialog(parent).run(cancelable, cancelable, runnable);
+ }
+
+ /**
* Returns the image descriptor for the given image ID.
* Returns null if there is no such image.
*/
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/CheckoutAction.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/CheckoutAction.java
index 9314fb497..13d581da6 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/CheckoutAction.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/CheckoutAction.java
@@ -45,7 +45,7 @@ public class CheckoutAction extends CVSAction {
final ICVSRemoteFolder[] remoteFolders = getSelectedRemoteFolders();
final String[][] expansions = new String[1][0];
expansions[0] = null;
- CVSUIPlugin.runWithProgress(getShell(), true, new IRunnableWithProgress() {
+ CVSUIPlugin.runWithProgressDialog(getShell(), true, new IRunnableWithProgress() {
public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
try {
expansions[0] = CVSProviderPlugin.getProvider().getExpansions(remoteFolders, monitor);
@@ -69,13 +69,16 @@ public class CheckoutAction extends CVSAction {
Policy.bind("ReplaceWithAction.confirmOverwrite"));//$NON-NLS-1$
if (prompt.promptForMultiple().length != projects.length) return;
- CVSUIPlugin.runWithProgress(getShell(), true, new IRunnableWithProgress() {
+ CVSUIPlugin.runWithProgressDialog(getShell(), true, new IRunnableWithProgress() {
public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
try {
+ monitor.beginTask(getTaskName(remoteFolders), 100);
monitor.setTaskName(getTaskName(remoteFolders));
CVSProviderPlugin.getProvider().checkout(remoteFolders, null, Policy.subMonitorFor(monitor, 100));
} catch (TeamException e) {
throw new InvocationTargetException(e);
+ } finally {
+ monitor.done();
}
}
});
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/TagAction.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/TagAction.java
index cf511bef5..72d4fd9ad 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/TagAction.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/TagAction.java
@@ -77,7 +77,7 @@ public class TagAction extends CVSAction {
if (result[0] == null) return;
// Tag the local resources, divided by project/provider
- CVSUIPlugin.runWithProgress(getShell(), true, new IRunnableWithProgress() {
+ CVSUIPlugin.runWithProgressDialog(getShell(), true, new IRunnableWithProgress() {
public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
Hashtable table = getProviderMapping(resources);
Set keySet = table.keySet();
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/TagInRepositoryAction.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/TagInRepositoryAction.java
index 33a93fcd6..d1f8a18eb 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/TagInRepositoryAction.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/TagInRepositoryAction.java
@@ -74,7 +74,7 @@ public class TagInRepositoryAction extends TagAction {
});
if (tag[0] == null) return;
- CVSUIPlugin.runWithProgress(getShell(), true, new IRunnableWithProgress() {
+ CVSUIPlugin.runWithProgressDialog(getShell(), true, new IRunnableWithProgress() {
public void run(IProgressMonitor monitor) throws InvocationTargetException {
try {
monitor.beginTask(null, 1000 * resources.length);

Back to the top