1 19 24 25 package org.netbeans.modules.j2ee.sun.ide.sunresources.wizards; 26 27 import java.awt.Component ; 28 import java.util.Vector ; 29 import org.openide.util.HelpCtx; 30 31 import org.netbeans.modules.j2ee.sun.ide.editors.NameValuePair; 32 import org.netbeans.modules.j2ee.sun.sunresources.beans.Wizard; 33 34 39 public class CPPropertiesPanelPanel extends ResourceWizardPanel { 40 41 45 private CPPropertiesPanelVisualPanel component; 46 private ResourceConfigHelper helper; 47 private Wizard wizard; 48 49 50 public CPPropertiesPanelPanel(ResourceConfigHelper helper, Wizard wizard) { 51 this.helper = helper; 52 this.wizard = wizard; 53 } 54 55 public Component getComponent() { 60 if (component == null) { 61 component = new CPPropertiesPanelVisualPanel(this, this.helper, this.wizard); 62 } 63 return component; 64 } 65 66 public void refreshFields(){ 67 if(component != null){ 68 component.refreshFields(); 69 component.setInitialFocus(); 70 } 71 } 72 73 public HelpCtx getHelp() { 74 return new HelpCtx("AS_Wiz_ConnPool_props"); } 76 77 public boolean isValid() { 78 setErrorMsg(bundle.getString("Empty_String")); 80 ResourceConfigData data = helper.getData(); 81 Vector vec = data.getProperties(); 82 for (int i = 0; i < vec.size(); i++) { 83 NameValuePair pair = (NameValuePair)vec.elementAt(i); 84 if (pair.getParamName() == null || pair.getParamValue() == null || 85 pair.getParamName().length() == 0 || pair.getParamValue().length() == 0){ 86 setErrorMsg(bundle.getString("Err_InvalidNameValue")); 87 return false; 88 } 89 } 90 return true; 91 } 92 93 protected final void fireChangeEvent (Object source) { 94 super.fireChange(this); 95 } 96 97 public boolean isFinishPanel() { 98 return isValid(); 99 } 100 } 101 | Popular Tags |