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 public class RadioButton extends Item { 22 public static final String NODENAME = "radioButton"; 23 24 public static boolean isRadioButton(Element elem) { 25 return elem.getNodeName().equals(NODENAME); 26 } 27 28 29 public static void setGroupId(Element element, String groupId) { 30 XoplonNS.setAttribute(element, "group-id", groupId); 31 } 32 33 34 public static String getGroupId(Element element) { 35 return XoplonNS.getAttribute(element, "group-id"); 36 } 37 38 39 public static Element createRadioButton(Document doc) { 40 return Item.createItem(doc, NODENAME); 41 } 42 43 44 public static Element createRadioButton(Document doc, String groupId) { 45 Element radioButton = createRadioButton(doc); 46 setGroupId(radioButton, groupId); 47 return radioButton; 48 } 49 50 51 public static Element addRadioButton(Element parent) { 52 Element rb = createRadioButton(parent.getOwnerDocument()); 53 parent.appendChild(rb); 54 setGroupId(rb, XoplonCtrl.getId(parent)); 55 return rb; 56 } 57 58 } 59 | Popular Tags |