1 13 package com.tonbeller.wcf.ui; 14 15 import org.w3c.dom.Document ; 16 import org.w3c.dom.Element ; 17 18 import com.tonbeller.wcf.utils.XoplonNS; 19 20 21 22 public abstract class Item extends XoplonCtrl { 23 24 25 public static void setSelected(Element element, boolean flag) { 26 String selected = flag ? "true" : "false"; 27 XoplonNS.setAttribute(element, "selected", selected); 28 } 29 30 31 public static boolean isSelected(Element element) { 32 boolean flag = (XoplonNS.getAttribute(element, "selected")).equals("true") ? true : false; 33 return flag; 34 } 35 36 37 protected static Element createItem(Document doc, String type) { 38 return EditCtrl.createValueHolder(doc, type); 39 } 40 41 42 public static void setValue(Element element, String value) { 43 XoplonNS.setAttribute(element, "value", value); 44 } 45 46 47 public static String getValue(Element element) { 48 return XoplonNS.getAttribute(element, "value"); 49 } 50 51 52 } 53 | Popular Tags |