public void replaceMCWith(DRMasterCriteria oldMC, NSArray smcList) { NSMutableArray arr = new NSMutableArray(masterCriteriaList()); int indx = arr.indexOfObject(oldMC); arr.insertObjectAtIndex(DRMasterCriteria.withSubMasterCriteriaUserInfo(smcList, oldMC.userInfo()), indx); arr.removeObject(oldMC); setMasterCriteriaList(arr); } }
public void moveUp(DRAttribute member, boolean up) { int cnt; NSMutableArray arr = _attribute.attributes(); int cur = arr.indexOfObject(member); arr.removeObject(member); cnt = arr.count(); if (up) { int newdex = cur-1; if (newdex < 0) { arr.addObject(member); } else { arr.insertObjectAtIndex(member, newdex); } } else { int newdex = cur+1; if (newdex > cnt) { arr.insertObjectAtIndex(member, 0); } else { arr.insertObjectAtIndex(member, newdex); } } }
public void moveUpDimension(DRGroup vGroup, boolean up, String dim) { int cnt; NSMutableArray dims = (NSMutableArray)dimensionForName(dim); int cur = dims.indexOfObject(vGroup); dims.removeObject(vGroup); cnt = dims.count(); if (up) { int newdex = cur-1; if (newdex < 0) { dims.addObject(vGroup); } else { dims.insertObjectAtIndex(vGroup, newdex); } } else { int newdex = cur+1; if (newdex > cnt) { dims.insertObjectAtIndex(vGroup, 0); } else { dims.insertObjectAtIndex(vGroup, newdex); } } }
public void toggleGroupInList(DRAttribute att) { DRAttribute newAtt; NSMutableArray arr = _attribute.attributes(); int curDex = arr.indexOfObject(att); if (att.isGroup()) { newAtt = DRAttribute.withKeyPathFormatLabelTotalUserInfo(att.keyPath(), att.format(), att.label(), att.shouldTotal(), att.userInfo()); } else { newAtt = DRAttributeGroup.withKeyPathFormatLabelTotalListUserInfo(att.keyPath(), att.format(), att.label(), att.shouldTotal(), new NSMutableArray(), att.userInfo()); } arr.insertObjectAtIndex(newAtt, curDex); arr.removeObjectAtIndex(curDex+1); }
public void toggleGroupInList(DRAttribute att) { int curDex; DRAttribute newAtt; NSMutableArray arr = new NSMutableArray(attributeList()); curDex = arr.indexOfObject(att); if (att.isGroup()) { newAtt = DRAttribute.withKeyPathFormatLabelTotalUserInfo(att.keyPath(), att.format(), att.label(), att.shouldTotal(), att.userInfo()); } else { newAtt = DRAttributeGroup.withKeyPathFormatLabelTotalListUserInfo(att.keyPath(), att.format(), att.label(), att.shouldTotal(), new NSMutableArray(), att.userInfo()); } arr.insertObjectAtIndex(newAtt, curDex); arr.removeObjectAtIndex(curDex+1); setAttributeList(arr); }