1 19 20 package org.netbeans.modules.options.editor; 21 22 import java.awt.BorderLayout ; 23 import java.awt.Component ; 24 import javax.swing.AbstractButton ; 25 import javax.swing.JComponent ; 26 import javax.swing.JLabel ; 27 import javax.swing.JPanel ; 28 import javax.swing.JTabbedPane ; 29 import javax.swing.border.EmptyBorder ; 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 43 public final class EditorPanel extends JPanel { 44 45 private JTabbedPane tabbedPane = new JTabbedPane (); 46 47 48 public EditorPanel ( 49 JComponent generalEditorPanel, 50 JComponent indentationPanel, 51 JComponent codeTemplatesPanel, 52 JComponent macrosPanel 53 ) { 54 generalEditorPanel.setBorder (new EmptyBorder (8, 8, 8, 8)); 55 indentationPanel.setBorder (new EmptyBorder (8, 8, 8, 8)); 56 codeTemplatesPanel.setBorder (new EmptyBorder (8, 8, 8, 8)); 57 macrosPanel.setBorder (new EmptyBorder (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 ()); 68 add (tabbedPane, BorderLayout.CENTER); 69 } 70 71 private static String loc (String key) { 72 return NbBundle.getMessage (EditorPanel.class, key); 73 } 74 } 75 76 77 | Popular Tags |