001: /*
002: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
003: *
004: * Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.
005: *
006: * The contents of this file are subject to the terms of either the GNU
007: * General Public License Version 2 only ("GPL") or the Common
008: * Development and Distribution License("CDDL") (collectively, the
009: * "License"). You may not use this file except in compliance with the
010: * License. You can obtain a copy of the License at
011: * http://www.netbeans.org/cddl-gplv2.html
012: * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
013: * specific language governing permissions and limitations under the
014: * License. When distributing the software, include this License Header
015: * Notice in each file and include the License file at
016: * nbbuild/licenses/CDDL-GPL-2-CP. Sun designates this
017: * particular file as subject to the "Classpath" exception as provided
018: * by Sun in the GPL Version 2 section of the License file that
019: * accompanied this code. If applicable, add the following below the
020: * License Header, with the fields enclosed by brackets [] replaced by
021: * your own identifying information:
022: * "Portions Copyrighted [year] [name of copyright owner]"
023: *
024: * Contributor(s):
025: *
026: * The Original Software is NetBeans. The Initial Developer of the Original
027: * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
028: * Microsystems, Inc. All Rights Reserved.
029: *
030: * If you wish your version of this file to be governed by only the CDDL
031: * or only the GPL Version 2, indicate your decision by adding
032: * "[Contributor] elects to include this software in this distribution
033: * under the [CDDL or GPL Version 2] license." If you do not indicate a
034: * single choice of license, a recipient has the option to distribute
035: * your version of this file under either the CDDL, the GPL Version 2 or
036: * to extend the choice of license to its licensees as provided above.
037: * However, if you add GPL Version 2 code and therefore, elected the GPL
038: * Version 2 license, then the option applies only if the new code is
039: * made subject to such option by the copyright holder.
040: */
041:
042: package org.netbeans.modules.apisupport.project.ui.customizer;
043:
044: import org.netbeans.modules.apisupport.project.universe.TestModuleDependency;
045:
046: /**
047: *
048: * @author Tomas Musil
049: */
050: public class EditTestDependencyPanel extends javax.swing.JPanel {
051: private TestModuleDependency tmd;
052:
053: /** Creates new form EditTestDependencyPanel */
054: public EditTestDependencyPanel(
055: final TestModuleDependency originalDep) {
056: tmd = originalDep;
057: initComponents();
058: // #114356: dependency can be set as runtime only in project.xml
059: compile.setVisible(false);
060: fillOriginal();
061: }
062:
063: /** This method is called from within the constructor to
064: * initialize the form.
065: * WARNING: Do NOT modify this code. The content of this method is
066: * always regenerated by the Form Editor.
067: */
068: // <editor-fold defaultstate="collapsed" desc=" Generated Code ">//GEN-BEGIN:initComponents
069: private void initComponents() {
070:
071: moduleJar = new javax.swing.JLabel();
072: moduleJarValue = new javax.swing.JTextField();
073: tests = new javax.swing.JCheckBox();
074: compile = new javax.swing.JCheckBox();
075: dependencies = new javax.swing.JCheckBox();
076:
077: moduleJar.setLabelFor(moduleJarValue);
078: org.openide.awt.Mnemonics.setLocalizedText(moduleJar,
079: org.openide.util.NbBundle.getMessage(
080: EditTestDependencyPanel.class,
081: "EditTestDependencyPanel.moduleJar.text")); // NOI18N
082:
083: moduleJarValue.setEditable(false);
084: moduleJarValue.setText(org.openide.util.NbBundle.getMessage(
085: EditTestDependencyPanel.class,
086: "EditTestDependencyPanel.moduleJarValue.text")); // NOI18N
087:
088: org.openide.awt.Mnemonics.setLocalizedText(tests,
089: org.openide.util.NbBundle.getMessage(
090: EditTestDependencyPanel.class,
091: "EditTestDependencyPanel.tests.text")); // NOI18N
092: tests.setBorder(javax.swing.BorderFactory.createEmptyBorder(0,
093: 0, 0, 0));
094: tests.setMargin(new java.awt.Insets(0, 0, 0, 0));
095:
096: org.openide.awt.Mnemonics.setLocalizedText(compile,
097: org.openide.util.NbBundle.getMessage(
098: EditTestDependencyPanel.class,
099: "EditTestDependencyPanel.compile.text")); // NOI18N
100: compile.setBorder(javax.swing.BorderFactory.createEmptyBorder(
101: 0, 0, 0, 0));
102: compile.setMargin(new java.awt.Insets(0, 0, 0, 0));
103:
104: org.openide.awt.Mnemonics.setLocalizedText(dependencies,
105: org.openide.util.NbBundle.getMessage(
106: EditTestDependencyPanel.class,
107: "EditTestDependencyPanel.dependencies.text")); // NOI18N
108: dependencies.setBorder(javax.swing.BorderFactory
109: .createEmptyBorder(0, 0, 0, 0));
110: dependencies.setMargin(new java.awt.Insets(0, 0, 0, 0));
111:
112: org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(
113: this );
114: this .setLayout(layout);
115: layout
116: .setHorizontalGroup(layout
117: .createParallelGroup(
118: org.jdesktop.layout.GroupLayout.LEADING)
119: .add(
120: layout
121: .createSequentialGroup()
122: .addContainerGap()
123: .add(
124: layout
125: .createParallelGroup(
126: org.jdesktop.layout.GroupLayout.LEADING)
127: .add(
128: layout
129: .createSequentialGroup()
130: .add(
131: moduleJar)
132: .addPreferredGap(
133: org.jdesktop.layout.LayoutStyle.RELATED)
134: .add(
135: moduleJarValue,
136: org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
137: 262,
138: Short.MAX_VALUE))
139: .add(tests)
140: .add(
141: dependencies)
142: .add(compile))
143: .addContainerGap()));
144: layout
145: .setVerticalGroup(layout
146: .createParallelGroup(
147: org.jdesktop.layout.GroupLayout.LEADING)
148: .add(
149: layout
150: .createSequentialGroup()
151: .addContainerGap()
152: .add(
153: layout
154: .createParallelGroup(
155: org.jdesktop.layout.GroupLayout.BASELINE)
156: .add(moduleJar)
157: .add(
158: moduleJarValue,
159: org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
160: org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
161: org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
162: .add(15, 15, 15)
163: .add(tests)
164: .addPreferredGap(
165: org.jdesktop.layout.LayoutStyle.RELATED)
166: .add(dependencies)
167: .addPreferredGap(
168: org.jdesktop.layout.LayoutStyle.RELATED)
169: .add(compile)
170: .addContainerGap(
171: org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
172: Short.MAX_VALUE)));
173:
174: moduleJar
175: .getAccessibleContext()
176: .setAccessibleDescription(
177: org.openide.util.NbBundle
178: .getMessage(
179: EditTestDependencyPanel.class,
180: "EditTestDependencyPanel.moduleJar.AccessibleContext.accessibleDescription")); // NOI18N
181: tests
182: .getAccessibleContext()
183: .setAccessibleDescription(
184: org.openide.util.NbBundle
185: .getMessage(
186: EditTestDependencyPanel.class,
187: "EditTestDependencyPanel.tests.AccessibleContext.accessibleDescription")); // NOI18N
188: compile
189: .getAccessibleContext()
190: .setAccessibleDescription(
191: org.openide.util.NbBundle
192: .getMessage(
193: EditTestDependencyPanel.class,
194: "EditTestDependencyPanel.compile.AccessibleContext.accessibleDescription")); // NOI18N
195: dependencies
196: .getAccessibleContext()
197: .setAccessibleDescription(
198: org.openide.util.NbBundle
199: .getMessage(
200: EditTestDependencyPanel.class,
201: "EditTestDependencyPanel.dependencies.AccessibleContext.accessibleDescription")); // NOI18N
202: }// </editor-fold>//GEN-END:initComponents
203:
204: private void fillOriginal() {
205: moduleJarValue.setText(tmd.getModule().getCodeNameBase());
206: tests.setSelected(tmd.isTest());
207: compile.setSelected(tmd.isCompile());
208: dependencies.setSelected(tmd.isRecursive());
209: }
210:
211: public TestModuleDependency getEditedDependency() {
212:
213: return new TestModuleDependency(tmd.getModule(), tests
214: .isSelected(), dependencies.isSelected(), compile
215: .isSelected());
216: }
217:
218: // Variables declaration - do not modify//GEN-BEGIN:variables
219: private javax.swing.JCheckBox compile;
220: private javax.swing.JCheckBox dependencies;
221: private javax.swing.JLabel moduleJar;
222: private javax.swing.JTextField moduleJarValue;
223: private javax.swing.JCheckBox tests;
224: // End of variables declaration//GEN-END:variables
225:
226: }
|