git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[EGIT PATCH 10/10] Enable a tooltip in the history view

From
Robin Rosenberg <robin.rosenberg@dewire.com>
Date
May 7, 2007, 21:30 UTC
Message-ID
<20070507213009.21546.55877.stgit@lathund.dewire.com>
In-Reply-To
<20070507212636.21546.29280.stgit@lathund.dewire.com>
This tooltip show the comment in full rather than the first line only.
Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>
---
 .../src/org/spearce/egit/ui/GitHistoryPage.java    |   27 +++++++++++++++++++++++
 1 files changed, 27 insertions(+), 0 deletions(-)
diff --git a/org.spearce.egit.ui/src/org/spearce/egit/ui/GitHistoryPage.java b/org.spearce.egit.ui/src/org/spearce/egit/ui/GitHistoryPage.java
index 57fefcc..e5d92fe 100644
--- a/org.spearce.egit.ui/src/org/spearce/egit/ui/GitHistoryPage.java
+++ b/org.spearce.egit.ui/src/org/spearce/egit/ui/GitHistoryPage.java
@@ -48,9 +48,11 @@ import org.eclipse.jface.viewers.Viewer;
 import org.eclipse.swt.SWT;
 import org.eclipse.swt.events.MouseEvent;
 import org.eclipse.swt.events.MouseListener;
+import org.eclipse.swt.events.MouseMoveListener;
 import org.eclipse.swt.events.SelectionAdapter;
 import org.eclipse.swt.events.SelectionEvent;
 import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.graphics.Point;
 import org.eclipse.swt.layout.GridData;
 import org.eclipse.swt.layout.GridLayout;
 import org.eclipse.swt.widgets.Composite;
@@ -136,6 +138,31 @@ public class GitHistoryPage extends HistoryPage implements IAdaptable,
 		
 		});
 
+		tree.addMouseMoveListener(new MouseMoveListener() {
+			TreeItem lastItem;
+			public void mouseMove(MouseEvent e) {
+				TreeItem item = tree.getItem(new Point(e.x,e.y));
+				if (item != null && item!=lastItem) {
+					IFileRevision rev = (IFileRevision) item.getData();
+					String commitStr=null;
+					if (appliedPatches!=null) {
+						String id = rev.getContentIdentifier();
+						if (!id.equals("Workspace")) {
+							StGitPatch patch = (StGitPatch) appliedPatches.get(new ObjectId(id));
+							if (patch!=null)
+								commitStr = "Patch: "+patch.getName();
+						} else {
+							commitStr = "Workspace:";
+						}
+					}
+					if (commitStr == null)
+						commitStr = "Commit: "+rev.getContentIdentifier();
+					tree.setToolTipText(commitStr+"\nAuthor:\t"+rev.getAuthor()+"\nDate:\t"+new Date(rev.getTimestamp())+"\n\n"+rev.getComment());
+				}
+				lastItem = item;
+			}
+		});
+
 		tree.addSelectionListener(new SelectionAdapter() {
 			public void widgetSelected(SelectionEvent e) {
 				// update the current
Previous: Robin RosenbergNext: Grzegorz Kulewski
Message 11 of 14 in “[EGIT 00/10] This weeks Eclipse patches”
  1. Robin RosenbergMay 7, 2007
  2. 01/10 Fixes due to changes in the Eclipse Team APIRobin Rosenberg, May 7, 2007
  3. 02/10 Recursion and update of all elements regardless of need.Robin Rosenberg, May 7, 2007
  4. 03/10 Update compare window immediatelyRobin Rosenberg, May 7, 2007
  5. 04/10 Bug: Do not crash when showing diff for first version of a fileRobin Rosenberg, May 7, 2007
  6. 05/10 Speed up ObjectId a little.Robin Rosenberg, May 7, 2007
  7. 06/10 Create a generic history walkerRobin Rosenberg, May 7, 2007
  8. 07/10 Cache pack index fullyRobin Rosenberg, May 7, 2007
  9. 08/10 Use ObjectId[] instead of List for parentsRobin Rosenberg, May 7, 2007
  10. 09/10 Run history refresh in backgroundRobin Rosenberg, May 7, 2007
  11. 10/10 Enable a tooltip in the history viewRobin Rosenberg, May 7, 2007
  12. Eclipse support status (was: Re: [EGIT 00/10] This weeks Eclipse patches)Grzegorz Kulewski, May 7, 2007
  13. Shawn O. PearceMay 8, 2007
  14. Shawn O. PearceMay 8, 2007

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.