1 56 57 package org.objectstyle.cayenne.dataview.dvmodeler; 58 59 import org.jdom.*; 60 61 66 67 public class EditFormat{ 68 private String className = ""; 69 private String pattern = ""; 70 71 public EditFormat(Element element){ 72 className = element.getAttributeValue("class"); 73 pattern = element.getChild("pattern").getText(); 74 } 75 76 public EditFormat(){ 77 } 78 79 public boolean isEmpty(){ 80 if (className.length() == 0){ 81 return true; 82 } else{ 83 return false; 84 } 85 } 86 87 public void setClassName(String className){ 88 this.className = className; 89 } 90 91 public String getClassName(){ 92 return className; 93 } 94 95 public void setPattern(String Pattern){ 96 this.pattern = Pattern; 97 } 98 99 public String getPattern(){ 100 return pattern; 101 } 102 103 public Element getEditFormatElement(){ 104 Element e = new Element("edit-format"); 105 e.setAttribute(new Attribute("class", className)); 106 Element ePattern = new Element("pattern"); 107 ePattern.addContent(pattern); 108 e.addContent(ePattern); 109 return e; 110 } 111 } 112 | Popular Tags |