From 9bc17d16ea48a7978b198126d346828b1d24fe4e Mon Sep 17 00:00:00 2001 From: James Moger Date: Mon, 18 Apr 2011 22:29:20 -0400 Subject: Color-coded change type indicator with tooltip for changed paths. Also fixed /dev/null reference due to deletion change. --- src/com/gitblit/wicket/pages/CommitDiffPage.java | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) (limited to 'src/com/gitblit/wicket/pages/CommitDiffPage.java') diff --git a/src/com/gitblit/wicket/pages/CommitDiffPage.java b/src/com/gitblit/wicket/pages/CommitDiffPage.java index 87e81102..d52b7a36 100644 --- a/src/com/gitblit/wicket/pages/CommitDiffPage.java +++ b/src/com/gitblit/wicket/pages/CommitDiffPage.java @@ -16,7 +16,7 @@ import com.gitblit.utils.JGitUtils; import com.gitblit.wicket.LinkPanel; import com.gitblit.wicket.RepositoryPage; import com.gitblit.wicket.WicketUtils; -import com.gitblit.wicket.models.PathModel; +import com.gitblit.wicket.models.PathModel.PathChangeModel; public class CommitDiffPage extends RepositoryPage { @@ -46,14 +46,19 @@ public class CommitDiffPage extends RepositoryPage { add(new LinkPanel("shortlog", "title", commit.getShortMessage(), CommitPage.class, newCommitParameter())); // changed paths list - List paths = JGitUtils.getFilesInCommit(r, commit); - ListDataProvider pathsDp = new ListDataProvider(paths); - DataView pathsView = new DataView("changedPath", pathsDp) { + List paths = JGitUtils.getFilesInCommit(r, commit); + ListDataProvider pathsDp = new ListDataProvider(paths); + DataView pathsView = new DataView("changedPath", pathsDp) { private static final long serialVersionUID = 1L; int counter = 0; - public void populateItem(final Item item) { - final PathModel entry = item.getModelObject(); + public void populateItem(final Item item) { + final PathChangeModel entry = item.getModelObject(); + Label changeType = new Label("changeType", ""); + WicketUtils.setChangeTypeCssClass(changeType, entry.changeType); + setChangeTypeTooltip(changeType, entry.changeType); + item.add(changeType); + if (entry.isTree()) { item.add(new LinkPanel("pathName", null, entry.path, TreePage.class, newPathParameter(entry.path))); } else { -- cgit v1.2.3