Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin Sawicki2012-02-24 20:36:42 -0500
committerKevin Sawicki2012-02-24 20:36:42 -0500
commit9066219c8c172cf1696ddffc6e8ac15a70e4cb07 (patch)
tree7146d49c97d540dbb781a5f4c6155d6754d55a5e /org.eclipse.egit.ui/src/org
parent14e0bf6785f5898899747de4d7cde57496caea55 (diff)
downloadegit-9066219c8c172cf1696ddffc6e8ac15a70e4cb07.tar.gz
egit-9066219c8c172cf1696ddffc6e8ac15a70e4cb07.tar.xz
egit-9066219c8c172cf1696ddffc6e8ac15a70e4cb07.zip
[historyView] Add 'Committed Date' column
Also renames 'Date' column to 'Authored Date' Bug: 369043 Change-Id: I9c00957a54149e63b3fb7510f62a1ed8c4469c1b
Diffstat (limited to 'org.eclipse.egit.ui/src/org')
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/UIText.java5
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/CommitGraphTable.java39
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/GraphLabelProvider.java17
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/uitext.properties3
4 files changed, 35 insertions, 29 deletions
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/UIText.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/UIText.java
index f76248f20..7c0d2814a 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/UIText.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/UIText.java
@@ -1591,7 +1591,7 @@ public class UIText extends NLS {
public static String HistoryPage_authorColumn;
/** */
- public static String HistoryPage_dateColumn;
+ public static String HistoryPage_authorDateColumn;
/** */
public static String HistoryPage_refreshJob;
@@ -3497,6 +3497,9 @@ public class UIText extends NLS {
public static String CommitGraphTable_Committer;
/** */
+ public static String CommitGraphTable_committerDataColumn;
+
+ /** */
public static String CommitGraphTable_CompareWithEachOtherInTreeMenuLabel;
/** */
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/CommitGraphTable.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/CommitGraphTable.java
index 79a3c02d2..364684280 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/CommitGraphTable.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/CommitGraphTable.java
@@ -306,9 +306,8 @@ class CommitGraphTable {
getTableView().addOpenListener(new IOpenListener() {
public void open(OpenEvent event) {
- if (input == null || !input.isSingleFile()) {
+ if (input == null || !input.isSingleFile())
return;
- }
ICommandService srv = (ICommandService) site
.getService(ICommandService.class);
@@ -317,7 +316,7 @@ class CommitGraphTable {
Command cmd = srv.getCommand(HistoryViewCommands.SHOWVERSIONS);
Parameterization[] parms;
if (Activator.getDefault().getPreferenceStore().getBoolean(
- UIPreferences.RESOURCEHISTORY_COMPARE_MODE)) {
+ UIPreferences.RESOURCEHISTORY_COMPARE_MODE))
try {
IParameter parm = cmd
.getParameter(HistoryViewCommands.COMPARE_MODE_PARAM);
@@ -327,7 +326,7 @@ class CommitGraphTable {
Activator.handleError(e.getMessage(), e, true);
parms = null;
}
- } else
+ else
parms = null;
ParameterizedCommand pcmd = new ParameterizedCommand(cmd, parms);
try {
@@ -363,13 +362,12 @@ class CommitGraphTable {
}
void selectCommit(final RevCommit c) {
- if (c instanceof PlotCommit) {
+ if (c instanceof PlotCommit)
table.setSelection(new StructuredSelection(c), true);
- } else if (commitsMap != null) {
+ else if (commitsMap != null) {
PlotCommit swtCommit = commitsMap.get(c.getId().name());
- if (swtCommit != null) {
+ if (swtCommit != null)
table.setSelection(new StructuredSelection(swtCommit), true);
- }
}
}
@@ -418,12 +416,10 @@ class CommitGraphTable {
allCommits = list;
table.setInput(asArray);
if (asArray != null && asArray.length > 0) {
- if (oldList != list) {
+ if (oldList != list)
initCommitsMap();
- }
- } else {
+ } else
table.getTable().deselectAll();
- }
if (commitToShow != null)
selectCommit(commitToShow);
}
@@ -460,7 +456,7 @@ class CommitGraphTable {
final TableColumn date = new TableColumn(rawTable, SWT.NONE);
date.setResizable(true);
- date.setText(UIText.HistoryPage_dateColumn);
+ date.setText(UIText.HistoryPage_authorDateColumn);
date.setWidth(250);
layout.addColumnData(new ColumnWeightData(5, true));
@@ -475,6 +471,12 @@ class CommitGraphTable {
committer.setText(UIText.CommitGraphTable_Committer);
committer.setWidth(100);
layout.addColumnData(new ColumnWeightData(5, true));
+
+ final TableColumn committerDate = new TableColumn(rawTable, SWT.NONE);
+ committerDate.setResizable(true);
+ committerDate.setText(UIText.CommitGraphTable_committerDataColumn);
+ committerDate.setWidth(100);
+ layout.addColumnData(new ColumnWeightData(5, true));
}
private void createPaintListener(final Table rawTable) {
@@ -482,7 +484,7 @@ class CommitGraphTable {
//
rawTable.addListener(SWT.EraseItem, new Listener() {
public void handleEvent(final Event event) {
- if (0 <= event.index && event.index <= 4)
+ if (0 <= event.index && event.index <= 5)
event.detail &= ~SWT.FOREGROUND;
}
});
@@ -548,12 +550,10 @@ class CommitGraphTable {
@Override
public void run() {
- if (af == ActionFactory.SELECT_ALL) {
+ if (af == ActionFactory.SELECT_ALL)
table.getTable().selectAll();
- }
- if (af == ActionFactory.COPY) {
+ if (af == ActionFactory.COPY)
doCopy();
- }
}
};
return action;
@@ -588,9 +588,8 @@ class CommitGraphTable {
UIText.CommitGraphTable_UnableToWritePatch,
commit.getId().name()), e);
} finally {
- if (patchFile != null) {
+ if (patchFile != null)
patchFile.deleteOnExit();
- }
}
}
}
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/GraphLabelProvider.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/GraphLabelProvider.java
index 9eb928535..2bfa6d49d 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/GraphLabelProvider.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/GraphLabelProvider.java
@@ -42,7 +42,7 @@ class GraphLabelProvider extends BaseLabelProvider implements
return c.getId().abbreviate(8).name() + "..."; //$NON-NLS-1$
if (columnIndex == 1 || columnIndex == 2) {
final PersonIdent author = authorOf(c);
- if (author != null) {
+ if (author != null)
switch (columnIndex) {
case 1:
return author.getName()
@@ -50,14 +50,17 @@ class GraphLabelProvider extends BaseLabelProvider implements
case 2:
return getDateFormatter().formatDate(author);
}
- }
}
- if (columnIndex == 4) {
+ if (columnIndex == 4 || columnIndex == 5) {
final PersonIdent committer = committerOf(c);
- if (committer != null) {
- return committer.getName()
- + " <" + committer.getEmailAddress() + ">"; //$NON-NLS-1$ //$NON-NLS-2$
- }
+ if (committer != null)
+ switch (columnIndex) {
+ case 4:
+ return committer.getName()
+ + " <" + committer.getEmailAddress() + ">"; //$NON-NLS-1$ //$NON-NLS-2$
+ case 5:
+ return getDateFormatter().formatDate(committer);
+ }
}
return ""; //$NON-NLS-1$
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/uitext.properties b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/uitext.properties
index b789dac7c..92a660d8d 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/uitext.properties
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/uitext.properties
@@ -551,7 +551,7 @@ ResourceHistory_toggleRevComment=Revision C&omment
HardResetToRevisionAction_hardReset=Hard Reset
HistoryPage_authorColumn=Author
-HistoryPage_dateColumn=Date
+HistoryPage_authorDateColumn=Authored Date
HistoryPage_refreshJob=Reading history from Git repository ''{0}''
HistoryPage_findbar_find=Find:
@@ -1226,6 +1226,7 @@ CommitFileDiffViewer_SelectOneCommitMessage=Please select exactly one commit
CommitFileDiffViewer_ShowAnnotationsMenuLabel=Show Annotations
CommitGraphTable_CommitId=Id
CommitGraphTable_Committer=Committer
+CommitGraphTable_committerDataColumn=Committed Date
CommitGraphTable_CompareWithEachOtherInTreeMenuLabel=Compare with Each Other in &Tree
CommitGraphTable_DeleteBranchAction=&Delete Branch
CommitGraphTable_messageColumn=Message

Back to the top