KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > modules > httpserver > GrantAccessPanel


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.httpserver;
21
22 import java.awt.Component JavaDoc;
23 import javax.swing.*;
24 import org.openide.awt.Mnemonics;
25 import org.openide.util.NbBundle;
26
27 /**
28 * message panel for granting access to internal HTTP server.
29 * @author Radim Kubacki
30 */

31 class GrantAccessPanel extends javax.swing.JPanel JavaDoc {
32
33     private String JavaDoc msg;
34
35     /** Creates new panel */
36     public GrantAccessPanel (String JavaDoc msg) {
37         this.msg = msg;
38         initComponents ();
39     }
40
41     private void initComponents() {
42         JTextArea localTopMessage = new javax.swing.JTextArea JavaDoc();
43
44         jCheckBox1 = new javax.swing.JCheckBox JavaDoc();
45         
46         setLayout(new java.awt.BorderLayout JavaDoc(0, 12));
47         
48         setBorder(new javax.swing.border.EmptyBorder JavaDoc(new java.awt.Insets JavaDoc(0, 0, 0, 0)));
49         getAccessibleContext().setAccessibleDescription(msg);
50         
51         localTopMessage.setLineWrap (true);
52         localTopMessage.setWrapStyleWord (true);
53         localTopMessage.setEditable (false);
54         localTopMessage.setEnabled (false);
55         localTopMessage.setOpaque (false);
56         localTopMessage.setDisabledTextColor (javax.swing.UIManager.getColor ("Label.foreground")); // NOI18N
57
localTopMessage.setFont (javax.swing.UIManager.getFont ("Label.font")); // NOI18N
58

59         StringBuffer JavaDoc lTopMessage = new StringBuffer JavaDoc();
60         lTopMessage.append(msg);
61         localTopMessage.setText(lTopMessage.toString());
62         add(localTopMessage, java.awt.BorderLayout.NORTH);
63         
64         Mnemonics.setLocalizedText(jCheckBox1, NbBundle.getMessage (GrantAccessPanel.class, "CTL_DNSTDNT"));
65         jCheckBox1.getAccessibleContext().setAccessibleDescription(NbBundle.getMessage (GrantAccessPanel.class, "ACSD_CTL_DNSTDNT"));
66         add(jCheckBox1, java.awt.BorderLayout.SOUTH);
67     }
68
69     private javax.swing.JLabel JavaDoc jLabel;
70     private javax.swing.JCheckBox JavaDoc jCheckBox1;
71
72     // main methods ....................................................................................
73

74     public void setShowDialog (boolean show) {
75         jCheckBox1.setSelected (!show);
76     }
77
78     public boolean getShowDialog () {
79         return !jCheckBox1.isSelected ();
80     }
81 }
82
Popular Tags