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 33 import org.netbeans.modules.j2ee.sun.sunresources.beans.FieldGroup; 34 import org.netbeans.modules.j2ee.sun.sunresources.beans.Wizard; 35 import org.netbeans.modules.j2ee.sun.sunresources.beans.FieldGroupHelper; 36 37 42 43 public class MailPropertyPanel extends ResourceWizardPanel { 44 45 49 private MailPropertyVisualPanel component; 50 private ResourceConfigHelper helper; 51 private Wizard wiz; 52 53 54 public MailPropertyPanel(ResourceConfigHelper helper, Wizard wiz) { 55 this.helper = helper; 56 this.wiz = wiz; 57 } 58 59 public Component getComponent() { 64 if (component == null) { 65 component = new MailPropertyVisualPanel(this); 66 } 67 return component; 68 } 69 70 public void refreshFields(){ 71 if(component != null){ 72 component.refreshFields(); 73 component.setInitialFocus(); 74 } 75 } 76 77 78 public FieldGroup getFieldGroup(String groupName) { 79 return FieldGroupHelper.getFieldGroup(wiz, groupName); 80 } 81 82 public HelpCtx getHelp() { 83 return new HelpCtx("AS_Wiz_Mail_props"); } 85 86 public boolean isValid() { 87 setErrorMsg(bundle.getString("Empty_String")); 88 ResourceConfigData data = helper.getData(); 89 Vector vec = data.getProperties(); 90 for (int i = 0; i < vec.size(); i++) { 91 NameValuePair pair = (NameValuePair)vec.elementAt(i); 92 if (pair.getParamName() == null || pair.getParamValue() == null || 93 pair.getParamName().length() == 0 || pair.getParamValue().length() == 0){ 94 setErrorMsg(bundle.getString("Err_InvalidNameValue")); 95 return false; 96 } 97 } 98 return true; 99 } 100 101 public ResourceConfigHelper getHelper() { 102 return helper; 103 } 104 105 public boolean isFinishPanel() { 106 return true; 107 } 108 109 } 110 | Popular Tags |