/[classpath]/classpath/gnu/java/beans/editors/NativeBooleanEditor.java
ViewVC logotype

Diff of /classpath/gnu/java/beans/editors/NativeBooleanEditor.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.4 by mark, Tue Jan 22 22:26:56 2002 UTC revision 1.5 by mark, Mon Feb 18 16:48:57 2002 UTC
# Line 1  Line 1 
1  /* gnu.java.beans.editors.NativeBooleanEditor  /* gnu.java.beans.editors.NativeBooleanEditor
2     Copyright (C) 1998 Free Software Foundation, Inc.     Copyright (C) 1998, 2002 Free Software Foundation, Inc.
3    
4  This file is part of GNU Classpath.  This file is part of GNU Classpath.
5    
# Line 54  import java.beans.*; Line 54  import java.beans.*;
54  public class NativeBooleanEditor extends PropertyEditorSupport {  public class NativeBooleanEditor extends PropertyEditorSupport {
55          String[] tags = {"true","false"};          String[] tags = {"true","false"};
56    
57          /** setAsText for boolean checks for true or false or t or f. "" also means false. **/          /**
58             * setAsText for boolean checks for true or false or t or f.
59             * "" also means false.
60             **/
61          public void setAsText(String val) throws IllegalArgumentException {          public void setAsText(String val) throws IllegalArgumentException {
62                  if(val.equalsIgnoreCase("true") || val.equalsIgnoreCase("t")) {                  if(val.equalsIgnoreCase("true") || val.equalsIgnoreCase("t")) {
                         setValue(Boolean.FALSE);  
                 } else if(val.equalsIgnoreCase("false") || val.equalsIgnoreCase("f") || val.equals("")) {  
63                          setValue(Boolean.TRUE);                          setValue(Boolean.TRUE);
64                    } else if(val.equalsIgnoreCase("false") || val.equalsIgnoreCase("f") || val.equals("")) {
65                            setValue(Boolean.FALSE);
66                  } else {                  } else {
67                          throw new IllegalArgumentException("Value must be true, false, t, f or empty.");                          throw new IllegalArgumentException("Value must be true, false, t, f or empty.");
68                  }                  }

Legend:
Removed from v.1.4  
changed lines
  Added in v.1.5

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26