2
* VcsAdvancedOptionsPanel.java
4
* Created on June 13, 2007, 3:21 PM
7
package org.netbeans.modules.versioning.util;
9
import java.awt.CardLayout;
10
import java.util.HashMap;
12
import javax.swing.DefaultListModel;
13
import javax.swing.JComponent;
19
public class VcsAdvancedOptionsPanel extends javax.swing.JPanel {
21
/** Creates new form VcsAdvancedOptionsPanel */
22
public VcsAdvancedOptionsPanel() {
26
public void addPanel(String name, JComponent component) {
27
((DefaultListModel)versioningSystemsList.getModel()).addElement(name);
28
containerPanel.add(name, component);
31
/** This method is called from within the constructor to
32
* initialize the form.
33
* WARNING: Do NOT modify this code. The content of this method is
34
* always regenerated by the Form Editor.
36
// <editor-fold defaultstate="collapsed" desc=" Generated Code ">//GEN-BEGIN:initComponents
37
private void initComponents() {
39
jScrollPane1 = new javax.swing.JScrollPane();
40
versioningSystemsList = new javax.swing.JList();
41
jLabel1 = new javax.swing.JLabel();
42
containerPanel = new javax.swing.JPanel();
44
setBorder(javax.swing.BorderFactory.createEmptyBorder(4, 0, 0, 0));
46
versioningSystemsList.setModel(new DefaultListModel());
47
versioningSystemsList.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);
48
versioningSystemsList.addListSelectionListener(new javax.swing.event.ListSelectionListener() {
49
public void valueChanged(javax.swing.event.ListSelectionEvent evt) {
50
versioningSystemsListValueChanged(evt);
53
jScrollPane1.setViewportView(versioningSystemsList);
54
versioningSystemsList.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(VcsAdvancedOptionsPanel.class, "VcsAdvancedOptionsPanel.versioningSystemsList.AccessibleContext.accessibleDescription")); // NOI18N
56
jLabel1.setLabelFor(versioningSystemsList);
57
org.openide.awt.Mnemonics.setLocalizedText(jLabel1, org.openide.util.NbBundle.getBundle(VcsAdvancedOptionsPanel.class).getString("LBL_VersioningSystems")); // NOI18N
59
containerPanel.setLayout(new java.awt.CardLayout());
61
org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(this);
62
this.setLayout(layout);
63
layout.setHorizontalGroup(
64
layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
65
.add(layout.createSequentialGroup()
66
.add(jScrollPane1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 104, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
67
.addPreferredGap(org.jdesktop.layout.LayoutStyle.UNRELATED)
68
.add(containerPanel, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 246, Short.MAX_VALUE))
69
.add(layout.createSequentialGroup()
73
layout.setVerticalGroup(
74
layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
75
.add(org.jdesktop.layout.GroupLayout.TRAILING, layout.createSequentialGroup()
76
.add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING)
77
.add(layout.createSequentialGroup()
79
.add(containerPanel, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 254, Short.MAX_VALUE))
80
.add(layout.createSequentialGroup()
82
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
83
.add(jScrollPane1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 265, Short.MAX_VALUE)))
86
}// </editor-fold>//GEN-END:initComponents
88
private void versioningSystemsListValueChanged(javax.swing.event.ListSelectionEvent evt) {//GEN-FIRST:event_versioningSystemsListValueChanged
89
((CardLayout) containerPanel.getLayout()).show(
90
containerPanel, (String) versioningSystemsList.getSelectedValue());
91
}//GEN-LAST:event_versioningSystemsListValueChanged
94
// Variables declaration - do not modify//GEN-BEGIN:variables
95
private javax.swing.JPanel containerPanel;
96
private javax.swing.JLabel jLabel1;
97
private javax.swing.JScrollPane jScrollPane1;
98
private javax.swing.JList versioningSystemsList;
99
// End of variables declaration//GEN-END:variables