uidesigner/com.nokia.sdt.component.symbian.test/data/modelUpdaterTest/script_updater.js
author fturovic <frank.turovich@nokia.com>
Fri, 24 Apr 2009 10:31:21 -0500
branchRCL_2_0
changeset 124 4629a6a90ed5
parent 2 d760517a8095
permissions -rw-r--r--
merged with Tims last change
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
cawthron
parents:
diff changeset
     1
function CModelUpdater() {
cawthron
parents:
diff changeset
     2
}
cawthron
parents:
diff changeset
     3
cawthron
parents:
diff changeset
     4
CModelUpdater.prototype.updateModel = function(instance, dataModel) {
cawthron
parents:
diff changeset
     5
	var newObject = dataModel.createNewComponentInstance(instance.parent.component);
cawthron
parents:
diff changeset
     6
	var command = dataModel.createAddNewComponentInstanceCommand(instance.EObject, newObject, 0);
cawthron
parents:
diff changeset
     7
	if (command.canExecute()) {
cawthron
parents:
diff changeset
     8
		command.execute();
cawthron
parents:
diff changeset
     9
	}
cawthron
parents:
diff changeset
    10
}
cawthron
parents:
diff changeset
    11