diff options
author | James Moger <james.moger@gitblit.com> | 2013-04-23 17:39:02 -0400 |
---|---|---|
committer | James Moger <james.moger@gitblit.com> | 2013-04-23 17:39:02 -0400 |
commit | 342a0566918d561b382b31ddd8a9696f363ca5e3 (patch) | |
tree | eee6cd594c910765f838319994e8d55c3074d5ec | |
parent | ea2c2a00f68a784761e8b68cd91a87693c37a0a7 (diff) | |
download | gitblit-342a0566918d561b382b31ddd8a9696f363ca5e3.tar.gz gitblit-342a0566918d561b382b31ddd8a9696f363ca5e3.zip |
Improve Gerrit change ref rendering (issue-206)
-rw-r--r-- | releases.moxie | 1 | ||||
-rw-r--r-- | src/main/java/com/gitblit/client/BranchRenderer.java | 5 | ||||
-rw-r--r-- | src/main/java/com/gitblit/wicket/panels/RefsPanel.java | 6 |
3 files changed, 12 insertions, 0 deletions
diff --git a/releases.moxie b/releases.moxie index 5aedcacc..c0654353 100644 --- a/releases.moxie +++ b/releases.moxie @@ -26,6 +26,7 @@ r17: { - Use standard ServletRequestWrapper instead of custom wrapper (issue 224)
changes:
+ - Improve Gerrit change ref decoration in the refs panel (issue 206)
- Disable Gson's pretty printing which has a huge performance gain
- Properly set application/json content-type on api calls
- Updated Polish translation
diff --git a/src/main/java/com/gitblit/client/BranchRenderer.java b/src/main/java/com/gitblit/client/BranchRenderer.java index 9a303c38..5f12c42c 100644 --- a/src/main/java/com/gitblit/client/BranchRenderer.java +++ b/src/main/java/com/gitblit/client/BranchRenderer.java @@ -37,6 +37,8 @@ public class BranchRenderer extends DefaultTableCellRenderer implements ListCell private static final String R_HEADS = "refs/heads/";
private static final String R_REMOTES = "refs/remotes/";
+
+ private static final String R_CHANGES = "refs/changes/";
public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected,
boolean hasFocus, int row, int column) {
@@ -71,6 +73,9 @@ public class BranchRenderer extends DefaultTableCellRenderer implements ListCell } else if (name.startsWith(R_REMOTES)) {
name = name.substring(R_REMOTES.length());
fg = Color.decode("#6C6CBF");
+ } else if (name.startsWith(R_CHANGES)) {
+ name = name.substring(R_CHANGES.length());
+ fg = Color.decode("#B0E0F0");
}
setForeground(fg);
super.setText(name);
diff --git a/src/main/java/com/gitblit/wicket/panels/RefsPanel.java b/src/main/java/com/gitblit/wicket/panels/RefsPanel.java index 3ba22c0b..c3807ac2 100644 --- a/src/main/java/com/gitblit/wicket/panels/RefsPanel.java +++ b/src/main/java/com/gitblit/wicket/panels/RefsPanel.java @@ -41,6 +41,8 @@ import com.gitblit.wicket.pages.TagPage; public class RefsPanel extends Panel {
private static final long serialVersionUID = 1L;
+
+ private static final String R_CHANGES = "refs/changes/";
public RefsPanel(String id, final String repositoryName, RevCommit c,
Map<ObjectId, List<RefModel>> refs) {
@@ -108,6 +110,10 @@ public class RefsPanel extends Panel { // local head
linkClass = LogPage.class;
cssClass = "headRef";
+ } else if (name.startsWith(R_CHANGES)) {
+ // Gerrit change ref
+ name = name.substring(R_CHANGES.length());
+ cssClass = "otherRef";
} else if (name.startsWith(Constants.R_REMOTES)) {
// remote branch
linkClass = LogPage.class;
|