1 13 package com.tonbeller.jpivot.table.navi; 14 15 import com.tonbeller.jpivot.olap.model.Member; 16 import com.tonbeller.jpivot.olap.model.OlapModel; 17 import com.tonbeller.jpivot.olap.model.Position; 18 import com.tonbeller.jpivot.olap.navi.DrillExpandPosition; 19 import com.tonbeller.jpivot.table.span.Span; 20 21 26 public class DrillExpandPositionUI extends DrillExpandUI { 27 public static final String ID = "drillPosition"; 28 public String getId() { 29 return ID; 30 } 31 32 DrillExpandPosition expandPosition; 33 34 protected boolean initializeExtension() { 35 OlapModel om = table.getOlapModel(); 36 expandPosition = (DrillExpandPosition) om.getExtension(DrillExpandPosition.ID); 37 return expandPosition != null; 38 } 39 40 protected boolean canExpand(Span span) { 41 if (!positionContainsMember(span)) 42 return false; 43 return expandPosition.canExpand( 44 (Position) span.getPosition().getRootDecoree(), 45 (Member) span.getMember().getRootDecoree()); 46 } 47 48 protected boolean canCollapse(Span span) { 49 if (!positionContainsMember(span)) 50 return false; 51 return expandPosition.canCollapse( 52 (Position) span.getPosition().getRootDecoree(), 53 (Member) span.getMember().getRootDecoree()); 54 } 55 56 protected void expand(Span span) { 57 expandPosition.expand( 58 (Position) span.getPosition().getRootDecoree(), 59 (Member) span.getMember().getRootDecoree()); 60 } 61 62 protected void collapse(Span span) { 63 expandPosition.collapse( 64 (Position) span.getPosition().getRootDecoree(), 65 (Member) span.getMember().getRootDecoree()); 66 } 67 68 protected String getCollapseImage() { 69 return "drill-position-collapse"; 70 } 71 72 protected String getExpandImage() { 73 return "drill-position-expand"; 74 } 75 76 protected String getOtherImage() { 77 return "drill-position-other"; 78 } 79 80 } 81 | Popular Tags |