Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean Michel-Lemieux2002-04-25 10:06:47 -0400
committerJean Michel-Lemieux2002-04-25 10:06:47 -0400
commit8fe6389f5594ca9a1d6e461226746f67260cf2d1 (patch)
treeb6bfa0ae090e218cf21161eed0a3021f1fc5b958
parent4c2119c8ca2b39dc57c95659a487c839645a742b (diff)
downloadeclipse.platform.team-I20020423Patch1Branch.tar.gz
eclipse.platform.team-I20020423Patch1Branch.tar.xz
eclipse.platform.team-I20020423Patch1Branch.zip
1. Backed out of using a timeout progress dialog. Instead the old behavior is toI20020423Patch1Branch
show a busy cursor which doesn't allow cancelling. 2. Removed hower-help in sync view that showed the comment
-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/sync/CVSSyncCompareInput.java118
2 files changed, 81 insertions, 62 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 07eeb7109..836120b19 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
@@ -20,7 +20,6 @@ import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPluginDescriptor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.core.runtime.OperationCanceledException;
import org.eclipse.core.runtime.Platform;
import org.eclipse.jface.operation.IRunnableWithProgress;
import org.eclipse.jface.preference.IPreferenceStore;
@@ -28,6 +27,7 @@ import org.eclipse.jface.preference.PreferenceConverter;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.jface.util.IPropertyChangeListener;
import org.eclipse.jface.util.PropertyChangeEvent;
+import org.eclipse.swt.custom.BusyIndicator;
import org.eclipse.swt.graphics.RGB;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
@@ -126,7 +126,7 @@ public class CVSUIPlugin extends AbstractUIPlugin {
* @exception InterruptedException when the progress monitor is cancelled
*/
public static void runWithProgress(Shell parent, boolean cancelable,
- IRunnableWithProgress runnable) throws InvocationTargetException, InterruptedException {
+ final IRunnableWithProgress runnable) throws InvocationTargetException, InterruptedException {
boolean createdShell = false;
try {
if (parent == null || parent.isDisposed()) {
@@ -144,7 +144,26 @@ public class CVSUIPlugin extends AbstractUIPlugin {
}
}
// pop up progress dialog after a short delay
- new TimeoutProgressMonitorDialog(parent, TIMEOUT).run(true /*fork*/, cancelable, runnable);
+ final Exception[] holder = new Exception[1];
+ BusyIndicator.showWhile(parent.getDisplay(), new Runnable() {
+ public void run() {
+ try {
+ runnable.run(new NullProgressMonitor());
+ } catch (InvocationTargetException e) {
+ holder[0] = e;
+ } catch (InterruptedException e) {
+ holder[0] = e;
+ }
+ }
+ });
+ if (holder[0] != null) {
+ if (holder[0] instanceof InvocationTargetException) {
+ throw (InvocationTargetException) holder[0];
+ } else {
+ throw (InterruptedException) holder[0];
+ }
+ }
+ //new TimeoutProgressMonitorDialog(parent, TIMEOUT).run(true /*fork*/, cancelable, runnable);
} finally {
if (createdShell) parent.dispose();
}
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/sync/CVSSyncCompareInput.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/sync/CVSSyncCompareInput.java
index 4e1f38051..79e0eb69a 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/sync/CVSSyncCompareInput.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/sync/CVSSyncCompareInput.java
@@ -54,68 +54,68 @@ public class CVSSyncCompareInput extends SyncCompareInput {
public Viewer createDiffViewer(Composite parent) {
CatchupReleaseViewer catchupReleaseViewer = new CVSCatchupReleaseViewer(parent, this);
setViewer(catchupReleaseViewer);
- catchupReleaseViewer.getTree().addMouseMoveListener(new MouseMoveListener() {
- /**
- * @see MouseMoveListener#mouseMove(MouseEvent)
- */
- public void mouseMove(MouseEvent e) {
- final Tree tree = (Tree)e.widget;
- TreeItem item = tree.getItem(new Point(e.x, e.y));
- final TeamFile file;
- if (item != null) {
- // Hack: this is the only way to get an item from the tree viewer
- Object o = item.getData();
- if (o instanceof TeamFile) {
- file = (TeamFile)o;
- } else file = null;
- } else file = null;
-
- // avoid redundant updates -- identity test is good enough here
- if (file == previousTeamFile) return;
- previousTeamFile = file;
- getShell().getDisplay().asyncExec(new Runnable() {
- public void run() {
- updateToolTip(tree, file);
- }
- });
- }
- });
+// catchupReleaseViewer.getTree().addMouseMoveListener(new MouseMoveListener() {
+// /**
+// * @see MouseMoveListener#mouseMove(MouseEvent)
+// */
+// public void mouseMove(MouseEvent e) {
+// final Tree tree = (Tree)e.widget;
+// TreeItem item = tree.getItem(new Point(e.x, e.y));
+// final TeamFile file;
+// if (item != null) {
+// // Hack: this is the only way to get an item from the tree viewer
+// Object o = item.getData();
+// if (o instanceof TeamFile) {
+// file = (TeamFile)o;
+// } else file = null;
+// } else file = null;
+//
+// // avoid redundant updates -- identity test is good enough here
+// if (file == previousTeamFile) return;
+// previousTeamFile = file;
+// getShell().getDisplay().asyncExec(new Runnable() {
+// public void run() {
+// updateToolTip(tree, file);
+// }
+// });
+// }
+// });
return catchupReleaseViewer;
}
- protected void updateToolTip(Tree tree, TeamFile file) {
- String newText = null;
- if (file != null && file.getChangeDirection() != ITeamNode.OUTGOING) {
- IRemoteSyncElement element = file.getMergeResource().getSyncElement();
- final ICVSRemoteFile remoteFile = (ICVSRemoteFile)element.getRemote();
- final ILogEntry[] logEntry = new ILogEntry[1];
- if (remoteFile != null) {
- try {
- CVSUIPlugin.runWithProgress(getViewer().getTree().getShell(), true /*cancelable*/,
- new IRunnableWithProgress() {
- public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
- try {
- logEntry[0] = remoteFile.getLogEntry(monitor);
- } catch (TeamException ex) {
- throw new InvocationTargetException(ex);
- }
- }
- });
- } catch (InterruptedException ex) {
- // ignore cancellation
- } catch (InvocationTargetException ex) {
- // ignore the exception
- }
- }
- if (logEntry[0] != null) {
- newText = logEntry[0].getComment();
- }
- }
- if (tree.isDisposed()) return;
- String oldText = tree.getToolTipText();
- if (newText == oldText || newText != null && newText.equals(oldText)) return;
- tree.setToolTipText(newText);
- }
+// protected void updateToolTip(Tree tree, TeamFile file) {
+// String newText = null;
+// if (file != null && file.getChangeDirection() != ITeamNode.OUTGOING) {
+// IRemoteSyncElement element = file.getMergeResource().getSyncElement();
+// final ICVSRemoteFile remoteFile = (ICVSRemoteFile)element.getRemote();
+// final ILogEntry[] logEntry = new ILogEntry[1];
+// if (remoteFile != null) {
+// try {
+// CVSUIPlugin.runWithProgress(getViewer().getTree().getShell(), true /*cancelable*/,
+// new IRunnableWithProgress() {
+// public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
+// try {
+// logEntry[0] = remoteFile.getLogEntry(monitor);
+// } catch (TeamException ex) {
+// throw new InvocationTargetException(ex);
+// }
+// }
+// });
+// } catch (InterruptedException ex) {
+// // ignore cancellation
+// } catch (InvocationTargetException ex) {
+// // ignore the exception
+// }
+// }
+// if (logEntry[0] != null) {
+// newText = logEntry[0].getComment();
+// }
+// }
+// if (tree.isDisposed()) return;
+// String oldText = tree.getToolTipText();
+// if (newText == oldText || newText != null && newText.equals(oldText)) return;
+// tree.setToolTipText(newText);
+// }
protected IRemoteSyncElement[] createSyncElements(IProgressMonitor monitor) throws TeamException {
IRemoteSyncElement[] trees = new IRemoteSyncElement[resources.length];

Back to the top