1 13 package org.openi.xmla.navigator.hierarchy; 14 15 import org.w3c.dom.Document ; 16 import org.w3c.dom.Element ; 17 18 import com.tonbeller.jpivot.olap.model.Member; 19 import com.tonbeller.wcf.catedit.Category; 20 import com.tonbeller.wcf.catedit.DefaultItemElementRenderer; 21 import com.tonbeller.wcf.catedit.Item; 22 import com.tonbeller.wcf.controller.RequestContext; 23 import com.tonbeller.wcf.utils.DomUtils; 24 25 29 public class HierarchyItemRenderer extends DefaultItemElementRenderer { 30 31 public Element render(RequestContext context, Document factory, Category cat, Item item) { 32 Element elem = super.render(context, factory, cat, item); 33 HierarchyItem hi = (HierarchyItem)item; 34 if (hi.isClickable()) 35 elem.setAttribute("id", hi.getId()); 36 37 if (!hi.getSlicerSelection().isEmpty()) { 38 Member m = (Member)hi.getSlicerSelection().get(0); 39 Element e = DomUtils.appendElement(elem, "slicer-value"); 40 e.setAttribute("label", m.getLabel()); 41 e.setAttribute("level", m.getLevel().getLabel()); 42 } 43 44 return elem; 45 46 } 47 } 48 | Popular Tags |