1 package com.tonbeller.jpivot.table.navi; 2 3 import javax.servlet.http.HttpSession ; 4 5 import org.w3c.dom.Element ; 6 7 import com.tonbeller.jpivot.table.ClickableMember; 8 import com.tonbeller.jpivot.table.SpanBuilder; 9 import com.tonbeller.jpivot.table.SpanBuilderDecorator; 10 import com.tonbeller.jpivot.table.TableComponent; 11 import com.tonbeller.jpivot.table.span.Span; 12 import com.tonbeller.wcf.controller.RequestContext; 13 14 22 public class StaticClickableMember extends SpanBuilderDecorator { 23 24 ClickableMember clickable; 25 26 public StaticClickableMember(SpanBuilder delegate, ClickableMember clickable) { 27 super(delegate); 28 this.clickable = clickable; 29 } 30 31 public void initialize(RequestContext context, TableComponent table) throws Exception { 32 super.initialize(context, table); 33 table.getDispatcher().addRequestListener(null, null, clickable); 34 table.getOlapModel().addModelChangeListener(clickable); 35 } 36 37 public void destroy(HttpSession session) throws Exception { 38 table.getDispatcher().removeRequestListener(clickable); 39 table.getOlapModel().removeModelChangeListener(clickable); 40 super.destroy(session); 41 } 42 43 public void startBuild(RequestContext context) { 44 super.startBuild(context); 45 clickable.startRendering(context, table); 46 } 47 48 public void stopBuild() { 49 clickable.stopRendering(); 50 super.stopBuild(); 51 } 52 53 public Element build(SBContext sbctx, Span span, boolean even) { 54 Element elem = super.build(sbctx, span, even); 55 clickable.decorate(sbctx, span.getObject()); 56 return elem; 57 } 58 59 } | Popular Tags |