1 19 20 package org.netbeans.modules.xml.schema.abe.nodes.properties; 21 22 import org.netbeans.modules.xml.schema.model.Any.ProcessContents; 23 import java.beans.PropertyEditorSupport ; 24 import org.openide.util.NbBundle; 25 26 32 public class ProcessContentsEditor extends PropertyEditorSupport { 33 34 37 public ProcessContentsEditor() { 38 } 39 40 public String [] getTags() { 41 return new String [] {NbBundle.getMessage(BooleanDefaultFalseEditor.class,"LBL_EmptyProcessContents"), 42 NbBundle.getMessage(BooleanDefaultFalseEditor.class,"LBL_Lax"), 43 NbBundle.getMessage(BooleanDefaultFalseEditor.class,"LBL_Skip"), 44 NbBundle.getMessage(BooleanDefaultFalseEditor.class,"LBL_Strict")}; 45 } 46 47 public void setAsText(String text) throws IllegalArgumentException { 48 if (text.equals(NbBundle.getMessage(BooleanDefaultFalseEditor.class,"LBL_EmptyProcessContents"))){ 49 setValue(null); 50 } else if (text.equals(NbBundle.getMessage(BooleanDefaultFalseEditor.class,"LBL_Lax"))){ 51 setValue(ProcessContents.LAX); 52 } else if (text.equals(NbBundle.getMessage(BooleanDefaultFalseEditor.class,"LBL_Skip"))){ 53 setValue(ProcessContents.SKIP); 54 } else if (text.equals(NbBundle.getMessage(BooleanDefaultFalseEditor.class,"LBL_Strict"))){ 55 setValue(ProcessContents.STRICT); 56 } 57 } 58 59 public String getAsText() { 60 Object val = getValue(); 61 if (val instanceof ProcessContents){ 62 if (ProcessContents.LAX.equals(val)) { 63 return NbBundle.getMessage(BooleanDefaultFalseEditor.class,"LBL_Lax"); 64 } else if (ProcessContents.SKIP.equals(val)) { 65 return NbBundle.getMessage(BooleanDefaultFalseEditor.class,"LBL_Skip"); 66 } else if (ProcessContents.STRICT.equals(val)) { 67 return NbBundle.getMessage(BooleanDefaultFalseEditor.class,"LBL_Strict"); 68 } 69 } 70 return NbBundle.getMessage(BooleanDefaultFalseEditor.class,"LBL_EmptyProcessContents"); 72 } 73 74 } 75 | Popular Tags |