Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjames2002-04-08 13:52:42 -0400
committerjames2002-04-08 13:52:42 -0400
commitb5935bd742b333e41c5c095f4742bdf24f05b639 (patch)
tree0b2064d5511f32bff7d5a4b45f7d0747dc4a1efe
parentc745e4aaa4d2622efae89e205d6507020606396e (diff)
downloadeclipse.platform.team-b5935bd742b333e41c5c095f4742bdf24f05b639.tar.gz
eclipse.platform.team-b5935bd742b333e41c5c095f4742bdf24f05b639.tar.xz
eclipse.platform.team-b5935bd742b333e41c5c095f4742bdf24f05b639.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.java57
1 files changed, 54 insertions, 3 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 d03632179..02d7308b3 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
@@ -13,6 +13,7 @@ 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.events.MouseTrackListener;
import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Tree;
@@ -50,11 +51,23 @@ public class CVSSyncCompareInput extends SyncCompareInput {
public Viewer createDiffViewer(Composite parent) {
CatchupReleaseViewer catchupReleaseViewer = new CVSCatchupReleaseViewer(parent, this);
setViewer(catchupReleaseViewer);
- catchupReleaseViewer.getTree().addMouseMoveListener(new MouseMoveListener() {
+ catchupReleaseViewer.getTree().addMouseTrackListener(new MouseTrackListener() {
/**
- * @see MouseMoveListener#mouseMove(MouseEvent)
+ * @see MouseTrackListener#mouseEnter(MouseEvent)
+ */
+ public void mouseEnter(MouseEvent e) {
+ }
+
+ /**
+ * @see MouseTrackListener#mouseExit(MouseEvent)
*/
- public void mouseMove(MouseEvent e) {
+ public void mouseExit(MouseEvent e) {
+ }
+
+ /**
+ * @see MouseTrackListener#mouseHover(MouseEvent)
+ */
+ public void mouseHover(MouseEvent e) {
Tree tree = (Tree)e.widget;
Point cursorLocation = tree.getDisplay().getCursorLocation();
cursorLocation = tree.toControl(cursorLocation);
@@ -88,6 +101,44 @@ public class CVSSyncCompareInput extends SyncCompareInput {
tree.setToolTipText(null);
}
});
+/* 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