~ubuntu-branches/ubuntu/quantal/netbeans/quantal

« back to all changes in this revision

Viewing changes to versioncontrol/util/src/org/netbeans/modules/versioning/util/VcsAdvancedOptionsPanel.java

  • Committer: Bazaar Package Importer
  • Author(s): Marek Slama
  • Date: 2008-01-29 14:11:22 UTC
  • Revision ID: james.westby@ubuntu.com-20080129141122-fnzjbo11ntghxfu7
Tags: upstream-6.0.1
ImportĀ upstreamĀ versionĀ 6.0.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * VcsAdvancedOptionsPanel.java
 
3
 *
 
4
 * Created on June 13, 2007, 3:21 PM
 
5
 */
 
6
 
 
7
package org.netbeans.modules.versioning.util;
 
8
 
 
9
import java.awt.CardLayout;
 
10
import java.util.HashMap;
 
11
import java.util.Map;
 
12
import javax.swing.DefaultListModel;
 
13
import javax.swing.JComponent;
 
14
 
 
15
/**
 
16
 *
 
17
 * @author  pbuzek
 
18
 */
 
19
public class VcsAdvancedOptionsPanel extends javax.swing.JPanel {
 
20
    
 
21
    /** Creates new form VcsAdvancedOptionsPanel */
 
22
    public VcsAdvancedOptionsPanel() {
 
23
        initComponents();
 
24
    }
 
25
    
 
26
    public void addPanel(String name, JComponent component) {
 
27
        ((DefaultListModel)versioningSystemsList.getModel()).addElement(name);
 
28
        containerPanel.add(name, component);
 
29
    }
 
30
    
 
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.
 
35
     */
 
36
    // <editor-fold defaultstate="collapsed" desc=" Generated Code ">//GEN-BEGIN:initComponents
 
37
    private void initComponents() {
 
38
 
 
39
        jScrollPane1 = new javax.swing.JScrollPane();
 
40
        versioningSystemsList = new javax.swing.JList();
 
41
        jLabel1 = new javax.swing.JLabel();
 
42
        containerPanel = new javax.swing.JPanel();
 
43
 
 
44
        setBorder(javax.swing.BorderFactory.createEmptyBorder(4, 0, 0, 0));
 
45
 
 
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);
 
51
            }
 
52
        });
 
53
        jScrollPane1.setViewportView(versioningSystemsList);
 
54
        versioningSystemsList.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(VcsAdvancedOptionsPanel.class, "VcsAdvancedOptionsPanel.versioningSystemsList.AccessibleContext.accessibleDescription")); // NOI18N
 
55
 
 
56
        jLabel1.setLabelFor(versioningSystemsList);
 
57
        org.openide.awt.Mnemonics.setLocalizedText(jLabel1, org.openide.util.NbBundle.getBundle(VcsAdvancedOptionsPanel.class).getString("LBL_VersioningSystems")); // NOI18N
 
58
 
 
59
        containerPanel.setLayout(new java.awt.CardLayout());
 
60
 
 
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()
 
70
                .add(jLabel1)
 
71
                .addContainerGap())
 
72
        );
 
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()
 
78
                        .add(31, 31, 31)
 
79
                        .add(containerPanel, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 254, Short.MAX_VALUE))
 
80
                    .add(layout.createSequentialGroup()
 
81
                        .add(jLabel1)
 
82
                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
 
83
                        .add(jScrollPane1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 265, Short.MAX_VALUE)))
 
84
                .addContainerGap())
 
85
        );
 
86
    }// </editor-fold>//GEN-END:initComponents
 
87
 
 
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
 
92
    
 
93
    
 
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
 
100
    
 
101
}