1 19 20 package org.netbeans.modules.java.j2seproject.ui.customizer; 21 22 import javax.swing.JPanel ; 23 import javax.swing.event.ChangeListener ; 24 25 import org.openide.filesystems.FileObject; 26 27 31 public class MainClassWarning extends JPanel { 32 33 private String message; 34 private FileObject[] sourcesRoots; 35 36 37 public MainClassWarning (String message, FileObject[] sourcesRoots) { 38 this.sourcesRoots = sourcesRoots; 39 this.message = message; 40 initComponents(); 41 } 43 44 48 public String getSelectedMainClass () { 49 return ((MainClassChooser)jPanel1).getSelectedMainClass (); 50 } 51 52 public void addChangeListener (ChangeListener l) { 53 ((MainClassChooser)jPanel1).addChangeListener (l); 54 } 55 56 public void removeChangeListener (ChangeListener l) { 57 ((MainClassChooser)jPanel1).removeChangeListener (l); 58 } 59 60 65 private void initComponents() { 67 java.awt.GridBagConstraints gridBagConstraints; 68 69 jLabel1 = new javax.swing.JLabel (); 70 jPanel1 = new MainClassChooser (sourcesRoots, org.openide.util.NbBundle.getBundle(MainClassWarning.class).getString("CTL_SelectAvaialableMainClasses")); 71 72 setLayout(new java.awt.GridBagLayout ()); 73 74 org.openide.awt.Mnemonics.setLocalizedText(jLabel1, this.message); 75 gridBagConstraints = new java.awt.GridBagConstraints (); 76 gridBagConstraints.gridx = 0; 77 gridBagConstraints.gridy = 0; 78 gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER; 79 gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; 80 gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; 81 gridBagConstraints.weightx = 1.0; 82 gridBagConstraints.insets = new java.awt.Insets (12, 12, 6, 12); 83 add(jLabel1, gridBagConstraints); 84 gridBagConstraints = new java.awt.GridBagConstraints (); 85 gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER; 86 gridBagConstraints.gridheight = java.awt.GridBagConstraints.REMAINDER; 87 gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; 88 gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; 89 gridBagConstraints.weightx = 1.0; 90 gridBagConstraints.weighty = 1.0; 91 gridBagConstraints.insets = new java.awt.Insets (6, 12, 12, 12); 92 add(jPanel1, gridBagConstraints); 93 94 getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getBundle(MainClassWarning.class).getString("AD_MainClassWarning")); } 97 98 private javax.swing.JLabel jLabel1; 100 private javax.swing.JPanel jPanel1; 101 103 104 } 105 | Popular Tags |