From a5e762ba4ab82f0c6ef71d853c5103f19bbf8e22 Mon Sep 17 00:00:00 2001
From: James Moger <james.moger@gitblit.com>
Date: Thu, 11 Oct 2012 08:10:20 -0400
Subject: [PATCH] Tweak canFork description

---
 src/com/gitblit/client/Utils.java |   25 +++++++++++++++++++++++--
 1 files changed, 23 insertions(+), 2 deletions(-)

diff --git a/src/com/gitblit/client/Utils.java b/src/com/gitblit/client/Utils.java
index 786eb9f..538e6be 100644
--- a/src/com/gitblit/client/Utils.java
+++ b/src/com/gitblit/client/Utils.java
@@ -17,10 +17,13 @@
 
 import java.awt.Color;
 import java.awt.Component;
+import java.awt.Desktop;
 import java.awt.Dimension;
 import java.awt.Font;
+import java.awt.Insets;
 import java.io.PrintWriter;
 import java.io.StringWriter;
+import java.net.URI;
 import java.text.MessageFormat;
 import java.util.Date;
 
@@ -37,14 +40,23 @@
 
 public class Utils {
 
-	public static JTable newTable(TableModel model) {
+	public final static int MARGIN = 5;
+
+	public final static Insets INSETS = new Insets(MARGIN, MARGIN, MARGIN, MARGIN);
+
+	public final static String TIMESTAMP_FORMAT = "yyyy-MM-dd HH:mm";
+
+	public final static String DATE_FORMAT = "yyyy-MM-dd";
+
+	public static JTable newTable(TableModel model, String datePattern) {
 		JTable table = new JTable(model);
 		table.setCellSelectionEnabled(false);
 		table.setRowSelectionAllowed(true);
 		table.getTableHeader().setReorderingAllowed(false);
 		table.setGridColor(new Color(0xd9d9d9));
 		table.setBackground(Color.white);
-		table.setDefaultRenderer(Date.class, new DateCellRenderer(null, Color.orange.darker()));
+		table.setDefaultRenderer(Date.class,
+				new DateCellRenderer(datePattern, Color.orange.darker()));
 		return table;
 	}
 
@@ -127,4 +139,13 @@
 		// Set the width
 		col.setPreferredWidth(width);
 	}
+
+	public static void browse(String url) {
+		try {
+			Desktop.getDesktop().browse(new URI(url));
+		} catch (Exception x) {
+			showException(null, x);
+		}
+	}
+
 }

--
Gitblit v1.9.1