1 6 7 package org.netbeans.test.editor.app.core.properties; 8 9 13 public class BooleanProperty implements Property { 14 15 private static String [] VALUES = {Boolean.TRUE.toString(),Boolean.FALSE.toString()}; 16 private boolean value = false; 17 18 19 public BooleanProperty(boolean value) { 20 this.value=value; 21 } 22 23 public String getProperty() { 24 if (value) { 25 return VALUES[0]; 26 } else { 27 return VALUES[1]; 28 } 29 } 30 31 public void setProperty(String value) { 32 if (Boolean.TRUE.toString().compareTo(value) != 0) { 33 this.value=true; 34 } else { 35 this.value=false; 36 } 37 } 38 39 public String [] getValues() { 40 return VALUES; 41 } 42 43 public boolean getValue() { 44 return value; 45 } 46 47 } 48 | Popular Tags |