Initial implementation of Clone
[nbgit.git] / src / org / nbgit / ui / repository / RepositoryPanel.java
blob41f986709f62dc98a32f2a6ae14fad0ed8b9bb8c
1 /*
2 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
4 * Copyright 1997-2009 Sun Microsystems, Inc. All rights reserved.
6 * The contents of this file are subject to the terms of either the GNU
7 * General Public License Version 2 only ("GPL") or the Common
8 * Development and Distribution License("CDDL") (collectively, the
9 * "License"). You may not use this file except in compliance with the
10 * License. You can obtain a copy of the License at
11 * http://www.netbeans.org/cddl-gplv2.html
12 * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
13 * specific language governing permissions and limitations under the
14 * License. When distributing the software, include this License Header
15 * Notice in each file and include the License file at
16 * nbbuild/licenses/CDDL-GPL-2-CP. Sun designates this
17 * particular file as subject to the "Classpath" exception as provided
18 * by Sun in the GPL Version 2 section of the License file that
19 * accompanied this code. If applicable, add the following below the
20 * License Header, with the fields enclosed by brackets [] replaced by
21 * your own identifying information:
22 * "Portions Copyrighted [year] [name of copyright owner]"
24 * Contributor(s):
26 * The Original Software is NetBeans. The Initial Developer of the Original
27 * Software is Sun Microsystems, Inc. Portions Copyright 1997-2009 Sun
28 * Microsystems, Inc. All Rights Reserved.
29 * Portions Copyright 2009 Alexander Coles (Ikonoklastik Productions).
31 * If you wish your version of this file to be governed by only the CDDL
32 * or only the GPL Version 2, indicate your decision by adding
33 * "[Contributor] elects to include this software in this distribution
34 * under the [CDDL or GPL Version 2] license." If you do not indicate a
35 * single choice of license, a recipient has the option to distribute
36 * your version of this file under either the CDDL, the GPL Version 2 or
37 * to extend the choice of license to its licensees as provided above.
38 * However, if you add GPL Version 2 code and therefore, elected the GPL
39 * Version 2 license, then the option applies only if the new code is
40 * made subject to such option by the copyright holder.
42 package org.nbgit.ui.repository;
44 /**
46 * @author Petr Kuzel
48 public class RepositoryPanel extends javax.swing.JPanel {
50 private Runnable postInitRoutine;
52 /** Creates new form RepositoryPanel */
53 public RepositoryPanel() {
54 initComponents();
57 void schedulePostInitRoutine(Runnable postInitRoutine) {
58 this.postInitRoutine = postInitRoutine;
61 @Override
62 public void addNotify() {
63 super.addNotify();
64 setPreferredSize(getPreferredSize());
65 if (postInitRoutine != null) {
66 postInitRoutine.run();
70 /** This method is called from within the constructor to
71 * initialize the form.
72 * WARNING: Do NOT modify this code. The content of this method is
73 * always regenerated by the Form Editor.
75 // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
76 private void initComponents() {
78 setMinimumSize(new java.awt.Dimension(480, 160));
79 java.util.ResourceBundle bundle = java.util.ResourceBundle.getBundle("org/nbgit/ui/repository/Bundle"); // NOI18N
80 setName(bundle.getString("BK2018")); // NOI18N
81 setVerifyInputWhenFocusTarget(false);
83 titleLabel.setText(bundle.getString("BK0001")); // NOI18N
85 jLabel2.setLabelFor(urlComboBox);
86 org.openide.awt.Mnemonics.setLocalizedText(jLabel2, org.openide.util.NbBundle.getMessage(RepositoryPanel.class, "BK0002")); // NOI18N
88 urlComboBox.setEditable(true);
89 java.awt.Component editorComp = urlComboBox.getEditor().getEditorComponent();
90 if (editorComp instanceof javax.swing.JTextField) {
91 ((javax.swing.JTextField) editorComp).setColumns(35);
94 org.openide.awt.Mnemonics.setLocalizedText(proxySettingsButton, org.openide.util.NbBundle.getMessage(RepositoryPanel.class, "BK0006")); // NOI18N
95 proxySettingsButton.setToolTipText(org.openide.util.NbBundle.getMessage(RepositoryPanel.class, "ACSD_ProxyDialog")); // NOI18N
97 tipLabel.setText("-"); // NOI18N
98 tipLabel.setMaximumSize(new java.awt.Dimension(32767, 32767));
100 userPasswordField.setColumns(8);
101 userPasswordField.setMinimumSize(new java.awt.Dimension(11, 22));
103 passwordLabel.setLabelFor(userPasswordField);
104 org.openide.awt.Mnemonics.setLocalizedText(passwordLabel, org.openide.util.NbBundle.getMessage(RepositoryPanel.class, "BK0004")); // NOI18N
105 passwordLabel.setToolTipText(org.openide.util.NbBundle.getMessage(RepositoryPanel.class, "TT_Password")); // NOI18N
107 userLabel.setLabelFor(userTextField);
108 org.openide.awt.Mnemonics.setLocalizedText(userLabel, org.openide.util.NbBundle.getMessage(RepositoryPanel.class, "BK0003")); // NOI18N
109 userLabel.setToolTipText(org.openide.util.NbBundle.getMessage(RepositoryPanel.class, "TT_UserName")); // NOI18N
111 userTextField.setColumns(8);
112 userTextField.setMinimumSize(new java.awt.Dimension(11, 22));
114 leaveBlankLabel.setText(org.openide.util.NbBundle.getMessage(RepositoryPanel.class, "BK0005")); // NOI18N
116 tunnelLabel.setText(org.openide.util.NbBundle.getMessage(RepositoryPanel.class, "BK0010")); // NOI18N
118 tunnelCommandTextField.setColumns(35);
120 tunnelCommandLabel.setText(org.openide.util.NbBundle.getMessage(RepositoryPanel.class, "BK0009")); // NOI18N
122 tunnelHelpLabel.setText(org.openide.util.NbBundle.getMessage(RepositoryPanel.class, "TT_svn_xxx")); // NOI18N
124 savePasswordCheckBox.setMnemonic('v');
125 savePasswordCheckBox.setText(org.openide.util.NbBundle.getMessage(RepositoryPanel.class, "BK0007")); // NOI18N
126 savePasswordCheckBox.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0));
128 org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(this);
129 this.setLayout(layout);
130 layout.setHorizontalGroup(
131 layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
132 .add(titleLabel)
133 .add(layout.createSequentialGroup()
134 .add(proxySettingsButton)
135 .addContainerGap())
136 .add(layout.createSequentialGroup()
137 .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
138 .add(jLabel2)
139 .add(userLabel)
140 .add(passwordLabel))
141 .add(38, 38, 38)
142 .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
143 .add(layout.createSequentialGroup()
144 .add(savePasswordCheckBox)
145 .addContainerGap())
146 .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
147 .add(tipLabel, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 601, Short.MAX_VALUE)
148 .add(org.jdesktop.layout.GroupLayout.TRAILING, layout.createSequentialGroup()
149 .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
150 .add(urlComboBox, 0, 601, Short.MAX_VALUE)
151 .add(0, 0, 0))
152 .add(layout.createSequentialGroup()
153 .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING, false)
154 .add(org.jdesktop.layout.GroupLayout.LEADING, userPasswordField, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
155 .add(org.jdesktop.layout.GroupLayout.LEADING, userTextField, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
156 .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
157 .add(leaveBlankLabel, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 431, Short.MAX_VALUE)
158 .addContainerGap()))))
159 .add(org.jdesktop.layout.GroupLayout.TRAILING, layout.createSequentialGroup()
160 .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING)
161 .add(org.jdesktop.layout.GroupLayout.LEADING, tunnelHelpLabel, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 779, Short.MAX_VALUE)
162 .add(org.jdesktop.layout.GroupLayout.LEADING, layout.createSequentialGroup()
163 .add(tunnelLabel)
164 .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
165 .add(tunnelCommandTextField))
166 .add(org.jdesktop.layout.GroupLayout.LEADING, tunnelCommandLabel))
167 .add(0, 0, 0))
169 layout.setVerticalGroup(
170 layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
171 .add(layout.createSequentialGroup()
172 .add(titleLabel)
173 .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
174 .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
175 .add(jLabel2)
176 .add(urlComboBox, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
177 .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
178 .add(tipLabel, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
179 .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
180 .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
181 .add(userLabel)
182 .add(userTextField, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
183 .add(leaveBlankLabel))
184 .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
185 .add(layout.createSequentialGroup()
186 .add(2, 2, 2)
187 .add(userPasswordField, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
188 .add(layout.createSequentialGroup()
189 .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
190 .add(passwordLabel)))
191 .add(3, 3, 3)
192 .add(savePasswordCheckBox)
193 .addPreferredGap(org.jdesktop.layout.LayoutStyle.UNRELATED)
194 .add(proxySettingsButton)
195 .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
196 .add(tunnelCommandLabel)
197 .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
198 .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
199 .add(tunnelLabel)
200 .add(tunnelCommandTextField, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
201 .add(18, 18, 18)
202 .add(tunnelHelpLabel, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 78, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
203 .addContainerGap(org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
206 titleLabel.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(RepositoryPanel.class, "ACSD_RepositoryPanel_Title")); // NOI18N
207 titleLabel.getAccessibleContext().setAccessibleParent(this);
208 jLabel2.getAccessibleContext().setAccessibleParent(this);
209 urlComboBox.getAccessibleContext().setAccessibleName(org.openide.util.NbBundle.getMessage(RepositoryPanel.class, "ACSN_RepositoryURL")); // NOI18N
210 urlComboBox.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(RepositoryPanel.class, "ACSD_RepositoryURL")); // NOI18N
211 urlComboBox.getAccessibleContext().setAccessibleParent(this);
212 proxySettingsButton.getAccessibleContext().setAccessibleParent(this);
213 userPasswordField.getAccessibleContext().setAccessibleParent(this);
214 passwordLabel.getAccessibleContext().setAccessibleParent(this);
215 userLabel.getAccessibleContext().setAccessibleParent(this);
216 userTextField.getAccessibleContext().setAccessibleParent(this);
217 leaveBlankLabel.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(RepositoryPanel.class, "ACSD_InfoLabel")); // NOI18N
218 leaveBlankLabel.getAccessibleContext().setAccessibleParent(this);
219 savePasswordCheckBox.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(RepositoryPanel.class, "BK0011")); // NOI18N
221 getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(RepositoryPanel.class, "ACSD_RepositoryPanel")); // NOI18N
222 }// </editor-fold>//GEN-END:initComponents
225 // Variables declaration - do not modify//GEN-BEGIN:variables
226 private final javax.swing.JLabel jLabel2 = new javax.swing.JLabel();
227 final javax.swing.JLabel leaveBlankLabel = new javax.swing.JLabel();
228 final javax.swing.JLabel passwordLabel = new javax.swing.JLabel();
229 final javax.swing.JButton proxySettingsButton = new javax.swing.JButton();
230 final javax.swing.JCheckBox savePasswordCheckBox = new javax.swing.JCheckBox();
231 final javax.swing.JLabel tipLabel = new javax.swing.JLabel();
232 final javax.swing.JLabel titleLabel = new javax.swing.JLabel();
233 final javax.swing.JLabel tunnelCommandLabel = new javax.swing.JLabel();
234 final javax.swing.JTextField tunnelCommandTextField = new javax.swing.JTextField();
235 final javax.swing.JLabel tunnelHelpLabel = new javax.swing.JLabel();
236 final javax.swing.JLabel tunnelLabel = new javax.swing.JLabel();
237 final javax.swing.JComboBox urlComboBox = new javax.swing.JComboBox();
238 final javax.swing.JLabel userLabel = new javax.swing.JLabel();
239 final javax.swing.JPasswordField userPasswordField = new javax.swing.JPasswordField();
240 final javax.swing.JTextField userTextField = new javax.swing.JTextField();
241 // End of variables declaration//GEN-END:variables