1 19 package org.netbeans.modules.j2ee.sun.util; 20 21 import org.openide.explorer.propertysheet.editors.EnhancedPropertyEditor; 22 23 import org.netbeans.modules.j2ee.sun.ide.editors.BooleanEditor; 24 import org.netbeans.modules.j2ee.sun.ide.editors.DataSourceTypeEditor; 25 import org.netbeans.modules.j2ee.sun.ide.editors.IsolationLevelEditor; 26 import org.netbeans.modules.j2ee.sun.ide.editors.ValidationMethodEditor; 27 30 public class EnhancedPropertyEditorFactory { 31 32 private static EnhancedPropertyEditorFactory factory; 33 34 35 38 private EnhancedPropertyEditorFactory() { 39 } 40 41 42 46 public static EnhancedPropertyEditorFactory getInstance() { 47 if(factory == null) { 48 factory = new EnhancedPropertyEditorFactory(); 49 } 50 return factory; 51 } 52 53 54 61 public EnhancedPropertyEditor getEnhancedPropertyEditor( 62 final Object value, final String customType) { 63 if(customType.equals(PropertyConstants.DATASOURCE_TYPE_FIELD)) 64 return new DataSourceTypeEditor(); 65 else if(customType.equals(PropertyConstants.ISOLATION_LEVEL_FIELD)) 66 return new IsolationLevelEditor(true); 67 else if(customType.equals(PropertyConstants.VALIDATION_METHOD_FIELD)) 68 return new ValidationMethodEditor(); 69 else if(value instanceof Boolean ) { 70 return new BooleanEditor(); 71 } else { 72 return new BooleanEditor(); 73 } 74 75 } 76 77 } 78 | Popular Tags |