{"thread":{"id":"11517","subject":"[EGIT PATCH] Showing commit info like the CVS plugin instead of tooltips.","startedAt":"2008-01-08T01:20:26Z","lastAt":"2008-01-10T00:17:37Z","messageCount":5,"participants":["Roger C. Soares","Robin Rosenberg"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"64693","messageId":"200801072320.26987.rogersoares@intelinet.com.br","threadId":"11517","inReplyTo":null,"subject":"[EGIT PATCH] Showing commit info like the CVS plugin instead of tooltips.","fromName":"Roger C. Soares","fromEmail":"rogersoares@intelinet.com.br","sentAt":"2008-01-08T01:20:26Z","receivedAt":"2008-01-08T01:20:26Z","isPatch":true,"sender":{"key":"rogersoares@intelinet.com.br","avatar":null},"body":"Tooltips for the info were annoying, especially on MacOS where the tooltip center is your pointer location.\nIt is now possible to copy&paste data.\nLike the CVS plugin, there's a menu to show/hide views. Thought it doesn't save in the preferences store for now.\n\nSigned-off-by: Roger C. Soares <rogersoares@intelinet.com.br>\n---\n .../src/org/spearce/egit/ui/GitHistoryPage.java    |  361 +++++++++++++++-----\n .../src/org/spearce/egit/ui/UIText.java            |    4 +\n .../src/org/spearce/egit/ui/uitext.properties      |    4 +\n 3 files changed, 277 insertions(+), 92 deletions(-)\n\ndiff --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\nindex 3738dfd..ae404cf 100644\n--- a/org.spearce.egit.ui/src/org/spearce/egit/ui/GitHistoryPage.java\n+++ b/org.spearce.egit.ui/src/org/spearce/egit/ui/GitHistoryPage.java\n@@ -17,6 +17,7 @@\n package org.spearce.egit.ui;\n \n import java.io.IOException;\n+import java.text.SimpleDateFormat;\n import java.util.Date;\n import java.util.HashMap;\n import java.util.List;\n@@ -37,10 +38,14 @@ import org.eclipse.core.runtime.IStatus;\n import org.eclipse.core.runtime.Status;\n import org.eclipse.core.runtime.jobs.Job;\n import org.eclipse.jface.action.Action;\n+import org.eclipse.jface.action.IAction;\n import org.eclipse.jface.action.IMenuListener;\n import org.eclipse.jface.action.IMenuManager;\n import org.eclipse.jface.action.MenuManager;\n+import org.eclipse.jface.action.Separator;\n import org.eclipse.jface.resource.JFaceResources;\n+import org.eclipse.jface.text.Document;\n+import org.eclipse.jface.text.TextViewer;\n import org.eclipse.jface.viewers.ColumnWeightData;\n import org.eclipse.jface.viewers.ILazyContentProvider;\n import org.eclipse.jface.viewers.StructuredSelection;\n@@ -48,12 +53,11 @@ import org.eclipse.jface.viewers.TableLayout;\n import org.eclipse.jface.viewers.TableViewer;\n import org.eclipse.jface.viewers.Viewer;\n import org.eclipse.swt.SWT;\n+import org.eclipse.swt.custom.SashForm;\n import org.eclipse.swt.events.MouseEvent;\n import org.eclipse.swt.events.MouseListener;\n-import org.eclipse.swt.events.MouseMoveListener;\n import org.eclipse.swt.events.SelectionAdapter;\n import org.eclipse.swt.events.SelectionEvent;\n-import org.eclipse.swt.graphics.Point;\n import org.eclipse.swt.layout.GridData;\n import org.eclipse.swt.layout.GridLayout;\n import org.eclipse.swt.widgets.Composite;\n@@ -72,6 +76,8 @@ import org.eclipse.team.internal.ui.history.DialogHistoryPageSite;\n import org.eclipse.team.ui.history.HistoryPage;\n import org.eclipse.team.ui.history.IHistoryCompareAdapter;\n import org.eclipse.team.ui.history.IHistoryPageSite;\n+import org.eclipse.ui.IActionBars;\n+import org.eclipse.ui.part.IPageSite;\n import org.spearce.egit.core.GitProvider;\n import org.spearce.egit.core.internal.mapping.GitCommitFileRevision;\n import org.spearce.egit.core.internal.mapping.GitFileHistory;\n@@ -92,16 +98,24 @@ public class GitHistoryPage extends HistoryPage implements IAdaptable,\n \tprivate static final String PREF_SHOWALLREPOVERSIONS = \"org.spearce.egit.ui.githistorypage.showallrepoversions\";\n \tprivate static final String PREF_SHOWALLPROJECTVERSIONS = \"org.spearce.egit.ui.githistorypage.showallprojectversions\";\n \tprivate static final String PREF_SHOWALLFOLDERVERSIONS = \"org.spearce.egit.ui.githistorypage.showallfolderversions\";\n+\t/* private */static final SimpleDateFormat DATETIME_FORMAT = new SimpleDateFormat(\"yyyy-MM-dd HH:mm\");\n+\t/* private */static final SimpleDateFormat DATETIMETZ_FORMAT = new SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss z\");\n \n-\tprivate Composite localComposite;\n+\tprivate SashForm localComposite;\n+\tprivate SashForm revisionInfoComposite;\n \n-\tprivate TableViewer viewer;\n+\t/* private */TableViewer viewer;\n+\t/* private */TextViewer revDetailTextViewer;\n+\t/* private */TextViewer revCommentTextViewer;\n+\t/* private */IAction toggleCommentWrapAction;\n+\t/* private */IAction toggleRevDetailAction;\n+\t/* private */IAction toggleRevCommentAction;\n \n-\tprivate Table table;\n+\t/* private */Table table;\n \n-\tprivate List<IFileRevision> fileRevisions;\n+\t/* private */List<IFileRevision> fileRevisions;\n \n-\tprotected boolean hintShowDiffNow;\n+\t/* private */boolean hintShowDiffNow;\n \n \tprivate boolean showAllProjectVersions;\n \n@@ -127,7 +141,8 @@ public class GitHistoryPage extends HistoryPage implements IAdaptable,\n \t}\n \n \tpublic void createControl(Composite parent) {\n-\t\tlocalComposite = new Composite(parent, SWT.NONE);\n+\t\tlocalComposite = new SashForm(parent, SWT.VERTICAL);\n+\n \t\tGridLayout layout = new GridLayout();\n \t\tlayout.marginHeight = 0;\n \t\tlayout.marginWidth = 0;\n@@ -138,6 +153,10 @@ public class GitHistoryPage extends HistoryPage implements IAdaptable,\n \n \t\tcreateTable(localComposite);\n \n+\t\trevisionInfoComposite = new SashForm(localComposite, SWT.HORIZONTAL);\n+\t\tcreateRevDetailTextViewer(revisionInfoComposite);\n+\t\tcreateRevCommentTextViewer(revisionInfoComposite);\n+\n \t\tIHistoryPageSite parentSite = getHistoryPageSite();\n \t\tif (parentSite != null && parentSite instanceof DialogHistoryPageSite)\n \t\t\tparentSite.setSelectionProvider(viewer);\n@@ -149,6 +168,7 @@ public class GitHistoryPage extends HistoryPage implements IAdaptable,\n \t\ttable.addMouseListener(new MouseListener() {\n \t\t\n \t\t\tpublic void mouseUp(MouseEvent e) {\n+\t\t\t\treturn;\n \t\t\t}\n \t\t\n \t\t\tpublic void mouseDown(MouseEvent e) {\n@@ -156,25 +176,11 @@ public class GitHistoryPage extends HistoryPage implements IAdaptable,\n \t\t\t}\n \t\t\n \t\t\tpublic void mouseDoubleClick(MouseEvent e) {\n+\t\t\t\treturn;\n \t\t\t}\n \t\t\n \t\t});\n \n-\t\ttable.addMouseMoveListener(new MouseMoveListener() {\n-\t\t\tTableItem lastItem;\n-\t\t\tpublic void mouseMove(MouseEvent e) {\n-\t\t\t\tTableItem item = table.getItem(new Point(e.x,e.y));\n-\t\t\t\tif (item != null && item!=lastItem) {\n-\t\t\t\t\tIFileRevision rev = (IFileRevision) item.getData();\n-\t\t\t\t\tif (rev == null)\n-\t\t\t\t\t\treturn;\n-\t\t\t\t\tString toolTipText = formatRevisionToolTipText(rev);\n-\t\t\t\t\ttable.setToolTipText(toolTipText);\n-\t\t\t\t}\n-\t\t\t\tlastItem = item;\n-\t\t\t}\n-\t\t});\n-\n \t\ttable.addSelectionListener(new SelectionAdapter() {\n \t\t\tpublic void widgetSelected(SelectionEvent e) {\n \t\t\t\t// update the current\n@@ -184,6 +190,12 @@ public class GitHistoryPage extends HistoryPage implements IAdaptable,\n \t\t\t\t\tselection2[i] = (IFileRevision) selection[i].getData();\n \t\t\t\t}\n \n+\t\t\t\t// Updates the revision info text viewers\n+\t\t\t\tcleanRevisionInfoTextViewers();\n+\t\t\t\tif(selection2.length == 1) {\n+\t\t\t\t\tsetRevisionInfoTextViewers(selection2[0]);\n+\t\t\t\t}\n+\n \t\t\t\tcompareAction.setCurrentFileRevision(fileRevisions.get(0));\n \t\t\t\tcompareAction.selectionChanged(new StructuredSelection(\n \t\t\t\t\t\tselection2));\n@@ -280,33 +292,92 @@ public class GitHistoryPage extends HistoryPage implements IAdaptable,\n \t\tshowAllFolderVersionsAction.setChecked(isShowAllFolderVersions());\n \t\tgetSite().getActionBars().getToolBarManager().add(\n \t\t\t\tshowAllFolderVersionsAction);\n+\n+\t\ttoggleCommentWrapAction = new Action(UIText.ResourceHistory_toggleCommentWrap) {\n+\t\t\tpublic void run() {\n+\t\t\t\tupdateResourceHistoryComposites();\n+\t\t\t}\n+\t\t};\n+\t\ttoggleCommentWrapAction.setChecked(true);\n+\n+\t\ttoggleRevDetailAction = new Action(UIText.ResourceHistory_toggleRevDetail) {\n+\t\t\tpublic void run() {\n+\t\t\t\tupdateResourceHistoryComposites();\n+\t\t\t}\n+\t\t};\n+\t\ttoggleRevDetailAction.setChecked(true);\n+\n+\t\ttoggleRevCommentAction = new Action(UIText.ResourceHistory_toggleRevComment) {\n+\t\t\tpublic void run() {\n+\t\t\t\tupdateResourceHistoryComposites();\n+\t\t\t}\n+\t\t};\n+\t\ttoggleRevCommentAction.setChecked(true);\n+\n+\t\tIActionBars actionBars = getSite().getActionBars();\n+\t\tIMenuManager menuManager = actionBars.getMenuManager();\n+\t\tif (menuManager != null) {\n+\t\t\tmenuManager.add(toggleCommentWrapAction);\n+\t\t\tmenuManager.add(new Separator());\n+\t\t\tmenuManager.add(toggleRevDetailAction);\n+\t\t\tmenuManager.add(toggleRevCommentAction);\n+\t\t\tmenuManager.add(new Separator());\n+\t\t}\n+\t\tactionBars.updateActionBars();\n+\t\tupdateResourceHistoryComposites();\n+\n+\t\tlocalComposite.setWeights(new int[] {65, 35});\n+\t\trevisionInfoComposite.setWeights(new int[] {40, 60});\n+\t}\n+\n+\t/* private */void updateResourceHistoryComposites() {\n+\t\tboolean commentWrap = toggleCommentWrapAction.isChecked();\n+\t\tboolean showRevDetail = toggleRevDetailAction.isChecked();\n+\t\tboolean showRevComment = toggleRevCommentAction.isChecked();\n+\n+\t\trevCommentTextViewer.getTextWidget().setWordWrap(commentWrap);\n+\n+\t\tif(showRevDetail && showRevComment) {\n+\t\t\tlocalComposite.setMaximizedControl(null);\n+\t\t\trevisionInfoComposite.setMaximizedControl(null);\n+\t\t} else {\n+\t\t\tif(!(showRevDetail || showRevComment)) {\n+\t\t\t\tlocalComposite.setMaximizedControl(table);\n+\t\t\t} else if(showRevDetail) {\n+\t\t\t\tlocalComposite.setMaximizedControl(null);\n+\t\t\t\trevisionInfoComposite.setMaximizedControl(revDetailTextViewer.getControl());\n+\t\t\t} else {\n+\t\t\t\tlocalComposite.setMaximizedControl(null);\n+\t\t\t\trevisionInfoComposite.setMaximizedControl(revCommentTextViewer.getControl());\n+\t\t\t}\n+\t\t}\n \t}\n \n-\tprivate boolean isShowAllRepoVersions() {\n+\t/* private */boolean isShowAllRepoVersions() {\n \t\treturn showAllRepoVersions;\n \t}\n \n-\tprotected void setShowAllRepoVersions(boolean showAllRepoVersions) {\n+\t/* private */void setShowAllRepoVersions(boolean showAllRepoVersions) {\n \t\tthis.showAllRepoVersions = showAllRepoVersions;\n \t\tActivator.getDefault().getPreferenceStore().setValue(\n \t\t\t\tPREF_SHOWALLREPOVERSIONS, showAllRepoVersions);\n \t}\n \n-\tprivate boolean isShowAllProjectVersions() {\n+\t/* private */boolean isShowAllProjectVersions() {\n \t\treturn showAllProjectVersions;\n \t}\n \n-\tprotected void setShowAllProjectVersions(boolean showAllProjectVersions) {\n+\t/* private */void setShowAllProjectVersions(boolean showAllProjectVersions) {\n \t\tthis.showAllProjectVersions = showAllProjectVersions;\n \t\tActivator.getDefault().getPreferenceStore().setValue(\n \t\t\t\tPREF_SHOWALLPROJECTVERSIONS, showAllProjectVersions);\n \t}\n \n-\tprivate boolean isShowAllFolderVersions() {\n+\t/* private */boolean isShowAllFolderVersions() {\n \t\treturn showAllFolderVersions;\n \t}\n \n-\tprotected void setShowAllFolderVersion(boolean showAllFolderVersions) {\n+\t/* private */void setShowAllFolderVersion(boolean showAllFolderVersions) {\n \t\tthis.showAllFolderVersions = showAllFolderVersions;\n \t\tActivator.getDefault().getPreferenceStore().setValue(\n \t\t\t\tPREF_SHOWALLFOLDERVERSIONS, showAllFolderVersions);\n@@ -392,7 +463,7 @@ public class GitHistoryPage extends HistoryPage implements IAdaptable,\n \t\t\t\tDate d = new Date(element.getTimestamp());\n \t\t\t\tif (d.getTime() == -1)\n \t\t\t\t\treturn \"\";\n-\t\t\t\treturn d.toString();\n+\t\t\t\treturn DATETIME_FORMAT.format(d);\n \t\t\t}\n \t\t\tif (columnIndex == 4)\n \t\t\t\treturn element.getAuthor();\n@@ -411,6 +482,166 @@ public class GitHistoryPage extends HistoryPage implements IAdaptable,\n \t\t}\n \t}\n \n+\tprivate void createRevDetailTextViewer(SashForm composite) {\n+\t\trevDetailTextViewer = new TextViewer(composite, SWT.H_SCROLL | SWT.V_SCROLL | SWT.READ_ONLY);\n+\t}\n+\n+\tprivate void createRevCommentTextViewer(SashForm composite) {\n+\t\trevCommentTextViewer = new TextViewer(composite, SWT.H_SCROLL | SWT.V_SCROLL | SWT.READ_ONLY);\n+\t}\n+\n+\t/* private */void setRevisionInfoTextViewers(IFileRevision rev) {\n+\t\tStringBuilder revisionInfo = new StringBuilder();\n+\t\tif (appliedPatches != null) {\n+\t\t\tString id = rev.getContentIdentifier();\n+\t\t\tif (!id.equals(\"Workspace\") && !id.equals(\"Index\")) {\n+\t\t\t\tStGitPatch patch = (StGitPatch) appliedPatches\n+\t\t\t\t\t\t.get(new ObjectId(id));\n+\t\t\t\tif (patch != null) {\n+\t\t\t\t\trevisionInfo.append(\"Patch: \");\n+\t\t\t\t\trevisionInfo.append(patch.getName());\n+\t\t\t\t}\n+\t\t\t} else {\n+\t\t\t\trevisionInfo.append(id.toString());\n+\t\t\t}\n+\t\t}\n+\t\tif (revisionInfo.length() == 0) {\n+\t\t\trevisionInfo.append(\"Commit: \");\n+\t\t\trevisionInfo.append(rev.getContentIdentifier());\n+\t\t}\n+\n+\t\t// Gets the tags for this revision.\n+\t\t// TODO: Understand this better and see if there's a simpler/shared way to do it.\n+\t\tIProject project = ((IResource) getInput()).getProject();\n+\t\tRepositoryMapping repositoryMapping = RepositoryMapping.getMapping(project);\n+\t\tMap<ObjectId,Tag[]> newtags = new HashMap<ObjectId,Tag[]>();\n+\t\ttry {\n+\t\t\tfor (String name : repositoryMapping.getRepository().getTags()) {\n+\t\t\t\tTag t = repositoryMapping.getRepository().mapTag(name);\n+\t\t\t\tTag[] samecommit = newtags.get(t.getObjId());\n+\t\t\t\tif (samecommit==null) { \n+\t\t\t\t\tsamecommit = new Tag[] { t };\n+\t\t\t\t} else {\n+\t\t\t\t\tTag[] n=new Tag[samecommit.length+1];\n+\t\t\t\t\tfor (int j=0; j<samecommit.length; ++j)\n+\t\t\t\t\t\tn[j] = samecommit[j];\n+\t\t\t\t\tn[n.length-1] = t;\n+\t\t\t\t\tsamecommit = n;\n+\t\t\t\t}\n+\t\t\t\tnewtags.put(t.getObjId(), samecommit);\n+\t\t\t}\n+\n+\t\t\tString id = rev.getContentIdentifier();\n+\t\t\tif (!id.equals(\"Workspace\") && !id.equals(\"Index\")) {\n+\t\t\t\tObjectId oid = new ObjectId(id);\n+\t\t\t\tStringBuilder b=new StringBuilder();\n+\t\t\t\tif (tags != null) {\n+\t\t\t\t\tTag[] matching = tags.get(oid);\n+\t\t\t\t\tif (matching != null) {\n+\t\t\t\t\t\tfor (Tag t : matching) {\n+\t\t\t\t\t\t\tif (b.length() > 0)\n+\t\t\t\t\t\t\t\tb.append(\", \");\n+\t\t\t\t\t\t\tString tag = t.getTag();\n+\t\t\t\t\t\t\tb.append(tag);\n+\t\t\t\t\t\t}\n+\t\t\t\t\t}\n+\t\t\t\t}\n+\t\t\t\tif(b.length() > 0) {\n+\t\t\t\t\trevisionInfo.append(\"\\nTags: \");\n+\t\t\t\t\trevisionInfo.append(b);\n+\t\t\t\t}\n+\t\t\t}\n+\t\t} catch (IOException e) {\n+\t\t\te.printStackTrace();\n+\t\t}\n+\n+\t\t// Gets the branches for this revision.\n+\t\t// TODO: Branches should always show all the branches from a commit.\n+\t\tMap<ObjectId, String[]> newBranches = new HashMap<ObjectId, String[]>();\n+\t\ttry {\n+\t\t\tfor (String branch : repositoryMapping.getRepository().getBranches()) {\n+\t\t\t\tObjectId id = repositoryMapping.getRepository().resolve(branch);\n+\t\t\t\tString[] samecommit = newBranches.get(id);\n+\t\t\t\tif (samecommit == null) {\n+\t\t\t\t\tsamecommit = new String[] { branch };\n+\t\t\t\t} else {\n+\t\t\t\t\tString[] n=new String[samecommit.length + 1];\n+\t\t\t\t\tfor (int j=0; j<samecommit.length; ++j)\n+\t\t\t\t\t\tn[j] = samecommit[j];\n+\t\t\t\t\tn[n.length-1] = branch;\n+\t\t\t\t\tsamecommit = n;\n+\t\t\t\t}\n+\t\t\t\tnewBranches.put(id, samecommit);\n+\t\t\t}\n+\t\t\tString[] samecommit = newBranches.get(currentHead);\n+\t\t\tif (samecommit == null) {\n+\t\t\t\tsamecommit = new String[] { \"HEAD\" };\n+\t\t\t} else {\n+\t\t\t\tString[] n=new String[samecommit.length + 1];\n+\t\t\t\tfor (int j=0; j<samecommit.length; ++j)\n+\t\t\t\t\tn[j] = samecommit[j];\n+\t\t\t\tn[n.length-1] = \"HEAD\";\n+\t\t\t\tsamecommit = n;\n+\t\t\t}\n+\t\t\tnewBranches.put(currentHead, samecommit);\n+\t\t\tbranches = newBranches;\n+\n+\t\t\tString id = rev.getContentIdentifier();\n+\t\t\tif (branches != null) {\n+\t\t\t\tStringBuilder b=new StringBuilder();\n+\t\t\t\tObjectId oid = new ObjectId(id);\n+\t\t\t\tString[] matching = branches.get(oid);\n+\t\t\t\tif (matching != null) {\n+\t\t\t\t\tfor (String t : matching) {\n+\t\t\t\t\t\tif (b.length() > 0)\n+\t\t\t\t\t\t\tb.append(\", \");\n+\t\t\t\t\t\tif (t.startsWith(\"refs/heads/\"))\n+\t\t\t\t\t\t\tt = t.substring(11);\n+\t\t\t\t\t\tb.append(t);\n+\t\t\t\t\t}\n+\t\t\t\t}\n+\t\t\t\tif(b.length() > 0) {\n+\t\t\t\t\trevisionInfo.append(\"\\nBranches: \");\n+\t\t\t\t\trevisionInfo.append(b);\n+\t\t\t\t}\n+\t\t\t}\n+\t\t} catch (IOException e) {\n+\t\t\te.printStackTrace();\n+\t\t}\n+\n+\t\trevisionInfo.append(\"\\nAuthor: \");\n+\t\trevisionInfo.append(rev.getAuthor());\n+\t\trevisionInfo.append(\"\\nDate: \");\n+\t\trevisionInfo.append(DATETIMETZ_FORMAT.format(new Date(rev.getTimestamp())));\n+\n+\t\tString comment = rev.getComment();\n+\t\trevDetailTextViewer.setDocument(new Document(revisionInfo.toString()));\n+\t\trevCommentTextViewer.setDocument(new Document(comment));\n+\n+\t\t// Adds the first comment line in the status line.\n+\t\tint enterIndex = comment.indexOf(\"\\n\");\n+\t\tif(enterIndex > 0) {\n+\t\t\tcomment = comment.substring(0, enterIndex);\n+\t\t}\n+\t\tIPageSite workbenchPageSite = getHistoryPageSite().getWorkbenchPageSite();\n+\t\tif (workbenchPageSite != null) {\n+\t\t\tworkbenchPageSite.getActionBars().getStatusLineManager().setMessage(comment);\n+\t\t}\n+\t}\n+\n+\t/* private */void cleanRevisionInfoTextViewers() {\n+\t\tif(revDetailTextViewer != null && revCommentTextViewer != null) {\n+\t\t\trevDetailTextViewer.setDocument(new Document(\"\"));\n+\t\t\trevCommentTextViewer.setDocument(new Document(\"\"));\n+\n+\t\t\t// Cleans the status line\n+\t\t\tIPageSite workbenchPageSite = getHistoryPageSite().getWorkbenchPageSite();\n+\t\t\tif (workbenchPageSite != null) {\n+\t\t\t\tworkbenchPageSite.getActionBars().getStatusLineManager().setMessage(null);\n+\t\t\t}\n+\t\t}\n+\t}\n+\n \tprivate void createTable(Composite composite) {\n \t\ttable = new Table(composite, SWT.H_SCROLL | SWT.V_SCROLL | SWT.MULTI\n \t\t\t\t| SWT.FULL_SELECTION | SWT.VIRTUAL);\n@@ -556,10 +787,10 @@ public class GitHistoryPage extends HistoryPage implements IAdaptable,\n \t\tviewer.setInput(getInput());\n \t}\n \n-\tprivate Map appliedPatches;\n+\t/* private */Map appliedPatches;\n \tObjectId currentHead;\n-\tprivate Map<ObjectId,Tag[]> tags;\n-\tprivate Map<ObjectId, String[]> branches;\n+\t/* private */Map<ObjectId,Tag[]> tags;\n+\t/* private */Map<ObjectId, String[]> branches;\n \tGitHistoryLabelProvider lp = new GitHistoryLabelProvider();\n \n \tclass HistoryRefreshJob extends Job {\n@@ -662,6 +893,8 @@ public class GitHistoryPage extends HistoryPage implements IAdaptable,\n \t\t\t\ttable.getDisplay().asyncExec(new Runnable() {\n \t\t\t\t\n \t\t\t\t\tpublic void run() {\n+\t\t\t\t\t\tcleanRevisionInfoTextViewers();\n+\n \t\t\t\t\t\ttable.removeAll();\n \t\t\t\t\t\ttable.setItemCount(fileRevisions.size());\n \t\t\t\t\t\ttable.setData(\"X\");\n@@ -720,6 +953,7 @@ public class GitHistoryPage extends HistoryPage implements IAdaptable,\n \t\t}\n \n \t\tpublic void dispose() {\n+\t\t\treturn;\n \t\t}\n \n \t\tpublic void updateElement(int index) {\n@@ -757,7 +991,7 @@ public class GitHistoryPage extends HistoryPage implements IAdaptable,\n \t\tcol.setResizable(true);\n \t\tcol.setText(TeamUIMessages.GenericHistoryTableProvider_RevisionTime);\n \t\t// X col.addSelectionListener(headerListener);\n-\t\t((TableLayout) table.getLayout()).addColumnData(new ColumnWeightData(30,\n+\t\t((TableLayout) table.getLayout()).addColumnData(new ColumnWeightData(20,\n \t\t\t\ttrue));\n \n \t\t// author\n@@ -773,7 +1007,7 @@ public class GitHistoryPage extends HistoryPage implements IAdaptable,\n \t\tcol.setResizable(true);\n \t\tcol.setText(TeamUIMessages.GenericHistoryTableProvider_Comment);\n \t\t// X col.addSelectionListener(headerListener);\n-\t\t((TableLayout) table.getLayout()).addColumnData(new ColumnWeightData(35,\n+\t\t((TableLayout) table.getLayout()).addColumnData(new ColumnWeightData(45,\n \t\t\t\ttrue));\n \t}\n \n@@ -821,61 +1055,4 @@ public class GitHistoryPage extends HistoryPage implements IAdaptable,\n \t\t// TODO Auto-generated method stub\n \t}\n \n-\t/**\n-\t * Formats the revision description to be displayed in the tooltip.\n-\t *\n-\t * @param rev\n-\t *            the revision to be displayed\n-\t * @return formatted description\n-\t */\n-\tprotected String formatRevisionToolTipText(IFileRevision rev) {\n-\t\tString commitStr = null;\n-\t\tif (appliedPatches != null) {\n-\t\t\tString id = rev.getContentIdentifier();\n-\t\t\tif (!id.equals(\"Workspace\") && !id.equals(\"Index\")) {\n-\t\t\t\tStGitPatch patch = (StGitPatch) appliedPatches\n-\t\t\t\t\t\t.get(new ObjectId(id));\n-\t\t\t\tif (patch != null)\n-\t\t\t\t\tcommitStr = \"Patch: \" + patch.getName();\n-\t\t\t} else {\n-\t\t\t\tcommitStr = id.toString();\n-\t\t\t}\n-\t\t}\n-\t\tif (commitStr == null)\n-\t\t\tcommitStr = \"Commit: \" + rev.getContentIdentifier();\n-\n-\t\t// The tooltip window is usually\n-\t\t// narrower\n-\t\t// than the comment. Remove soft returns\n-\t\t// to\n-\t\t// avoid short lines like in\n-\t\t// this\n-\t\t// example\n-\t\tString niceComment = unwrapComment(rev.getComment());\n-\t\tString toolTipText = commitStr + \"\\nAuthor: \" + rev.getAuthor()\n-\t\t\t\t+ \"\\nDate: \" + new Date(rev.getTimestamp()) + \"\\n\\n\"\n-\t\t\t\t+ niceComment;\n-\t\treturn toolTipText;\n-\t}\n-\n-\t/**\n-\t * Remove soft returns (single \\n) from the string. Keep hard returns\n-\t * between paragraphs (two \\n).\n-\t *\n-\t * @param origComment\n-\t * @return reformated comment\n-\t */\n-\tprivate static String unwrapComment(String origComment) {\n-\t\tif (origComment == null)\n-\t\t\treturn null;\n-\t\tString paragraphs[] = origComment.split(\"\\n\\\\s*\\n\");\n-\t\tStringBuffer result = new StringBuffer();\n-\t\tfor (int i = 0; i < paragraphs.length; i++) {\n-\t\t\tresult.append(paragraphs[i].replaceAll(\"\\n\", \" \"));\n-\t\t\tif (i < paragraphs.length - 1)\n-\t\t\t\tresult.append(\"\\n\\n\");\n-\t\t}\n-\t\treturn result.toString();\n-\t}\n-\n }\ndiff --git a/org.spearce.egit.ui/src/org/spearce/egit/ui/UIText.java b/org.spearce.egit.ui/src/org/spearce/egit/ui/UIText.java\nindex cdbe8bb..b714c1d 100644\n--- a/org.spearce.egit.ui/src/org/spearce/egit/ui/UIText.java\n+++ b/org.spearce.egit.ui/src/org/spearce/egit/ui/UIText.java\n@@ -39,6 +39,10 @@ public class UIText extends NLS {\n \n \tpublic static String QuickDiff_failedLoading;\n \n+\tpublic static String ResourceHistory_toggleCommentWrap;\n+\tpublic static String ResourceHistory_toggleRevDetail;\n+\tpublic static String ResourceHistory_toggleRevComment;\n+\n \tstatic {\n \t\tinitializeMessages(UIText.class.getPackage().getName() + \".uitext\",\n \t\t\t\tUIText.class);\ndiff --git a/org.spearce.egit.ui/src/org/spearce/egit/ui/uitext.properties b/org.spearce.egit.ui/src/org/spearce/egit/ui/uitext.properties\nindex 75e975b..f45f4d2 100644\n--- a/org.spearce.egit.ui/src/org/spearce/egit/ui/uitext.properties\n+++ b/org.spearce.egit.ui/src/org/spearce/egit/ui/uitext.properties\n@@ -28,3 +28,7 @@ ExistingOrNewPage_createNew=Create a new Git repository for this project\n \n Decorator_failedLazyLoading=Resource decorator failed to load tree contents on demand.\n QuickDiff_failedLoading=Quick diff failed to obtain file data.\n+\n+ResourceHistory_toggleCommentWrap=Wrap Comments\n+ResourceHistory_toggleRevDetail=Show Revision Details\n+ResourceHistory_toggleRevComment=Show Revision Comment\n\\ No newline at end of file\n-- \n1.5.3.7\n"},{"id":"64790","messageId":"200801082320.52548.robin.rosenberg.lists@dewire.com","threadId":"11517","inReplyTo":"200801072320.26987.rogersoares@intelinet.com.br","subject":"Re: [EGIT PATCH] Showing commit info like the CVS plugin instead of tooltips.","fromName":"Robin Rosenberg","fromEmail":"robin.rosenberg.lists@dewire.com","sentAt":"2008-01-08T22:20:52Z","receivedAt":"2008-01-08T22:20:52Z","isPatch":true,"sender":{"key":"robin.rosenberg@dewire.com","avatar":"https://avatars.githubusercontent.com/u/46357?v=4"},"body":"tisdagen den 8 januari 2008 skrev du:\n> Tooltips for the info were annoying, especially on MacOS where the tooltip center is your pointer location.\n> It is now possible to copy&paste data.\n> Like the CVS plugin, there's a menu to show/hide views. Thought it doesn't save in the preferences store for now.\nLooks nice. We probably want this into preferences and I'd still like the tooltop as an option. I.e. when you turn off\nthe other panes the tooltip should come back. What I'd really want is the \"Press F2\"-version, like the javadoc\ntooltips, but that requires some more work (I guess, maybe only a little is needed).\n\n> +\t/* private */TextViewer revDetailTextViewer;\n> +\t/* private */TextViewer revCommentTextViewer;\n> +\t/* private */IAction toggleCommentWrapAction;\n> +\t/* private */IAction toggleRevDetailAction;\n> +\t/* private */IAction toggleRevCommentAction;\n>  \n> -\tprivate Table table;\n> +\t/* private */Table table;\n>  \n> -\tprivate List<IFileRevision> fileRevisions;\n> +\t/* private */List<IFileRevision> fileRevisions;\n>  \n> -\tprotected boolean hintShowDiffNow;\n> +\t/* private */boolean hintShowDiffNow;\nWhy? What's wrong plain private?\n\n> \\ No newline at end of file\nThere was trailing whitespace also, but I can fix such things easily. I'm erasing those on changed lines only, a\nchange at the time at the moment instead of big ws fixes. In eclipse 3.3 there is an option to fix trailing spaces\non save on changed lines only.\n\n-- robin\n"},{"id":"64800","messageId":"4784209D.6080100@intelinet.com.br","threadId":"11517","inReplyTo":"200801082320.52548.robin.rosenberg.lists@dewire.com","subject":"Re: [EGIT PATCH] Showing commit info like the CVS plugin instead of tooltips.","fromName":"Roger C. Soares","fromEmail":"rogersoares@intelinet.com.br","sentAt":"2008-01-09T01:17:17Z","receivedAt":"2008-01-09T01:17:17Z","isPatch":true,"sender":{"key":"rogersoares@intelinet.com.br","avatar":null},"body":"Hi Robin,\n\n> Looks nice. We probably want this into preferences and I'd still like the tooltop as an option. I.e. when you turn off\n> the other panes the tooltip should come back. What I'd really want is the \"Press F2\"-version, like the javadoc\n> tooltips, but that requires some more work (I guess, maybe only a little is needed).\n>   \nShowing the tooltips when you press F2 makes more sense to me. What I'm \nconfortable to do now is to add another option in the history menu \n(after show revision comment) to show the tooltips. I can send a new \npatch with this.\n\nFor the search bar, I would like to make it visible by pressing ctrl-f \nwhen the history panel has the focus. So if I learn how to do it I can \nalso do the F2 for the tooltips (low priority though).\n\n\n>> +\t/* private */TextViewer revDetailTextViewer;\n>> +\t/* private */TextViewer revCommentTextViewer;\n>> +\t/* private */IAction toggleCommentWrapAction;\n>> +\t/* private */IAction toggleRevDetailAction;\n>> +\t/* private */IAction toggleRevCommentAction;\n>>  \n>> -\tprivate Table table;\n>> +\t/* private */Table table;\n>>  \n>> -\tprivate List<IFileRevision> fileRevisions;\n>> +\t/* private */List<IFileRevision> fileRevisions;\n>>  \n>> -\tprotected boolean hintShowDiffNow;\n>> +\t/* private */boolean hintShowDiffNow;\n>>     \n> Why? What's wrong plain private?\n>   \nThis is to improve performance and getting rid of the warning:\nRead access to enclosing field GitHistoryPage.appliedPatches is emulated \nby a synthetic accessor method. Increasing its visibility will improve \nyour performance\n\n[]s,\nRoger.\n"},{"id":"64861","messageId":"200801091912.37723.robin.rosenberg.lists@dewire.com","threadId":"11517","inReplyTo":"4784209D.6080100@intelinet.com.br","subject":"Re: [EGIT PATCH] Showing commit info like the CVS plugin instead of tooltips.","fromName":"Robin Rosenberg","fromEmail":"robin.rosenberg.lists@dewire.com","sentAt":"2008-01-09T18:12:37Z","receivedAt":"2008-01-09T18:12:37Z","isPatch":true,"sender":{"key":"robin.rosenberg@dewire.com","avatar":"https://avatars.githubusercontent.com/u/46357?v=4"},"body":"onsdagen den 9 januari 2008 skrev Roger C. Soares:\n> Hi Robin,\n> \n> > Looks nice. We probably want this into preferences and I'd still like the \ntooltop as an option. I.e. when you turn off\n> > the other panes the tooltip should come back. What I'd really want is \nthe \"Press F2\"-version, like the javadoc\n> > tooltips, but that requires some more work (I guess, maybe only a little \nis needed).\n> >   \n> Showing the tooltips when you press F2 makes more sense to me. What I'm \nActually not what I meant. Javadoc tooltips popup as a tooltip. When it is \nactive you can press F2 to see more information,\ncopy text etc.\n\n> For the search bar, I would like to make it visible by pressing ctrl-f \n> when the history panel has the focus. \nYou're free to experiment. I'm quite fond of the search field in kmail. It is \na textfield that filters mail on\nheader fields as I type.\n> >> -\tprotected boolean hintShowDiffNow;\n> >> +\t/* private */boolean hintShowDiffNow;\n> >>     \n> > Why? What's wrong plain private?\n> >   \n> This is to improve performance and getting rid of the warning:\n> Read access to enclosing field GitHistoryPage.appliedPatches is emulated \n> by a synthetic accessor method. Increasing its visibility will improve \n> your performance\n\nAh, should have noticed. That's ok.\n\nI found a bug. When you travel down the histtory using arrow keys all of the \nsudden the commit info disappears.\n\n-- robin\n"},{"id":"64888","messageId":"47856421.3070907@intelinet.com.br","threadId":"11517","inReplyTo":"200801091912.37723.robin.rosenberg.lists@dewire.com","subject":"Re: [EGIT PATCH] Showing commit info like the CVS plugin instead of tooltips.","fromName":"Roger C. Soares","fromEmail":"rogersoares@intelinet.com.br","sentAt":"2008-01-10T00:17:37Z","receivedAt":"2008-01-10T00:17:37Z","isPatch":true,"sender":{"key":"rogersoares@intelinet.com.br","avatar":null},"body":"\n\nRobin Rosenberg escreveu:\n>> Showing the tooltips when you press F2 makes more sense to me. What I'm \n>>     \n> Actually not what I meant. Javadoc tooltips popup as a tooltip. When it is \n> active you can press F2 to see more information,\n> copy text etc.\n>   \nHumnmn, I see...\n\n>> For the search bar, I would like to make it visible by pressing ctrl-f \n>> when the history panel has the focus. \n>>     \n> You're free to experiment. I'm quite fond of the search field in kmail. It is \n> a textfield that filters mail on\n> header fields as I type.\n>   \nYep, I'm willing to do something in this direction. The behavior I'm \nthinking right now won't be to hide the lines that don't match but to do \nmore like gitk. Highlight rows and have next/previous buttons, and if \npossible show where I am (like 3/10 or 3 of 10).\n\n> I found a bug. When you travel down the histtory using arrow keys all of the \n> sudden the commit info disappears.\n>   \nCool, thanks, I'll investigate it.\n\n[]s,\nRoger.\n"}]}