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/JPalette.java | 49 +++++++++++++++++++++++++++++++++++++++++++++++--
1 files changed, 47 insertions(+), 2 deletions(-)
diff --git a/src/com/gitblit/client/JPalette.java b/src/com/gitblit/client/JPalette.java
index eb445b4..07900cb 100644
--- a/src/com/gitblit/client/JPalette.java
+++ b/src/com/gitblit/client/JPalette.java
@@ -38,8 +38,16 @@
private static final long serialVersionUID = 1L;
private PaletteModel<T> availableModel;
private PaletteModel<T> selectedModel;
+ private JButton add;
+ private JButton subtract;
+ private JButton up;
+ private JButton down;
public JPalette() {
+ this(false);
+ }
+
+ public JPalette(boolean controlOrder) {
super(new BorderLayout(5, 5));
availableModel = new PaletteModel<T>();
@@ -48,7 +56,7 @@
final JTable available = new JTable(availableModel);
final JTable selected = new JTable(selectedModel);
- JButton add = new JButton("->");
+ add = new JButton("->");
add.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent event) {
List<T> move = new ArrayList<T>();
@@ -66,7 +74,7 @@
selectedModel.fireTableDataChanged();
}
});
- JButton subtract = new JButton("<-");
+ subtract = new JButton("<-");
subtract.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent event) {
List<T> move = new ArrayList<T>();
@@ -86,9 +94,37 @@
}
});
+ up = new JButton("\u2191");
+ up.addActionListener(new ActionListener() {
+ public void actionPerformed(ActionEvent event) {
+ int row = selected.getSelectedRow();
+ if (row > 0) {
+ T o = selectedModel.list.remove(row);
+ selectedModel.list.add(row - 1, o);
+ selectedModel.fireTableDataChanged();
+ }
+ }
+ });
+
+ down = new JButton("\u2193");
+ down.addActionListener(new ActionListener() {
+ public void actionPerformed(ActionEvent event) {
+ int row = selected.getSelectedRow();
+ if (row < selected.getRowCount() - 1) {
+ T o = selectedModel.list.remove(row);
+ selectedModel.list.add(row + 1, o);
+ selectedModel.fireTableDataChanged();
+ }
+ }
+ });
+
JPanel controls = new JPanel(new GridLayout(0, 1, 0, 5));
controls.add(add);
controls.add(subtract);
+ if (controlOrder) {
+ controls.add(up);
+ controls.add(down);
+ }
JPanel center = new JPanel(new GridBagLayout());
center.add(controls);
@@ -117,6 +153,15 @@
panel.add(jsp, BorderLayout.CENTER);
return panel;
}
+
+ @Override
+ public void setEnabled(boolean enabled) {
+ super.setEnabled(enabled);
+ add.setEnabled(enabled);
+ subtract.setEnabled(enabled);
+ up.setEnabled(enabled);
+ down.setEnabled(enabled);
+ }
public void setObjects(List<T> all, List<T> selected) {
List<T> available = new ArrayList<T>(all);
--
Gitblit v1.9.1