001package kiwi.ui.propeditor; 002 003public class DefaultPropertyEditorFactory implements PropertyEditorFactory 004 { 005 private static DefaultPropertyEditorFactory instance 006 = new DefaultPropertyEditorFactory(); 007 008 /** 009 */ 010 011 public static PropertyEditorFactory getInstance() 012 { 013 return(instance); 014 } 015 016 /* 017 */ 018 019 private DefaultPropertyEditorFactory() 020 { 021 } 022 023 /** 024 */ 025 026 public PropertyValueEditor createEditor(PropertyType type) 027 { 028 Class clazz = type.getClass(); 029 PropertyValueEditor editor = null; 030 031 if(clazz == TextPropertyType.class) 032 editor = new TextValueEditor(); 033 034 else if(clazz == NumericPropertyType.class) 035 editor = new NumericValueEditor(); 036 037 else if(clazz == ListPropertyType.class) 038 editor = new ListValueEditor(); 039 040 else 041 editor = new FixedValueEditor(); 042 043 return(editor); 044 } 045 046 } 047 048/* end of source file */