KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > modules > apisupport > project > ui > customizer > EditTestDependencyPanel


1 /*
2  * The contents of this file are subject to the terms of the Common Development
3  * and Distribution License (the License). You may not use this file except in
4  * compliance with the License.
5  *
6  * You can obtain a copy of the License at http://www.netbeans.org/cddl.html
7  * or http://www.netbeans.org/cddl.txt.
8  *
9  * When distributing Covered Code, include this CDDL Header Notice in each file
10  * and include the License file at http://www.netbeans.org/cddl.txt.
11  * If applicable, add the following below the CDDL Header, with the fields
12  * enclosed by brackets [] replaced by your own identifying information:
13  * "Portions Copyrighted [year] [name of copyright owner]"
14  *
15  * The Original Software is NetBeans. The Initial Developer of the Original
16  * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
17  * Microsystems, Inc. All Rights Reserved.
18  */

19
20
21 package org.netbeans.modules.apisupport.project.ui.customizer;
22
23 import org.netbeans.modules.apisupport.project.universe.TestModuleDependency;
24
25 /**
26  *
27  * @author Tomas Musil
28  */

29 public class EditTestDependencyPanel extends javax.swing.JPanel JavaDoc {
30     private TestModuleDependency tmd ;
31     
32     /** Creates new form EditTestDependencyPanel */
33     public EditTestDependencyPanel(final TestModuleDependency originalDep) {
34         tmd = originalDep;
35         initComponents();
36         fillOriginal();
37     }
38     
39     /** This method is called from within the constructor to
40      * initialize the form.
41      * WARNING: Do NOT modify this code. The content of this method is
42      * always regenerated by the Form Editor.
43      */

44     // <editor-fold defaultstate="collapsed" desc=" Generated Code ">//GEN-BEGIN:initComponents
45
private void initComponents() {
46
47         moduleJar = new javax.swing.JLabel JavaDoc();
48         moduleJarValue = new javax.swing.JTextField JavaDoc();
49         tests = new javax.swing.JCheckBox JavaDoc();
50         compile = new javax.swing.JCheckBox JavaDoc();
51         dependencies = new javax.swing.JCheckBox JavaDoc();
52
53         moduleJar.setLabelFor(moduleJarValue);
54         org.openide.awt.Mnemonics.setLocalizedText(moduleJar, org.openide.util.NbBundle.getMessage(EditTestDependencyPanel.class, "EditTestDependencyPanel.moduleJar.text")); // NOI18N
55

56         moduleJarValue.setEditable(false);
57         moduleJarValue.setText(org.openide.util.NbBundle.getMessage(EditTestDependencyPanel.class, "EditTestDependencyPanel.moduleJarValue.text")); // NOI18N
58

59         org.openide.awt.Mnemonics.setLocalizedText(tests, org.openide.util.NbBundle.getMessage(EditTestDependencyPanel.class, "EditTestDependencyPanel.tests.text")); // NOI18N
60
tests.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0));
61         tests.setMargin(new java.awt.Insets JavaDoc(0, 0, 0, 0));
62
63         org.openide.awt.Mnemonics.setLocalizedText(compile, org.openide.util.NbBundle.getMessage(EditTestDependencyPanel.class, "EditTestDependencyPanel.compile.text")); // NOI18N
64
compile.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0));
65         compile.setMargin(new java.awt.Insets JavaDoc(0, 0, 0, 0));
66
67         org.openide.awt.Mnemonics.setLocalizedText(dependencies, org.openide.util.NbBundle.getMessage(EditTestDependencyPanel.class, "EditTestDependencyPanel.dependencies.text")); // NOI18N
68
dependencies.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0));
69         dependencies.setMargin(new java.awt.Insets JavaDoc(0, 0, 0, 0));
70
71         org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(this);
72         this.setLayout(layout);
73         layout.setHorizontalGroup(
74             layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
75             .add(layout.createSequentialGroup()
76                 .addContainerGap()
77                 .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
78                     .add(layout.createSequentialGroup()
79                         .add(moduleJar)
80                         .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
81                         .add(moduleJarValue, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 262, Short.MAX_VALUE))
82                     .add(tests)
83                     .add(dependencies)
84                     .add(compile))
85                 .addContainerGap())
86         );
87         layout.setVerticalGroup(
88             layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
89             .add(layout.createSequentialGroup()
90                 .addContainerGap()
91                 .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
92                     .add(moduleJar)
93                     .add(moduleJarValue, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
94                 .add(15, 15, 15)
95                 .add(tests)
96                 .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
97                 .add(dependencies)
98                 .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
99                 .add(compile)
100                 .addContainerGap(org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
101         );
102
103         moduleJar.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(EditTestDependencyPanel.class, "EditTestDependencyPanel.moduleJar.AccessibleContext.accessibleDescription")); // NOI18N
104
tests.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(EditTestDependencyPanel.class, "EditTestDependencyPanel.tests.AccessibleContext.accessibleDescription")); // NOI18N
105
compile.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(EditTestDependencyPanel.class, "EditTestDependencyPanel.compile.AccessibleContext.accessibleDescription")); // NOI18N
106
dependencies.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(EditTestDependencyPanel.class, "EditTestDependencyPanel.dependencies.AccessibleContext.accessibleDescription")); // NOI18N
107
}// </editor-fold>//GEN-END:initComponents
108

109     private void fillOriginal(){
110         moduleJarValue.setText(tmd.getModule().getCodeNameBase());
111         tests.setSelected(tmd.isTest());
112         compile.setSelected(tmd.isCompile());
113         dependencies.setSelected(tmd.isRecursive());
114     }
115     
116     
117     public TestModuleDependency getEditedDependency(){
118         
119         return new TestModuleDependency(tmd.getModule(), tests.isSelected(), dependencies.isSelected(),
120                 compile.isSelected());
121     }
122     
123     // Variables declaration - do not modify//GEN-BEGIN:variables
124
private javax.swing.JCheckBox JavaDoc compile;
125     private javax.swing.JCheckBox JavaDoc dependencies;
126     private javax.swing.JLabel JavaDoc moduleJar;
127     private javax.swing.JTextField JavaDoc moduleJarValue;
128     private javax.swing.JCheckBox JavaDoc tests;
129     // End of variables declaration//GEN-END:variables
130

131 }
132
Popular Tags