1 19 20 28 29 package org.netbeans.modules.xml.schema.ui.basic.editors; 30 31 import org.netbeans.modules.xml.schema.model.Any.ProcessContents; 32 import java.beans.PropertyEditorSupport ; 33 import org.openide.util.NbBundle; 34 35 41 public class ProcessContentsEditor extends PropertyEditorSupport { 42 43 46 public ProcessContentsEditor() { 47 } 48 49 public String [] getTags() { 50 return new String [] {NbBundle.getMessage(BooleanDefaultFalseEditor.class,"LBL_EmptyProcessContents"), 51 NbBundle.getMessage(BooleanDefaultFalseEditor.class,"LBL_Lax"), 52 NbBundle.getMessage(BooleanDefaultFalseEditor.class,"LBL_Skip"), 53 NbBundle.getMessage(BooleanDefaultFalseEditor.class,"LBL_Strict")}; 54 } 55 56 public void setAsText(String text) throws IllegalArgumentException { 57 if (text.equals(NbBundle.getMessage(BooleanDefaultFalseEditor.class,"LBL_EmptyProcessContents"))){ 58 setValue(null); 59 } else if (text.equals(NbBundle.getMessage(BooleanDefaultFalseEditor.class,"LBL_Lax"))){ 60 setValue(ProcessContents.LAX); 61 } else if (text.equals(NbBundle.getMessage(BooleanDefaultFalseEditor.class,"LBL_Skip"))){ 62 setValue(ProcessContents.SKIP); 63 } else if (text.equals(NbBundle.getMessage(BooleanDefaultFalseEditor.class,"LBL_Strict"))){ 64 setValue(ProcessContents.STRICT); 65 } 66 } 67 68 public String getAsText() { 69 Object val = getValue(); 70 if (val instanceof ProcessContents){ 71 if (ProcessContents.LAX.equals(val)) { 72 return NbBundle.getMessage(BooleanDefaultFalseEditor.class,"LBL_Lax"); 73 } else if (ProcessContents.SKIP.equals(val)) { 74 return NbBundle.getMessage(BooleanDefaultFalseEditor.class,"LBL_Skip"); 75 } else if (ProcessContents.STRICT.equals(val)) { 76 return NbBundle.getMessage(BooleanDefaultFalseEditor.class,"LBL_Strict"); 77 } 78 } 79 return NbBundle.getMessage(BooleanDefaultFalseEditor.class,"LBL_EmptyProcessContents"); 81 } 82 83 } 84 | Popular Tags |