1 19 20 package org.netbeans.modules.ruby.rubyproject.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() { java.awt.GridBagConstraints gridBagConstraints; 67 68 jLabel1 = new javax.swing.JLabel (); 69 jScrollPane1 = new javax.swing.JScrollPane (); 70 jPanel1 = new MainClassChooser (sourcesRoots, org.openide.util.NbBundle.getBundle(MainClassWarning.class).getString("CTL_SelectAvaialableMainClasses")); 71 72 setLayout(new java.awt.GridBagLayout ()); 73 74 getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getBundle(MainClassWarning.class).getString("AD_MainClassWarning")); 75 org.openide.awt.Mnemonics.setLocalizedText(jLabel1, this.message); 76 gridBagConstraints = new java.awt.GridBagConstraints (); 77 gridBagConstraints.gridx = 0; 78 gridBagConstraints.gridy = 0; 79 gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER; 80 gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; 81 gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; 82 gridBagConstraints.weightx = 1.0; 83 gridBagConstraints.insets = new java.awt.Insets (12, 12, 6, 12); 84 add(jLabel1, gridBagConstraints); 85 86 jScrollPane1.setBorder(null); 87 jScrollPane1.setViewportView(jPanel1); 88 89 gridBagConstraints = new java.awt.GridBagConstraints (); 90 gridBagConstraints.gridx = 1; 91 gridBagConstraints.gridy = 1; 92 gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER; 93 gridBagConstraints.gridheight = java.awt.GridBagConstraints.REMAINDER; 94 gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; 95 gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; 96 gridBagConstraints.weightx = 1.0; 97 gridBagConstraints.weighty = 1.0; 98 add(jScrollPane1, gridBagConstraints); 99 100 } 102 103 private javax.swing.JLabel jLabel1; 105 private javax.swing.JPanel jPanel1; 106 private javax.swing.JScrollPane jScrollPane1; 107 109 110 } 111 | Popular Tags |