1 19 24 25 package org.netbeans.modules.j2ee.sun.share.configbean.customizers.ejbmodule; 26 27 import java.util.ArrayList ; 28 import java.util.Collection ; 29 import java.util.ResourceBundle ; 30 31 import javax.swing.JPanel ; 32 33 import org.netbeans.modules.j2ee.sun.share.configbean.customizers.common.BeanInputDialog; 34 35 40 41 public class PropertyDialog extends BeanInputDialog{ 42 43 String name; 44 String value; 45 PropertyDialogPanel propertyDlgPanel; 46 String helpId; 47 48 static final ResourceBundle bundle = 49 ResourceBundle.getBundle( 50 "org.netbeans.modules.j2ee.sun.share.configbean.customizers.ejbmodule.Bundle"); 52 private static final String ACTIVATION_CONFIG_PROPERTY = "AS_CFG_Activation_Config_Property"; 54 55 56 public PropertyDialog(ActivationCfgPropertyPanel parent, 57 String title, Object [] values){ 58 super(parent, title, true, values); 59 name = (String )values[0]; 60 value = (String )values[1]; 61 helpId = ACTIVATION_CONFIG_PROPERTY; 62 } 63 64 65 public PropertyDialog(ActivationCfgPropertyPanel parent, 66 String title){ 67 super(parent, title, true); 68 helpId = ACTIVATION_CONFIG_PROPERTY; 69 } 70 71 72 public String getHelpId() { 73 return helpId; 74 } 75 76 77 protected JPanel getDialogPanel(Object [] values){ 78 propertyDlgPanel = new PropertyDialogPanel(values); 84 return propertyDlgPanel; 85 } 86 87 88 protected JPanel getDialogPanel(){ 89 propertyDlgPanel = new PropertyDialogPanel(); 95 return propertyDlgPanel; 96 } 97 98 99 protected Object [] getValues(){ 100 Object [] values = new Object [2]; 101 values[0] = (Object )propertyDlgPanel.getName(); 102 values[1] = (Object )propertyDlgPanel.getValue(); 103 return values; 104 } 105 106 107 protected Collection getErrors(){ 108 ArrayList errors = new ArrayList (); 109 110 if(validationSupport == null) assert(false); 112 113 String property = propertyDlgPanel.getName(); 114 errors.addAll(validationSupport.validate(property, 115 "/sun-ejb-jar/enterprise-beans/cmp-resource/property/name", bundle.getString("LBL_Name"))); 118 property = propertyDlgPanel.getValue(); 119 errors.addAll(validationSupport.validate(property, 120 "/sun-ejb-jar/enterprise-beans/cmp-resource/property/value", bundle.getString("LBL_Value"))); 123 return errors; 124 } 125 126 127 protected int getNOofFields() { 129 return 2; 130 } 131 } 132 | Popular Tags |