home *** CD-ROM | disk | FTP | other *** search
- package sun.beans.editors;
-
- import java.beans.PropertyEditorSupport;
-
- public class BoolEditor extends PropertyEditorSupport {
- public String getJavaInitializationString() {
- return (Boolean)((PropertyEditorSupport)this).getValue() ? "true" : "false";
- }
-
- public String getAsText() {
- return (Boolean)((PropertyEditorSupport)this).getValue() ? "True" : "False";
- }
-
- public void setAsText(String var1) throws IllegalArgumentException {
- if (var1.toLowerCase().equals("true")) {
- ((PropertyEditorSupport)this).setValue(Boolean.TRUE);
- } else if (var1.toLowerCase().equals("false")) {
- ((PropertyEditorSupport)this).setValue(Boolean.FALSE);
- } else {
- throw new IllegalArgumentException(var1);
- }
- }
-
- public String[] getTags() {
- String[] var1 = new String[]{"True", "False"};
- return var1;
- }
- }
-