KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > modules > j2ee > ejbcore > naming > EJBNamePanel


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.j2ee.ejbcore.naming;
21
22 /**
23  * @author Martin Adamek
24  */

25 final class EJBNamePanel extends javax.swing.JPanel JavaDoc {
26     
27     private final EJBNameOptionsPanelController controller;
28     
29     EJBNamePanel(EJBNameOptionsPanelController controller) {
30         this.controller = controller;
31         initComponents();
32         // TODO listen to changes in form fields and call controller.changed()
33
}
34     
35     /** This method is called from within the constructor to
36      * initialize the form.
37      * WARNING: Do NOT modify this code. The content of this method is
38      * always regenerated by the Form Editor.
39      */

40     // <editor-fold defaultstate="collapsed" desc=" Generated Code ">//GEN-BEGIN:initComponents
41
private void initComponents() {
42
43         setBackground(java.awt.Color.white);
44
45         org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(this);
46         this.setLayout(layout);
47         layout.setHorizontalGroup(
48             layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
49             .add(0, 423, Short.MAX_VALUE)
50         );
51         layout.setVerticalGroup(
52             layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
53             .add(0, 378, Short.MAX_VALUE)
54         );
55     }// </editor-fold>//GEN-END:initComponents
56

57     void load() {
58         // TODO read settings and initialize GUI
59
// Example:
60
// someCheckBox.setSelected(Preferences.userNodeForPackage(EJBNamePanel.class).getBoolean("someFlag", false));
61
// or for org.openide.util with API spec. version >= 7.4:
62
// someCheckBox.setSelected(NbPreferences.forModule(EJBNamePanel.class).getBoolean("someFlag", false));
63
// or:
64
// someTextField.setText(SomeSystemOption.getDefault().getSomeStringProperty());
65
}
66     
67     void store() {
68         // TODO store modified settings
69
// Example:
70
// Preferences.userNodeForPackage(EJBNamePanel.class).putBoolean("someFlag", someCheckBox.isSelected());
71
// or for org.openide.util with API spec. version >= 7.4:
72
// NbPreferences.forModule(EJBNamePanel.class).putBoolean("someFlag", someCheckBox.isSelected());
73
// or:
74
// SomeSystemOption.getDefault().setSomeStringProperty(someTextField.getText());
75
}
76     
77     boolean valid() {
78         // TODO check whether form is consistent and complete
79
return true;
80     }
81     
82     // Variables declaration - do not modify//GEN-BEGIN:variables
83
// End of variables declaration//GEN-END:variables
84

85 }
86
Popular Tags