From ac7f1753d3f742e0af8dd5e142b4eac9d9d2fbba Mon Sep 17 00:00:00 2001 From: James Moger <james.moger@gitblit.com> Date: Fri, 28 Oct 2011 21:41:31 -0400 Subject: [PATCH] Preserve feed selections when not saving passwords --- src/com/gitblit/client/Utils.java | 23 ++++++++++++++++++++--- 1 files changed, 20 insertions(+), 3 deletions(-) diff --git a/src/com/gitblit/client/Utils.java b/src/com/gitblit/client/Utils.java index ae81e7f..1f44c32 100644 --- a/src/com/gitblit/client/Utils.java +++ b/src/com/gitblit/client/Utils.java @@ -36,21 +36,32 @@ import com.gitblit.Constants.RpcRequest; public class Utils { + + 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) { + 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; + } + + public static void explainNotAllowed(Component c, RpcRequest request) { + String msg = MessageFormat.format("The Gitblit server does not allow the request \"{0}\".", + request.name()); + JOptionPane.showMessageDialog(c, msg, "Not Allowed", JOptionPane.ERROR_MESSAGE); } public static void explainForbidden(Component c, RpcRequest request) { String msg = MessageFormat.format( - "The request \"{0}\" has been forbidden by the Gitblit server.", request.name()); + "The request \"{0}\" has been forbidden for the account by the Gitblit server.", + request.name()); JOptionPane.showMessageDialog(c, msg, "Forbidden", JOptionPane.ERROR_MESSAGE); } @@ -60,6 +71,12 @@ JOptionPane.showMessageDialog(c, msg, "Unauthorized", JOptionPane.ERROR_MESSAGE); } + public static void explainUnknown(Component c, RpcRequest request) { + String msg = MessageFormat.format( + "The request \"{0}\" is not recognized by the Gitblit server.", request.name()); + JOptionPane.showMessageDialog(c, msg, "Unknown Request", JOptionPane.ERROR_MESSAGE); + } + public static void showException(Component c, Throwable t) { StringWriter writer = new StringWriter(); t.printStackTrace(new PrintWriter(writer)); -- Gitblit v1.9.1