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/NameRenderer.java | 34 ++++++++++++++++++++++++++++++----
1 files changed, 30 insertions(+), 4 deletions(-)
diff --git a/src/com/gitblit/client/NameRenderer.java b/src/com/gitblit/client/NameRenderer.java
index 41393fb..4cbb590 100644
--- a/src/com/gitblit/client/NameRenderer.java
+++ b/src/com/gitblit/client/NameRenderer.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,13 +30,19 @@
* @author James Moger
*
*/
-public class NameRenderer extends DefaultTableCellRenderer {
+public class NameRenderer extends DefaultTableCellRenderer implements ListCellRenderer {
private static final long serialVersionUID = 1L;
- final String groupSpan;
+ private static final Color CORNFLOWER = new Color(0x00, 0x69, 0xD6);
- public NameRenderer(Color group, Color repo) {
+ private final String groupSpan;
+
+ public NameRenderer() {
+ this(Color.gray, CORNFLOWER);
+ }
+
+ private NameRenderer(Color group, Color repo) {
groupSpan = "<span style='color:" + getHexColor(group) + "'>";
setForeground(repo);
}
@@ -51,6 +59,25 @@
public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected,
boolean hasFocus, int row, int column) {
super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column);
+ setValue(value == null ? "" : value, isSelected);
+ return this;
+ }
+
+ @Override
+ public Component getListCellRendererComponent(JList list, Object value, int index,
+ boolean isSelected, boolean cellHasFocus) {
+ setValue(value == null ? "" : value, isSelected);
+ if (isSelected) {
+ setBackground(list.getSelectionBackground());
+ setForeground(list.getSelectionForeground());
+ } else {
+ setBackground(list.getBackground());
+ setForeground(CORNFLOWER);
+ }
+ return this;
+ }
+
+ private void setValue(Object value, boolean isSelected) {
String name = value.toString();
int lastSlash = name.lastIndexOf('/');
if (!isSelected && lastSlash > -1) {
@@ -60,6 +87,5 @@
} else {
this.setText(name);
}
- return this;
}
}
\ No newline at end of file
--
Gitblit v1.9.1