KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > modules > project > ui > groups > AdHocGroupEditPanelBasic


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 package org.netbeans.modules.project.ui.groups;
21
22 /**
23  * Panel to configure state of an existing ad-hoc group.
24  * Applicable in basic mode.
25  * @author Jesse Glick
26  */

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     /** This method is called from within the constructor to
42      * initialize the form.
43      * WARNING: Do NOT modify this code. The content of this method is
44      * always regenerated by the Form Editor.
45      */

46     // <editor-fold defaultstate="collapsed" desc=" Generated Code ">//GEN-BEGIN:initComponents
47
private void initComponents() {
48
49         nameLabel = new javax.swing.JLabel JavaDoc();
50         nameField = new javax.swing.JTextField JavaDoc();
51
52         nameLabel.setLabelFor(nameField);
53         org.openide.awt.Mnemonics.setLocalizedText(nameLabel, org.openide.util.NbBundle.getMessage(AdHocGroupEditPanelBasic.class, "AdHocGroupEditPanel.nameLabel.text")); // NOI18N
54

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     }// </editor-fold>//GEN-END:initComponents
76

77     
78     // Variables declaration - do not modify//GEN-BEGIN:variables
79
private javax.swing.JTextField JavaDoc nameField;
80     private javax.swing.JLabel JavaDoc nameLabel;
81     // End of variables declaration//GEN-END:variables
82

83 }
84
Popular Tags