1 19 20 package org.netbeans.modules.j2ee.ejbjarproject.ui.wizards; 21 22 import java.io.File ; 23 import java.text.MessageFormat ; 24 25 import javax.swing.JFileChooser ; 26 import javax.swing.event.DocumentEvent ; 27 import javax.swing.event.DocumentListener ; 28 import org.netbeans.modules.j2ee.ejbjarproject.ui.FoldersListSettings; 29 import org.netbeans.spi.project.support.ant.PropertyUtils; 30 31 import org.netbeans.spi.project.ui.support.ProjectChooser; 32 33 import org.openide.WizardDescriptor; 34 import org.openide.util.NbBundle; 35 36 public class PanelProjectAppVisual extends SettingsPanel implements DocumentListener { 37 38 private PanelConfigureProjectApp panel; 39 40 41 public PanelProjectAppVisual(PanelConfigureProjectApp panel) { 42 initComponents(); 43 this.panel = panel; 44 45 } 49 50 55 private void initComponents() { 57 java.awt.GridBagConstraints gridBagConstraints; 58 59 Label = new javax.swing.JLabel (); 60 setAsMainCheckBox = new javax.swing.JCheckBox (); 61 jLabel1 = new javax.swing.JLabel (); 62 Button = new javax.swing.JButton (); 63 jList1 = new javax.swing.JList (); 64 jButton1 = new javax.swing.JButton (); 65 66 setLayout(new java.awt.GridBagLayout ()); 67 68 Label.setDisplayedMnemonic(org.openide.util.NbBundle.getMessage(PanelProjectAppVisual.class, "LBL_NWP1_ProjectName_LabelMnemonic").charAt(0)); 69 org.openide.awt.Mnemonics.setLocalizedText(Label, java.util.ResourceBundle.getBundle("org/netbeans/modules/j2ee/ejbjarproject/ui/wizards/Bundle").getString("LBL_NWP1_SpecifyCreateApplication_Label")); 70 gridBagConstraints = new java.awt.GridBagConstraints (); 71 gridBagConstraints.gridx = 0; 72 gridBagConstraints.gridy = 0; 73 gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER; 74 gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; 75 gridBagConstraints.insets = new java.awt.Insets (0, 0, 12, 0); 76 add(Label, gridBagConstraints); 77 78 setAsMainCheckBox.setSelected(true); 79 org.openide.awt.Mnemonics.setLocalizedText(setAsMainCheckBox, java.util.ResourceBundle.getBundle("org/netbeans/modules/j2ee/ejbjarproject/ui/wizards/Bundle").getString("LBL_NWP1_AddToApplication_CheckBox")); 80 setAsMainCheckBox.setMargin(new java.awt.Insets (0, 0, 0, 0)); 81 gridBagConstraints = new java.awt.GridBagConstraints (); 82 gridBagConstraints.gridx = 0; 83 gridBagConstraints.gridy = 1; 84 gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER; 85 gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; 86 gridBagConstraints.insets = new java.awt.Insets (0, 0, 6, 0); 87 add(setAsMainCheckBox, gridBagConstraints); 88 89 jLabel1.setDisplayedMnemonic(java.util.ResourceBundle.getBundle("org/netbeans/modules/j2ee/ejbjarproject/ui/wizards/Bundle").getString("LBL_NWP1_CreatedProjectFolder_LablelMnemonic").charAt(0)); 90 jLabel1.setLabelFor(jList1); 91 org.openide.awt.Mnemonics.setLocalizedText(jLabel1, java.util.ResourceBundle.getBundle("org/netbeans/modules/j2ee/ejbjarproject/ui/wizards/Bundle").getString("LBL_NWP1_CreatedProjectFolder_Lablel")); 92 gridBagConstraints = new java.awt.GridBagConstraints (); 93 gridBagConstraints.gridx = 0; 94 gridBagConstraints.gridy = 2; 95 gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; 96 gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST; 97 gridBagConstraints.insets = new java.awt.Insets (0, 0, 5, 0); 98 add(jLabel1, gridBagConstraints); 99 100 org.openide.awt.Mnemonics.setLocalizedText(Button, java.util.ResourceBundle.getBundle("org/netbeans/modules/j2ee/ejbjarproject/ui/wizards/Bundle").getString("LBL_NWP1_BrowseLocation_Button")); 101 Button.setActionCommand("BROWSE"); 102 gridBagConstraints = new java.awt.GridBagConstraints (); 103 gridBagConstraints.gridx = 2; 104 gridBagConstraints.gridy = 2; 105 gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; 106 gridBagConstraints.insets = new java.awt.Insets (0, 6, 5, 0); 107 add(Button, gridBagConstraints); 108 109 gridBagConstraints = new java.awt.GridBagConstraints (); 110 gridBagConstraints.gridx = 1; 111 gridBagConstraints.gridy = 2; 112 gridBagConstraints.gridwidth = java.awt.GridBagConstraints.RELATIVE; 113 gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; 114 gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST; 115 gridBagConstraints.weightx = 1.0; 116 gridBagConstraints.insets = new java.awt.Insets (0, 12, 5, 0); 117 add(jList1, gridBagConstraints); 118 119 org.openide.awt.Mnemonics.setLocalizedText(jButton1, java.util.ResourceBundle.getBundle("org/netbeans/modules/j2ee/ejbjarproject/ui/wizards/Bundle").getString("LBL_NWP1_NewProject_Button")); 120 gridBagConstraints = new java.awt.GridBagConstraints (); 121 gridBagConstraints.gridx = 2; 122 gridBagConstraints.gridy = 3; 123 add(jButton1, gridBagConstraints); 124 125 } 126 128 public void addNotify() { 129 super.addNotify(); 130 } 133 134 boolean valid(WizardDescriptor wizardDescriptor) { 135 140 148 return true; 150 } 151 152 void store(WizardDescriptor d) { 153 155 158 } 163 164 void read (WizardDescriptor settings) { 165 171 173 182 } 185 186 private javax.swing.JButton Button; 188 private javax.swing.JLabel Label; 189 private javax.swing.JButton jButton1; 190 private javax.swing.JLabel jLabel1; 191 private javax.swing.JList jList1; 192 private javax.swing.JCheckBox setAsMainCheckBox; 193 195 private static JFileChooser createChooser() { 196 JFileChooser chooser = new JFileChooser (); 197 chooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY); 198 chooser.setAcceptAllFileFilterUsed(false); 199 200 return chooser; 201 } 202 203 private String validFreeProjectName(final File parentFolder, final String formater, final int index) { 204 String name = MessageFormat.format(formater, new Object [] {new Integer (index)}); 205 File file = new File (parentFolder, name); 206 return file.exists() ? null : name; 207 } 208 209 public void changedUpdate(DocumentEvent e) { 211 updateTexts(e); 212 } 213 214 public void insertUpdate(DocumentEvent e) { 215 updateTexts(e); 216 } 217 218 public void removeUpdate(DocumentEvent e) { 219 updateTexts(e); 220 } 221 223 224 226 private void updateTexts(DocumentEvent e) { 227 229 } 231 232 238 241 } 242 243 | Popular Tags |