KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > modules > options > editor > EditorPanel


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.options.editor;
21
22 import java.awt.BorderLayout JavaDoc;
23 import java.awt.Component JavaDoc;
24 import javax.swing.AbstractButton JavaDoc;
25 import javax.swing.JComponent JavaDoc;
26 import javax.swing.JLabel JavaDoc;
27 import javax.swing.JPanel JavaDoc;
28 import javax.swing.JTabbedPane JavaDoc;
29 import javax.swing.border.EmptyBorder JavaDoc;
30 import org.netbeans.modules.options.indentation.IndentationPanel;
31 import org.netbeans.modules.options.macros.MacrosPanel;
32 import org.netbeans.spi.options.OptionsCategory;
33
34 import org.openide.awt.Mnemonics;
35 import org.openide.util.NbBundle;
36
37
38 /**
39  * Implementation of one panel in Options Dialog.
40  *
41  * @author Jan Jancura
42  */

43 public final class EditorPanel extends JPanel JavaDoc {
44
45     private JTabbedPane JavaDoc tabbedPane = new JTabbedPane JavaDoc ();
46     
47     
48     public EditorPanel (
49         JComponent JavaDoc generalEditorPanel,
50         JComponent JavaDoc indentationPanel,
51         JComponent JavaDoc codeTemplatesPanel,
52         JComponent JavaDoc macrosPanel
53     ) {
54         generalEditorPanel.setBorder (new EmptyBorder JavaDoc (8, 8, 8, 8));
55         indentationPanel.setBorder (new EmptyBorder JavaDoc (8, 8, 8, 8));
56         codeTemplatesPanel.setBorder (new EmptyBorder JavaDoc (8, 8, 8, 8));
57         macrosPanel.setBorder (new EmptyBorder JavaDoc (8, 8, 8, 8));
58         tabbedPane.addTab (loc ("General_Tab"), generalEditorPanel);
59         tabbedPane.addTab (loc ("Indentation_Tab"), indentationPanel);
60         tabbedPane.addTab (loc ("Code_Templates_Tab"), codeTemplatesPanel);
61         tabbedPane.addTab (loc ("Macro_Tab"), macrosPanel);
62         tabbedPane.setMnemonicAt (0, loc ("General_Tab_Mnemonic").charAt (0));
63         tabbedPane.setMnemonicAt (1, loc ("Indentation_Tab_Mnemonic").charAt (0));
64         tabbedPane.setMnemonicAt (2, loc ("Code_Templates_Tab_Mnemonic").charAt (0));
65         tabbedPane.setMnemonicAt (3, loc ("Macro_Tab_Mnemonic").charAt (0));
66
67         setLayout (new BorderLayout JavaDoc ());
68         add (tabbedPane, BorderLayout.CENTER);
69     }
70     
71     private static String JavaDoc loc (String JavaDoc key) {
72         return NbBundle.getMessage (EditorPanel.class, key);
73     }
74 }
75
76
77
Popular Tags