From 0e44acbb2fec928a1606dc60f427a148fff405c9 Mon Sep 17 00:00:00 2001
From: Mohamed Ragab <moragab@gmail.com>
Date: Wed, 02 May 2012 11:15:01 -0400
Subject: [PATCH] Added a script to facilitate setting the proxy host and port and no proxy hosts, and then it concatenates all the java system properties for setting the java proxy configurations and puts the resulting string in an environment variable JAVA_PROXY_CONFIG, modified the scirpts gitblit, gitblit-ubuntu, and gitblit-centos to source the java-proxy-config.sh script and then include the resulting java proxy configuration in the java command
---
src/com/gitblit/client/BranchRenderer.java | 33 ++++++++++++++++++++++++++++-----
1 files changed, 28 insertions(+), 5 deletions(-)
diff --git a/src/com/gitblit/client/BranchRenderer.java b/src/com/gitblit/client/BranchRenderer.java
index 532a432..9a303c3 100644
--- a/src/com/gitblit/client/BranchRenderer.java
+++ b/src/com/gitblit/client/BranchRenderer.java
@@ -18,7 +18,9 @@
import java.awt.Color;
import java.awt.Component;
+import javax.swing.JList;
import javax.swing.JTable;
+import javax.swing.ListCellRenderer;
import javax.swing.table.DefaultTableCellRenderer;
/**
@@ -28,7 +30,7 @@
* @author James Moger
*
*/
-public class BranchRenderer extends DefaultTableCellRenderer {
+public class BranchRenderer extends DefaultTableCellRenderer implements ListCellRenderer {
private static final long serialVersionUID = 1L;
@@ -39,7 +41,29 @@
public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected,
boolean hasFocus, int row, int column) {
super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column);
- String name = value.toString();
+ setText(value == null ? "" : value.toString());
+ if (isSelected) {
+ setForeground(table.getSelectionForeground());
+ }
+ return this;
+ }
+
+ @Override
+ public Component getListCellRendererComponent(JList list, Object value, int index,
+ boolean isSelected, boolean cellHasFocus) {
+ setText(value == null ? "" : value.toString());
+ if (isSelected) {
+ setBackground(list.getSelectionBackground());
+ setForeground(list.getSelectionForeground());
+ } else {
+ setBackground(list.getBackground());
+ }
+ return this;
+ }
+
+ @Override
+ public void setText(String text) {
+ String name = text;
Color fg = getForeground();
if (name.startsWith(R_HEADS)) {
name = name.substring(R_HEADS.length());
@@ -48,8 +72,7 @@
name = name.substring(R_REMOTES.length());
fg = Color.decode("#6C6CBF");
}
- setText(name);
- setForeground(isSelected ? table.getSelectionForeground() : fg);
- return this;
+ setForeground(fg);
+ super.setText(name);
}
}
\ No newline at end of file
--
Gitblit v1.9.1