From 9bc17d16ea48a7978b198126d346828b1d24fe4e Mon Sep 17 00:00:00 2001 From: James Moger <james.moger@gitblit.com> Date: Mon, 18 Apr 2011 22:29:20 -0400 Subject: [PATCH] Color-coded change type indicator with tooltip for changed paths. --- src/com/gitblit/wicket/pages/CommitPage.java | 16 ++++++++++------ 1 files changed, 10 insertions(+), 6 deletions(-) diff --git a/src/com/gitblit/wicket/pages/CommitPage.java b/src/com/gitblit/wicket/pages/CommitPage.java index 064a7fe..0406523 100644 --- a/src/com/gitblit/wicket/pages/CommitPage.java +++ b/src/com/gitblit/wicket/pages/CommitPage.java @@ -18,7 +18,7 @@ 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 CommitPage extends RepositoryPage { @@ -78,14 +78,18 @@ addFullText("fullMessage", c.getFullMessage(), true); // changed paths list - List<PathModel> paths = JGitUtils.getFilesInCommit(r, c); - ListDataProvider<PathModel> pathsDp = new ListDataProvider<PathModel>(paths); - DataView<PathModel> pathsView = new DataView<PathModel>("changedPath", pathsDp) { + List<PathChangeModel> paths = JGitUtils.getFilesInCommit(r, c); + ListDataProvider<PathChangeModel> pathsDp = new ListDataProvider<PathChangeModel>(paths); + DataView<PathChangeModel> pathsView = new DataView<PathChangeModel>("changedPath", pathsDp) { private static final long serialVersionUID = 1L; int counter = 0; - public void populateItem(final Item<PathModel> item) { - final PathModel entry = item.getModelObject(); + public void populateItem(final Item<PathChangeModel> 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 { -- Gitblit v1.9.1