Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjames2002-04-08 11:53:31 -0400
committerjames2002-04-08 11:53:31 -0400
commitb8b98fb906e327bf3afac99f9e69f40f8852d7c5 (patch)
treeb84d722435e9c6662b5db10a2064f7bc5ffba245
parentc05a94e02aee7bf8f0edefbeab4d689c919b515f (diff)
downloadeclipse.platform.team-b8b98fb906e327bf3afac99f9e69f40f8852d7c5.tar.gz
eclipse.platform.team-b8b98fb906e327bf3afac99f9e69f40f8852d7c5.tar.xz
eclipse.platform.team-b8b98fb906e327bf3afac99f9e69f40f8852d7c5.zip
257: Wishlist: hoverhelp on resource in sync view shows release comment (1GKDEK6)
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/sync/CVSSyncCompareInput.java46
1 files changed, 46 insertions, 0 deletions
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 339084de1..d03632179 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
@@ -8,9 +8,17 @@ package org.eclipse.team.internal.ccvs.ui.sync;
import org.eclipse.compare.structuremergeviewer.ICompareInput;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.jface.dialogs.ErrorDialog;
import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.swt.events.MouseEvent;
+import org.eclipse.swt.events.MouseMoveListener;
+import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Tree;
+import org.eclipse.swt.widgets.TreeItem;
+import org.eclipse.team.ccvs.core.ICVSRemoteFile;
+import org.eclipse.team.ccvs.core.ILogEntry;
import org.eclipse.team.core.TeamException;
import org.eclipse.team.core.sync.IRemoteSyncElement;
import org.eclipse.team.internal.ccvs.core.resources.CVSRemoteSyncElement;
@@ -42,6 +50,44 @@ 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) {
+ Tree tree = (Tree)e.widget;
+ Point cursorLocation = tree.getDisplay().getCursorLocation();
+ cursorLocation = tree.toControl(cursorLocation);
+ TreeItem item = tree.getItem(cursorLocation);
+ if (item != null) {
+ // Hack: this is the only way to get an item from the tree
+ Object o = item.getData();
+ if (o instanceof TeamFile) {
+ TeamFile file = (TeamFile)o;
+ IRemoteSyncElement element = file.getMergeResource().getSyncElement();
+ ICVSRemoteFile remoteFile = (ICVSRemoteFile)element.getRemote();
+ ILogEntry logEntry = remoteFile.getLogEntry();
+ if (logEntry == null) {
+ // Hack: call getContents() so that the log entry is available.
+ try {
+ remoteFile.getContents(new NullProgressMonitor());
+ } catch (TeamException ex) {
+ tree.setToolTipText(null);
+ return;
+ }
+ logEntry = remoteFile.getLogEntry();
+ }
+ String newText = logEntry.getComment();
+ String oldText = tree.getToolTipText();
+ if (!newText.equals(oldText)) {
+ tree.setToolTipText(logEntry.getComment());
+ }
+ return;
+ }
+ }
+ tree.setToolTipText(null);
+ }
+ });
return catchupReleaseViewer;
}

Back to the top