KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > modules > j2ee > common > ui > BrokenServerAlertPanel


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.common.ui;
21
22 import javax.swing.JPanel JavaDoc;
23 import org.openide.util.NbBundle;
24
25 /**
26  * Broken/missing server alert panel.
27  *
28  * PLEASE NOTE! This is just a temporary solution. BrokenReferencesSupport from
29  * the java project support currently does not allow to plug in a check for missing
30  * servers. Once BrokenReferencesSupport will support it, this class should be
31  * removed.
32  */

33 public class BrokenServerAlertPanel extends JPanel JavaDoc {
34     
35     public BrokenServerAlertPanel() {
36         initComponents();
37         notAgain.setSelected(!J2EEUISettings.getDefault().isShowAgainBrokenServerAlert());
38     }
39     
40     /** This method is called from within the constructor to
41      * initialize the form.
42      * WARNING: Do NOT modify this code. The content of this method is
43      * always regenerated by the Form Editor.
44      */

45     // <editor-fold defaultstate="collapsed" desc=" Generated Code ">//GEN-BEGIN:initComponents
46
private void initComponents() {
47         java.awt.GridBagConstraints JavaDoc gridBagConstraints;
48
49         notAgain = new javax.swing.JCheckBox JavaDoc();
50         message = new javax.swing.JLabel JavaDoc();
51
52         setLayout(new java.awt.GridBagLayout JavaDoc());
53
54         getAccessibleContext().setAccessibleName(org.openide.util.NbBundle.getMessage(BrokenServerAlertPanel.class, "ACSN_BrokenServersAlertPanel"));
55         getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(BrokenServerAlertPanel.class, "ACSD_BrokenServersAlertPanel"));
56         org.openide.awt.Mnemonics.setLocalizedText(notAgain, org.openide.util.NbBundle.getMessage(BrokenServerAlertPanel.class, "MSG_Broken_Server_Again"));
57         notAgain.setMargin(new java.awt.Insets JavaDoc(0, 0, 0, 0));
58         notAgain.addActionListener(new java.awt.event.ActionListener JavaDoc() {
59             public void actionPerformed(java.awt.event.ActionEvent JavaDoc evt) {
60                 notAgainActionPerformed(evt);
61             }
62         });
63
64         gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
65         gridBagConstraints.gridx = 0;
66         gridBagConstraints.gridy = 1;
67         gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
68         gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
69         gridBagConstraints.insets = new java.awt.Insets JavaDoc(6, 11, 0, 0);
70         add(notAgain, gridBagConstraints);
71         notAgain.getAccessibleContext().setAccessibleName(org.openide.util.NbBundle.getMessage(BrokenServerAlertPanel.class, "ACSN_BrokenServersAlertPanel_notAgain"));
72         notAgain.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(BrokenServerAlertPanel.class, "ACSD_BrokenServersAlertPanel_notAgain"));
73
74         org.openide.awt.Mnemonics.setLocalizedText(message, org.openide.util.NbBundle.getMessage(BrokenServerAlertPanel.class, "MSG_Broken_Server"));
75         gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
76         gridBagConstraints.gridx = 0;
77         gridBagConstraints.gridy = 0;
78         gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
79         gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
80         gridBagConstraints.weightx = 1.0;
81         gridBagConstraints.weighty = 1.0;
82         gridBagConstraints.insets = new java.awt.Insets JavaDoc(11, 11, 0, 0);
83         add(message, gridBagConstraints);
84         message.getAccessibleContext().setAccessibleName(NbBundle.getMessage(BrokenServerAlertPanel.class, "ACSN_BrokenServersAlertPanel"));
85         message.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(BrokenServerAlertPanel.class, "ACSD_BrokenServersAlertPanel"));
86
87     }// </editor-fold>//GEN-END:initComponents
88

89     private void notAgainActionPerformed(java.awt.event.ActionEvent JavaDoc evt) {//GEN-FIRST:event_notAgainActionPerformed
90
J2EEUISettings.getDefault().setShowAgainBrokenServerAlert(!notAgain.isSelected());
91     }//GEN-LAST:event_notAgainActionPerformed
92

93     // Variables declaration - do not modify//GEN-BEGIN:variables
94
private javax.swing.JLabel JavaDoc message;
95     private javax.swing.JCheckBox JavaDoc notAgain;
96     // End of variables declaration//GEN-END:variables
97

98 }
99
Popular Tags