1 19 20 21 package org.netbeans.modules.apisupport.project.ui.customizer; 22 23 import org.netbeans.modules.apisupport.project.universe.TestModuleDependency; 24 25 29 public class EditTestDependencyPanel extends javax.swing.JPanel { 30 private TestModuleDependency tmd ; 31 32 33 public EditTestDependencyPanel(final TestModuleDependency originalDep) { 34 tmd = originalDep; 35 initComponents(); 36 fillOriginal(); 37 } 38 39 44 private void initComponents() { 46 47 moduleJar = new javax.swing.JLabel (); 48 moduleJarValue = new javax.swing.JTextField (); 49 tests = new javax.swing.JCheckBox (); 50 compile = new javax.swing.JCheckBox (); 51 dependencies = new javax.swing.JCheckBox (); 52 53 moduleJar.setLabelFor(moduleJarValue); 54 org.openide.awt.Mnemonics.setLocalizedText(moduleJar, org.openide.util.NbBundle.getMessage(EditTestDependencyPanel.class, "EditTestDependencyPanel.moduleJar.text")); 56 moduleJarValue.setEditable(false); 57 moduleJarValue.setText(org.openide.util.NbBundle.getMessage(EditTestDependencyPanel.class, "EditTestDependencyPanel.moduleJarValue.text")); 59 org.openide.awt.Mnemonics.setLocalizedText(tests, org.openide.util.NbBundle.getMessage(EditTestDependencyPanel.class, "EditTestDependencyPanel.tests.text")); tests.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0)); 61 tests.setMargin(new java.awt.Insets (0, 0, 0, 0)); 62 63 org.openide.awt.Mnemonics.setLocalizedText(compile, org.openide.util.NbBundle.getMessage(EditTestDependencyPanel.class, "EditTestDependencyPanel.compile.text")); compile.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0)); 65 compile.setMargin(new java.awt.Insets (0, 0, 0, 0)); 66 67 org.openide.awt.Mnemonics.setLocalizedText(dependencies, org.openide.util.NbBundle.getMessage(EditTestDependencyPanel.class, "EditTestDependencyPanel.dependencies.text")); dependencies.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0)); 69 dependencies.setMargin(new java.awt.Insets (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")); tests.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(EditTestDependencyPanel.class, "EditTestDependencyPanel.tests.AccessibleContext.accessibleDescription")); compile.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(EditTestDependencyPanel.class, "EditTestDependencyPanel.compile.AccessibleContext.accessibleDescription")); dependencies.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(EditTestDependencyPanel.class, "EditTestDependencyPanel.dependencies.AccessibleContext.accessibleDescription")); } 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 private javax.swing.JCheckBox compile; 125 private javax.swing.JCheckBox dependencies; 126 private javax.swing.JLabel moduleJar; 127 private javax.swing.JTextField moduleJarValue; 128 private javax.swing.JCheckBox tests; 129 131 } 132 | Popular Tags |