1 13 package com.tonbeller.jpivot.xmla; 14 15 import com.tonbeller.jpivot.core.ExtensionSupport; 16 import com.tonbeller.jpivot.olap.mdxparse.ParsedQuery; 17 import com.tonbeller.jpivot.olap.navi.SwapAxes; 18 19 22 public class XMLA_SwapAxes extends ExtensionSupport implements SwapAxes { 23 24 27 public XMLA_SwapAxes() { 28 super.setId(SwapAxes.ID); 29 } 30 31 35 public boolean canSwapAxes() { 36 XMLA_Model model = (XMLA_Model) getModel(); 37 ParsedQuery pQuery = model.getPQuery(); 38 if (pQuery != null) 39 return (pQuery.getAxes().length >= 2); 40 else 41 return false; 42 } 43 44 47 public void setSwapAxes(boolean swap) { 48 XMLA_Model model = (XMLA_Model) getModel(); 49 XMLA_QueryAdapter qad = (XMLA_QueryAdapter) model.getQueryAdapter(); 51 qad.setSwapAxes(swap); 52 } 53 54 57 public boolean isSwapAxes() { 58 XMLA_Model model = (XMLA_Model) getModel(); 59 XMLA_QueryAdapter qad = (XMLA_QueryAdapter) model.getQueryAdapter(); 61 return qad.isSwapAxes(); 62 } 63 64 } | Popular Tags |