1 19 package org.netbeans.modules.j2ee.sun.ide.editors; 20 21 import java.awt.Component ; 22 import java.beans.PropertyEditorSupport ; 23 24 import org.openide.explorer.propertysheet.editors.EnhancedPropertyEditor; 25 26 public class ValidationMethodEditor extends PropertyEditorSupport implements EnhancedPropertyEditor { 27 28 public static String curr_Sel; 29 public String [] choices = { 30 "auto-commit", "meta-data", "table" }; 34 35 public ValidationMethodEditor() { 36 curr_Sel = null; 37 } 38 39 public String getAsText () { 40 return curr_Sel; 41 } 42 43 public void setAsText (String string) throws IllegalArgumentException { 44 if((string==null)||(string.equals(""))) throw new IllegalArgumentException (); 46 else 47 curr_Sel = string; 48 this.firePropertyChange(); 49 } 50 51 public void setValue (Object val) { 52 if (! (val instanceof String )) { 53 throw new IllegalArgumentException (); 54 } 55 curr_Sel = (String ) val; 56 } 57 58 public Object getValue () { 59 return curr_Sel; 60 } 61 62 public String getJavaInitializationString () { 63 return getAsText (); 64 } 65 66 public String [] getTags () { 67 return choices; 68 } 69 70 public Component getInPlaceCustomEditor () { 71 return null; 72 } 73 74 75 public boolean hasInPlaceCustomEditor () { 76 return false; 77 } 78 79 public boolean supportsEditingTaggedValues () { 80 return false; 81 } 82 83 } 84 85 86 | Popular Tags |