1 19 20 package org.netbeans.modules.project.ui.groups; 21 22 27 public class AdHocGroupEditPanelBasic extends GroupEditPanel { 28 29 private final AdHocGroup g; 30 31 public AdHocGroupEditPanelBasic(AdHocGroup g) { 32 this.g = g; 33 initComponents(); 34 nameField.setText(g.getName()); 35 } 36 37 public void applyChanges() { 38 g.setName(nameField.getText().trim()); 39 } 40 41 46 private void initComponents() { 48 49 nameLabel = new javax.swing.JLabel (); 50 nameField = new javax.swing.JTextField (); 51 52 nameLabel.setLabelFor(nameField); 53 org.openide.awt.Mnemonics.setLocalizedText(nameLabel, org.openide.util.NbBundle.getMessage(AdHocGroupEditPanelBasic.class, "AdHocGroupEditPanel.nameLabel.text")); 55 org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(this); 56 this.setLayout(layout); 57 layout.setHorizontalGroup( 58 layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) 59 .add(layout.createSequentialGroup() 60 .addContainerGap() 61 .add(nameLabel) 62 .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) 63 .add(nameField, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 363, Short.MAX_VALUE) 64 .addContainerGap()) 65 ); 66 layout.setVerticalGroup( 67 layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) 68 .add(layout.createSequentialGroup() 69 .addContainerGap() 70 .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) 71 .add(nameLabel) 72 .add(nameField, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) 73 .addContainerGap(org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) 74 ); 75 } 77 78 private javax.swing.JTextField nameField; 80 private javax.swing.JLabel nameLabel; 81 83 } 84 | Popular Tags |