uidesigner/com.nokia.sdt.component.symbian.test/data/display/script_queryContainment.js
author Ed Swartz <ed.swartz@nokia.com>
Fri, 23 Apr 2010 09:37:47 -0500
changeset 1266 15644163b1a2
parent 0 fb279309251b
permissions -rw-r--r--
David's commit: the connections view was not listening to the changes in connection status, so unless a service changed status, the change in connection status didn?t get updated



function QueryContainment() {
}


function doComponentCheck(instance, componentId) {
	return instance.componentId == componentId;
}

function doComponentCheckStatus(instance, componentId) {
	if (doComponentCheck(instance, componentId))
		return null;
		
	statusBuilder = newStatusBuilder();
	params = new Array(1);
	params[0] = componentId;
	statusBuilder.add(4, "Test {0}", params);
	return statusBuilder.createStatus("", null);
}

QueryContainment.prototype.canContainComponent = function(instance, otherComponent) {
	return doComponentCheckStatus(instance, otherComponent.id);
}

QueryContainment.prototype.canContainChild = function(instance, child) {
	return this.canContainComponent(instance.attributes, child.componentId);
}

QueryContainment.prototype.canRemoveChild = function(instance, child) {
	return doComponentCheck(instance, child.componentId);
}