1 19 20 package org.netbeans.modules.j2ee.earproject.ui.wizards; 21 22 import java.awt.BorderLayout ; 23 import java.awt.GridBagConstraints ; 24 import java.util.ResourceBundle ; 25 import javax.swing.JPanel ; 26 import org.openide.WizardDescriptor; 27 28 public class PanelConfigureProjectVisual extends JPanel { 29 30 private final SettingsPanel projectLocationPanel; 31 private final PanelOptionsVisual optionsPanel; 32 33 34 public PanelConfigureProjectVisual(PanelConfigureProject panel, String namePropIndex, ResourceBundle customBundle, boolean importStyle) { 35 initComponents(); 36 this.getAccessibleContext().setAccessibleDescription(customBundle.getString("ACS_NWP1_NamePanel_A11YDesc")); 38 if (!importStyle) { 39 projectLocationPanel = new PanelProjectLocationVisual(panel, namePropIndex, customBundle,importStyle); 40 } else { 41 projectLocationPanel = new PanelProjectImportVisual(panel, namePropIndex, customBundle,importStyle); 42 } 43 locationContainer.add(projectLocationPanel, BorderLayout.CENTER); 44 45 optionsPanel = new PanelOptionsVisual(panel,importStyle); 46 GridBagConstraints gridBagConstraints = new GridBagConstraints (); 47 gridBagConstraints.fill = GridBagConstraints.BOTH; 48 gridBagConstraints.weightx = 1.0; 49 gridBagConstraints.weighty = 1.0; 50 optionsContainer.add(optionsPanel, gridBagConstraints); 51 52 if (!importStyle) { 53 projectLocationPanel.addPropertyChangeListener(optionsPanel); 54 } 55 56 setName(customBundle.getString("LBL_NWP1_ProjectTitleName")); if (!importStyle) { 59 putClientProperty("NewProjectWizard_Title", customBundle.getString("TXT_NewProject")); } else { 61 putClientProperty("NewProjectWizard_Title", customBundle.getString("TXT_ImportProject")); } 63 } 64 65 boolean valid(WizardDescriptor wizardDescriptor) { 66 if (!projectLocationPanel.valid(wizardDescriptor)) { 67 return false; 68 } 69 boolean optionsValid = true; 70 if (optionsPanel != null) { 71 optionsValid = optionsPanel.valid(wizardDescriptor); 72 } 73 return optionsValid; 74 } 75 76 void read (WizardDescriptor d) { 77 projectLocationPanel.read(d); 78 if (null != optionsPanel) { 79 optionsPanel.read(d); 80 } 81 } 82 83 void store(WizardDescriptor d) { 84 projectLocationPanel.store(d); 85 if (null != optionsPanel) { 86 optionsPanel.store(d); 87 } 88 } 89 90 95 private void initComponents() { 97 java.awt.GridBagConstraints gridBagConstraints; 98 99 locationContainer = new javax.swing.JPanel (); 100 jSeparator1 = new javax.swing.JSeparator (); 101 optionsContainer = new javax.swing.JPanel (); 102 103 setLayout(new java.awt.GridBagLayout ()); 104 105 setRequestFocusEnabled(false); 106 locationContainer.setLayout(new java.awt.BorderLayout ()); 107 108 gridBagConstraints = new java.awt.GridBagConstraints (); 109 gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER; 110 gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; 111 gridBagConstraints.weightx = 1.0; 112 add(locationContainer, gridBagConstraints); 113 114 gridBagConstraints = new java.awt.GridBagConstraints (); 115 gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER; 116 gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; 117 gridBagConstraints.weightx = 1.0; 118 gridBagConstraints.insets = new java.awt.Insets (12, 0, 12, 0); 119 add(jSeparator1, gridBagConstraints); 120 121 optionsContainer.setLayout(new java.awt.GridBagLayout ()); 122 123 gridBagConstraints = new java.awt.GridBagConstraints (); 124 gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER; 125 gridBagConstraints.gridheight = java.awt.GridBagConstraints.REMAINDER; 126 gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; 127 gridBagConstraints.weightx = 1.0; 128 gridBagConstraints.weighty = 1.0; 129 add(optionsContainer, gridBagConstraints); 130 131 } 133 private javax.swing.JSeparator jSeparator1; 135 private javax.swing.JPanel locationContainer; 136 private javax.swing.JPanel optionsContainer; 137 139 } 140 | Popular Tags |