1 19 package org.netbeans.modules.j2ee.sun.ide.editors; 20 21 import java.beans.PropertyEditorSupport ; 22 import java.awt.Component ; 23 import org.openide.explorer.propertysheet.editors.EnhancedPropertyEditor; 24 29 public class LogLevelEditor extends PropertyEditorSupport implements EnhancedPropertyEditor { 30 31 public String curr_Sel; 32 public String [] choices = { 33 "FINEST", "FINER", "FINE", "CONFIG", "INFO", "WARNING", "SEVERE", }; 41 42 public LogLevelEditor() { 43 curr_Sel = null; 44 } 45 46 public String getAsText() { 47 return curr_Sel; 48 } 49 50 public void setAsText(String string) throws IllegalArgumentException { 51 if((string==null)||(string.equals(""))) throw new IllegalArgumentException (); 53 else 54 curr_Sel = string; 55 this.firePropertyChange(); 56 } 57 58 public void setValue(Object val) { 59 if (! (val instanceof String )) { 60 throw new IllegalArgumentException (); 61 } 62 63 curr_Sel = (String ) val; 64 super.setValue(curr_Sel); 65 } 66 67 public Object getValue() { 68 return curr_Sel; 69 } 70 71 public String getJavaInitializationString() { 72 return getAsText(); 73 } 74 75 public String [] getTags() { 76 return choices; 77 } 78 79 public Component getInPlaceCustomEditor() { 80 return null; 81 } 82 83 84 public boolean hasInPlaceCustomEditor() { 85 return false; 86 } 87 88 public boolean supportsEditingTaggedValues() { 89 return false; 90 } 91 92 } 93 94 95 | Popular Tags |