Heads merge
authorEugene Ostroukhov <eugeneo@symbian.org>
Mon, 19 Apr 2010 18:04:34 -0700
changeset 311 eef7c6acd0f3
parent 310 e9484be98cfe (diff)
parent 307 528ed2ad874b (current diff)
child 312 11f39c9c3156
Heads merge
org.symbian.tools.wrttools/projecttemplates/flickr.zip
--- a/org.symbian.tools.wrttools.previewer/src/org/symbian/tools/wrttools/previewer/PreviewerUtil.java	Mon Apr 19 17:52:52 2010 -0700
+++ b/org.symbian.tools.wrttools.previewer/src/org/symbian/tools/wrttools/previewer/PreviewerUtil.java	Mon Apr 19 18:04:34 2010 -0700
@@ -74,7 +74,7 @@
     }
 
     public static boolean isRelevantResource(IResource resource) {
-        if (resource.getType() == IResource.FILE) {
+        if (resource.exists() && resource.getType() == IResource.FILE) {
             return !resource.getFullPath().segment(1).equalsIgnoreCase("preview")
                     && !"wgz".equalsIgnoreCase(resource.getFileExtension())
                     && !(PreviewerPlugin.PLUGIN_ID + ".xml").equals(resource.getName());
--- a/org.symbian.tools.wrttools/META-INF/MANIFEST.MF	Mon Apr 19 17:52:52 2010 -0700
+++ b/org.symbian.tools.wrttools/META-INF/MANIFEST.MF	Mon Apr 19 18:04:34 2010 -0700
@@ -23,7 +23,8 @@
  org.eclipse.ui.navigator;bundle-version="3.4.0",
  org.eclipse.ui.navigator.resources;bundle-version="3.4.0",
  org.w3c.css;bundle-version="1.0.0",
- org.eclipse.core.expressions;bundle-version="3.4.101"
+ org.eclipse.core.expressions;bundle-version="3.4.101",
+ org.eclipse.wst.xml.ui;bundle-version="1.1.2"
 Bundle-RequiredExecutionEnvironment: J2SE-1.5,
  JavaSE-1.6
 Bundle-ActivationPolicy: lazy
Binary file org.symbian.tools.wrttools/icons/phonegap.png has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.symbian.tools.wrttools/libraries/phonegap.js	Mon Apr 19 18:04:34 2010 -0700
@@ -0,0 +1,1743 @@
+if (typeof(DeviceInfo) != 'object')
+    DeviceInfo = {};
+
+/**
+ * This represents the PhoneGap API itself, and provides a global namespace for accessing
+ * information about the state of PhoneGap.
+ * @class
+ */
+PhoneGap = {
+    queue: {
+        ready: true,
+        commands: [],
+        timer: null
+    },
+    _constructors: []
+};
+
+/**
+ * Boolean flag indicating if the PhoneGap API is available and initialized.
+ */
+PhoneGap.available = DeviceInfo.uuid != undefined;
+
+/**
+ * Execute a PhoneGap command in a queued fashion, to ensure commands do not
+ * execute with any race conditions, and only run when PhoneGap is ready to
+ * recieve them.
+ * @param {String} command Command to be run in PhoneGap, e.g. "ClassName.method"
+ * @param {String[]} [args] Zero or more arguments to pass to the method
+ */
+PhoneGap.exec = function() {
+    PhoneGap.queue.commands.push(arguments);
+    if (PhoneGap.queue.timer == null)
+        PhoneGap.queue.timer = setInterval(PhoneGap.run_command, 10);
+};
+/**
+ * Internal function used to dispatch the request to PhoneGap.  This needs to be implemented per-platform to
+ * ensure that methods are called on the phone in a way appropriate for that device.
+ * @private
+ */
+PhoneGap.run_command = function() {
+};
+
+/**
+ * This class contains acceleration information
+ * @constructor
+ * @param {Number} x The force applied by the device in the x-axis.
+ * @param {Number} y The force applied by the device in the y-axis.
+ * @param {Number} z The force applied by the device in the z-axis.
+ */
+function Acceleration(x, y, z) {
+	/**
+	 * The force applied by the device in the x-axis.
+	 */
+	this.x = x;
+	/**
+	 * The force applied by the device in the y-axis.
+	 */
+	this.y = y;
+	/**
+	 * The force applied by the device in the z-axis.
+	 */
+	this.z = z;
+	/**
+	 * The time that the acceleration was obtained.
+	 */
+	this.timestamp = new Date().getTime();
+}
+
+/**
+ * This class specifies the options for requesting acceleration data.
+ * @constructor
+ */
+function AccelerationOptions() {
+	/**
+	 * The timeout after which if acceleration data cannot be obtained the errorCallback
+	 * is called.
+	 */
+	this.timeout = 10000;
+}
+/**
+ * This class provides access to device accelerometer data.
+ * @constructor
+ */
+function Accelerometer() {
+	/**
+	 * The last known acceleration.
+	 */
+	this.lastAcceleration = null;
+}
+
+/**
+ * Asynchronously aquires the current acceleration.
+ * @param {Function} successCallback The function to call when the acceleration
+ * data is available
+ * @param {Function} errorCallback The function to call when there is an error 
+ * getting the acceleration data.
+ * @param {AccelerationOptions} options The options for getting the accelerometer data
+ * such as timeout.
+ */
+
+Accelerometer.prototype.getCurrentAcceleration = function(successCallback, errorCallback, options) {
+	// If the acceleration is available then call success
+	// If the acceleration is not available then call error
+	
+	try {
+		alert(1);
+		if (!this.serviceObj) 
+			this.serviceObj = this.getServiceObj();
+		
+		if (this.serviceObj == null) 
+			throw {
+				name: "DeviceErr",
+				message: "Could not initialize service object"
+			};
+		
+		//get the sensor channel
+		var SensorParams = {
+			SearchCriterion: "AccelerometerAxis"
+		};
+		var returnvalue = this.serviceObj.ISensor.FindSensorChannel(SensorParams);
+		alert(2);
+		var error = returnvalue["ErrorCode"];
+		var errmsg = returnvalue["ErrorMessage"];
+		if (!(error == 0 || error == 1012)) {
+			var ex = {
+				name: "Unable to find Sensor Channel: " + error,
+				message: errmsg
+			};
+			throw ex;
+		}
+		var channelInfoMap = returnvalue["ReturnValue"][0];
+		var criteria = {
+			ChannelInfoMap: channelInfoMap,
+			ListeningType: "ChannelData"
+		};
+		
+		if (typeof(successCallback) != 'function') 
+			successCallback = function(){
+			};
+		if (typeof(errorCallback) != 'function') 
+			errorCallback = function(){
+			};
+		
+		this.success_callback = successCallback;
+		this.error_callback = errorCallback;
+		//create a closure to persist this instance of Accelerometer into the RegisterForNofication callback
+		var obj = this;
+		
+		// TODO: this call crashes WRT, but there is no other way to read the accel sensor
+		// http://discussion.forum.nokia.com/forum/showthread.php?t=182151&highlight=memory+leak
+		this.serviceObj.ISensor.RegisterForNotification(criteria, function(transId, eventCode, result){
+			try {
+				alert(10);
+				var criteria = {
+					TransactionID: transId
+				};
+				obj.serviceObj.ISensor.Cancel(criteria);
+				
+				var accel = new Acceleration(result.ReturnValue.XAxisData, result.ReturnValue.YAxisData, result.ReturnValue.ZAxisData);
+				Accelerometer.lastAcceleration = accel;
+				
+				obj.success_callback(accel);
+				
+			} 
+			catch (ex) {
+				obj.serviceObj.ISensor.Cancel(criteria);
+				obj.error_callback(ex);
+			}
+			
+		});
+		alert(4);
+	} catch (ex) {
+		alert(5);
+		errorCallback(ex);
+	}
+
+};
+
+
+/**
+ * Asynchronously aquires the acceleration repeatedly at a given interval.
+ * @param {Function} successCallback The function to call each time the acceleration
+ * data is available
+ * @param {Function} errorCallback The function to call when there is an error 
+ * getting the acceleration data.
+ * @param {AccelerationOptions} options The options for getting the accelerometer data
+ * such as timeout.
+ */
+
+Accelerometer.prototype.watchAcceleration = function(successCallback, errorCallback, options) {
+	this.getCurrentAcceleration(successCallback, errorCallback, options);
+	// TODO: add the interval id to a list so we can clear all watches
+ 	var frequency = (options != undefined)? options.frequency : 10000;
+	return setInterval(function() {
+		navigator.accelerometer.getCurrentAcceleration(successCallback, errorCallback, options);
+	}, frequency);
+};
+
+/**
+ * Clears the specified accelerometer watch.
+ * @param {String} watchId The ID of the watch returned from #watchAcceleration.
+ */
+Accelerometer.prototype.clearWatch = function(watchId) {
+	clearInterval(watchId);
+};
+
+//gets the Acceleration Service Object from WRT
+Accelerometer.prototype.getServiceObj = function() {
+	var so;
+	
+    try {
+        so = device.getServiceObject("Service.Sensor", "ISensor");
+    } catch (ex) {
+		throw {
+			name: "DeviceError",
+			message: "Could not initialize accel service object (" + ex.name + ": " + ex.message + ")"
+		};
+    }		
+	return so;
+};
+
+if (typeof navigator.accelerometer == "undefined") navigator.accelerometer = new Accelerometer();/**
+ * This class provides access to the device camera.
+ * @constructor
+ */
+function Camera() {
+	this.success_callback = null;
+	this.error_callback = null;
+}
+
+/**
+ * We use the Platform Services 2.0 API here. So we must include a portion of the
+ * PS 2.0 source code (camera API). 
+ * @param {Function} successCallback
+ * @param {Function} errorCallback
+ * @param {Object} options
+ */
+Camera.prototype.getPicture = function(successCallback, errorCallback, options){
+	try {
+		if (!this.serviceObj) {
+			this.serviceObj = com.nokia.device.load("", "com.nokia.device.camera", "");
+		}
+		if (!this.serviceObj) {
+			throw {
+				name: "CameraError",
+				message: "could not load camera service"
+			};
+		}
+		var obj = this;
+		
+		obj.success_callback = successCallback;
+		obj.error_callback = errorCallback;
+		this.serviceObj.startCamera( function(transactionID, errorCode, outPut) { 
+			//outPut should be an array of image urls (local), or an error code
+			if (errorCode == 0) {
+				obj.success_callback(outPut);
+			}
+			else {
+				obj.error_callback({
+					name: "CameraError",
+					message: errorCode
+				});
+			}
+		});
+		
+	} catch (ex) {
+		errorCallback.call(ex);
+	}
+	
+};
+
+if (typeof navigator.camera == "undefined") navigator.camera = new Camera();/*
+Copyright © 2009 Nokia. All rights reserved.
+Code licensed under the BSD License:
+Software License Agreement (BSD License) Copyright © 2009 Nokia.
+All rights reserved.
+Redistribution and use of this software in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+
+Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 
+Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 
+Neither the name of Nokia Corporation. nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission of Nokia Corporation. 
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+version: 1.0
+*/
+
+
+// utility.js
+//
+// This file contains some utility functions for S60 providers
+
+
+// Start an application and wait for it to exit
+
+//TBD: Get rid of this global, use closures instead
+
+DeviceError.prototype = new Error(); //inheritance occurs here
+DeviceError.prototype.constructor = DeviceError; //If this not present then, it uses default constructor of Error
+
+//constructor for DeviceError.
+function DeviceError(message,code) 
+{
+	this.toString = concatenate;
+	this.code = code;
+	this.name = "DeviceException";//we can even overwrite default name "Error"
+	this.message=message; 
+}
+
+function concatenate()
+{
+	return (this.name+":"+" "+this.message+" "+this.code);
+}
+
+function splitErrorMessage(errmessage)
+{
+	if(errmessage.search(/:/)!=-1)
+	{
+		if((errmessage.split(":").length)==2)
+		{
+			return errmessage.split(":")[1];
+		}
+		if((errmessage.split(":").length)>2)
+		{
+			return errmessage.split(":")[2];
+		}
+	}
+	return errmessage;
+}
+
+
+var __s60_start_and_wait_cb;
+
+function __s60_on_app_exit(){
+  widget.onshow = null;
+  if(__s60_start_and_wait_cb != null){
+    __s60_start_and_wait_cb();
+  }
+}
+
+function __s60_on_app_start(){
+  widget.onhide = null;
+  widget.onshow = __s60_on_app_exit;
+}
+
+// This function cannot actually force JS to wait,
+// but it does supply a callback the apps can use
+// to continue processing on return from the app.
+// Apps should take care not to reinvoke this and
+// should be careful about any other processing
+// that might happen while the app is running.
+
+function __s60_start_and_wait(id, args, app_exit_cb){
+  __s60_start_and_wait_cb = app_exit_cb;
+  widget.onhide = __s60_on_app_start;
+  widget.openApplication(id, args);
+}
+
+function __s60_api_not_supported(){
+  throw(err_ServiceNotSupported);
+}
+
+function __s60_enumerate_object(object, namespace, func, param){
+    var key;
+    for(key in object){
+       
+        var propname;
+       	if(namespace){
+	    propname = namespace + "." + key;
+	}
+	else{
+	    propname = key;
+	}
+        var value = object[key];
+        if(typeof value == "object"){
+	  __s60_enumerate_object(value, propname, func, param);
+	}
+	else {
+	  func(propname,value, param);
+	}
+    }
+}
+/*
+Copyright © 2009 Nokia. All rights reserved.
+Code licensed under the BSD License:
+Software License Agreement (BSD License) Copyright © 2009 Nokia.
+All rights reserved.
+Redistribution and use of this software in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+
+Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 
+Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 
+Neither the name of Nokia Corporation. nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission of Nokia Corporation. 
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+version: 1.0
+*/
+
+
+var __device_debug_on__ = true;
+var err_missing_argument = 1003;
+var event_cancelled = 3;
+var err_bad_argument = 1002;
+var err_InvalidService_Argument = 1000;
+var err_ServiceNotReady = 1006;
+var err_ServiceNotSupported = 1004;
+
+function __device_debug(text){
+  //if(__device_debug_on__) alert(text);
+}
+
+function __device_handle_exception(e, text){
+	__device_debug(text);
+	throw(e);
+}
+
+function __device_typeof(value)
+{
+	// First check to see if the value is undefined.
+	if (value == undefined) {
+        return "undefined";
+    }
+	// Check for objects created with the "new" keyword.
+	if (value instanceof Object) {
+		// Check whether it's a string object.
+		if (value instanceof String) {
+			return "String";
+		}
+		// Check whether it's an array object/array literal.
+		else 
+			if (value instanceof Array) {
+				return "Array";
+			}
+	}
+	// dealing with a literal.
+		if (typeof value) {
+			if (typeof value == "object") {
+				if (typeof value == "object" && !value) {
+					return "null";
+				}
+			}
+           // if not null check for other types
+			
+				// Check if it's a string literal.
+			else if (typeof value == "string") {
+					return "string";
+				}
+		}	 
+}
+
+
+// The top-level service object. It would be nice to use a namespace here 
+// (com.nokia.device.service), but emulating namespaces still allows name clashes.
+/*
+var sp_device = {
+        //services: null; // TBD: Make the services list a member of this object?
+	load: __device_service_load,
+        listServices: __device_service_list,
+        listInterfaces: __device_service_interfaces,
+        version: "0.1",
+        info: "device prototype"
+};
+*/
+
+if(undefined == com)
+    var com={};
+
+if( typeof com != "object")
+    throw("com defined as non object");
+
+if(undefined == com.nokia)
+    com.nokia = {};
+
+if( typeof com.nokia != "object")
+    throw("com.nokia defined as non object");
+
+if(undefined == com.nokia.device)
+    com.nokia.device = {
+        load: __device_service_load,
+        listServices: __device_service_list,
+        listInterfaces: __device_service_interfaces,
+        version: "0.1",
+        info: "device prototype"
+        };
+else
+    throw("com.nokia.device already defined");
+
+com.nokia.device.SORT_ASCENDING = 0;
+com.nokia.device.SORT_DESCENDING = 1;
+
+com.nokia.device.SORT_BY_DATE = 0;
+com.nokia.device.SORT_BY_SENDER = 1;
+
+com.nokia.device.STATUS_READ = 0;
+com.nokia.device.STATUS_UNREAD = 1;
+
+
+// Configure the services offered.
+
+var __device_services_inited = false;
+
+var __device_services = [
+
+  // For now, the only service is the base "device"" service
+  {
+    "name":"com.nokia.device",
+    "version": 0.1, 
+    "interfaces": []
+  }
+];
+
+// Initialize the configured services.
+
+function __device_services_init(){
+  if(__device_services_inited){
+    return;
+  }
+  __device_services_inited = true;
+
+  // Get the service-specific service entries. Note that these
+  // need to be individually wrapped by try/catch blocks so that the
+  // interpreter gracefully handles missing services. 
+
+  try {
+    __device_services[0].interfaces.push(__device_geolocation_service_entry);
+  }catch (e){
+    __device_debug("Missing library implementation: " + e);
+  }
+  try {
+    __device_services[0].interfaces.push(__device_camera_service_entry);
+  }catch (e){
+    __device_debug("Missing library implementation: " + e);
+  }
+  try {
+    __device_services[0].interfaces.push(__device_media_service_entry);
+  }catch (e){
+//    __device_debug("Missing library implementation: " + e);
+  }
+  try {
+    __device_services[0].interfaces.push(__device_contacts_service_entry);
+  }catch (e){
+//    __device_debug("Missing library implementation: " + e);
+  }
+ try {
+    __device_services[0].interfaces.push(__device_messaging_service_entry);
+  }catch (e){
+      __device_debug("Missing library implementation: " + e);
+  }
+  try {
+    __device_services[0].interfaces.push(__device_calendar_service_entry);
+  }catch (e){
+      __device_debug("Missing library implementation: " + e);
+  }
+  try {
+    __device_services[0].interfaces.push(__device_landmarks_service_entry);
+  }catch (e){
+      __device_debug("Missing library implementation: " + e);
+  }
+  try {
+    __device_services[0].interfaces.push(__device_event_service_entry);
+  }catch (e){
+      __device_debug("Missing library implementation: " + e);
+  }
+  try {
+    __device_services[0].interfaces.push(__device_sysinfo_service_entry);
+  }catch (e){
+      __device_debug("Missing library implementation: " + e);
+  }
+  try {
+    __device_services[0].interfaces.push(__device_sensors_service_entry);
+  }catch (e){
+      __device_debug("Missing library implementation: " + e);
+  }
+
+}
+
+function __device_get_implementation(i){
+  //__device_debug("get_implementation: " + i);
+  return  new i.proto(new(i.providers[0].instance));
+}
+
+function __device_get_descriptor(i){
+  //__device_debug("get_descriptor: " + i);
+  return new i.descriptor(new(i.providers[0].descriptor));
+}
+
+function __device_get_interface(s, interfaceName, version){
+  //__device_debug("get_interface: " + s + " " + interfaceName);
+  var i = s.interfaces;
+  if((interfaceName == null) || (interfaceName == '')){
+    // Interface name not specified, get first interface, ignoring version
+    return __device_get_implementation(i[0]);
+  }
+
+  // Find first match of name and version
+  for (var d in i){
+  
+    if(i[d].name == null){
+      __device_update_descriptor(i[d]);
+    }
+    if(i[d].name == undefined){
+      continue;
+    }
+    if (i[d].name == interfaceName){
+      // Match version if specified
+      if ((version == null) || (version == '') || (i[d].version >= version)){
+	return __device_get_implementation(i[d]);
+      }
+    }
+  }
+  return null;
+}
+
+// Implemention of the load method
+
+function __device_service_load(serviceName, interfaceName, version){
+
+  __device_services_init();
+  
+  // Service name is specified
+   if ((serviceName != null) && (serviceName != '') &&(serviceName != "*")){
+    for(var s in __device_services){
+      if (serviceName == __device_services[s].name){
+	return __device_get_interface(__device_services[s], interfaceName, version);
+      }
+    }
+  // Service name not specified, get first implementation 
+  } else {
+    //__device_debug("Trying to get interface implementations: ");
+    for(var s in __device_services){
+      //__device_debug("service_load: " + s + ":" +  __device_services[s].name + ": " + interfaceName);
+      var i = __device_get_interface(__device_services[s], interfaceName, version);
+      if (i != null){
+	return i;
+      }
+    }
+  }
+  return null;
+}
+
+// Lazily fill in the descriptor table
+
+function __device_update_descriptor(i){
+  var d = __device_get_descriptor(i);
+  i.name = d.interfaceName;
+  i.version = d.version;  
+}
+// Get an array of interface descriptors for a service
+
+function __device_interface_list(s){
+  var retval = new Array();
+  for(var i in s.interfaces){
+    if(s.interfaces[i].name == null){
+      __device_update_descriptor(s.interfaces[i]);
+    }
+    if(s.interfaces[i].name == undefined){
+      continue;
+    }
+    retval[i] = new Object();
+    retval[i].name = s.interfaces[i].name;
+    retval[i].version = s.interfaces[i].version;
+  }  
+  return retval;
+}
+
+// Get a service description
+
+function __device_service_descriptor(s){
+  this.name = s.name;
+  this.version = s.version;
+  this.interfaces = __device_interface_list(s);
+  this.toString = __device_service_descriptor_to_string;
+}
+
+function __device_service_descriptor_to_string(){
+  var is = "\nInterfaces(s): ";
+
+  for (i in this.interfaces){
+    is += "\n" + this.interfaces[i].name + " " + this.interfaces[0].version;
+  }
+  return ("Service: " + this.name + is);
+}
+
+// Implement the listServices method 
+
+function __device_service_list(serviceName, interfaceName, version){
+  //__device_debug("__device_service_list: " + serviceName + " " + interfaceName);
+  __device_services_init();
+  var retval = new Array();
+  var n = 0;
+  
+  //Treat empty service and interface names as wildcards
+  if ((serviceName == null)|| (serviceName == '')/* || (serviceName == undefined)*/){
+    serviceName = ".*"; 
+  }
+  if ((interfaceName == null) || (interfaceName == '') /*|| (serviceName == undefined)*/){
+    interfaceName = ".*";
+  }
+ 
+  if ((typeof serviceName != "string") || (typeof interfaceName != "string")) {
+  	return retval;
+  }
+  
+  // This method does regular expression matching of service and interface
+
+  var sregx = new RegExp(serviceName);
+  var iregx = new RegExp(interfaceName);
+ 
+  for(var s in __device_services){
+   //__device_debug (serviceName + "==" + __device_services[s].name + "?:" + sregx.test(__device_services[s].name));
+    if (sregx.test(__device_services[s].name)){
+      // Find the first matching interface 
+        
+      for(var i in __device_services[s].interfaces){
+        if(__device_services[s].interfaces[i].name == null){
+          __device_update_descriptor(__device_services[s].interfaces[i]);
+	}
+        if(__device_services[s].interfaces[i].name == undefined){
+	  continue;
+	}
+	//__device_debug (interfaceName + "==" + __device_services[s].interfaces[i].name + "?:" + iregx.test(__device_services[s].interfaces[i].name));
+	if (iregx.test(__device_services[s].interfaces[i].name)){
+	  if ((version == null) || (version == '') || (__device_services[s].interfaces[i].version >= version)){
+            // An interface matched, we're done.
+            retval[n] = new __device_service_descriptor(__device_services[s]);
+            break; 
+	  }
+	}
+      }
+    }
+    ++n;
+  }
+  return retval;
+}
+
+// Implement the listInterfaces method
+    
+function __device_service_interfaces(serviceName){
+  __device_services_init();
+  if(serviceName==null||serviceName==undefined||serviceName==''){
+  	throw new DeviceError("Framework: listInterfaces: serviceName is missing", err_missing_argument);
+  }
+  for (var s in __device_services){
+    if(__device_services[s].name == serviceName){
+      return __device_interface_list(__device_services[s]);
+    }
+  }
+  return null;
+}
+
+function modifyObjectBaseProp(obj){
+  for (pro in obj) {
+    if(typeof obj[pro] == "function" )
+      obj[pro] = 0;
+    }
+};
+/*
+Copyright © 2009 Nokia. All rights reserved.
+Code licensed under the BSD License:
+Software License Agreement (BSD License) Copyright © 2009 Nokia.
+All rights reserved.
+Redistribution and use of this software in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+
+Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 
+Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 
+Neither the name of Nokia Corporation. nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission of Nokia Corporation. 
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+version: 1.0
+*/
+
+
+// S60 sp-based camera provider
+
+function __sp_camera_descriptor(){
+  //__device_debug("sp_camera_descriptor");
+  //Read-only properties
+  this.interfaceName = "com.nokia.device.camera";
+  this.version = "0.1";
+  //Class-static properties 
+}
+
+// TBD make local to closure funcs
+var __sp_camera_start_date;
+
+function __sp_camera_instance(){
+  //__device_debug("sp_camera_instance");
+  //Descriptor
+  this.descriptor = new __sp_camera_descriptor();
+  //Core methods
+  this.startCamera = __sp_startCamera;
+  this.stopViewfinder = __s60_api_not_supported;
+  //Extended methods
+  this.takePicture = __s60_api_not_supported;
+  //Private data
+}
+
+var CAMERA_APP_ID = 0x101f857a;
+
+//Apps should take care that this is not reinvoked
+//while the viewfinder is running. 
+
+function __sp_startCamera(camera_cb){
+
+	//If callback is null , then return missing argument error
+    if( camera_cb == null )
+        throw new DeviceError("Camera:startCamera:callback is missing", err_missing_argument);
+        
+	//If the callback is not a function, then return bad type error
+	if( typeof(camera_cb) != "function" )
+	    throw new DeviceError("Camera:startCamera:callback is a non-function", err_bad_argument);
+
+  var finished = function (){
+    var invoker = function (arg1, arg2, arg3){
+      //__device_debug("invoker with: " + camera_cb);
+      var it = arg3.ReturnValue;
+      var item;
+      var items = new Array();
+      while (( item = it.getNext()) != undefined){
+          var d = new Date(Date.parse(item.FileDate));
+          //__device_debug(item.FileName + " " + d );
+          // Items returned in reverse date order, so stop iterating before
+          // reaching initial date. (Should be able to do this more efficiently
+          // with sp filter, but that doesn't seem to work right now.)
+          if (d > __sp_camera_start_date) {
+              var pathname = item.FileNameAndPath.replace(/\\/g, "/");
+              var fileScheme = "file:///";
+              //Non-patched builds don't allow file scheme TBD: change this for patched builds
+              items.unshift(fileScheme + pathname);
+          }
+      }
+      var dummyTransID = 0;
+      var dummyStatusCode = 0;
+      camera_cb(dummyTransID, dummyStatusCode, items);
+    };
+
+    
+    //When camera returns, get the image(s) created
+    try {
+      var mso = device.getServiceObject("Service.MediaManagement", "IDataSource");
+    }
+    catch(e) {
+      __device_handle_exception (e, "media service not available : " + e);
+    }
+    
+    var criteria = new Object();
+	modifyObjectBaseProp(criteria);
+    criteria.Type = 'FileInfo';
+    criteria.Filter = new Object();
+	modifyObjectBaseProp(criteria.Filter);
+    criteria.Filter.FileType = 'Image';
+    //criteria.Filter.Key = 'FileDate';
+    //criteria.Filter.StartRange = null;
+    //criteria.Filter.EndRange = null;
+    criteria.Sort = new Object();
+	modifyObjectBaseProp(criteria.Sort);
+    criteria.Sort.Key = 'FileDate';
+    criteria.Sort.Order = 'Descending';
+    
+    try {
+      var rval = mso.IDataSource.GetList(criteria, invoker);
+    }
+    catch (e) {
+      __device_handle_exception (e, "media service GetList failed: " + e);
+    }
+  };
+
+  __sp_camera_start_date = new Date();
+  __s60_start_and_wait(CAMERA_APP_ID, "", finished);
+  var dummyTid = 0;
+  return dummyTid;
+}
+
+
+/*
+Copyright © 2009 Nokia. All rights reserved.
+Code licensed under the BSD License:
+Software License Agreement (BSD License) Copyright © 2009 Nokia.
+All rights reserved.
+Redistribution and use of this software in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+
+Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 
+Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 
+Neither the name of Nokia Corporation. nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission of Nokia Corporation. 
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+version: 1.0
+*/
+
+
+// Camera service interface
+
+var __device_camera_service_entry =  {"name": null, 
+					 "version": null,
+					 "proto": __device_camera,
+					 "descriptor": __device_camera_descriptor,
+					 "providers": [{"descriptor": __sp_camera_descriptor, "instance": __sp_camera_instance}]
+					};
+
+function __device_camera_descriptor(provider){
+  this.interfaceName = provider.interfaceName;
+  this.version = provider.version;
+}
+
+
+// Private camera  prototype: called from service factory
+function __device_camera(provider){
+  //Private properties
+  this.provider = provider;
+  //Read-only properties
+  this.interfaceName = provider.descriptor.interfaceName;
+  this.version = provider.descriptor.version;
+ // this.supportedMediaTypes = provider.supportedMediaTypes;
+ // this.supportedSizes = provider.supportedSizes;
+  //Core methods
+  this.startCamera = __device_camera_startCamera;
+  this.stopViewfinder = __device_camera_stopViewfinder;
+  //Extended methods
+  this.takePicture = __device_camera_takePicture;
+}
+
+
+//Why bother to define these methods? Because the camera
+//object defines the contract for providers!
+
+function __device_camera_startCamera(camera_cb){
+  return this.provider.startCamera(camera_cb);
+}
+
+function __device_camera_stopViewfinder(){
+  this.provider.stopViewfinder();
+}
+
+function __device_camera_takePicture(format){
+  this.provider.takePicture(format);
+}
+/**
+ * This class provides access to the device contacts.
+ * @constructor
+ */
+
+function Contacts() {
+	
+}
+
+function Contact() {
+	this.id = null;
+	this.name = { 
+		formatted: "",
+		givenName: "",
+		familyName: ""
+	};
+    this.phones = [];
+    this.emails = [];
+}
+
+Contact.prototype.displayName = function()
+{
+    // TODO: can be tuned according to prefs
+	return this.givenName + " " + this.familyName;
+};
+
+/*
+ * @param {ContactsFilter} filter Object with filter properties. filter.name only for now.
+ * @param {function} successCallback Callback function on success
+ * @param {function} errorCallback Callback function on failure
+ * @param {object} options Object with properties .page and .limit for paging
+ */
+
+Contacts.prototype.find = function(filter, successCallback, errorCallback, options) {
+	try {
+		
+		this.contactsService = device.getServiceObject("Service.Contact", "IDataSource");
+		this.options = options;
+		
+		var criteria = new Object();
+		criteria.Type = "Contact";
+		if (filter && filter.name)
+			criteria.Filter = { SearchVal: filter.name };
+		
+		if (typeof(successCallback) != 'function') 
+			successCallback = function(){};
+		if (typeof(errorCallback) != 'function') 
+			errorCallback = function(){};
+		if (typeof options == 'object'){
+			if (isNaN(this.options.limit))
+				this.options.limit = 200;
+			if (isNaN(this.options.page))
+				this.options.page = 1;
+		}
+		
+		//need a closure here to bind this method to this instance of the Contacts object
+		this.global_success = successCallback;
+		var obj = this;
+		
+		//WRT: result.ReturnValue is an iterator of contacts
+		this.contactsService.IDataSource.GetList(criteria, function(transId, eventCode, result){
+			obj.success_callback(result.ReturnValue);
+		});
+	} 
+	catch (ex) {
+		errorCallback(ex);
+	}
+};
+
+Contacts.prototype.success_callback = function(contacts_iterator) {
+	var gapContacts = new Array();
+	contacts_iterator.reset();
+    var contact;
+	var i = 0;
+	var end = this.options.page * this.options.limit;
+	var start = end - this.options.limit;
+	while ((contact = contacts_iterator.getNext()) != undefined && i < end) {
+		try {
+			if (i >= start) {
+				var gapContact = new Contact();
+				gapContact.name.givenName = Contacts.GetValue(contact, "FirstName");
+				gapContact.name.familyName = Contacts.GetValue(contact, "LastName");
+				gapContact.name.formatted = gapContact.firstName + " " + gapContact.lastName;
+				gapContact.emails = Contacts.getEmailsList(contact);
+				gapContact.phones = Contacts.getPhonesList(contact);
+				gapContact.address = Contacts.getAddress(contact);
+				gapContact.id = Contacts.GetValue(contact, "id");
+				gapContacts.push(gapContact);
+			}
+			i++;
+		} catch (e) {
+			alert("ContactsError (" + e.name + ": " + e.message + ")");
+		}
+	}
+	this.contacts = gapContacts;
+	this.global_success(gapContacts);
+};
+
+Contacts.getEmailsList = function(contact) {
+	var emails = new Array();
+	try {
+			emails[0] = { type:"General", address: Contacts.GetValue(contact, "EmailGen") };
+			emails[1] = { type:"Work", address: Contacts.GetValue(contact, "EmailWork") };		
+			emails[2] = { type:"Home", address: Contacts.GetValue(contact, "EmailHome") };
+	} catch (e) {
+		emails = [];
+	}
+	return emails;
+};
+
+Contacts.getPhonesList = function(contact) {
+	var phones = new Array();
+	try {
+			phones[0] = { type:"Mobile", number: Contacts.GetValue(contact, "MobilePhoneGen") };
+			phones[1] = { type:"Home", number: Contacts.GetValue(contact, "LandPhoneGen") };
+			phones[2] = { type:"Fax", number: Contacts.GetValue(contact, "FaxNumberGen") };
+			phones[3] = { type:"Work", number: Contacts.GetValue(contact, "LandPhoneWork") };
+			phones[4] = { type:"WorkMobile", number: Contacts.GetValue(contact, "MobilePhoneWork") };
+	} catch (e) {
+		phones = [];
+	}
+	return phones;
+};
+
+Contacts.getAddress = function(contact) {
+	var address = "";
+	try {
+		address = Contacts.GetValue(contact, "AddrLabelHome") + ", " + Contacts.GetValue(contact, "AddrStreetHome") + ", " +
+				Contacts.GetValue(contact, "AddrLocalHome") + ", " + Contacts.GetValue(contact, "AddrRegionHome") + ", " + 
+				Contacts.GetValue(contact, "AddrPostCodeHome") + ", " + Contacts.GetValue(contact, "AddrCountryHome");
+	} catch (e) {
+		address = "";
+	}
+	return address;
+};
+
+Contacts.GetValue = function(contactObj, key) {
+	try {
+		return contactObj[key]["Value"];
+	} catch (e) {
+		return "";
+	}
+};
+
+if (typeof navigator.contacts == "undefined") navigator.contacts = new Contacts();
+PhoneGap.ExtendWrtDeviceObj = function(){
+	
+	if (!window.device)
+		window.device = {};
+	navigator.device = window.device;
+
+	try {
+	
+		if (window.menu)
+	    	window.menu.hideSoftkeys();
+		
+		device.available = PhoneGap.available;
+		device.platform = null;
+		device.version = null;
+		device.name = null;
+		device.uuid = null;
+		
+		var so = device.getServiceObject("Service.SysInfo", "ISysInfo");
+		var pf = PhoneGap.GetWrtPlatformVersion(so);
+		device.platform = pf.platform;
+		device.version = pf.version;
+		device.uuid = PhoneGap.GetWrtDeviceProperty(so, "IMEI");
+		device.name = PhoneGap.GetWrtDeviceProperty(so, "PhoneModel");
+	} 
+	catch (e) {
+		device.available = false;
+	}
+};
+
+PhoneGap.GetWrtDeviceProperty = function(serviceObj, key) {
+	var criteria = { "Entity": "Device", "Key": key };
+	var result = serviceObj.ISysInfo.GetInfo(criteria);
+	if (result.ErrorCode == 0) {
+		return result.ReturnValue.StringData;
+	}
+	else {
+		return null;
+	}
+};
+
+PhoneGap.GetWrtPlatformVersion = function(serviceObj) {
+	var criteria = { "Entity": "Device", "Key": "PlatformVersion" };
+	var result = serviceObj.ISysInfo.GetInfo(criteria);
+	if (result.ErrorCode == 0) {
+		var version = {};
+		version.platform = result.ReturnValue.MajorVersion;
+		version.version = result.ReturnValue.MinorVersion;
+		return version;
+	}
+	else {
+		return null;
+	}
+};
+
+PhoneGap.ExtendWrtDeviceObj();/**
+ * This class provides access to device GPS data.
+ * @constructor
+ */
+function Geolocation() {
+    /**
+     * The last known GPS position.
+     */
+    this.lastPosition = null;
+    this.lastError = null;
+    this.callbacks = {
+        onLocationChanged: [],
+        onError:           []
+    };
+};
+
+/**
+ * Asynchronously aquires the current position.
+ * @param {Function} successCallback The function to call when the position
+ * data is available
+ * @param {Function} errorCallback The function to call when there is an error 
+ * getting the position data.
+ * @param {PositionOptions} options The options for getting the position data
+ * such as timeout.
+ */
+Geolocation.prototype.getCurrentPosition = function(successCallback, errorCallback, options) {
+    var referenceTime = 0;
+    if (this.lastPosition)
+        referenceTime = this.lastPosition.timestamp;
+    else
+        this.start(options);
+
+    var timeout = 20000;
+    var interval = 500;
+    if (typeof(options) == 'object' && options.interval)
+        interval = options.interval;
+
+    if (typeof(successCallback) != 'function')
+        successCallback = function() {};
+    if (typeof(errorCallback) != 'function')
+        errorCallback = function() {};
+
+    var dis = this;
+    var delay = 0;
+    var timer = setInterval(function() {
+        delay += interval;
+		//if we have a new position, call success and cancel the timer
+        if (dis.lastPosition && dis.lastPosition.timestamp > referenceTime) {
+            successCallback(dis.lastPosition);
+            clearInterval(timer);
+        } else if (delay >= timeout) { //else if timeout has occured then call error and cancel the timer
+            errorCallback();
+            clearInterval(timer);
+        }
+		//else the interval gets called again
+    }, interval);
+};
+
+/**
+ * Asynchronously aquires the position repeatedly at a given interval.
+ * @param {Function} successCallback The function to call each time the position
+ * data is available
+ * @param {Function} errorCallback The function to call when there is an error 
+ * getting the position data.
+ * @param {PositionOptions} options The options for getting the position data
+ * such as timeout and the frequency of the watch.
+ */
+Geolocation.prototype.watchPosition = function(successCallback, errorCallback, options) {
+	// Invoke the appropriate callback with a new Position object every time the implementation 
+	// determines that the position of the hosting device has changed. 
+	this.getCurrentPosition(successCallback, errorCallback, options);
+	var frequency = 10000;
+        if (typeof options == 'object' && options.frequency)
+            frequency = options.frequency;
+	var that = this;
+	return setInterval(function() {
+		that.getCurrentPosition(successCallback, errorCallback, options);
+	}, frequency);
+};
+
+
+/**
+ * Clears the specified position watch.
+ * @param {String} watchId The ID of the watch returned from #watchPosition.
+ */
+Geolocation.prototype.clearWatch = function(watchId) {
+	clearInterval(watchId);
+};
+
+Geolocation.prototype.start = function(options) {
+	var so = device.getServiceObject("Service.Location", "ILocation");
+	
+	//construct the criteria for our location request
+	var updateOptions = new Object();
+	// Specify that location information need not be guaranteed. This helps in
+	// that the widget doesn't need to wait for that information possibly indefinitely.
+	updateOptions.PartialUpdates = true;
+	
+	//default 15 seconds
+	if (typeof(options) == 'object' && options.timeout) 
+		//options.timeout in in ms, updateOptions.UpdateTimeout in microsecs
+		updateOptions.UpdateTimeOut = options.timeout * 1000;
+
+	//default 1 second
+	if (typeof(options) == 'object' && options.interval) 
+		//options.timeout in in ms, updateOptions.UpdateTimeout in microsecs
+		updateOptions.UpdateInterval = options.interval * 1000;
+	
+	// Initialize the criteria for the GetLocation call
+	var trackCriteria = new Object();
+	// could use "BasicLocationInformation" or "GenericLocationInfo"
+	trackCriteria.LocationInformationClass = "GenericLocationInfo";
+	trackCriteria.Updateoptions = updateOptions;
+	
+	var dis = this;
+	so.ILocation.Trace(trackCriteria, function(transId, eventCode, result) {
+		var retVal = result.ReturnValue;
+
+		if (result.ErrorCode != 0 || isNaN(retVal.Latitude))
+			return;
+		
+		// heading options: retVal.TrueCourse, retVal.MagneticHeading, retVal.Heading, retVal.MagneticCourse
+		// but retVal.Heading was the only field being returned with data on the test device (Nokia 5800)
+		// WRT does not provide accuracy
+		var newCoords = new Coordinates(retVal.Latitude, retVal.Longitude, retVal.Altitude, null, retVal.Heading, retVal.HorizontalSpeed);
+		var positionObj = { coords: newCoords, timestamp: (new Date()).getTime() };
+
+		dis.lastPosition = positionObj;
+	});
+	
+};
+
+
+if (typeof navigator.geolocation == "undefined") navigator.geolocation = new Geolocation();
+
+/**
+ * This class provides access to the device media, interfaces to both sound and video
+ * @constructor
+ */
+function Media(src, successCallback, errorCallback) {
+	this.src = src;
+	this.successCallback = successCallback;
+	this.errorCallback = errorCallback;												
+}
+
+Media.prototype.record = function() {
+};
+
+Media.prototype.play = function(src) {
+
+	if (document.getElementById('gapsound'))
+		document.body.removeChild(document.getElementById('gapsound'));
+	var obj;
+	obj = document.createElement("embed");
+	obj.setAttribute("id", "gapsound");
+	obj.setAttribute("type", "audio/x-mpeg");
+	obj.setAttribute("width", "0");
+	obj.setAttribute("width", "0");
+	obj.setAttribute("hidden", "true");
+	obj.setAttribute("autostart", "true");
+	obj.setAttribute("src", src);
+	document.body.appendChild(obj);
+};
+
+Media.prototype.pause = function() {
+};
+
+Media.prototype.stop = function() {
+};
+
+if (typeof navigator.media == "undefined") navigator.media = new Media();
+/**
+ * This class provides access to notifications on the device.
+ */
+function Notification() {
+	
+}
+
+Notification.prototype.vibrate = function(mills)
+{
+	
+	if (!Notification.getSysinfoObject())
+		Notification.embedSysinfoObject();
+	
+	this.sysinfo = Notification.getSysinfoObject();
+	this.sysinfo.startvibra(mills, 100);
+};
+
+//TODO: this is not beeping
+Notification.prototype.beep = function(count, volume)
+{
+	if (!Notification.getSysinfoObject())
+		Notification.embedSysinfoObject();
+	
+	this.sysinfo = Notification.getSysinfoObject();	
+	this.sysinfo.beep(220,2000);
+};
+
+
+/**
+ * Open a native alert dialog, with a customizable title and button text.
+ * @param {String} message Message to print in the body of the alert
+ * @param {String} [title="Alert"] Title of the alert dialog (default: Alert)
+ * @param {String} [buttonLabel="OK"] Label of the close button (default: OK)
+ */
+Notification.prototype.alert = function(message, title, buttonLabel) {
+    // Default is to use a browser alert; this will use "index.html" as the title though
+    alert(message);
+};
+
+/**
+ * Start spinning the activity indicator on the statusbar
+ */
+Notification.prototype.activityStart = function() {
+};
+
+/**
+ * Stop spinning the activity indicator on the statusbar, if it's currently spinning
+ */
+Notification.prototype.activityStop = function() {
+};
+
+/**
+ * Causes the device to blink a status LED.
+ * @param {Integer} count The number of blinks.
+ * @param {String} colour The colour of the light.
+ */
+Notification.prototype.blink = function(count, colour) {
+	
+};
+
+Notification.embedSysinfoObject = function() {
+	var el = document.createElement("embed");
+	el.setAttribute("type", "application/x-systeminfo-widget");
+	el.setAttribute("hidden", "yes");
+	document.getElementsByTagName("body")[0].appendChild(el);
+	return;
+};
+
+Notification.getSysinfoObject = function() {
+	return document.embeds[0];
+};
+
+if (typeof navigator.notification == "undefined") navigator.notification = new Notification();
+/**
+ * This class provides access to the device orientation.
+ * @constructor
+ */
+function Orientation() {
+	/**
+	 * The current orientation, or null if the orientation hasn't changed yet.
+	 */
+	this.currentOrientation = null;
+}
+
+/**
+ * Set the current orientation of the phone.  This is called from the device automatically.
+ * 
+ * When the orientation is changed, the DOMEvent \c orientationChanged is dispatched against
+ * the document element.  The event has the property \c orientation which can be used to retrieve
+ * the device's current orientation, in addition to the \c Orientation.currentOrientation class property.
+ *
+ * @param {Number} orientation The orientation to be set
+ */
+Orientation.prototype.setOrientation = function(orientation) {
+		if (orientation == this.currentOrientation) 
+			return;
+		var old = this.currentOrientation;
+
+		this.currentOrientation = orientation;
+		var e = document.createEvent('Events');
+		e.initEvent('orientationChanged', 'false', 'false');
+		e.orientation = orientation;
+		e.oldOrientation = old;
+		document.dispatchEvent(e);
+};
+
+/**
+ * Asynchronously aquires the current orientation.
+ * @param {Function} successCallback The function to call when the orientation
+ * is known.
+ * @param {Function} errorCallback The function to call when there is an error 
+ * getting the orientation.
+ */
+Orientation.prototype.getCurrentOrientation = function(successCallback, errorCallback) {
+	// If the orientation is available then call success
+	// If the orientation is not available then call error
+	try {
+		if (!this.serviceObj) 
+			this.serviceObj = this.getServiceObj();
+		
+		if (this.serviceObj == null) 
+			errorCallback({
+				name: "DeviceErr",
+				message: "Could not initialize service object"
+			});
+		
+		//get the sensor channel
+		var SensorParams = {
+			SearchCriterion: "Orientation"
+		};
+		var returnvalue = this.serviceObj.ISensor.FindSensorChannel(SensorParams);
+		
+		var error = returnvalue["ErrorCode"];
+		var errmsg = returnvalue["ErrorMessage"];
+		if (!(error == 0 || error == 1012)) {
+			var ex = {
+				name: "Unable to find Sensor Channel: " + error,
+				message: errmsg
+			};
+			errorCallback(ex);
+		}
+		var channelInfoMap = returnvalue["ReturnValue"][0];
+		var criteria = {
+			ChannelInfoMap: channelInfoMap,
+			ListeningType: "ChannelData"
+		};
+		
+		if (typeof(successCallback) != 'function') 
+			successCallback = function(){
+			};
+		if (typeof(errorCallback) != 'function') 
+			errorCallback = function(){
+			};
+		
+		this.success_callback = successCallback;
+		this.error_callback = errorCallback;
+		
+		//create a closure to persist this instance of orientation object into the RegisterForNofication callback
+		var obj = this;
+		
+		this.serviceObj.ISensor.RegisterForNotification(criteria, function(transId, eventCode, result){
+			alert(1);
+			var criteria = {
+				TransactionID: transId
+			};
+			try {
+				var orientation = result.ReturnValue.DeviceOrientation;
+				obj.serviceObj.ISensor.Cancel(criteria);
+				
+				obj.setOrientation(orientation);
+				
+				obj.success_callback(orientation);
+				
+			} 
+			catch (ex) {
+				obj.serviceObj.ISensor.Cancel(criteria);
+				obj.error_callback(ex);
+			}
+			
+		});
+	} catch (ex) {
+		errorCallback({ name: "OrientationError", message: ex.name + ": " + ex.message });
+	}
+};
+
+/**
+ * Asynchronously aquires the orientation repeatedly at a given interval.
+ * @param {Function} successCallback The function to call each time the orientation
+ * data is available.
+ * @param {Function} errorCallback The function to call when there is an error 
+ * getting the orientation data.
+ */
+Orientation.prototype.watchOrientation = function(successCallback, errorCallback, options) {
+	// Invoke the appropriate callback with a new Position object every time the implementation 
+	// determines that the position of the hosting device has changed. 
+	this.getCurrentOrientation(successCallback, errorCallback);
+	var frequency = (options != undefined)? options.frequency : 1000;
+	return setInterval(function() {
+		navigator.orientation.getCurrentOrientation(successCallback, errorCallback);
+	}, frequency);
+};
+
+/**
+ * Clears the specified orientation watch.
+ * @param {String} watchId The ID of the watch returned from #watchOrientation.
+ */
+Orientation.prototype.clearWatch = function(watchId) {
+	clearInterval(watchId);
+};
+
+//gets the Acceleration Service Object from WRT
+Orientation.prototype.getServiceObj = function() {
+	var so;
+	
+    try {
+        so = device.getServiceObject("Service.Sensor", "ISensor");
+    } catch (ex) {
+		throw {
+			name: "DeviceError",
+			message: ex.name + ": " + ex.message
+		};
+    }		
+	return so;
+};
+
+if (typeof navigator.orientation == "undefined") navigator.orientation = new Orientation();
+/**
+ * This class contains position information.
+ * @param {Object} lat
+ * @param {Object} lng
+ * @param {Object} acc
+ * @param {Object} alt
+ * @param {Object} altacc
+ * @param {Object} head
+ * @param {Object} vel
+ * @constructor
+ */
+function Position(coords, timestamp) {
+	this.coords = coords;
+        this.timestamp = new Date().getTime();
+}
+
+function Coordinates(lat, lng, alt, acc, head, vel) {
+	/**
+	 * The latitude of the position.
+	 */
+	this.latitude = lat;
+	/**
+	 * The longitude of the position,
+	 */
+	this.longitude = lng;
+	/**
+	 * The accuracy of the position.
+	 */
+	this.accuracy = acc;
+	/**
+	 * The altitude of the position.
+	 */
+	this.altitude = alt;
+	/**
+	 * The direction the device is moving at the position.
+	 */
+	this.heading = head;
+	/**
+	 * The velocity with which the device is moving at the position.
+	 */
+	this.speed = vel;
+}
+
+/**
+ * This class specifies the options for requesting position data.
+ * @constructor
+ */
+function PositionOptions() {
+	/**
+	 * Specifies the desired position accuracy.
+	 */
+	this.enableHighAccuracy = true;
+	/**
+	 * The timeout after which if position data cannot be obtained the errorCallback
+	 * is called.
+	 */
+	this.timeout = 10000;
+}
+
+/**
+ * This class contains information about any GSP errors.
+ * @constructor
+ */
+function PositionError() {
+	this.code = null;
+	this.message = "";
+}
+
+PositionError.UNKNOWN_ERROR = 0;
+PositionError.PERMISSION_DENIED = 1;
+PositionError.POSITION_UNAVAILABLE = 2;
+PositionError.TIMEOUT = 3;
+/**
+ * This class provides access to the device SMS functionality.
+ * @constructor
+ */
+function Sms() {
+
+}
+
+/**
+ * Sends an SMS message.
+ * @param {Integer} number The phone number to send the message to.
+ * @param {String} message The contents of the SMS message to send.
+ * @param {Function} successCallback The function to call when the SMS message is sent.
+ * @param {Function} errorCallback The function to call when there is an error sending the SMS message.
+ * @param {PositionOptions} options The options for accessing the GPS location such as timeout and accuracy.
+ */
+Sms.prototype.send = function(number, message, successCallback, errorCallback, options) {
+    try {
+		if (!this.serviceObj)
+			this.serviceObj = this.getServiceObj();
+			
+	    // Setup input params using dot syntax
+	    var criteria = new Object();
+	    criteria.MessageType = 'SMS';
+	    criteria.To = number;
+	    criteria.BodyText = message;
+
+      	var result = this.serviceObj.IMessaging.Send(criteria);
+    	if (result.ErrorCode != 0 && result.ErrorCode != "0")
+		{
+			var exception = { name: "SMSError", message: result.ErrorMessage };
+			throw exception;
+		} else {
+			successCallback.call();
+		}
+    }
+  	catch(ex)
+  	{
+		errorCallback.call({ name: "SmsError", message: ex.name + ": " + ex.message });
+  	}
+
+};
+
+
+//gets the Sms Service Object from WRT
+Sms.prototype.getServiceObj = function() {
+	var so;
+	
+    try {
+        so = device.getServiceObject("Service.Messaging", "IMessaging");
+    } catch (ex) {
+		throw {
+			name: "SmsError",
+			message: "Failed to load sms service (" + ex.name + ": " + ex.message + ")"
+		};
+    }		
+	return so;
+};
+
+if (typeof navigator.sms == "undefined") navigator.sms = new Sms();/**
+ * @author ryan
+ */
+
+function Storage() {
+	this.length = null;
+	this.available = true;
+	this.serialized = null;
+	this.items = null;
+	
+	if (!window.widget) {
+		this.available = false;
+		return;
+	}
+	var pref = window.widget.preferenceForKey(Storage.PREFERENCE_KEY);
+	
+	//storage not yet created
+	if (pref == "undefined" || pref == undefined) {
+		this.length = 0;
+		this.serialized = "({})";
+		this.items = {};
+		window.widget.setPreferenceForKey(this.serialized, Storage.PREFERENCE_KEY);
+	} else {
+		this.serialized = pref;'({"store_test": { "key": "store_test", "data": "asdfasdfs" },})';
+
+		this.items = eval(this.serialized);
+
+	}
+}
+
+Storage.PREFERENCE_KEY = "phonegap_storage_pref_key";
+
+Storage.prototype.index = function (key) {
+	
+};
+
+Storage.prototype.getItem = function (key) {
+	try {
+		return this.items[key].data;
+	} catch (ex) {
+		return null;
+	}
+};
+
+Storage.prototype.setItem = function (key, data) {
+	
+	if (!this.items[key])
+		this.length++;
+	this.items[key] = {
+		"key": key,
+		"data": data
+	};
+	
+	this.serialize();
+};
+
+Storage.prototype.removeItem = function (key) {
+	if (this.items[key]) {
+		this.items[key] = undefined;
+		this.length--;
+	}
+	this.serialize();
+};
+
+Storage.prototype.clear = function () {
+	this.length = 0;
+	this.serialized = "({})";
+	this.items = {};
+};
+
+Storage.prototype.serialize = function() {
+	var json = "";
+	
+	for (key in this.items) {
+		var item = this.items[key];
+		json += "\"" + item.key + "\": { \"key\": \"" + item.key + "\", \"data\": \"" + item.data + "\" }, ";
+	}
+
+	window.widget.setPreferenceForKey( "({" + json + "})", Storage.PREFERENCE_KEY);
+};
+
+if (typeof navigator.storage == "undefined" ) navigator.storage = new Storage();
Binary file org.symbian.tools.wrttools/libraries/wrtkit.zip has changed
--- a/org.symbian.tools.wrttools/plugin.xml	Mon Apr 19 17:52:52 2010 -0700
+++ b/org.symbian.tools.wrttools/plugin.xml	Mon Apr 19 18:04:34 2010 -0700
@@ -2,6 +2,7 @@
 <?eclipse version="3.4"?>
 <plugin>
    <extension-point id="projectTemplates" name="WRT Project Templates" schema="schema/projectTemplates.exsd"/>
+   <extension-point id="jsLibraries" name="JavaScript Libraries" schema="schema/jsLibraries.exsd"/>
 
 <!-- Generic Project Builder and Project Natures  -->		
  	
@@ -554,10 +555,6 @@
  <extension
        point="org.eclipse.wst.jsdt.core.JsGlobalScopeContainerInitializer">
     <JsGlobalScopeContainerInitializer
-       class="org.symbian.tools.wrttools.core.libraries.WrtKitLibInitializer"
-       id="org.symbian.wrtkit">
-    </JsGlobalScopeContainerInitializer>
-    <JsGlobalScopeContainerInitializer
        class="org.symbian.tools.wrttools.core.libraries.WrtLibInitializer"
        id="org.symbian.wrt">
     </JsGlobalScopeContainerInitializer>
@@ -565,11 +562,6 @@
  <extension
         point="org.eclipse.wst.jsdt.ui.JsGlobalScopeContainerPage">
     <JsGlobalScopeContainerPage
-            name="WRTKit"
-            class="org.symbian.tools.wrttools.wizards.WrtKitLibraryWizardPage"
-            id="org.symbian.wrtkit">
-    </JsGlobalScopeContainerPage>    
-    <JsGlobalScopeContainerPage
             name="WebRuntime Toolkit"
             class="org.symbian.tools.wrttools.wizards.WrtLibraryWizardPage"
             id="org.symbian.wrt">
@@ -652,6 +644,13 @@
           id="org.symbian.tools.wrttools.commands.package"
           name="Package Application">
     </command>
+    <command
+          categoryId="org.symbian.tools.wrttools.commands.maincategory"
+          defaultHandler="org.symbian.tools.wrttools.handlers.AddJSLibrary"
+          description="Adds JavaScript libraries to WRT projects"
+          id="org.symbian.tools.wrttools.addlibrary"
+          name="Add JavaScript Libraries...">
+    </command>
  </extension>
  <extension
        point="org.eclipse.ui.menus">
@@ -678,6 +677,15 @@
              visible="true">
        </separator>
        <command
+             commandId="org.symbian.tools.wrttools.addlibrary"
+             id="org.symbian.tools.wrttools.toolbars.addlibrary"
+             style="push">
+       </command>
+       <separator
+             name="org.symbian.tools.wrttools.deploypackage"
+             visible="true">
+       </separator>
+       <command
              commandId="org.symbian.tools.wrttools.commands.deploy"
              icon="icons/deploy_widget.gif"
              id="org.symbian.tools.wrttools.toolbars.deploy">
@@ -741,6 +749,35 @@
              visible="true">
        </separator>
     </menuContribution>
+    <menuContribution
+          locationURI="popup:org.eclipse.ui.popup.any?after=group.build">
+       <dynamic
+             class="org.symbian.tools.wrttools.core.libraries.AddLibraryPopupMenu$LibrariesPopupMenu"
+             id="org.symbian.tools.wrttools.addlibrary">
+          <visibleWhen>
+             <and>
+                <iterate
+                      ifEmpty="false"
+                      operator="and">
+                   <adapt
+                         type="org.eclipse.core.resources.IProject">
+                      <test
+                            property="org.eclipse.core.resources.projectNature"
+                            value="org.symbian.tools.wrttools.WidgetProjectNature">
+                      </test>
+                   </adapt>
+                </iterate>
+                <count
+                      value="1">
+                </count>
+             </and>
+          </visibleWhen>
+       </dynamic>
+       <separator
+             name="org.symbian.tools.wrttools.libs"
+             visible="true">
+       </separator>
+    </menuContribution>
  </extension>
  <extension
        point="org.eclipse.ui.handlers">
@@ -823,5 +860,20 @@
     <persistent
           value="true">
     </persistent>
+ </extension>
+ <extension
+       point="org.symbian.tools.wrttools.jsLibraries">
+    <library
+          icon="icons/main16_prev.gif"
+          id="org.symbian.wrtkit"
+          installer="org.symbian.tools.wrttools.core.libraries.WRTKitInstaller"
+          name="WRTKit">
+    </library>
+    <library
+          icon="icons/phonegap.png"
+          id="phonegap"
+          installer="org.symbian.tools.wrttools.core.libraries.PhoneGapInstaller"
+          name="PhoneGap">
+    </library>
  </extension>
 </plugin>
Binary file org.symbian.tools.wrttools/projecttemplates/WRTKit/Resources/CheckBox.png has changed
Binary file org.symbian.tools.wrttools/projecttemplates/WRTKit/Resources/ContentPanelFoldIcons.png has changed
Binary file org.symbian.tools.wrttools/projecttemplates/WRTKit/Resources/ControlAssemblyBackground.png has changed
Binary file org.symbian.tools.wrttools/projecttemplates/WRTKit/Resources/DocumentBackground.png has changed
Binary file org.symbian.tools.wrttools/projecttemplates/WRTKit/Resources/FormButtonCenter.png has changed
Binary file org.symbian.tools.wrttools/projecttemplates/WRTKit/Resources/FormButtonLeft.png has changed
Binary file org.symbian.tools.wrttools/projecttemplates/WRTKit/Resources/FormButtonRight.png has changed
Binary file org.symbian.tools.wrttools/projecttemplates/WRTKit/Resources/ListViewCaptionBackground.png has changed
Binary file org.symbian.tools.wrttools/projecttemplates/WRTKit/Resources/NotificationPopupBackground.png has changed
Binary file org.symbian.tools.wrttools/projecttemplates/WRTKit/Resources/NotificationPopupTypeIndicator.png has changed
Binary file org.symbian.tools.wrttools/projecttemplates/WRTKit/Resources/ProgressBar0.png has changed
Binary file org.symbian.tools.wrttools/projecttemplates/WRTKit/Resources/ProgressBar10.png has changed
Binary file org.symbian.tools.wrttools/projecttemplates/WRTKit/Resources/ProgressBar100.png has changed
Binary file org.symbian.tools.wrttools/projecttemplates/WRTKit/Resources/ProgressBar20.png has changed
Binary file org.symbian.tools.wrttools/projecttemplates/WRTKit/Resources/ProgressBar30.png has changed
Binary file org.symbian.tools.wrttools/projecttemplates/WRTKit/Resources/ProgressBar40.png has changed
Binary file org.symbian.tools.wrttools/projecttemplates/WRTKit/Resources/ProgressBar50.png has changed
Binary file org.symbian.tools.wrttools/projecttemplates/WRTKit/Resources/ProgressBar60.png has changed
Binary file org.symbian.tools.wrttools/projecttemplates/WRTKit/Resources/ProgressBar70.png has changed
Binary file org.symbian.tools.wrttools/projecttemplates/WRTKit/Resources/ProgressBar80.png has changed
Binary file org.symbian.tools.wrttools/projecttemplates/WRTKit/Resources/ProgressBar90.png has changed
Binary file org.symbian.tools.wrttools/projecttemplates/WRTKit/Resources/ProgressBarUnknown.gif has changed
Binary file org.symbian.tools.wrttools/projecttemplates/WRTKit/Resources/RadioButton.png has changed
Binary file org.symbian.tools.wrttools/projecttemplates/WRTKit/Resources/ScrollbarThumbBottom.png has changed
Binary file org.symbian.tools.wrttools/projecttemplates/WRTKit/Resources/ScrollbarThumbMiddle.png has changed
Binary file org.symbian.tools.wrttools/projecttemplates/WRTKit/Resources/ScrollbarThumbTop.png has changed
Binary file org.symbian.tools.wrttools/projecttemplates/WRTKit/Resources/ScrollbarTrackBottom.png has changed
Binary file org.symbian.tools.wrttools/projecttemplates/WRTKit/Resources/ScrollbarTrackMiddle.png has changed
Binary file org.symbian.tools.wrttools/projecttemplates/WRTKit/Resources/ScrollbarTrackTop.png has changed
Binary file org.symbian.tools.wrttools/projecttemplates/WRTKit/Resources/SeparatorCenter.png has changed
Binary file org.symbian.tools.wrttools/projecttemplates/WRTKit/Resources/SeparatorLeft.png has changed
Binary file org.symbian.tools.wrttools/projecttemplates/WRTKit/Resources/SeparatorRight.png has changed
--- a/org.symbian.tools.wrttools/projecttemplates/WRTKit/Resources/UI.css	Mon Apr 19 17:52:52 2010 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,924 +0,0 @@
-/**
- * Copyright (c) 2009-2010 Symbian Foundation and/or its subsidiary(-ies).
- * All rights reserved.
- * This component and the accompanying materials are made available
- * under the terms of the License "Eclipse Public License v1.0"
- * which accompanies this distribution, and is available
- * at the URL "http://www.eclipse.org/legal/epl-v10.html".
- *
- * Initial Contributors:
- * Symbian Foundation - initial contribution.
- * Contributors:
- */
-/*
-© Copyright 2008 Nokia Corporation. All rights reserved.
-
-IMPORTANT:  The Nokia software ("WRTKit and Example Widget files") is supplied to you by Nokia
-Corporation ("Nokia") in consideration of your agreement to the following terms. Your use, installation
-and/or redistribution of the WRTKit and Example Widget files constitutes acceptance of these terms. If
-you do not agree with these terms, please do not use, install, or redistribute the WRTKit and Example
-Widget files.
-
-In consideration of your agreement to abide by the following terms, and subject to these terms, Nokia
-grants you a personal, non-exclusive license, under Nokia's copyrights in the WRTKit and Example
-Widget files, to use, reproduce, and redistribute the WRTKit and Example files, in text form (for HTML,
-CSS, or JavaScript files) or binary form (for associated images), for the sole purpose of creating S60
-Widgets.
-
-If you redistribute the WRTKit and Example files, you must retain this entire notice in all such
-redistributions of the WRTKit and Example files.
-
-You may not use the name, trademarks, service marks or logos of Nokia to endorse or promote products
-that include the WRTKit and Example files without the prior written explicit agreement with Nokia.
-Except as expressly stated in this notice, no other rights or licenses, express or implied, are granted by
-Nokia herein, including but not limited to any patent rights that may be infringed by your products that
-incorporate the WRTKit and Example files or by other works in which the WRTKit and Example files
-may be incorporated.
-
-The WRTKit and Example files are provided on an "AS IS" basis.  NOKIA MAKES NO
-WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE IMPLIED
-WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A
-PARTICULAR PURPOSE, REGARDING THE EXAMPLES OR ITS USE AND OPERATION
-ALONE OR IN COMBINATION WITH YOUR PRODUCTS.
-
-IN NO EVENT SHALL NOKIA BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL OR
-CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-INTERRUPTION) ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION, AND/OR
-DISTRIBUTION OF THE EXAMPLES, HOWEVER CAUSED AND WHETHER UNDER THEORY
-OF CONTRACT, TORT (INCLUDING NEGLIGENCE), STRICT LIABILITY OR OTHERWISE,
-EVEN IF NOKIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-*/
-
-/******************************************************************************/
-/*        Definition of visuals for the WRTKit user interface toolkit         */
-/******************************************************************************/
-
-/******************************************************************************/
-/* Document body rules */
-
-body {
-    margin: 0px;
-    background: url("DocumentBackground.png") repeat-x fixed;
-    font: normal 12px Arial, sans-serif;
-    color: rgb(0,0,0);
-}
-
-
-/******************************************************************************/
-/* Override default WRT styling for HTML form controls */
-
-/* Textarea when focused */
-textarea:focus {
-    outline: none;
-}
-
-/* Textarea when hovering */
-textarea:hover {
-    outline: none;
-}
-
-/* Select elements when focused */
-select:focus {
-    outline: none;
-}
-
-/* Select elements when hovering */
-select:hover {
-    outline: none;
-}
-
-/* Input elements when focused */
-input:focus {
-    outline: none;
-}
-
-/* Input elements when hovering */
-input:hover {
-    outline: none;
-}
-
-/* Link elements */
-a {
-    text-decoration: none;
-    color: rgb(0,0,0);
-}
-
-/* Links when focused */
-a:focus {
-    background: none;
-    outline: none;
-}
-
-/* Links when hovering */
-a:hover {
-    background: none;
-    outline: none;
-}
-
-
-/******************************************************************************/
-/* Rules for default view and document scrollbar containers */
-
-/* Default view container rules */
-.ViewContainer {
-    margin: 0px 0px 0px 0px;
-}
-
-/* Default document scrollbar container rules */
-.DocumentScrollbarContainer {
-    position: fixed;
-    right: 0px;
-    top: 0px;
-    height: 100%;
-    width: 7px;
-}
-
-
-/******************************************************************************/
-/* View style rules */
-
-/* Rules for the list view */
-.ListView {
-    margin: 0px 0px 0px 0px;
-}
-
-/* Rules for the list view caption */
-.ListViewCaption {
-    background: url("ListViewCaptionBackground.png");
-    height: 35px;
-}
-
-/* Rules for the list view caption text */
-.ListViewCaptionText {
-    font-size: 18px;
-    font-weight: bold;
-    padding: 7px 0px 0px 11px;
-}
-
-/* Rules for the list view control list element */
-.ListViewControlList {
-    margin: 1px 10px 1px 3px;
-}
-
-
-/******************************************************************************/
-/* Control style rules */
-
-/* Rules for control root element (rootElement) */
-.Control {
-    
-}
-
-/* Control assembly rules (assemblyElement) */
-.ControlAssembly {
-    background: url("ControlAssemblyBackground.png") repeat-x;
-    padding: 1px 5px;
-}
-
-/* Control assembly in normal state */
-.ControlAssemblyNormal {
-    background-position: 0px 0px;
-}
-
-/* Control assembly in focused state */
-.ControlAssemblyFocus {
-    background-position: 0px -250px;
-}
-
-/* Control assembly in hovering state */
-.ControlAssemblyHover {
-    background-position: 0px -500px;
-}
-
-/* Control assembly in disabled state */
-.ControlAssemblyDisabled {
-    background-position: 0px 0px;
-}
-
-/* Caption for controls (captionElement) */
-.ControlCaption {
-    font-weight: bold;
-    padding: 3px 0px 0px 3px;
-}
-
-/* Caption for controls in normal state */
-.ControlCaptionNormal {
-    
-}
-
-/* Caption for controls when focused */
-.ControlCaptionFocus {
-    color: rgb(255,255,255);
-}
-
-/* Caption for controls when hovering */
-.ControlCaptionHover {
-    
-}
-
-/* Caption for controls when disabled */
-.ControlCaptionDisabled {
-    color: rgb(125,125,125);
-}
-
-/* Control element rules (controlElement) */
-.ControlElement {
-    padding: 3px 3px 3px 3px;
-}
-
-/******************************************************************************/
-/* Label */
-
-/* Rules for the text value of a Label control */
-.LabelText {
-    
-}
-
-
-/******************************************************************************/
-/* ContentPanel */
-
-/* Caption area rules for non-foldable content panels */
-.ContentPanelCaptionNonFoldable {
-    padding: 3px 0px 0px 3px;
-}
-
-/* Caption area rules for foldable content panels */
-.ContentPanelCaptionFoldable {
-    padding: 4px 0px 3px 3px;
-}
-
-/* Rules for fold toggling element in content panel */
-.ContentPanelFoldToggle {
-    background: url("ContentPanelFoldIcons.png") no-repeat;
-    padding-left: 16px;
-}
-
-/* Collapsed fold */
-.ContentPanelFoldToggleCollapsed {
-    background-position: 0px 0px;
-}
-
-/* Expanded fold */
-.ContentPanelFoldToggleExpanded {
-    background-position: 0px -50px;
-}
-
-/* Rules for the content panel caption text */
-.ContentPanelCaptionText {
-    font-weight: bold;
-}
-
-/* Caption text for content panel in normal state */
-.ContentPanelCaptionTextNormal {
-    
-}
-
-/* Caption text for content panel when focused */
-.ContentPanelCaptionTextFocus {
-    color: rgb(255,255,255);
-}
-
-/* Caption text for content panel when hovering */
-.ContentPanelCaptionTextHover {
-    
-}
-
-/* Caption text for content panel when disabled */
-.ContentPanelCaptionTextDisabled {
-    color: rgb(125,125,125);
-}
-
-/* Rules for content in the content panel */
-.ContentPanelContent {
-    padding: 2px 2px 2px 8px;
-}
-
-
-/******************************************************************************/
-/* FormButton */
-
-/* Rules for form button */
-.FormButton {
-    
-}
-
-/* Rules for form button control element */
-.FormButtonControlElement {
-    
-}
-
-/* Rules for form button table (table) */
-.FormButtonTable {
-    width: 100%;
-    border-spacing: 0px;
-    padding: 0px;
-    table-layout: fixed;
-}
-
-/* Form button row (tr) */
-.FormButtonRow {
-    padding: 0px;
-}
-
-/* Rules for form button left cell (td) */
-.FormButtonLeftCell {
-    width: 8px;
-    height: 26px;
-    background: url("FormButtonLeft.png") no-repeat;
-    padding: 0px;
-}
-
-/* Rules for form button center cell (td) */
-.FormButtonCenterCell {
-    height: 26px;
-    background: url("FormButtonCenter.png") repeat-x;
-    padding: 0px;
-    vertical-align: middle;
-    text-align: center;
-}
-
-/* Rules for form button right cell (td) */
-.FormButtonRightCell {
-    width: 8px;
-    height: 26px;
-    background: url("FormButtonRight.png") no-repeat;
-    padding: 0px;
-}
-
-/* Rules for form button left cell in normal state (td) */
-.FormButtonLeftCellNormal {
-    background-position: 0px 0px;
-}
-
-/* Rules for form button left cell in focused state (td) */
-.FormButtonLeftCellFocus {
-    background-position: 0px -50px;
-}
-
-/* Rules for form button left cell in hover state (td) */
-.FormButtonLeftCellHover {
-    background-position: 0px -100px;
-}
-
-/* Rules for form button left cell in disabled state (td) */
-.FormButtonLeftCellDisabled {
-    background-position: 0px -150px;
-}
-
-/* Rules for form button center cell in normal state (td) */
-.FormButtonCenterCellNormal {
-    background-position: 0px 0px;
-}
-
-/* Rules for form button center cell in focused state (td) */
-.FormButtonCenterCellFocus {
-    background-position: 0px -50px;
-}
-
-/* Rules for form button center cell in hover state (td) */
-.FormButtonCenterCellHover {
-    background-position: 0px -100px;
-}
-
-/* Rules for form button center cell in disabled state (td) */
-.FormButtonCenterCellDisabled {
-    background-position: 0px -150px;
-}
-
-/* Rules for form button left cell in normal state (td) */
-.FormButtonRightCellNormal {
-    background-position: 0px 0px;
-}
-
-/* Rules for form button left cell in focused state (td) */
-.FormButtonRightCellFocus {
-    background-position: 0px -50px;
-}
-
-/* Rules for form button left cell in hover state (td) */
-.FormButtonRightCellHover {
-    background-position: 0px -100px;
-}
-
-/* Rules for form button left cell in disabled state (td) */
-.FormButtonRightCellDisabled {
-    background-position: 0px -150px;
-}
-
-/* Rules for form button text */
-.FormButtonText {
-    font-weight: bold;
-}
-
-/* Form button text in normal state */
-.FormButtonTextNormal {
-    color: rgb(255,255,255);
-}
-
-/* Form button text when focused */
-.FormButtonTextFocus {
-    color: rgb(255,255,255);
-}
-
-/* Form button text when hovering */
-.FormButtonTextHover {
-    color: rgb(255,255,255);
-}
-
-/* Form button text when disabled */
-.FormButtonTextDisabled {
-    color: rgb(200,200,200);
-}
-
-
-/******************************************************************************/
-/* NavigationButton */
-
-/* Rules for navigation button */
-.NavigationButton {
-    
-}
-
-/* Rules for navigation button control element */
-.NavigationButtonControlElement {
-    padding: 3px 3px 3px 3px;
-}
-
-/* Rules for navigation button table (table) */
-.NavigationButtonTable {
-    border-spacing: 0px;
-    padding: 0px;
-}
-
-/* Navigation button row (tr) */
-.NavigationButtonRow {
-    padding: 0px;
-}
-
-/* Rules for navigation button image cell (td) */
-.NavigationButtonImageCell {
-    line-height: 1px;
-    font-size: 1px;
-    vertical-align: middle;
-}
-
-/* Rules for navigation button text cell (td) */
-.NavigationButtonTextCell {
-    vertical-align: middle;
-    padding: 0px;
-}
-
-/* Rules for navigation button image */
-.NavigationButtonImage {
-    padding: 0px 5px 0px 0px;
-}
-
-/* Rules for navigation button text */
-.NavigationButtonText {
-    font-weight: bold;
-}
-
-/* Navigation button text in normal state */
-.NavigationButtonTextNormal {
-    
-}
-
-/* Navigation button text when focused */
-.NavigationButtonTextFocus {
-    color: rgb(255,255,255);
-}
-
-/* Navigation button text when hovering */
-.NavigationButtonTextHover {
-    
-}
-
-/* Navigation button text when disabled */
-.NavigationButtonTextDisabled {
-    color: rgb(125,125,125);
-}
-
-
-/******************************************************************************/
-/* TextField */
-
-/* Rules for textField */
-.TextField {
-    width: 100%;
-    border: 1px solid rgb(0,0,0);
-    background: rgb(255,255,255);
-    margin: 0px 0px 3px 0px;
-}
-
-/* TextField in normal state */
-.TextFieldNormal {
-    
-}
-
-/* TextField in focus state */
-.TextFieldFocus {
-    
-}
-
-/* TextField in hover state */
-.TextFieldHover {
-    
-}
-
-/* TextField in disabled state */
-.TextFieldDisabled {
-    color: rgb(50,50,50);
-    background: rgb(200,200,200);
-}
-
-
-/******************************************************************************/
-/* TextArea */
-
-/* Rules for TextArea */
-.TextArea {
-    width: 100%;
-    border: 1px solid rgb(0,0,0);
-    background: rgb(255,255,255);
-    margin: 0px 0px 3px 0px;
-}
-
-/* TextArea in normal state */
-.TextAreaNormal {
-    
-}
-
-/* TextArea in focus state */
-.TextAreaFocus {
-    
-}
-
-/* TextArea in hover state */
-.TextAreaHover {
-    
-}
-
-/* TextArea in disabled state */
-.TextAreaDisabled {
-    color: rgb(50,50,50);
-    background: rgb(200,200,200);
-}
-
-
-/******************************************************************************/
-/* Separator */
-
-/* Rules for Separator (table) */
-.Separator {
-    width: 100%;
-    padding: 0px;
-    border-spacing: 0px;
-    table-layout: fixed;
-    margin: 3px 0px;
-}
-
-/* Separator row (tr) */
-.SeparatorRow {
-    padding: 0px;
-}
-
-/* Separator left cell (td) */
-.SeparatorLeftCell {
-    width: 5px;
-    height: 2px;
-    background: url("SeparatorLeft.png") no-repeat;
-    padding: 0px;
-}
-
-/* Separator center cell (td) */
-.SeparatorCenterCell {
-    height: 2px;
-    background: url("SeparatorCenter.png") repeat-x;
-    padding: 0px;
-}
-
-/* Separator right cell (td) */
-.SeparatorRightCell {
-    width: 6px;
-    height: 2px;
-    background: url("SeparatorRight.png") no-repeat;
-    padding: 0px;
-}
-
-
-/******************************************************************************/
-/* SelectionMenu */
-
-/* Rules for SelectionMenu select element */
-.SelectionMenu {
-    width: 100%;
-    border: 1px solid rgb(0,0,0);
-    background: rgb(255,255,255);
-    margin: 0px 0px 3px 0px;
-}
-
-/* SelectionMenu in normal state */
-.SelectionMenuNormal {
-    
-}
-
-/* SelectionMenu in focus state */
-.SelectionMenuFocus {
-    
-}
-
-/* SelectionMenu in hover state */
-.SelectionMenuHover {
-    
-}
-
-/* SelectionMenu in disabled state */
-.SelectionMenuDisabled {
-    color: rgb(50,50,50);
-    background: rgb(200,200,200);
-}
-
-/* Rules for SelectionMenu option elements */
-.SelectionMenuOption {
-    background: rgb(255,255,255);
-}
-
-/* SelectionMenu option in normal state */
-.SelectionMenuOptionNormal {
-    
-}
-
-/* SelectionMenu option in focus state */
-.SelectionMenuOptionFocus {
-    
-}
-
-/* SelectionMenu option in hover state */
-.SelectionMenuOptionHover {
-    
-}
-
-/* SelectionMenu option in disabled state */
-.SelectionMenuOptionDisabled {
-    color: rgb(50,50,50);
-    background: rgb(200,200,200);
-}
-
-
-/******************************************************************************/
-/* SelectionList */
-
-/* SelectionList option list element */
-.SelectionList {
-    
-}
-
-/* SelectionList option list element in normal state */
-.SelectionListNormal {
-    
-}
-
-/* SelectionList option list element in focus state */
-.SelectionListFocus {
-    
-}
-
-/* SelectionList option list element in hover state */
-.SelectionListHover {
-    
-}
-
-/* SelectionList option list element in disabled state */
-.SelectionListDisabled {
-    
-}
-
-/* SelectionList option element in single selection mode */
-.SelectionListOptionSingle {
-    padding-left: 19px;
-    background: url("RadioButton.png") no-repeat;
-    height: 16px;
-}
-
-/* SelectionList option element in single selection mode, unchecked normal state */
-.SelectionListOptionSingleUncheckedNormal {
-    background-position: 0px 0px;
-}
-
-/* SelectionList option element in single selection mode, unchecked focus state */
-.SelectionListOptionSingleUncheckedFocus {
-    background-position: 0px -50px;
-}
-
-/* SelectionList option element in single selection mode, unchecked diabled state */
-.SelectionListOptionSingleUncheckedDisabled {
-    background-position: 0px -100px;
-}
-
-/* SelectionList option element in single selection mode, checked normal state */
-.SelectionListOptionSingleCheckedNormal {
-    background-position: 0px -150px;
-}
-
-/* SelectionList option element in single selection mode, checked focus state */
-.SelectionListOptionSingleCheckedFocus {
-    background-position: 0px -200px;
-}
-
-/* SelectionList option element in single selection mode, checked diabled state */
-.SelectionListOptionSingleCheckedDisabled {
-    background-position: 0px -250px;
-}
-
-/* SelectionList option element in multi selection mode */
-.SelectionListOptionMulti {
-    padding-left: 19px;
-    background: url("CheckBox.png") no-repeat;
-    height: 16px;
-}
-
-/* SelectionList option element in multi selection mode, unchecked normal state */
-.SelectionListOptionMultiUncheckedNormal {
-    background-position: 0px 0px;
-}
-
-/* SelectionList option element in multi selection mode, unchecked focus state */
-.SelectionListOptionMultiUncheckedFocus {
-    background-position: 0px -50px;
-}
-
-/* SelectionList option element in multi selection mode, unchecked diabled state */
-.SelectionListOptionMultiUncheckedDisabled {
-    background-position: 0px -100px;
-}
-
-/* SelectionList option element in multi selection mode, checked normal state */
-.SelectionListOptionMultiCheckedNormal {
-    background-position: 0px -150px;
-}
-
-/* SelectionList option element in multi selection mode, checked focus state */
-.SelectionListOptionMultiCheckedFocus {
-    background-position: 0px -200px;
-}
-
-/* SelectionList option element in multi selection mode, checked diabled state */
-.SelectionListOptionMultiCheckedDisabled {
-    background-position: 0px -250px;
-}
-
-/* SelectionList option text */
-.SelectionListOptionText {
-    
-}
-
-/* SelectionList option text in normal state */
-.SelectionListOptionTextNormal {
-    
-}
-
-/* SelectionList option text in focus state */
-.SelectionListOptionTextFocus {
-    color: rgb(255,255,255);
-}
-
-/* SelectionList option text in hover state */
-.SelectionListOptionTextHover {
-    
-}
-
-/* SelectionList option text in disabled state */
-.SelectionListOptionTextDisabled {
-    color: rgb(125,125,125);
-}
-
-
-/******************************************************************************/
-/* Scrollbar */
-
-/* Scrollbar root element */
-.Scrollbar {
-    position: absolute;
-    height: 100%;
-    width: 7px;
-}
-
-/* Top portion of scrollbar track */
-.ScrollbarTrackTop {
-    position: absolute;
-    background: url("ScrollbarTrackTop.png") no-repeat;
-    width: 7px;
-    height: 4px;
-}
-
-/* Middle portion of scrollbar track */
-.ScrollbarTrackMiddle {
-    position: absolute;
-    background: url("ScrollbarTrackMiddle.png") repeat-y;
-    width: 7px;
-}
-
-/* Bottom portion of scrollbar track */
-.ScrollbarTrackBottom {
-    position: absolute;
-    background: url("ScrollbarTrackBottom.png") no-repeat;
-    width: 7px;
-    height: 4px;
-}
-
-/* Top portion of scrollbar thumb */
-.ScrollbarThumbTop {
-    position: absolute;
-    background: url("ScrollbarThumbTop.png") no-repeat;
-    width: 7px;
-    height: 5px;
-}
-
-/* Middle portion of scrollbar thumb */
-.ScrollbarThumbMiddle {
-    position: absolute;
-    background: url("ScrollbarThumbMiddle.png") repeat-y;
-    width: 7px;
-}
-
-/* Bottom portion of scrollbar thumb */
-.ScrollbarThumbBottom {
-    position: absolute;
-    background: url("ScrollbarThumbBottom.png") no-repeat;
-    width: 7px;
-    height: 5px;
-}
-
-
-/******************************************************************************/
-/* NotificationPopup */
-
-/* Container that defines the area for the popup dialog */
-.NotificationPopupContainer {
-    position: fixed;
-    bottom: 0px;
-    left: 50%;
-    margin-left: -115px;
-    width: 230px;
-    height: 85px;
-}
-
-/* Notification popup dialog */
-.NotificationPopup {
-    position: absolute;
-    width: 230px;
-    height: 85px;
-    background: url("NotificationPopupBackground.png") repeat-x;
-    border: 1px solid rgb(0,0,0);
-}
-
-/* Notification type indicator */
-.NotificationPopupTypeIndicator {
-    position: absolute;
-    left: 195px;
-    top: 10px;
-    width: 24px;
-    height: 34px;
-    background: url("NotificationPopupTypeIndicator.png") no-repeat;
-}
-
-/* Notification type indicator for notifications of undefined type */
-.NotificationPopupTypeIndicatorNone {
-    background-position: 0px 0px;
-}
-
-/* Notification type indicator for info notifications */
-.NotificationPopupTypeIndicatorInfo {
-    background-position: 0px -50px;
-}
-
-/* Notification type indicator for warning notifications */
-.NotificationPopupTypeIndicatorWarning {
-    background-position: 0px -100px;
-}
-
-/* Notification type indicator for wait notifications */
-.NotificationPopupTypeIndicatorWait {
-    background-position: 0px -150px;
-}
-
-/* Notification text area */
-.NotificationPopupText {
-    position: absolute;
-    left: 10px;
-    top: 8px;
-    width: 180px;
-    height: 50px;
-}
-
-/* Progress bar */
-.NotificationPopupProgressBar {
-    position: absolute;
-    left: 6px;
-    top: 60px;
-    width: 218px;
-    height: 16px;
-}
--- a/org.symbian.tools.wrttools/projecttemplates/WRTKit/UI/ActionControl.js	Mon Apr 19 17:52:52 2010 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,120 +0,0 @@
-/**
- * Copyright (c) 2009-2010 Symbian Foundation and/or its subsidiary(-ies).
- * All rights reserved.
- * This component and the accompanying materials are made available
- * under the terms of the License "Eclipse Public License v1.0"
- * which accompanies this distribution, and is available
- * at the URL "http://www.eclipse.org/legal/epl-v10.html".
- *
- * Initial Contributors:
- * Nokia Corporation - initial contribution.
- * 
- * Contributors:
- * 
- * Description:
- * 
- */
-
-///////////////////////////////////////////////////////////////////////////////
-// The ActionControl class is an abstract base class for action controls like
-// buttons. Don't use ActionControl directly.
-
-// Constructor.
-function ActionControl(id, caption) {
-    if (id != UI_NO_INIT_ID) {
-        this.init(id, caption);
-    }
-}
-
-// ActionControl inherits from Control.
-ActionControl.prototype = new Control(UI_NO_INIT_ID);
-
-// Reference to the button element.
-ActionControl.prototype.buttonElement = null;
-
-// Reference to the link element.
-ActionControl.prototype.linkElement = null;
-
-// Enabled status.
-ActionControl.prototype.enabled = false;
-
-// Initializer - called from constructor.
-ActionControl.prototype.init = function(id, caption) {
-    uiLogger.debug("ActionControl.init(" + id + ", " + caption + ")");
-    
-    // call superclass initializer
-    Control.prototype.init.call(this, id, caption);
-    
-    // the control defaults to enabled
-    this.enabled = true;
-};
-
-// Common event listeners hookup function called from subclasses.
-ActionControl.prototype.bindActionControlListeners = function() {
-    var self = this;
-    this.linkElement.addEventListener("focus", function() { self.focusStateChanged(true); }, false);
-    this.linkElement.addEventListener("blur", function() { self.focusStateChanged(false); }, false);
-    this.buttonElement.addEventListener("mouseover", function() { self.hoverStateChanged(true); }, false);
-    this.buttonElement.addEventListener("mouseout", function() { self.hoverStateChanged(false); }, false);
-    this.buttonElement.addEventListener("mousedown", function(event) {
-                                                       self.controlClicked(event);
-                                                       event.stopPropagation();
-                                                       event.preventDefault();
-                                                   }, true);
-    this.buttonElement.addEventListener("keydown", function(event) {
-                                                    // center and enter trigger the action
-                                                    if (event.keyCode == 0 || event.keyCode == 13) {
-                                                        self.controlClicked();
-                                                        event.stopPropagation();
-                                                        event.preventDefault();
-                                                    }
-                                                 }, true);
-};
-
-// Returns the enabled state.
-ActionControl.prototype.isEnabled = function() {
-    return this.enabled;
-};
-
-// Sets the enabled state.
-ActionControl.prototype.setEnabled = function(enabled) {
-    uiLogger.debug("ActionControl.setEnabled(" + enabled + ")");
-    // switch the state
-    this.enabled = enabled;
-};
-
-// Sets the focused state for the control.
-// Note: This may not always succeed.
-ActionControl.prototype.setFocused = function(focused) {
-    uiLogger.debug("ActionControl.setFocused(" + focused + ")");
-    if (this.enabled) {
-        if (focused) {
-            this.linkElement.focus();
-        } else {
-            this.linkElement.blur();
-        }
-    }
-};
-
-// Callback for clicks.
-ActionControl.prototype.controlClicked = function(event) {
-    uiLogger.debug("ActionControl.controlClicked()");
-    
-    // if we're enabled then a click results in an action performed event
-    if (this.enabled) {
-        // focus when clicked
-        if (!this.focused) {
-            this.linkElement.focus();
-        }
-        
-        // notify event listeners
-        this.actionPerformed(event);
-    }
-};
-
-// Callback for action performed events.
-ActionControl.prototype.actionPerformed = function(event) {
-    uiLogger.debug("ActionControl.actionPerformed()");
-    // notify event listeners
-    this.fireEvent(this.createEvent("ActionPerformed", event));
-};
--- a/org.symbian.tools.wrttools/projecttemplates/WRTKit/UI/Ajax.js	Mon Apr 19 17:52:52 2010 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,79 +0,0 @@
-/**
- * Copyright (c) 2009-2010 Symbian Foundation and/or its subsidiary(-ies).
- * All rights reserved.
- * This component and the accompanying materials are made available
- * under the terms of the License "Eclipse Public License v1.0"
- * which accompanies this distribution, and is available
- * at the URL "http://www.eclipse.org/legal/epl-v10.html".
- *
- * Initial Contributors:
- * Nokia Corporation - initial contribution.
- * 
- * Contributors:
- * 
- * Description:
- * 
- */
-
-///////////////////////////////////////////////////////////////////////////////
-// Ajax utility calss to create XmlHttpRequest object
-function Ajax() 
-{
-	//	xmlHttpRequest object	
-	var request = null;
-
-    // branch for native XMLHttpRequest object
-    if(window.XMLHttpRequest && !(window.ActiveXObject)) {
-    	try 
-		{
-			request = new XMLHttpRequest();
-			try
-			{
-				//	attach the Bypass code, if the browser is firefox
-				if(netscape.security.PrivilegeManager.enablePrivilege)
-				{
-					//	duplicate the function
-					request._open = request.open;
-					
-					//	redefine the function definition
-					request.open = function(method, url, flag)
-					{
-						try
-						{
-							// Enable Universal Browser Read
-							netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserRead");
-
-							//	call the native XmlHttpRequest.open method
-							this._open(method, url, flag);
-						}catch(e)
-						{
-							//	call the native XmlHttpRequest.open method
-							this._open(method, url, flag);
-						}
-					};
-				}
-			}
-			catch(e)
-			{
-				//	eatup all exceptions
-			}
-		} 
-		catch(e) {
-			request = null;
-        }
-    // branch for IE/Windows ActiveX version
-    } else if(window.ActiveXObject) {
-       	try {
-        	request = new ActiveXObject("Msxml2.XMLHTTP");
-      	} catch(e) {
-        	try {
-          		request = new ActiveXObject("Microsoft.XMLHTTP");
-        	} catch(e) {
-          		alert('Failed to create XmlHttprequest');
-				return null;
-        	}
-		}
-    }
-	
-	return (request);
-}
--- a/org.symbian.tools.wrttools/projecttemplates/WRTKit/UI/ContentPanel.js	Mon Apr 19 17:52:52 2010 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,343 +0,0 @@
-/**
- * Copyright (c) 2009-2010 Symbian Foundation and/or its subsidiary(-ies).
- * All rights reserved.
- * This component and the accompanying materials are made available
- * under the terms of the License "Eclipse Public License v1.0"
- * which accompanies this distribution, and is available
- * at the URL "http://www.eclipse.org/legal/epl-v10.html".
- *
- * Initial Contributors:
- * Nokia Corporation - initial contribution.
- * 
- * Contributors:
- * 
- * Description:
- * 
- */
-
-///////////////////////////////////////////////////////////////////////////////
-// The ContentPanel class is a control for displaying content. The panel
-// can be expanded and collapsed.
-
-// Constructor.
-function ContentPanel(id, caption, content, foldable, expanded) {
-    if (id != UI_NO_INIT_ID) {
-        this.init(id, caption, content, foldable, expanded);
-    }
-}
-
-// ContentPanel inherits from Control.
-ContentPanel.prototype = new Control(UI_NO_INIT_ID);
-
-// The element hierarchy in a content panel is as follows:
-//
-// rootElement
-//     assemblyElement
-//         captionElement
-//             foldToggleElement
-//                 captionLinkElement
-//                     captionTextElement
-//     contentElement
-//
-// captionTextElement is moved under foldToggleElement if disabled
-// or captionElement if not foldable
-
-// The fold toggle element used for folding content panels.
-ContentPanel.prototype.foldToggleElement = null;
-
-// The caption link element of this control.
-ContentPanel.prototype.captionLinkElement = null;
-
-// The caption text element of this control.
-ContentPanel.prototype.captionTextElement = null;
-
-// The content element of this control.
-ContentPanel.prototype.contentElement = null;
-
-// The foldable state of this control.
-ContentPanel.prototype.foldable = false;
-
-// The expanded state of this control.
-ContentPanel.prototype.expanded = false;
-
-// Enabled status.
-ContentPanel.prototype.enabled = false;
-
-// Initializer - called from constructor.
-ContentPanel.prototype.init = function(id, caption, content, foldable, expanded) {
-    uiLogger.debug("ContentPanel.init(" + id + ", " + caption + ", " + content + ", " + foldable + ", " + expanded + ")");
-    
-    // call superclass initializer
-    Control.prototype.init.call(this, id, caption);
-    
-    // the control defaults to enabled
-    this.enabled = true;
-    
-    // create caption text element
-    this.captionTextElement = document.createElement("span");
-    
-    // disconnect the control element
-    this.assemblyElement.removeChild(this.controlElement);
-    
-    // set the foldable state
-    this.foldable = foldable;
-    
-    // is this a foldable content panel?
-    if (foldable) {
-        // create fold toggle element
-        this.foldToggleElement = document.createElement("div");
-        this.captionElement.appendChild(this.foldToggleElement);
-        
-        // create caption link and add to caption element
-        this.captionLinkElement = document.createElement("a");
-        this.captionLinkElement.href = "JavaScript:void(0)";
-        this.foldToggleElement.appendChild(this.captionLinkElement);
-        
-        // add the text element to the link element
-        this.captionLinkElement.appendChild(this.captionTextElement);
-        
-        // bind event listeners
-        var self = this;
-        this.captionLinkElement.addEventListener("focus", function() { self.focusStateChanged(true); }, false);
-        this.captionLinkElement.addEventListener("blur", function() { self.focusStateChanged(false); }, false);
-        this.foldToggleElement.addEventListener("mouseover", function() { self.hoverStateChanged(true); }, false);
-        this.foldToggleElement.addEventListener("mouseout", function() { self.hoverStateChanged(false); }, false);
-        this.foldToggleElement.addEventListener("mousedown", function(event) {
-                                                                 self.captionClicked();
-                                                                 event.stopPropagation();
-                                                                 event.preventDefault();
-                                                             }, true);
-        this.foldToggleElement.addEventListener("keydown", function(event) {
-                                                               // center and enter trigger the action
-                                                               if (event.keyCode == 0 || event.keyCode == 13) {
-                                                                   self.captionClicked();
-                                                                   event.stopPropagation();
-                                                                   event.preventDefault();
-                                                               }
-                                                           }, true);
-        
-        this.expanded = expanded;
-    } else {
-        // since this is not a foldable panel the content should be expanded
-        this.expanded = true;
-        
-        // add the text element directly to the caption element
-        this.captionElement.appendChild(this.captionTextElement);
-    }
-    
-    // create content element
-    this.contentElement = document.createElement("div");
-    this.contentElement.style.display = this.expanded ? "block" : "none";
-    this.rootElement.appendChild(this.contentElement);
-    
-    // set caption, content and expanded state
-    this.setCaption(caption);
-    this.setContent(content);
-    
-    // update style
-    this.updateStyleFromState();
-};
-
-// Returns the enabled state.
-ContentPanel.prototype.isEnabled = function() {
-    return this.enabled;
-};
-
-// Sets the enabled state.
-ContentPanel.prototype.setEnabled = function(enabled) {
-    uiLogger.debug("ContentPanel.setEnabled(" + enabled + ")");
-    
-    // bail out early if there is no change in state
-    if (this.enabled == enabled) {
-        return;
-    }
-    
-    // set the enabled state
-    this.enabled = enabled;
-    
-    // is this a foldable content?
-    if (this.foldable) {
-         // the caption link must be disabled
-        if (this.enabled) {
-            // diabled -> enabled
-            this.foldToggleElement.removeChild(this.captionTextElement);
-            this.foldToggleElement.appendChild(this.captionLinkElement);
-            this.captionLinkElement.appendChild(this.captionTextElement);
-        } else {
-            // enabled -> diabled
-            this.captionLinkElement.removeChild(this.captionTextElement);
-            this.foldToggleElement.removeChild(this.captionLinkElement);
-            this.foldToggleElement.appendChild(this.captionTextElement);
-        }
-    }
-    
-    // update style
-    this.updateStyleFromState();    
-};
-
-// Returns the caption; null if none.
-ContentPanel.prototype.getCaption = function() {
-    return this.caption;
-};
-
-// Sets the caption; null if none.
-ContentPanel.prototype.setCaption = function(caption) {
-    // bail out if the caption text element has not been created
-    // this is to prevent the superclass init calling this before
-    // we've initialized our custom caption
-    if (this.captionTextElement == null)
-        return;
-    
-    uiLogger.debug("ContentPanel.setCaption(" + caption + ")");
-    
-    // set the display style
-    this.captionElement.style.display = (caption == null) ? "none" : "block";
-    
-    // set the caption
-    this.caption = caption;
-    this.captionTextElement.innerHTML = (caption == null) ? "" : caption;
-    
-    // update style
-    this.updateStyleFromState();
-};
-
-// Returns the content.
-ContentPanel.prototype.getContent = function() {
-    return this.contentElement.innerHTML;
-};
-
-// Sets the content.
-ContentPanel.prototype.setContent = function(content) {
-    uiLogger.debug("ContentPanel.setContent(" + content + ")");
-    this.contentElement.innerHTML = (content == null) ? "" : content;
-};
-
-// Returns the focusable state for the control.
-ContentPanel.prototype.isFocusable = function() {
-    // a content panel is focusable if it's foldable and enabled
-    return (this.foldable && this.enabled);
-};
-
-// Sets the focused state for the control.
-// Note: This may not always succeed.
-ContentPanel.prototype.setFocused = function(focused) {
-    uiLogger.debug("ContentPanel.setFocused(" + focused + ")");
-    if (this.enabled && this.foldable) {
-        if (focused) {
-            this.captionLinkElement.focus();
-        } else {
-            this.captionLinkElement.blur();
-        }
-    }
-    // note that this.focused gets set as a result of focusStateChanged() being called
-    // rather than setting it explicitly here
-};
-
-// Returns the expanded state.
-ContentPanel.prototype.isExpanded = function() {
-    return this.expanded;
-};
-
-// Sets the expanded state.
-ContentPanel.prototype.setExpanded = function(expanded) {
-    uiLogger.debug("ContentPanel.setExpanded(" + expanded + ")");
-    
-    // make sure only foldable content panels are folded
-    if (!this.foldable) {
-        uiLogger.warn("Cannot fold a non-foldable content panel!");
-        return;
-    }
-    
-    this.expanded = expanded;
-    if (this.expanded) {
-        // expand
-        this.contentElement.style.display = "block";
-        
-        // find out control top and bottom
-        var controlTop = this.getAbsoluteTop(this.rootElement);
-        var controlHeight = this.rootElement.clientHeight;
-        var controlBottom = controlTop + controlHeight;
-        
-        // find out the viewport top and bottom
-        var viewportTop = window.scrollY;
-        var viewportHeight = window.innerHeight;
-        var viewportBottom = viewportTop + viewportHeight;
-        
-        // make sure the control is positioned so that it can be seen
-        var overflow = controlBottom - viewportBottom;
-        if (overflow > 0) {
-            // there's overflow so we need to scroll to get the control
-            // into the viewport - however not so far that the control
-            // goes past the viewport top.
-            var distanceToTop = controlTop - viewportTop;
-            var scrollAmount = Math.min(overflow, distanceToTop);
-            window.scrollBy(0, scrollAmount);
-        }
-    } else {
-        // collapse
-        this.contentElement.style.display = "none";
-    }
-    
-    // notify event listeners
-    this.fireEvent(this.createEvent("ExpandedStateChanged", this.expanded));
-    
-    // update the style
-    this.updateStyleFromState();
-};
-
-// Returns the absolute position (y) of the given element.
-ContentPanel.prototype.getAbsoluteTop = function(element) {
-    // traverse from element to root and add top-offset
-    // for each element we find on the way
-    var absTop = 0;
-    while (element != null) {
-        absTop += element.offsetTop;
-        element = element.offsetParent;
-    }
-    return absTop;
-};
-
-// Callback for when the caption is clicked.
-ContentPanel.prototype.captionClicked = function() {
-    uiLogger.debug("ContentPanel.captionClicked()");
-    
-    // if we're enabled then a click results toggling the expanded state
-    if (this.enabled) {
-        // focus when clicked
-        if (!this.focused) {
-            this.captionLinkElement.focus();
-        }
-        
-        // toggle the expanded state
-        this.setExpanded(!this.expanded);
-    }
-};
-
-// Updates the style of the control to reflects the state of the control.
-ContentPanel.prototype.updateStyleFromState = function() {
-    uiLogger.debug("ContentPanel.updateStyleFromState()");
-
-    // determine the state name
-    var stateName = this.getStyleStateName();
-    
-    // set root element class name
-    this.setClassName(this.rootElement, "Control");
-
-    // set the control assembly class names
-    this.setClassName(this.assemblyElement, "ControlAssembly ControlAssembly" + stateName);
-    
-    if (this.foldable) {
-        // foldable content panel
-        this.setClassName(this.captionElement, "ContentPanelCaptionFoldable");
-        this.setClassName(this.foldToggleElement, "ContentPanelFoldToggle ContentPanelFoldToggle" + (this.expanded ? "Expanded" : "Collapsed"));
-    } else {
-        // non-folding
-        this.setClassName(this.captionElement, "ContentPanelCaptionNonFoldable");
-    }
-    
-    // set the content caption text class names
-    this.setClassName(this.captionTextElement, "ContentPanelCaptionText ContentPanelCaptionText" + stateName);
-    
-    // set the content element class names
-    this.setClassName(this.contentElement, "ContentPanelContent");
-};
--- a/org.symbian.tools.wrttools/projecttemplates/WRTKit/UI/Control.js	Mon Apr 19 17:52:52 2010 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,207 +0,0 @@
-/**
- * Copyright (c) 2009-2010 Symbian Foundation and/or its subsidiary(-ies).
- * All rights reserved.
- * This component and the accompanying materials are made available
- * under the terms of the License "Eclipse Public License v1.0"
- * which accompanies this distribution, and is available
- * at the URL "http://www.eclipse.org/legal/epl-v10.html".
- *
- * Initial Contributors:
- * Nokia Corporation - initial contribution.
- * 
- * Contributors:
- * 
- * Description:
- * 
- */
-
-///////////////////////////////////////////////////////////////////////////////
-// The Control class is an abstract base class for all user interface controls.
-
-// Constructor.
-function Control(id, caption) {
-    if (id != UI_NO_INIT_ID) {
-        this.init(id, caption);
-    }
-}
-
-// Control inherits from UIElement.
-Control.prototype = new UIElement(UI_NO_INIT_ID);
-
-// The view that control belongs to.
-Control.prototype.view = null;
-
-// Is the control focused?
-Control.prototype.focused = false;
-
-// Is the pointer over this control?
-Control.prototype.hovering = false;
-
-// The element hierarchy in a control is as follows:
-//
-// rootElement
-//     assemblyElement
-//         captionElement
-//         controlElement
-//
-// The assembly element groups the portion of a control that typically handle
-// the visual effects for focus and hover states. Having a separate root and
-// assembly elements allows other elements to be added to a control without
-// them being affected by the CSS rules of the assembly element.
-
-// The assembly element of this control.
-Control.prototype.assemblyElement = null;
-
-// The caption of this control; null if none.
-Control.prototype.caption = null;
-
-// The caption element of this control.
-Control.prototype.captionElement = null;
-
-// The control element of this control.
-Control.prototype.controlElement = null;
-
-// Initializer - called from constructor.
-Control.prototype.init = function(id, caption) {
-    uiLogger.debug("Control.init(" + id + ", " + caption + ")");
-    
-    // call superclass initializer
-    UIElement.prototype.init.call(this, id);
-    
-    // create assembly, caption and control elements
-    this.assemblyElement = document.createElement("div");
-    this.captionElement = document.createElement("div");
-    this.assemblyElement.appendChild(this.captionElement);
-    this.controlElement = document.createElement("div");
-    this.assemblyElement.appendChild(this.controlElement);
-    this.rootElement.appendChild(this.assemblyElement);
-    
-    // set the caption
-    // style is not updated because the subclass will update the style later
-    // when it has completely initialized the component
-    this.setCaption(caption, true);
-};
-
-// Returns the caption; null if none.
-Control.prototype.getCaption = function() {
-    return this.caption;
-};
-
-// Sets the caption; null if none.
-Control.prototype.setCaption = function(caption, noStyleUpdate) {
-    uiLogger.debug("Control.setCaption(" + caption + ")");
-    
-    // set the display style
-    this.captionElement.style.display = (caption == null) ? "none" : "block";
-    
-    // set the caption
-    this.caption = caption;
-    this.captionElement.innerHTML = (caption == null) ? "" : caption;
-    
-    // update style
-    if (!noStyleUpdate) {
-        this.updateStyleFromState();
-    }
-};
-
-// Returns the enabled state.
-// Override this in subclasses as required to implement the state change.
-Control.prototype.isEnabled = function() {
-    return false;
-};
-
-// Sets the enabled state.
-// Override this in subclasses as required to implement the state change.
-Control.prototype.setEnabled = function(enabled) {
-    uiLogger.debug("Control.setEnabled(" + enabled + ")");
-};
-
-// Returns the focusable state for the control.
-// Defaults focusable if enabled - override this in subclasses as required.
-Control.prototype.isFocusable = function() {
-    return this.isEnabled();
-};
-
-// Returns the focused state for the control.
-Control.prototype.isFocused = function() {
-    return this.focused;
-};
-
-// Sets the focused state for the control.
-// Note: This may not always succeed.
-// Override this in subclasses as required to implement the state change.
-Control.prototype.setFocused = function(focused) {
-    uiLogger.debug("Control.setFocused(" + focused + ")");
-    // note that this.focused gets set as a result of focusStateChanged() being called
-    // rather than setting it explicitly here
-};
-
-// Called when the focus state has changed for this control.
-Control.prototype.focusStateChanged = function(focused) {
-    uiLogger.debug("Control.focusStateChanged(" + focused + ")");
-    if (this.focused != focused) {
-        this.focused = focused;
-        
-        // let the view know about the focus change
-        if (this.view != null) {
-            this.view.focusedControlChanged(focused ? this : null);
-        }
-        
-        // update the style from the current state
-        this.updateStyleFromState();
-        
-        // notify event listeners
-        this.fireEvent(this.createEvent("FocusStateChanged", focused));
-    }
-};
-
-// Called when the hover state has changed for this control.
-Control.prototype.hoverStateChanged = function(hovering) {
-    uiLogger.debug("Control.hoverStateChanged(" + hovering + ")");
-    if (this.hovering != hovering) {
-        this.hovering = hovering;
-        
-        // update the style from the current state
-        this.updateStyleFromState();
-        
-        // notify event listeners
-        this.fireEvent(this.createEvent("HoverStateChanged", hovering));
-    }
-};
-
-// Helper method that returns the state name for the current state.
-Control.prototype.getStyleStateName = function() {
-    var focusable = this.isFocusable();
-    if (focusable && this.focused) {
-        return "Focus";
-    } else if (focusable && this.hovering) {
-        return "Hover";
-    } else if (!this.isEnabled()) {
-        return "Disabled";
-    } else {
-        return "Normal";
-    }
-};
-
-// Resets the state tracking for focus and hover.
-// Override this in subclasses as required to implement the state reset.
-Control.prototype.resetFocusState = function() {
-    uiLogger.debug("Control.resetFocusState()");
-    this.hovering = false;
-    this.focused = false;
-    this.updateStyleFromState();
-};
-
-// Helper function that sets a classname for an element.
-// Only sets the class name if it actually is different from the current value.
-Control.prototype.setClassName = function(element, className) {
-    if (element.className != className) {
-        element.className = className;
-    }
-};
-
-// Updates the style of the control to reflects the state of the control.
-// Override this in subclasses as required to implement the state change.
-Control.prototype.updateStyleFromState = function() {
-    uiLogger.debug("Control.updateStyleFromState()");
-};
--- a/org.symbian.tools.wrttools/projecttemplates/WRTKit/UI/FormButton.js	Mon Apr 19 17:52:52 2010 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,153 +0,0 @@
-/**
- * Copyright (c) 2009-2010 Symbian Foundation and/or its subsidiary(-ies).
- * All rights reserved.
- * This component and the accompanying materials are made available
- * under the terms of the License "Eclipse Public License v1.0"
- * which accompanies this distribution, and is available
- * at the URL "http://www.eclipse.org/legal/epl-v10.html".
- *
- * Initial Contributors:
- * Nokia Corporation - initial contribution.
- * 
- * Contributors:
- * 
- * Description:
- * 
- */
-
-///////////////////////////////////////////////////////////////////////////////
-// The FormButton class implements a button control for use in form-style UIs.
-
-// Constructor.
-function FormButton(id, text) {
-    if (id != UI_NO_INIT_ID) {
-        this.init(id, text);
-    }
-}
-
-// FormButton inherits from ActionControl.
-FormButton.prototype = new ActionControl(UI_NO_INIT_ID);
-
-// Button table element.
-FormButton.prototype.tableElement = null;
-
-// Button table row element.
-FormButton.prototype.tableRowElement = null;
-
-// Button table left cell element.
-FormButton.prototype.tableLeftCellElement = null;
-
-// Button table center cell element.
-FormButton.prototype.tableCenterCellElement = null;
-
-// Button text element.
-FormButton.prototype.textElement = null;
-
-// Button table right cell element.
-FormButton.prototype.tableRightCellElement = null;
-
-// Initializer - called from constructor.
-FormButton.prototype.init = function(id, text) {
-    uiLogger.debug("FormButton.init(" + id + ", " + text + ")");
-    
-    // call superclass initializer
-    ActionControl.prototype.init.call(this, id, null);
-    
-    // remove caption element
-    this.assemblyElement.removeChild(this.captionElement);
-    
-    // construct the button
-    this.buttonElement = document.createElement("div");
-    this.tableElement = document.createElement("table");
-    this.tableRowElement = document.createElement("tr");
-    this.tableLeftCellElement = document.createElement("td");
-    this.tableCenterCellElement = document.createElement("td");
-    this.linkElement = document.createElement("a");
-    this.linkElement.href = "JavaScript:void(0)";
-    this.textElement = document.createElement("span");
-    this.tableRightCellElement = document.createElement("td");
-    this.tableElement.appendChild(this.tableRowElement);
-    this.tableRowElement.appendChild(this.tableLeftCellElement);
-    this.tableRowElement.appendChild(this.tableCenterCellElement);
-    this.tableCenterCellElement.appendChild(this.linkElement);
-    this.linkElement.appendChild(this.textElement);
-    this.tableRowElement.appendChild(this.tableRightCellElement);
-    this.buttonElement.appendChild(this.tableElement);
-    this.controlElement.appendChild(this.buttonElement);
-    
-    // set the text
-    this.setText(text);
-    
-    // bind event listeners
-    this.bindActionControlListeners();
-    
-    // update the style
-    this.updateStyleFromState();
-};
-
-// Sets the enabled state.
-FormButton.prototype.setEnabled = function(enabled) {
-    uiLogger.debug("FormButton.setEnabled(" + enabled + ")");
-    
-    // bail out early if there is no change in state
-    if (this.enabled == enabled) {
-        return;
-    }
-    
-    // set the enabled state
-    this.enabled = enabled;
-    
-    if (this.enabled) {
-        // diabled -> enabled
-        this.tableCenterCellElement.removeChild(this.textElement);
-        this.tableCenterCellElement.appendChild(this.linkElement);
-        this.linkElement.appendChild(this.textElement);
-    } else {
-        // enabled -> diabled
-        this.linkElement.removeChild(this.textElement);
-        this.tableCenterCellElement.removeChild(this.linkElement);
-        this.tableCenterCellElement.appendChild(this.textElement);
-    }
-    
-    // update the style
-    this.updateStyleFromState();
-};
-
-// Returns the button text.
-FormButton.prototype.getText = function() {
-    return this.textElement.innerHTML;
-};
-
-// Sets the button text.
-FormButton.prototype.setText = function(text) {
-    uiLogger.debug("FormButton.setText(" + text + ")");
-    this.textElement.innerHTML = (text == null) ? "" : text;;
-};
-
-// Updates the style of the control to reflects the state of the control.
-FormButton.prototype.updateStyleFromState = function() {
-    uiLogger.debug("FormButton.updateStyleFromState()");
-    
-    // determine the state name
-    var stateName = this.getStyleStateName();
-    
-    // set root element class name
-    this.setClassName(this.rootElement, "Control");
-    
-    // set the control assembly class names
-    this.setClassName(this.assemblyElement, "ControlAssembly ControlAssemblyNormal");
-    
-    // control element
-    this.setClassName(this.controlElement, "ControlElement FormButtonControlElement");
-    
-    // set the button table class names
-    this.setClassName(this.buttonElement, "FormButton");
-    this.setClassName(this.tableElement, "FormButtonTable");
-    this.setClassName(this.tableRowElement, "FormButtonRow");
-    this.setClassName(this.tableLeftCellElement, "FormButtonLeftCell FormButtonLeftCell" + stateName);
-    this.setClassName(this.tableCenterCellElement, "FormButtonCenterCell FormButtonLeftCell" + stateName);
-    this.setClassName(this.tableRightCellElement, "FormButtonRightCell FormButtonLeftCell" + stateName);
-    
-    // set the button text class name
-    this.setClassName(this.textElement, "FormButtonText FormButtonText" + stateName);
-};
--- a/org.symbian.tools.wrttools/projecttemplates/WRTKit/UI/Label.js	Mon Apr 19 17:52:52 2010 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,81 +0,0 @@
-/**
- * Copyright (c) 2009-2010 Symbian Foundation and/or its subsidiary(-ies).
- * All rights reserved.
- * This component and the accompanying materials are made available
- * under the terms of the License "Eclipse Public License v1.0"
- * which accompanies this distribution, and is available
- * at the URL "http://www.eclipse.org/legal/epl-v10.html".
- *
- * Initial Contributors:
- * Nokia Corporation - initial contribution.
- * 
- * Contributors:
- * 
- * Description:
- * 
- */
-
-///////////////////////////////////////////////////////////////////////////////
-// The Label class implements a control that displays textual content.
-
-// Constructor.
-function Label(id, caption, text) {
-    if (id != UI_NO_INIT_ID) {
-        this.init(id, caption, text);
-    }
-}
-
-// Label inherits from Control.
-Label.prototype = new Control(UI_NO_INIT_ID);
-
-// Content element for label text.
-Label.prototype.contentElement = null;
-
-// Initializer - called from constructor.
-Label.prototype.init = function(id, caption, text) {
-    uiLogger.debug("Label.init(" + id + ", " + caption + ", " + text + ")");
-    
-    // call superclass initializer
-    Control.prototype.init.call(this, id, caption);
-    
-    // create content element
-    this.contentElement = document.createElement("div");
-    this.controlElement.appendChild(this.contentElement);
-    
-    // set the text
-    this.setText(text);
-};
-
-// Returns the enabled state for the control.
-Label.prototype.isEnabled = function() {
-    return true;
-};
-
-// Returns the focusable state for the control.
-Label.prototype.isFocusable = function() {
-    return false;
-};
-
-// Returns the control text.
-Label.prototype.getText = function() {
-    return this.contentElement.innerHTML;
-};
-
-// Sets the text for the control.
-Label.prototype.setText = function(text) {
-    uiLogger.debug("Label.setText(" + text + ")");
-    this.contentElement.innerHTML = (text == null) ? "" : text;
-    this.updateStyleFromState();
-};
-
-// Updates the style of the control to reflects the state of the control.
-Label.prototype.updateStyleFromState = function() {
-    uiLogger.debug("Label.updateStyleFromState()");
-    
-    // set element class names
-    this.setClassName(this.rootElement, "Control");
-    this.setClassName(this.assemblyElement, "ControlAssembly ControlAssemblyNormal");
-    this.setClassName(this.captionElement, "ControlCaption ControlCaptionNormal");
-    this.setClassName(this.controlElement, "ControlElement");
-    this.setClassName(this.contentElement, "LabelText");
-};
--- a/org.symbian.tools.wrttools/projecttemplates/WRTKit/UI/ListView.js	Mon Apr 19 17:52:52 2010 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,165 +0,0 @@
-/**
- * Copyright (c) 2009-2010 Symbian Foundation and/or its subsidiary(-ies).
- * All rights reserved.
- * This component and the accompanying materials are made available
- * under the terms of the License "Eclipse Public License v1.0"
- * which accompanies this distribution, and is available
- * at the URL "http://www.eclipse.org/legal/epl-v10.html".
- *
- * Initial Contributors:
- * Nokia Corporation - initial contribution.
- * 
- * Contributors:
- * 
- * Description:
- * 
- */
-
-///////////////////////////////////////////////////////////////////////////////
-// The ListView class implements a vertical list view that hosts controls
-// as child components.
-
-// Constructor.
-function ListView(id, caption) {
-    if (id != UI_NO_INIT_ID) {
-        this.init(id, caption);
-    }
-}
-
-// ListView inherits from View.
-ListView.prototype = new View(UI_NO_INIT_ID);
-
-// The caption of this view; null if none.
-ListView.prototype.caption = null;
-
-// The caption element of this view.
-ListView.prototype.captionElement = null;
-
-// The caption text element of this view.
-ListView.prototype.captionTextElement = null;
-
-// Root HTML element for controls.
-ListView.prototype.listElement = null;
-
-// List of controls in the view.
-ListView.prototype.controls = null;
-
-// Initializer for ListView.
-ListView.prototype.init = function(id, caption) {
-    uiLogger.debug("ListView.init(" + id + ", " + caption + ")");
-    
-    // call superclass initializer
-    View.prototype.init.call(this, id);
-    
-    // init control array
-    this.controls = [];
-    
-    // set style class name for root element
-    this.rootElement.className = "ListView";
-    
-    // create caption and caption text elements
-    this.captionElement = document.createElement("div");
-    this.captionElement.className = "ListViewCaption";
-    this.captionTextElement = document.createElement("div");
-    this.captionTextElement.className = "ListViewCaptionText";
-    this.captionElement.appendChild(this.captionTextElement);
-    this.rootElement.appendChild(this.captionElement);
-    
-    // create root element for controls and add to the view root element
-    this.listElement = document.createElement("div");
-    this.listElement.className = "ListViewControlList";
-    this.rootElement.appendChild(this.listElement);
-    
-    // set the caption
-    this.setCaption(caption);
-};
-
-// Returns the caption; null if none.
-ListView.prototype.getCaption = function() {
-    return this.caption;
-};
-
-// Sets the caption; null if none.
-ListView.prototype.setCaption = function(caption) {
-    uiLogger.debug("ListView.setCaption(" + caption + ")");
-    
-    // set the display style
-    this.captionElement.style.display = (caption == null) ? "none" : "block";
-    
-    // set the caption
-    this.caption = caption;
-    this.captionTextElement.innerHTML = (caption == null) ? "" : caption;
-};
-
-// Returns an array of controls in the view.
-ListView.prototype.getControls = function() {
-    return this.controls;
-};
-
-// Adds a control to the view.
-ListView.prototype.addControl = function(control) {
-    uiLogger.debug("ListView.addControl(" + control + ")");
-    
-    // add the control to the controls array and attach it to the list element
-    this.controls.push(control);
-    this.listElement.appendChild(control.rootElement);
-    control.view = this;
-};
-
-// Inserts a control to the view before the specified control.
-ListView.prototype.insertControl = function(control, beforeControl) {
-    uiLogger.debug("ListView.insertControl(" + control + ", " + beforeControl + ")");
-    
-    // iterate through current controls
-    for (var i = 0; i < this.controls.length; i++) {
-        // is this the control we should insert before?
-        if (this.controls[i] == beforeControl) {
-            // we found the control to insert before - insert here and connect to list element
-            this.controls.splice(i, 0, control);
-            this.listElement.insertBefore(control.rootElement, beforeControl.rootElement);
-            control.view = this;
-            return;
-        }
-    }
-    
-    // the control wasn't found so we'll add it last
-    this.addControl(control);
-};
-
-// Removes a control from the view.
-ListView.prototype.removeControl = function(control) {
-    uiLogger.debug("ListView.removeControl(" + control + ")");
-    
-    // iterate through current controls
-    for (var i = 0; i < this.controls.length; i++) {
-        // is this the control we should remove?
-        if (this.controls[i] == control) {
-            // we found the control to remove - remove it from the list element
-            this.controls.splice(i, 1);
-            this.listElement.removeChild(control.rootElement);
-            control.view = null;
-        }
-    }
-};
-
-// Attempts to focus the first focusable control.
-ListView.prototype.focusFirstControl = function() {
-    uiLogger.debug("ListView.focusFirstControl()");
-    for (var i = 0; i < this.controls.length; i++) {
-        // is this control focusable?
-        var control = this.controls[i];
-        if (control.isFocusable()) {
-            control.setFocused(true);
-            break;
-        }
-    }
-};
-
-// Attempts to reset all control focus states.
-// Override in subclasses as required.
-ListView.prototype.resetControlFocusStates = function() {
-    uiLogger.debug("ListView.resetControlFocusStates()");
-    for (var i = 0; i < this.controls.length; i++) {
-        this.controls[i].resetFocusState();
-    }
-};
--- a/org.symbian.tools.wrttools/projecttemplates/WRTKit/UI/NavigationButton.js	Mon Apr 19 17:52:52 2010 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,196 +0,0 @@
-/**
- * Copyright (c) 2009-2010 Symbian Foundation and/or its subsidiary(-ies).
- * All rights reserved.
- * This component and the accompanying materials are made available
- * under the terms of the License "Eclipse Public License v1.0"
- * which accompanies this distribution, and is available
- * at the URL "http://www.eclipse.org/legal/epl-v10.html".
- *
- * Initial Contributors:
- * Nokia Corporation - initial contribution.
- * 
- * Contributors:
- * 
- * Description:
- * 
- */
-
-///////////////////////////////////////////////////////////////////////////////
-// The NavigationButton class implements a button control for use in
-// navigational contexts in menu-style UIs.
-
-// Constructor.
-function NavigationButton(id, image, text) {
-    if (id != UI_NO_INIT_ID) {
-        this.init(id, image, text);
-    }
-}
-
-// NavigationButton inherits from ActionControl.
-NavigationButton.prototype = new ActionControl(UI_NO_INIT_ID);
-
-// Button table element.
-NavigationButton.prototype.tableElement = null;
-
-// Button table row element.
-NavigationButton.prototype.tableRowElement = null;
-
-// Button table left cell element.
-NavigationButton.prototype.tableLeftCellElement = null;
-
-// Button table right cell element.
-NavigationButton.prototype.tableRightCellElement = null;
-
-// Button image element.
-NavigationButton.prototype.imageElement = null;
-
-// Button link element.
-NavigationButton.prototype.linkElement = null;
-
-// Button text element.
-NavigationButton.prototype.textElement = null;
-
-// Initializer - called from constructor.
-NavigationButton.prototype.init = function(id, image, text) {
-    uiLogger.debug("NavigationButton.init(" + id + ", " + image + ", " + text + ")");
-    
-    // call superclass initializer
-    ActionControl.prototype.init.call(this, id, null);
-    
-    // remove caption element
-    this.assemblyElement.removeChild(this.captionElement);
-    
-    // construct the button
-    this.buttonElement = document.createElement("div");
-    this.tableElement = document.createElement("table");
-    this.tableRowElement = document.createElement("tr");
-    this.tableLeftCellElement = document.createElement("td");
-    this.tableRightCellElement = document.createElement("td");
-    this.imageElement = null;
-    this.linkElement = document.createElement("a");
-    this.linkElement.href = "JavaScript:void(0)";
-    this.textElement = document.createElement("span");
-    this.tableElement.appendChild(this.tableRowElement);
-    this.tableRowElement.appendChild(this.tableLeftCellElement);
-    this.tableRowElement.appendChild(this.tableRightCellElement);
-    this.tableRightCellElement.appendChild(this.linkElement);
-    this.linkElement.appendChild(this.textElement);
-    this.buttonElement.appendChild(this.tableElement);
-    this.controlElement.appendChild(this.buttonElement);
-    
-    // set the image and text
-    this.setImage(image);
-    this.setText(text);
-    
-    // bind event listeners
-    this.bindActionControlListeners();
-    
-    // update the style
-    this.updateStyleFromState();
-};
-
-// Sets the enabled state.
-NavigationButton.prototype.setEnabled = function(enabled) {
-    uiLogger.debug("NavigationButton.setEnabled(" + enabled + ")");
-    
-    // bail out early if there is no change in state
-    if (this.enabled == enabled) {
-        return;
-    }
-    
-    // set the enabled state
-    this.enabled = enabled;
-    
-    if (this.enabled) {
-        // diabled -> enabled
-        this.tableRightCellElement.removeChild(this.textElement);
-        this.tableRightCellElement.appendChild(this.linkElement);
-        this.linkElement.appendChild(this.textElement);
-    } else {
-        // enabled -> diabled
-        this.linkElement.removeChild(this.textElement);
-        this.tableRightCellElement.removeChild(this.linkElement);
-        this.tableRightCellElement.appendChild(this.textElement);
-    }
-    
-    // update the style
-    this.updateStyleFromState();
-};
-
-// Returns the button image (URL); null if none.
-NavigationButton.prototype.getImage = function() {
-    return (this.imageElement != null) ? this.imageElement.src : null;
-};
-
-// Sets the button image (URL); null if none.
-NavigationButton.prototype.setImage = function(image) {
-    uiLogger.debug("NavigationButton.setImage(" + image + ")");
-    
-    if (image == null) {
-        // remove image - if any
-        if (this.imageElement != null) {
-            this.tableLeftCellElement.removeChild(this.imageElement);
-        }
-    } else {
-        // default to not append image element
-        var append = false;
-        
-        // create image element if one doesn't exist
-        if (this.imageElement == null) {
-            this.imageElement = document.createElement("img");
-            this.imageElement.setAttribute("alt", "");
-            append = true;
-        }
-        
-        // set image source URL
-        this.imageElement.src = image;
-        
-        // append the image element to the left cell?
-        if (append) {
-            this.tableLeftCellElement.appendChild(this.imageElement);
-        }
-    }
-};
-
-// Returns the button text.
-NavigationButton.prototype.getText = function() {
-    return this.textElement.innerHTML;
-};
-
-// Sets the button text.
-NavigationButton.prototype.setText = function(text) {
-    uiLogger.debug("NavigationButton.setText(" + text + ")");
-    this.textElement.innerHTML = (text == null) ? "" : text;;
-};
-
-// Updates the style of the control to reflects the state of the control.
-NavigationButton.prototype.updateStyleFromState = function() {
-    uiLogger.debug("NavigationButton.updateStyleFromState()");
-    
-    // determine the state name
-    var stateName = this.getStyleStateName();
-    
-    // set root element class name
-    this.setClassName(this.rootElement, "Control");
-    
-    // set the control assembly class names
-    this.setClassName(this.assemblyElement, "ControlAssembly ControlAssembly" + stateName);
-    
-    // control element
-    this.setClassName(this.controlElement, "ControlElement NavigationButtonControlElement");
-    
-    // set the button table class names
-    this.setClassName(this.buttonElement, "NavigationButton");
-    this.setClassName(this.tableElement, "NavigationButtonTable");
-    this.setClassName(this.tableRowElement, "NavigationButtonRow");
-    this.setClassName(this.tableLeftCellElement, "NavigationButtonImageCell");
-    this.setClassName(this.tableRightCellElement, "NavigationButtonTextCell");
-    
-    // set image class names
-    if (this.imageElement) {
-        this.setClassName(this.imageElement, "NavigationButtonImage");
-    }
-    
-    // set the button text class name
-    this.setClassName(this.textElement, "NavigationButtonText NavigationButtonText" + stateName);
-};
--- a/org.symbian.tools.wrttools/projecttemplates/WRTKit/UI/NotificationPopup.js	Mon Apr 19 17:52:52 2010 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,306 +0,0 @@
-/**
- * Copyright (c) 2009-2010 Symbian Foundation and/or its subsidiary(-ies).
- * All rights reserved.
- * This component and the accompanying materials are made available
- * under the terms of the License "Eclipse Public License v1.0"
- * which accompanies this distribution, and is available
- * at the URL "http://www.eclipse.org/legal/epl-v10.html".
- *
- * Initial Contributors:
- * Nokia Corporation - initial contribution.
- * 
- * Contributors:
- * 
- * Description:
- * 
- */
-
-///////////////////////////////////////////////////////////////////////////////
-// The NotificationPopup class handles the display of notifications such as
-// warnings, information messages and progress indication.
-
-// Constructor.
-function NotificationPopup() {
-    // create notification popup
-    this.containerElement = document.createElement("div");
-    this.containerElement.className = "NotificationPopupContainer";
-    this.popupElement = document.createElement("div");
-    this.popupElement.className = "NotificationPopup";
-    this.typeIndicatorElement = document.createElement("div");
-    this.typeIndicatorElement.className = "NotificationPopupTypeIndicator";
-    this.textElement = document.createElement("div");
-    this.textElement.className = "NotificationPopupText";
-    this.progressBarElement = document.createElement("div");
-    this.progressBarElement.className = "NotificationPopupProgressBar";
-    
-    // assemble popup
-    this.popupElement.appendChild(this.typeIndicatorElement);
-    this.popupElement.appendChild(this.textElement);
-    this.popupElement.appendChild(this.progressBarElement);
-    this.containerElement.appendChild(this.popupElement);
-    
-    // create progress bar image element and initialize it
-    this.progressBarImageElement = document.createElement("img");
-    var self = this;
-    this.progressBarImageElement.addEventListener("load", function() { self.progressBarImageLoadingCompleted(); }, false);
-    this.progressBarImageElement.setAttribute("alt", "");
-    this.progressBarImageURL = this.getProgressBarImage(0);
-    this.progressBarImageElement.src = this.progressBarImageURL;
-    this.progressBarElement.appendChild(this.progressBarImageElement);
-    
-    // init the popup to be fully down
-    this.popupElement.style.top = "100%";
-    
-    // set default popup contents
-    this.setPopupContents(null, null, null);
-}
-
-// Notification container element.
-NotificationPopup.prototype.containerElement = null;
-
-// Notification popup element.
-NotificationPopup.prototype.popupElement = null;
-
-// Type indicator element.
-NotificationPopup.prototype.typeIndicatorElement = null;
-
-// Notification text element.
-NotificationPopup.prototype.textElement = null;
-
-// Progress bar element.
-NotificationPopup.prototype.progressBarElement = null;
-
-// Progress bar image element.
-NotificationPopup.prototype.progressBarImageElement = null;
-
-// Progress bar image URL.
-NotificationPopup.prototype.progressBarImageURL = null;
-
-// Has the progress bar image been loaded?
-NotificationPopup.prototype.progressBarImageLoaded = false;
-
-// Flag that tracks whether we're in the middle of starting to
-// show a notification popup.
-NotificationPopup.prototype.processingShowNotification = false;
-
-// Notification popup position (0 = hidden, 1 = showing).
-NotificationPopup.prototype.popupPosition = 0;
-
-// Interval for timer ticks (in milliseconds)
-NotificationPopup.prototype.ANIM_TIMER_INTERVAL = 25;
-
-// Animation timer identifier or null if no active timer.
-NotificationPopup.prototype.animTimerId = null;
-
-// Time in milliseconds for the popup animation to complete
-NotificationPopup.prototype.ANIM_TIME = 300;
-
-// Flag that determines the behavior of showNotification(). If set to true
-// the popup will snap open when showNotification() is called instead of
-// animation.
-NotificationPopup.prototype.SHOW_SNAPS_OPEN = true;
-
-// Animation direction (0 = no movement, -1 hiding, +1 = showing).
-NotificationPopup.prototype.animDir = 0;
-
-// Auto-hide timer identifier or null if no active timer.
-NotificationPopup.prototype.autoHideTimerId = null;
-
-// The commanded display time.
-NotificationPopup.prototype.displayTime = -1;
-
-// Displays a notification.
-NotificationPopup.prototype.showNotification = function(displayTime, type, text, progress) {
-    uiLogger.debug("NotificationPopup.showNotification(" + displayTime + ", " + type + ", " + text + ", " + progress + ")");
-    
-    // mark that showNotification() has been called and that we are in
-    // the middle of starting to show the notification popup
-    this.processingShowNotification = true;
-    
-    // remember the display time
-    this.displayTime = displayTime;
-    
-    // attach the popup to the document if not attached
-    if (this.containerElement.parentNode == null) {
-        document.body.appendChild(this.containerElement);
-        uiLogger.debug("Notification popup attached to document");
-    }
-    
-    // set popup contents and update style
-    this.setPopupContents(type, text, progress);
-    
-    // if the progress image is loaded then we can complete the showing
-    // of the notification popup immediately - otherwise the image loaded
-    // allback will complete the process.
-    if (this.progressBarImageLoaded) {
-        this.completeShowNotification();
-    }
-};
-
-// Completes displaying of a notification.
-// Note: Used internally - don't call this directly.
-NotificationPopup.prototype.completeShowNotification = function() {
-    uiLogger.debug("NotificationPopup.completeShowNotification()");
-    
-    // animation direction is +1 for showing the popup
-    if (this.popupPosition != 1) {
-        if (this.SHOW_SNAPS_OPEN) {
-            if (this.popupPosition == 0) {
-                this.popupPosition = 1;
-            }
-        }
-        this.animatePopup(1);
-    }
-    
-    // setup auto hiding if a display time is specified
-    if (this.displayTime > 0) {
-        // stop any existing timer
-        if (this.autoHideTimerId != null) {
-            clearTimeout(this.autoHideTimerId);
-            uiLogger.debug("Auto hide timer stopped");
-        }
-        // set timer to hide notification
-        var self = this;
-        this.autoHideTimerId = setTimeout(function() {
-                                              if (self.displayTime > 0) {
-                                                  self.hideNotification();
-                                              }
-                                          }, this.ANIM_TIME + this.displayTime);
-        uiLogger.debug("Auto hide timer started");
-    }
-    
-    // mark us as no longer processing a show notification call
-    this.processingShowNotification = false;
-};
-
-// Hides the currently displayed notification.
-NotificationPopup.prototype.hideNotification = function() {
-    uiLogger.debug("NotificationPopup.hideNotification()");
-    // mark us as no longer processing a show notification call
-    this.processingShowNotification = false;
-    
-    // animation direction is -1 for hiding the popup
-    if (this.popupPosition != 0) {
-        this.animatePopup(-1);
-    }
-    
-    // stop auto hide timer if one is set
-    if (this.autoHideTimerId != null) {
-        clearTimeout(this.autoHideTimerId);
-        this.autoHideTimerId = null;
-        uiLogger.debug("Auto hide timer stopped");
-    }
-};
-
-// Starts animation of the popup (1 to show, -1 to hide).
-NotificationPopup.prototype.animatePopup = function(direction) {
-    uiLogger.debug("NotificationPopup.animatePopup(" + direction + ")");
-    // set the direction and star the animation timer
-    this.animDir = direction;
-    if (this.animTimerId == null) {
-        var self = this;
-        this.animTimerId = setInterval(function() { self.animate(); }, this.ANIM_TIMER_INTERVAL);
-        uiLogger.debug("Notification popup animation started");
-    }
-};
-
-// Callback for animation timer.
-NotificationPopup.prototype.animate = function() {
-    // calculate new popup position and clamp
-    var animStep = (this.ANIM_TIMER_INTERVAL / this.ANIM_TIME) * this.animDir;
-    var newPos = this.popupPosition + animStep;
-    if (newPos < 0) {
-        newPos = 0;
-    } else if (newPos > 1) {
-        newPos = 1;
-    }
-    
-    // set the new position to the popup element
-    this.popupPosition = newPos;
-    this.popupElement.style.top = (100 - Math.round(this.popupPosition * 100)) + "%";
-    
-    // have we reached the end of the animation?
-    if (newPos == 0 || newPos == 1) {
-        // reset animation direction
-        this.animDir = 0;
-        
-        // remove the popup from the body if its hidden
-        if (newPos == 0) {
-            document.body.removeChild(this.containerElement);
-            uiLogger.debug("Notification popup detached from document");
-        }
-        
-        // stop timer
-        clearTimeout(this.animTimerId);
-        this.animTimerId = null;
-        uiLogger.debug("Notification popup animation stopped");
-    }
-};
-
-// Returns a URL for the progress bar image to use for the specified progress.
-NotificationPopup.prototype.getProgressBarImage = function(progress) {
-    // path for progress bar images
-    var progressBarImagePath = "WRTKit/Resources/";
-    
-    if (progress < 0) {
-        // unknown progress
-        return progressBarImagePath + "ProgressBarUnknown.gif";
-    } else {
-        // known progress (should be between 0 and 1)
-        var progPct = Math.round(progress * 10) * 10;
-        if (progPct < 0) {
-            progPct = 0;
-        } else if (progPct > 100) {
-            progPct = 100;
-        }
-        return progressBarImagePath + "ProgressBar" + progPct + ".png";
-    }
-};
-
-// Sets the contents of the popup.
-NotificationPopup.prototype.setPopupContents = function(type, text, progress) {
-    uiLogger.debug("NotificationPopup.setPopupContents(" + type + ", " + text + ", " + progress + ")");
-    
-    // figure out notification type style name
-    var typeName = (type == null) ? "none" : type.toLowerCase();
-    typeName = typeName.charAt(0).toUpperCase() + typeName.substring(1);
-    
-    // set type element class names
-    this.typeIndicatorElement.className = "NotificationPopupTypeIndicator NotificationPopupTypeIndicator" + typeName;
-    
-    // set notification text
-    this.textElement.innerHTML = (text == null) ? "" : text;
-    
-    // set progress
-    this.progressBarElement.style.display = (progress == null) ? "none" : "block";
-    if (progress != null) {
-        var imgURL = this.getProgressBarImage(progress);
-        if (imgURL != this.progressBarImageURL) {
-            // load new image
-            this.progressBarImageLoaded = false;
-            this.progressBarImageURL = imgURL;
-            this.progressBarImageElement.src = imgURL;
-        } else {
-            // the correct image is already loaded
-            this.progressBarImageLoaded = true;
-        }
-    } else {
-        // there is no progress bar so there is no need
-        // to load any progress bar image
-        this.progressBarImageLoaded = true;
-    }
-};
-
-// Callback for notifying the object that its progress bar image completed loading.
-NotificationPopup.prototype.progressBarImageLoadingCompleted = function() {
-    uiLogger.debug("NotificationPopup.progressBarImageLoadingCompleted()");
-    
-    // mark the progress bar image as loaded
-    this.progressBarImageLoaded = true;
-    
-    // complete the process of displaying the notification popup
-    // if it has been commanded but not yet completed
-    if (this.processingShowNotification) {
-        this.completeShowNotification();
-    }
-};
--- a/org.symbian.tools.wrttools/projecttemplates/WRTKit/UI/Scrollbar.js	Mon Apr 19 17:52:52 2010 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,149 +0,0 @@
-/**
- * Copyright (c) 2009-2010 Symbian Foundation and/or its subsidiary(-ies).
- * All rights reserved.
- * This component and the accompanying materials are made available
- * under the terms of the License "Eclipse Public License v1.0"
- * which accompanies this distribution, and is available
- * at the URL "http://www.eclipse.org/legal/epl-v10.html".
- *
- * Initial Contributors:
- * Nokia Corporation - initial contribution.
- * 
- * Contributors:
- * 
- * Description:
- * 
- */
-
-///////////////////////////////////////////////////////////////////////////////
-// The Scrollbar class is an implementation of a user interface element that
-// indicates the current viewport position in a document.
-
-// Constructor.
-function Scrollbar(parentElement) {
-    uiLogger.debug("Scrollbar(" + parentElement + ")");
-    
-    // get the parent element
-    this.parentElement = parentElement;
-    
-    // create the root element
-    this.rootElement = document.createElement("div");
-    this.rootElement.className = "Scrollbar";
-    this.rootElement.style.visibility = "hidden";
-    
-    // create the scrollbar
-    // the scrollbar consists of a root element with six children
-    // (three track elements and three thumb elements)
-    
-    // track
-    this.trackTopElement = document.createElement("div");
-    this.trackTopElement.className = "ScrollbarTrackTop";
-    this.trackMiddleElement = document.createElement("div");
-    this.trackMiddleElement.className = "ScrollbarTrackMiddle";
-    this.trackBottomElement = document.createElement("div");
-    this.trackBottomElement.className = "ScrollbarTrackBottom";
-    
-    // thumb
-    this.thumbTopElement = document.createElement("div");
-    this.thumbTopElement.className = "ScrollbarThumbTop";
-    this.thumbMiddleElement = document.createElement("div");
-    this.thumbMiddleElement.className = "ScrollbarThumbMiddle";
-    this.thumbBottomElement = document.createElement("div");
-    this.thumbBottomElement.className = "ScrollbarThumbBottom";
-    
-    // assemble and attach the scrollbar
-    this.rootElement.appendChild(this.trackTopElement);
-    this.rootElement.appendChild(this.trackMiddleElement);
-    this.rootElement.appendChild(this.trackBottomElement);
-    this.rootElement.appendChild(this.thumbTopElement);
-    this.rootElement.appendChild(this.thumbMiddleElement);
-    this.rootElement.appendChild(this.thumbBottomElement);
-    this.parentElement.appendChild(this.rootElement);
-    
-    // bring the scrollbar up to date
-    this.update(0, 100, 100);
-}
-
-// Parent element for the scrollbar.
-Scrollbar.prototype.parentElement = null;
-
-// Root HTML element in the scrollbar.
-Scrollbar.prototype.rootElement = null;
-
-// Scrollbar track top element.
-Scrollbar.prototype.trackTopElement = null;
-
-// Scrollbar track middle element.
-Scrollbar.prototype.trackMiddleElement = null;
-
-// Scrollbar track bottom element.
-Scrollbar.prototype.trackBottomElement = null;
-
-// Scrollbar thumb top element.
-Scrollbar.prototype.thumbTopElement = null;
-
-// Scrollbar thumb middle element.
-Scrollbar.prototype.thumbMiddleElement = null;
-
-// Scrollbar thumb bottom element.
-Scrollbar.prototype.thumbBottomElement = null;
-
-// Is the scrollbar needed?
-Scrollbar.prototype.scrollbarNeeded = false;
-
-// Updates the scrollbar.
-Scrollbar.prototype.update = function(scrollY, viewportHeight, documentHeight) {
-    // figure out current heights
-    var scrollbarHeight = this.rootElement.clientHeight;
-    var trackTopHeight = this.trackTopElement.clientHeight;
-    var trackBottomHeight = this.trackBottomElement.clientHeight;
-    var thumbTopHeight = this.thumbTopElement.clientHeight;
-    var thumbBottomHeight = this.thumbBottomElement.clientHeight;
-    
-    // scrollable height is the larger of document and viewport heights
-    var scrollableHeight = documentHeight;
-    var scrollbarNeeded = true;
-    if (viewportHeight >= documentHeight) {
-        scrollableHeight = viewportHeight;
-        scrollbarNeeded = false;
-    }
-    
-    // show or hide scrollbar?
-    if (scrollbarNeeded != this.scrollbarNeeded) {
-        this.scrollbarNeeded = scrollbarNeeded;
-        this.rootElement.style.visibility = scrollbarNeeded ? "visible" : "hidden";
-    }
-    
-    // calculate thumb top position...
-    var thumbTopPct = scrollY / scrollableHeight;
-    var thumbTop = scrollbarHeight * thumbTopPct;
-    // ...and bottom position...
-    var thumbBottomPct = (scrollY + viewportHeight) / scrollableHeight;
-    var thumbBottom = scrollbarHeight * thumbBottomPct;
-    
-    // ...and thumb height
-    var thumbHeight = thumbBottom - thumbTop;
-    
-    // ensure that the thumb is not too small
-    var thumbMinHeight = thumbTopHeight + thumbBottomHeight;
-    if (thumbHeight < thumbMinHeight) {
-        var underflow = thumbMinHeight - thumbHeight;
-        // adjust thumb top pos assuming a shorter scrollbar track
-        var thumbMid = (scrollbarHeight - underflow) * ((thumbTopPct + thumbBottomPct) / 2) + (underflow / 2);
-        thumbTop = thumbMid - (thumbMinHeight / 2);
-        thumbBottom = thumbTop + thumbMinHeight;
-        thumbHeight = thumbBottom - thumbTop;
-    }
-    
-    // position and size track element (add 1 to the middle section height for rounding errors)
-    this.trackTopElement.style.top = "0px";
-    this.trackMiddleElement.style.top = Math.round(trackTopHeight) + "px";
-    this.trackMiddleElement.style.height = Math.round(scrollbarHeight - trackTopHeight - trackBottomHeight + 1) + "px";
-    this.trackBottomElement.style.top = Math.round(scrollbarHeight - trackTopHeight) + "px";
-    
-    // position and size thumb element (add 1 to the middle section height for rounding errors)
-    this.thumbTopElement.style.top = Math.round(thumbTop) + "px";
-    this.thumbMiddleElement.style.top = Math.round(thumbTop + thumbTopHeight) + "px";
-    this.thumbMiddleElement.style.height = Math.round(thumbHeight - thumbTopHeight - thumbBottomHeight + 1) + "px";
-    this.thumbBottomElement.style.top = Math.round(thumbBottom - thumbBottomHeight) + "px";
-};
--- a/org.symbian.tools.wrttools/projecttemplates/WRTKit/UI/SelectionControl.js	Mon Apr 19 17:52:52 2010 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,165 +0,0 @@
-/**
- * Copyright (c) 2009-2010 Symbian Foundation and/or its subsidiary(-ies).
- * All rights reserved.
- * This component and the accompanying materials are made available
- * under the terms of the License "Eclipse Public License v1.0"
- * which accompanies this distribution, and is available
- * at the URL "http://www.eclipse.org/legal/epl-v10.html".
- *
- * Initial Contributors:
- * Nokia Corporation - initial contribution.
- * 
- * Contributors:
- * 
- * Description:
- * 
- */
-
-///////////////////////////////////////////////////////////////////////////////
-// The SelectionControl class is an abstract base class for controls that lets
-// the user select one or more options from a list of options. Don't use
-// SelectionControl directly.
-
-// Constructor.
-function SelectionControl(id, caption, options, multipleSelection, selected) {
-    if (id != UI_NO_INIT_ID) {
-        this.init(id, caption, options, multipleSelection, selected);
-    }
-}
-
-// SelectionControl inherits from Control.
-SelectionControl.prototype = new Control(UI_NO_INIT_ID);
-
-// List of options.
-SelectionControl.prototype.options = null;
-
-// The single selected option in single selection controls
-// or list of options in multi selection controls.
-SelectionControl.prototype.selected = null;
-
-// Single or multiple selection.
-SelectionControl.prototype.multipleSelection = false;
-
-// Initializer - called from constructor.
-SelectionControl.prototype.init = function(id, caption, options, multipleSelection, selected) {
-    uiLogger.debug("SelectionControl.init(" + id + ", " + caption + ", " + options + ", " + multipleSelection + ", " + selected + ")");
-    
-    // call superclass initializer
-    Control.prototype.init.call(this, id, caption);
-    
-    // set the multiple selection property
-    this.multipleSelection = multipleSelection;
-    
-    // init options and selected (makes copies of the original arrays)
-    this.options = (options != null) ? options.slice(0) : [];
-    if (multipleSelection) {
-        this.selected = (selected == null) ? [] : selected.slice(0);
-    } else {
-        this.selected = selected;
-    }
-    this.validateSelected();
-};
-
-// Returns true if the control is a multiple selection control; false if single.
-SelectionControl.prototype.isMultipleSelection = function() {
-    return this.multipleSelection;
-};
-
-// Returns true if the specified option is selected; false if not.
-SelectionControl.prototype.isSelected = function(option) {
-    if (this.multipleSelection) {
-        // multiple selection
-        // iterate through all selected options and look for the specified option
-        for (var i = 0; i < this.selected.length; i++) {
-            if (this.selected[i] == option) {
-                return true;
-            }
-        }
-        return false;
-    } else {
-        // single selection
-        return (this.selected == option);
-    }
-};
-
-// Returns the currently selected option in a single selection control or
-// an array of selected options in a multiple selection control. If there are
-// no selected options a single selection control returns null and a multiple
-// selection control returns an empty array.
-SelectionControl.prototype.getSelected = function() {
-    return this.multipleSelection ? this.selected.slice(0) : this.selected;
-};
-
-// Sets the currently selected options. Pass a single option in a single selection
-// control or an array of selected controls in a multiple selection control. To
-// deselect all options pass null in a single selection control and an empty array
-// in a multiple selection control.
-// Override in sublcasses to provide full implementation.
-SelectionControl.prototype.setSelected = function(selected) {
-    this.selected = this.multipleSelection ? selected.slice(0) : selected;
-    // make sure the selected option or options are legal
-    this.validateSelected();
-};
-
-// Ensures that the selected option or options exist among the options in this control.
-SelectionControl.prototype.validateSelected = function() {
-    if (this.multipleSelection) {
-        // multiple selection
-        // iterate through all selected options and ensure they exist among the options
-        for (var i = 0; i < this.selected.length; i++) {
-            // check that the selected option exists among the options
-            var found = false;
-            for (var j = 0; j < this.options.length; j++) {
-                if (this.options[j] == this.selected[i]) {
-                    // found - stop looking for this option
-                    found = true;
-                    break;
-                }
-            }
-            // not found - remove this selected element
-            if (!found) {
-                this.selected.splice(i, 1);
-                // since we removed an entry we must re-check this position
-                i--;
-            }
-        }
-    } else {
-        // single selection
-        if (this.selected != null) {
-            // check that the selected option exists among the options
-            for (var i = 0; i < this.options.length; i++) {
-                if (this.options[i] == this.selected) {
-                    // found - we're done
-                    return;
-                }
-            }
-            // not found - remove the selection
-            this.selected = null;
-        }
-    }
-};
-
-// Returns the options in the control as an array of option objects with
-// a value and text property.
-SelectionControl.prototype.getOptions = function() {
-    return this.options;
-};
-
-// Sets the options in the control.
-// Override in sublcasses to provide full implementation.
-SelectionControl.prototype.setOptions = function(options) {
-    this.options = options.slice(0);
-    // make sure the selected option or options are legal
-    this.validateSelected();
-};
-
-// Returns the option that has the specified value; null if none.
-SelectionControl.prototype.getOptionForValue = function(value) {
-    // iterate through all options and look for a match
-    for (var i = 0; i < this.options.length; i++) {
-        if (this.options[i].value == value) {
-            return this.options[i];
-        }
-    }
-    return null;
-};
--- a/org.symbian.tools.wrttools/projecttemplates/WRTKit/UI/SelectionList.js	Mon Apr 19 17:52:52 2010 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,331 +0,0 @@
-/**
- * Copyright (c) 2009-2010 Symbian Foundation and/or its subsidiary(-ies).
- * All rights reserved.
- * This component and the accompanying materials are made available
- * under the terms of the License "Eclipse Public License v1.0"
- * which accompanies this distribution, and is available
- * at the URL "http://www.eclipse.org/legal/epl-v10.html".
- *
- * Initial Contributors:
- * Nokia Corporation - initial contribution.
- * 
- * Contributors:
- * 
- * Description:
- * 
- */
-
-///////////////////////////////////////////////////////////////////////////////
-// The SelectionList class implements a single or multi selection control
-// that lets users select one or more options from a list of options.
-
-// Constructor.
-function SelectionList(id, caption, options, multipleSelection, selected) {
-    if (id != UI_NO_INIT_ID) {
-        this.init(id, caption, options, multipleSelection, selected);
-    }
-}
-
-// SelectionList inherits from SelectionControl.
-SelectionList.prototype = new SelectionControl(UI_NO_INIT_ID);
-
-// Root element for options.
-SelectionList.prototype.optionListElement = null;
-
-// Array for tracking option elements.
-SelectionList.prototype.optionElements = null;
-
-// Tracking for currently focused option; null if none.
-SelectionList.prototype.focusedOption = null;
-
-// Enabled status.
-SelectionList.prototype.enabled = false;
-
-// Initializer - called from constructor.
-SelectionList.prototype.init = function(id, caption, options, multipleSelection, selected) {
-    uiLogger.debug("SelectionList.init(" + id + ", " + caption + ", " + options + ", " + multipleSelection + ", " + selected + ")");
-    
-    // call superclass initializer
-    SelectionControl.prototype.init.call(this, id, caption, options, multipleSelection, selected);
-    
-    // create option list element
-    this.optionListElement = document.createElement("div");
-    this.controlElement.appendChild(this.optionListElement);
-    
-    // the control defaults to enabled
-    this.enabled = true;
-    
-    // init option element arrays
-    this.optionElements = [];
-    
-    // update the option elements to match the options in this control
-    this.updateOptionElements();
-};
-
-// Returns the enabled state.
-SelectionList.prototype.isEnabled = function() {
-    return this.enabled;
-};
-
-// Sets the enabled state.
-SelectionList.prototype.setEnabled = function(enabled) {
-    uiLogger.debug("SelectionList.setEnabled(" + enabled + ")");
-    // switch the state and update the the control
-    this.enabled = enabled;
-    this.updateOptionElements();
-};
-
-// Sets the focused state for the control.
-// Note: This may not always succeed.
-SelectionList.prototype.setFocused = function(focused) {
-    uiLogger.debug("SelectionList.setFocused(" + focused + ")");
-    if (this.enabled && this.optionElements.length > 0) {
-        if (focused) {
-            this.optionElements[0].link.focus();
-        } else {
-            this.optionElements[0].link.blur();
-        }
-    }
-};
-
-// Sets the currently selected options. Pass a single option in a single selection
-// control or an array of selected controls in a multiple selection control. To
-// deselect all options pass null in a single selection control and an empty array
-// in a multiple selection control.
-SelectionList.prototype.setSelected = function(selected) {
-    // call superclass setSelected()
-    SelectionControl.prototype.setSelected.call(this, selected);
-    this.updateStyleFromState();
-};
-
-// Sets the options in the control.
-SelectionList.prototype.setOptions = function(options) {
-    // call superclass setOptions()
-    SelectionControl.prototype.setOptions.call(this, options);
-    this.updateOptionElements();
-};
-
-// Updates the option elements for the control element.
-SelectionList.prototype.updateOptionElements = function() {
-    uiLogger.debug("SelectionControl.updateOptionElements()");
-    
-    // start by removing all current options from the option list element
-    while (this.optionListElement.firstChild != null) {
-        this.optionListElement.removeChild(this.optionListElement.firstChild);
-    }
-    
-    // iterate through the options and add (and possibly create) a
-    // properly configured option element for each option
-    for (var i = 0; i < this.options.length; i++) {
-        // get the option and option element we're working on
-        var option = this.options[i];
-        
-        // option, link and text elements for this option
-        var optionElement;
-        var optionLinkElement;
-        var optionTextElement;
-        
-        // get the elements
-        if (i == this.optionElements.length) {
-            // we need to create a new option element...
-            optionElement = document.createElement("div");
-            
-            // ...and a new option link element...
-            optionLinkElement = document.createElement("a");
-            optionLinkElement.href = "JavaScript:void(0)";
-            
-            // ...and a new option text element
-            optionTextElement = document.createElement("span");
-            
-            // hook up event listeners to the element
-            var self = this;
-            optionLinkElement.addEventListener("focus", function(event) { self.optionFocusStateChanged(event, true); }, false);
-            optionLinkElement.addEventListener("blur", function(event) { self.optionFocusStateChanged(event, false); }, false);
-            optionElement.addEventListener("mouseover", function() { self.hoverStateChanged(true); }, false);
-            optionElement.addEventListener("mouseout", function() { self.hoverStateChanged(false); }, false);
-            optionElement.addEventListener("mousedown", function(event) {
-                                                               self.optionClicked(event);
-                                                               event.stopPropagation();
-                                                               event.preventDefault();
-                                                        }, true);
-            optionElement.addEventListener("keydown", function(event) {
-                                                            // center and enter trigger the action
-                                                            if (event.keyCode == 0 || event.keyCode == 13) {
-                                                                self.optionClicked(event);
-                                                                event.stopPropagation();
-                                                                event.preventDefault();
-                                                            }
-                                                      }, true);
-            
-            // add the elements to the option element array
-            this.optionElements.push({ option: optionElement, link: optionLinkElement, text: optionTextElement });
-        } else {
-            // we already have ready elements so we'll reuse them
-            optionElement = this.optionElements[i].option;
-            optionLinkElement = this.optionElements[i].link;
-            optionTextElement = this.optionElements[i].text;
-            
-            // remove the option link element from its current parent - if any
-            if (optionLinkElement.parentNode != null) {
-                optionLinkElement.parentNode.removeChild(optionLinkElement);
-            }
-            
-            // remove the option text element from its current parent - if any
-            if (optionTextElement.parentNode != null) {
-                optionTextElement.parentNode.removeChild(optionTextElement);
-            }
-        }
-        
-        // set the option text
-        optionTextElement.innerHTML = option.text;
-        
-        // hook up the option to the control
-        if (this.enabled) {
-            // add the option link element to the option element
-            optionElement.appendChild(optionLinkElement);
-            // add the text element to the option element
-            optionLinkElement.appendChild(optionTextElement);
-        } else {
-            // add the text element directly to the control element
-            optionElement.appendChild(optionTextElement);
-        }
-        // add the option element to the option list element
-        this.optionListElement.appendChild(optionElement);
-    }
-    
-    // update the style
-    this.updateStyleFromState();
-};
-
-// Callback for focus state change events.
-SelectionList.prototype.optionFocusStateChanged = function(event, focused) {
-    uiLogger.debug("SelectionControl.optionFocusStateChanged()");
-    
-    // get the event source option
-    var option = null;
-    var optionElement = null;
-    for (var i = 0; i < this.optionElements.length; i++) {
-        optionElement = this.optionElements[i];
-        if (optionElement.link == event.currentTarget) {
-            option = this.options[i];
-            break;
-        }
-    }
-    
-    // remember the focused option; or null if none is focused
-    if (focused) {
-        this.focusedOption = option;
-    } else {
-        this.focusedOption = null;
-    }
-    
-    // call the superclass focus state change handler
-    this.focusStateChanged(focused);
-};
-
-// Callback for clicks.
-SelectionList.prototype.optionClicked = function(event) {
-    uiLogger.debug("SelectionControl.optionClicked()");
-    
-    // bail out if we're not enabled
-    if (!this.enabled) {
-        return false;
-    }
-    
-    // get the changed option
-    var option = null;
-    var optionElement = null;
-    for (var i = 0; i < this.optionElements.length; i++) {
-        optionElement = this.optionElements[i];
-        if (optionElement.option == event.currentTarget) {
-            option = this.options[i];
-            break;
-        }
-    }
-    
-    // make sure the option is focused
-    optionElement.link.focus();
-    
-    // toggle the selection
-    if (this.multipleSelection) {
-        // iterate through the selected options and see if this
-        // option is selected. if not then add it to the selection.
-        // if it already is selected then them remove it.
-        var found = false;
-        for (var i = 0; i < this.selected.length; i++) {
-            if (this.selected[i] == option) {
-                // remove from selected set
-                found = true;
-                this.selected.splice(i, 1);
-                break;
-            }
-        }
-        if (!found) {
-            // add to the selected set
-            this.selected.push(option);
-        }
-    } else {
-        // update the selected option
-        this.selected = option;
-    }
-    
-    // update the style
-    this.updateStyleFromState();
-    
-    // notify event listeners
-    this.fireEvent(this.createEvent("SelectionChanged", this.getSelected()));
-};
-
-// Resets the state tracking for focus and hover.
-// Override this in subclasses as required to implement the state reset.
-SelectionList.prototype.resetFocusState = function() {
-    uiLogger.debug("SelectionList.resetFocusState()");
-    this.hovering = false;
-    this.focused = false;
-    this.focusedOption = null;
-    this.updateStyleFromState();
-};
-
-// Updates the style of the control to reflects the state of the control.
-SelectionList.prototype.updateStyleFromState = function() {
-    uiLogger.debug("SelectionList.updateStyleFromState()");
-    
-    // determine the state name
-    var stateName = this.getStyleStateName();
-    
-    // set element class names
-    this.setClassName(this.rootElement, "Control");
-    this.setClassName(this.controlElement, "ControlElement");
-    this.setClassName(this.assemblyElement, "ControlAssembly ControlAssembly" + stateName);
-    this.setClassName(this.captionElement, "ControlCaption ControlCaption" + stateName);
-    
-    // set option list and option class names
-    this.setClassName(this.optionListElement, "SelectionList SelectionList" + stateName);
-    for (var i = 0; i < this.options.length; i++) {
-        var option = this.options[i];
-        
-        // get the option and option text elements for this option
-        var optionElement = this.optionElements[i].option;
-        var optionTextElement = this.optionElements[i].text;
-        
-        // figure out the option state
-        var optionStateName = this.isSelected(option) ? "Checked" : "Unchecked";
-        if (!this.enabled) {
-            optionStateName += "Disabled";
-        } else if (this.focusedOption == option) {
-            optionStateName += "Focus";
-        } else {
-            optionStateName += "Normal";
-        }
-        
-        // set option element class names
-        if (this.multipleSelection) {
-            this.setClassName(optionElement, "SelectionListOptionMulti SelectionListOptionMulti" + optionStateName);
-        } else {
-            this.setClassName(optionElement, "SelectionListOptionSingle SelectionListOptionSingle" + optionStateName);
-        }
-        
-        // set option text class names
-        this.setClassName(optionTextElement, "SelectionListOptionText SelectionListOptionText" + stateName);
-    }
-};
--- a/org.symbian.tools.wrttools/projecttemplates/WRTKit/UI/SelectionMenu.js	Mon Apr 19 17:52:52 2010 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,180 +0,0 @@
-/**
- * Copyright (c) 2009-2010 Symbian Foundation and/or its subsidiary(-ies).
- * All rights reserved.
- * This component and the accompanying materials are made available
- * under the terms of the License "Eclipse Public License v1.0"
- * which accompanies this distribution, and is available
- * at the URL "http://www.eclipse.org/legal/epl-v10.html".
- *
- * Initial Contributors:
- * Nokia Corporation - initial contribution.
- * 
- * Contributors:
- * 
- * Description:
- * 
- */
-
-///////////////////////////////////////////////////////////////////////////////
-// The SelectionMenu class implements a single or multi selection control
-// that lets users select one or more options from a menu.
-
-// Constructor.
-function SelectionMenu(id, caption, options, multipleSelection, selected) {
-    if (id != UI_NO_INIT_ID) {
-        this.init(id, caption, options, multipleSelection, selected);
-    }
-}
-
-// SelectionMenu inherits from SelectionControl.
-SelectionMenu.prototype = new SelectionControl(UI_NO_INIT_ID);
-
-// Reference to the peer HTML element.
-SelectionControl.prototype.peerElement = null;
-
-// Array for tracking option elements.
-SelectionMenu.prototype.optionElements = null;
-
-// Initializer - called from constructor.
-SelectionMenu.prototype.init = function(id, caption, options, multipleSelection, selected) {
-    uiLogger.debug("SelectionMenu.init(" + id + ", " + caption + ", " + options + ", " + multipleSelection + ", " + selected + ")");
-    
-    // call superclass initializer
-    SelectionControl.prototype.init.call(this, id, caption, options, multipleSelection, selected);
-    
-    // create the control
-    this.peerElement = document.createElement("select");
-    this.peerElement.multiple = multipleSelection;
-    this.controlElement.appendChild(this.peerElement);
-    
-    // init option elements array
-    this.optionElements = [];
-    
-    // update the option elements to match the options in this control
-    this.updateOptionElements();
-    
-    // bind event listeners
-    var self = this;
-    this.peerElement.addEventListener("focus", function() { self.focusStateChanged(true); }, false);
-    this.peerElement.addEventListener("blur", function() { self.focusStateChanged(false); }, false);
-    this.peerElement.addEventListener("mouseover", function() { self.hoverStateChanged(true); }, false);
-    this.peerElement.addEventListener("mouseout", function() { self.hoverStateChanged(false); }, false);
-    this.peerElement.addEventListener("change", function() { self.selectionChanged(); }, false);
-};
-
-// Returns the enabled state.
-SelectionMenu.prototype.isEnabled = function() {
-    return !this.peerElement.disabled;
-};
-
-// Sets the enabled state.
-SelectionMenu.prototype.setEnabled = function(enabled) {
-    uiLogger.debug("SelectionMenu.setEnabled(" + enabled + ")");
-    this.peerElement.disabled = !enabled;
-};
-
-// Sets the focused state for the control.
-// Note: This may not always succeed.
-SelectionMenu.prototype.setFocused = function(focused) {
-    uiLogger.debug("SelectionMenu.setFocused(" + focused + ")");
-    if (focused) {
-        this.peerElement.focus();
-    } else {
-        this.peerElement.blur();
-    }
-};
-
-// Sets the currently selected options. Pass a single option in a single selection
-// control or an array of selected controls in a multiple selection control. To
-// deselect all options pass null in a single selection control and an empty array
-// in a multiple selection control.
-SelectionMenu.prototype.setSelected = function(selected) {
-    // call superclass setSelected()
-    SelectionControl.prototype.setSelected.call(this, selected);
-    
-    // iterate through the options and set the selected state
-    // on the corresponding option element
-    for (var i = 0; i < this.options.length; i++) {
-        this.optionElements[i].selected = this.isSelected(this.options[i]);
-    }
-};
-
-// Sets the options in the control.
-SelectionMenu.prototype.setOptions = function(options) {
-    // call superclass setOptions()
-    SelectionControl.prototype.setOptions.call(this, options);
-    this.updateOptionElements();
-};
-
-// Updates the option elements for the peer select element.
-SelectionMenu.prototype.updateOptionElements = function() {
-    // start by removing all current options from the select element
-    while (this.peerElement.firstChild != null) {
-        this.peerElement.removeChild(this.peerElement.firstChild);
-    }
-    
-    // iterate through the options and add (and possibly create) a
-    // properly configured option element for each option
-    for (var i = 0; i < this.options.length; i++) {
-        // do we need to create a new option element?
-        if (i == this.optionElements.length) {
-            this.optionElements.push(document.createElement("option"));
-        }
-        
-        // get the option and option element we're working on
-        var option = this.options[i];
-        var optionElement = this.optionElements[i];
-        
-        // set the state for this option element and add it to the
-        // peer select element
-        optionElement.text = option.text;
-        optionElement.selected = this.isSelected(option);
-        this.peerElement.appendChild(optionElement);
-    }
-    
-    // update the style
-    this.updateStyleFromState();    
-};
-
-// Callback for selection change events.
-SelectionMenu.prototype.selectionChanged = function() {
-    uiLogger.debug("SelectionControl.selectionChanged()");
-    
-    // update the selected options array or reference
-    this.selected = (this.multipleSelection) ? [] : null;
-    for (var i = 0; i < this.options.length; i++) {
-        if (this.optionElements[i].selected) {
-            if (this.multipleSelection) {
-                this.selected.push(this.options[i]);
-            } else {
-                this.selected = this.options[i];
-                break;
-            }
-        }
-    }
-    
-    // notify event listeners
-    this.fireEvent(this.createEvent("SelectionChanged", this.getSelected()));
-};
-
-// Updates the style of the control to reflects the state of the control.
-SelectionMenu.prototype.updateStyleFromState = function() {
-    uiLogger.debug("SelectionMenu.updateStyleFromState()");
-    
-    // determine the state name
-    var stateName = this.getStyleStateName();
-    
-    // set element class names
-    this.setClassName(this.rootElement, "Control");
-    this.setClassName(this.controlElement, "ControlElement");
-    this.setClassName(this.assemblyElement, "ControlAssembly ControlAssembly" + stateName);
-    this.setClassName(this.captionElement, "ControlCaption ControlCaption" + stateName);
-    
-    // set select and option element class names
-    var peerStateName = this.isEnabled() ? stateName : "Disabled";
-    this.setClassName(this.peerElement, "SelectionMenu SelectionMenu" + peerStateName);
-    for (var i = 0; i < this.options.length; i++) {
-        var option = this.optionElements[i];
-        this.setClassName(option, "SelectionMenuOption SelectionMenuOption" + peerStateName);
-    }
-};
--- a/org.symbian.tools.wrttools/projecttemplates/WRTKit/UI/Separator.js	Mon Apr 19 17:52:52 2010 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,95 +0,0 @@
-/**
- * Copyright (c) 2009-2010 Symbian Foundation and/or its subsidiary(-ies).
- * All rights reserved.
- * This component and the accompanying materials are made available
- * under the terms of the License "Eclipse Public License v1.0"
- * which accompanies this distribution, and is available
- * at the URL "http://www.eclipse.org/legal/epl-v10.html".
- *
- * Initial Contributors:
- * Nokia Corporation - initial contribution.
- * 
- * Contributors:
- * 
- * Description:
- * 
- */
-
-///////////////////////////////////////////////////////////////////////////////
-// The Separator class is used to provide a visual separator in a list.
-
-// Constructor.
-function Separator(id) {
-    if (id != UI_NO_INIT_ID) {
-        this.init(id);
-    }
-}
-
-// Separator inherits from Control.
-Separator.prototype = new Control(UI_NO_INIT_ID);
-
-// Reference to the separator element.
-Separator.prototype.separatorElement = null;
-
-// Separator row element.
-Separator.prototype.tableRowElement = null;
-
-// Left cell element.
-Separator.prototype.tableLeftCellElement = null;
-
-// Center cell element.
-Separator.prototype.tableCenterCellElement = null;
-
-// Right cell element.
-Separator.prototype.tableRightCellElement = null;
-
-// Initializer - called from constructor.
-Separator.prototype.init = function(id) {
-    uiLogger.debug("Separator.init(" + id + ")");
-    
-    // call superclass initializer
-    Control.prototype.init.call(this, id, null);
-    
-    // remove caption and control elements
-    this.assemblyElement.removeChild(this.captionElement);
-    this.assemblyElement.removeChild(this.controlElement);
-    
-    // create separator
-    this.separatorElement = document.createElement("table");
-    this.tableRowElement = document.createElement("tr");
-    this.tableLeftCellElement = document.createElement("td");
-    this.tableCenterCellElement = document.createElement("td");
-    this.tableRightCellElement = document.createElement("td");
-    this.tableRowElement.appendChild(this.tableLeftCellElement);
-    this.tableRowElement.appendChild(this.tableCenterCellElement);
-    this.tableRowElement.appendChild(this.tableRightCellElement);
-    this.separatorElement.appendChild(this.tableRowElement);
-    this.assemblyElement.appendChild(this.separatorElement);
-    
-    // update style
-    this.updateStyleFromState();
-};
-
-// Returns the enabled state for the control.
-Separator.prototype.isEnabled = function() {
-    return true;
-};
-
-// Returns the focusable state for the control.
-Separator.prototype.isFocusable = function() {
-    return false;
-};
-
-// Updates the style of the control to reflects the state of the control.
-Separator.prototype.updateStyleFromState = function() {
-    uiLogger.debug("Separator.updateStyleFromState()");
-    
-    // set element class names
-    this.setClassName(this.rootElement, "Control");
-    this.setClassName(this.assemblyElement, "ControlAssembly ControlAssemblyNormal");
-    this.setClassName(this.separatorElement, "Separator");
-    this.setClassName(this.tableRowElement, "SeparatorRow");
-    this.setClassName(this.tableLeftCellElement, "SeparatorLeftCell");
-    this.setClassName(this.tableCenterCellElement, "SeparatorCenterCell");
-    this.setClassName(this.tableRightCellElement, "SeparatorRightCell");
-};
--- a/org.symbian.tools.wrttools/projecttemplates/WRTKit/UI/TextArea.js	Mon Apr 19 17:52:52 2010 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,72 +0,0 @@
-/**
- * Copyright (c) 2009-2010 Symbian Foundation and/or its subsidiary(-ies).
- * All rights reserved.
- * This component and the accompanying materials are made available
- * under the terms of the License "Eclipse Public License v1.0"
- * which accompanies this distribution, and is available
- * at the URL "http://www.eclipse.org/legal/epl-v10.html".
- *
- * Initial Contributors:
- * Nokia Corporation - initial contribution.
- * 
- * Contributors:
- * 
- * Description:
- * 
- */
-
-///////////////////////////////////////////////////////////////////////////////
-// The TextArea class implements a multi line text entry control.
-
-// Constructor.
-function TextArea(id, caption, value, rows) {
-    if (id != UI_NO_INIT_ID) {
-        this.init(id, caption, value, rows);
-    }
-}
-
-// TextArea inherits from TextEntryControl.
-TextArea.prototype = new TextEntryControl(UI_NO_INIT_ID);
-
-// Initializer - called from constructor.
-TextArea.prototype.init = function(id, caption, value, rows) {
-    uiLogger.debug("TextArea.init(" + id + ", " + caption + ", " + value + ", " + rows + ")");
-    
-    // call superclass initializer
-    TextEntryControl.prototype.init.call(this, id, caption);
-    
-    // create the peer element
-    this.peerElement = document.createElement("textarea");
-    // default rowcount is 3 if not defined
-    // width always comes from style but is a required attribute
-    this.peerElement.rows = (rows != null) ? rows : 3;
-    this.peerElement.cols = 20;
-    this.controlElement.appendChild(this.peerElement);
-    
-    // set the value
-    this.peerElement.value = (value == null) ? "" : value;
-    
-    // bind event listeners
-    this.bindTextEntryControlListeners();
-    
-    // update the style
-    this.updateStyleFromState();
-};
-
-// Updates the style of the control to reflects the state of the control.
-TextArea.prototype.updateStyleFromState = function() {
-    uiLogger.debug("TextArea.updateStyleFromState()");
-    
-    // determine the state name
-    var stateName = this.getStyleStateName();
-    
-    // set element class names
-    this.setClassName(this.rootElement, "Control");
-    this.setClassName(this.controlElement, "ControlElement");
-    this.setClassName(this.assemblyElement, "ControlAssembly ControlAssembly" + stateName);
-    this.setClassName(this.captionElement, "ControlCaption ControlCaption" + stateName);
-    
-    // set peer element class names
-    var peerStateName = this.isEnabled() ? stateName : "Disabled";
-    this.setClassName(this.peerElement, "TextArea TextArea" + stateName);
-};
--- a/org.symbian.tools.wrttools/projecttemplates/WRTKit/UI/TextEntryControl.js	Mon Apr 19 17:52:52 2010 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,101 +0,0 @@
-/**
- * Copyright (c) 2009-2010 Symbian Foundation and/or its subsidiary(-ies).
- * All rights reserved.
- * This component and the accompanying materials are made available
- * under the terms of the License "Eclipse Public License v1.0"
- * which accompanies this distribution, and is available
- * at the URL "http://www.eclipse.org/legal/epl-v10.html".
- *
- * Initial Contributors:
- * Nokia Corporation - initial contribution.
- * 
- * Contributors:
- * 
- * Description:
- * 
- */
-
-///////////////////////////////////////////////////////////////////////////////
-// The TextEntryControl class is an abstract base class for the single and multi-
-// line text entry controls TextField and TextArea. Don't use TextEntryControl
-// directly.
-
-// Constructor.
-function TextEntryControl(id, caption) {
-    if (id != UI_NO_INIT_ID) {
-        this.init(id, caption);
-    }
-}
-
-// TextEntryControl inherits from Control.
-TextEntryControl.prototype = new Control(UI_NO_INIT_ID);
-
-// Reference to the peer HTML element.
-TextEntryControl.prototype.peerElement = null;
-
-// Initializer - called from constructor.
-TextEntryControl.prototype.init = function(id, caption) {
-    uiLogger.debug("TextEntryControl.init(" + id + ", " + caption + ")");
-    
-    // call superclass initializer
-    Control.prototype.init.call(this, id, caption);
-};
-
-// Common event listeners hookup function called from subclasses.
-TextEntryControl.prototype.bindTextEntryControlListeners = function() {
-    var self = this;
-    this.peerElement.addEventListener("focus", function() { self.focusStateChanged(true); }, false);
-    this.peerElement.addEventListener("blur", function() { self.focusStateChanged(false); }, false);
-    this.peerElement.addEventListener("mouseover", function() { self.hoverStateChanged(true); }, false);
-    this.peerElement.addEventListener("mouseout", function() { self.hoverStateChanged(false); }, false);
-    this.peerElement.addEventListener("change", function() { self.valueChanged(); }, false);
-};
-
-// Returns the enabled state.
-// Override this in subclasses as required to implement the state change.
-TextEntryControl.prototype.isEnabled = function() {
-    return !this.peerElement.readOnly;
-};
-
-// Sets the enabled state.
-// Override this in subclasses as required to implement the state change.
-TextEntryControl.prototype.setEnabled = function(enabled) {
-    uiLogger.debug("TextEntryControl.setEnabled(" + enabled + ")");
-    this.peerElement.readOnly = !enabled;
-    // update the style
-    this.updateStyleFromState();
-};
-
-// Returns the control text.
-TextEntryControl.prototype.getText = function() {
-    return this.peerElement.value;
-};
-
-// Sets the text for the control.
-TextEntryControl.prototype.setText = function(text) {
-    this.peerElement.value = text;
-};
-
-// Returns the focusable state for the control.
-TextEntryControl.prototype.isFocusable = function() {
-    // text entry controls are always focusable
-    return true;
-};
-
-// Sets the focused state for the control.
-// Note: This may not always succeed.
-TextEntryControl.prototype.setFocused = function(focused) {
-    uiLogger.debug("TextEntryControl.setFocused(" + focused + ")");
-    if (focused) {
-        this.peerElement.focus();
-    } else {
-        this.peerElement.blur();
-    }
-};
-
-// Callback for value change events.
-TextEntryControl.prototype.valueChanged = function() {
-    uiLogger.debug("TextEntryControl.valueChanged()");
-    // notify event listeners
-    this.fireEvent(this.createEvent("ValueChanged", this.peerElement.value));
-};
--- a/org.symbian.tools.wrttools/projecttemplates/WRTKit/UI/TextField.js	Mon Apr 19 17:52:52 2010 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,69 +0,0 @@
-/**
- * Copyright (c) 2009-2010 Symbian Foundation and/or its subsidiary(-ies).
- * All rights reserved.
- * This component and the accompanying materials are made available
- * under the terms of the License "Eclipse Public License v1.0"
- * which accompanies this distribution, and is available
- * at the URL "http://www.eclipse.org/legal/epl-v10.html".
- *
- * Initial Contributors:
- * Nokia Corporation - initial contribution.
- * 
- * Contributors:
- * 
- * Description:
- * 
- */
-
-///////////////////////////////////////////////////////////////////////////////
-// The TextField class implements a single line text entry control.
-
-// Constructor.
-function TextField(id, caption, value, masked) {
-    if (id != UI_NO_INIT_ID) {
-        this.init(id, caption, value, masked);
-    }
-}
-
-// TextField inherits from TextEntryControl.
-TextField.prototype = new TextEntryControl(UI_NO_INIT_ID);
-
-// Initializer - called from constructor.
-TextField.prototype.init = function(id, caption, value, masked) {
-    uiLogger.debug("TextField.init(" + id + ", " + caption + ", " + value + ", " + masked + ")");
-    
-    // call superclass initializer
-    TextEntryControl.prototype.init.call(this, id, caption);
-    
-    // create the peer element
-    this.peerElement = document.createElement("input");
-    this.peerElement.type = masked ? "password" : "text";
-    this.controlElement.appendChild(this.peerElement);
-    
-    // set the value
-    this.peerElement.value = (value == null) ? "" : value;
-    
-    // bind event listeners
-    this.bindTextEntryControlListeners();
-    
-    // update the style
-    this.updateStyleFromState();
-};
-
-// Updates the style of the control to reflects the state of the control.
-TextField.prototype.updateStyleFromState = function() {
-    uiLogger.debug("TextField.updateStyleFromState()");
-    
-    // determine the state name
-    var stateName = this.getStyleStateName();
-    
-    // set element class names
-    this.setClassName(this.rootElement, "Control");
-    this.setClassName(this.controlElement, "ControlElement");
-    this.setClassName(this.assemblyElement, "ControlAssembly ControlAssembly" + stateName);
-    this.setClassName(this.captionElement, "ControlCaption ControlCaption" + stateName);
-    
-    // set peer element class names
-    var peerStateName = this.isEnabled() ? stateName : "Disabled";
-    this.setClassName(this.peerElement, "TextField TextField" + peerStateName);
-};
--- a/org.symbian.tools.wrttools/projecttemplates/WRTKit/UI/UIElement.js	Mon Apr 19 17:52:52 2010 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,90 +0,0 @@
-/**
- * Copyright (c) 2009-2010 Symbian Foundation and/or its subsidiary(-ies).
- * All rights reserved.
- * This component and the accompanying materials are made available
- * under the terms of the License "Eclipse Public License v1.0"
- * which accompanies this distribution, and is available
- * at the URL "http://www.eclipse.org/legal/epl-v10.html".
- *
- * Initial Contributors:
- * Nokia Corporation - initial contribution.
- * 
- * Contributors:
- * 
- * Description:
- * 
- */
-
-///////////////////////////////////////////////////////////////////////////////
-// The UIElement class is the base class for all user interface elements.
-
-// Constructor.
-function UIElement(id) {
-    if (id != UI_NO_INIT_ID) {
-        this.init(id);
-    }
-}
-
-// UI element identifier.
-UIElement.prototype.id = null;
-
-// Root HTML element in the UI element.
-UIElement.prototype.rootElement = null;
-
-// Initializer for UIElement.
-UIElement.prototype.init = function(id) {
-    uiLogger.debug("UIElement.init(" + id + ")");
-    
-    // copy identifier
-    this.id = id;
-    
-    // init event listener array
-    this.eventListeners = [];
-    
-    // create the root element
-    this.rootElement = document.createElement("div");
-    if (id != null) {
-        this.rootElement.id = id;
-    }
-};
-
-// Returns an array containing the current event listeners.
-UIElement.prototype.getEventListeners = function() {
-    return this.eventListeners;
-};
-
-// Adds an event listener.
-UIElement.prototype.addEventListener = function(eventType, listener) {
-    var listenerDef = { type: eventType, listener: listener };
-    this.eventListeners.push(listenerDef);
-};
-
-// Removes an event listener.
-UIElement.prototype.removeEventListener = function(eventType, listener) {
-    // iterate through current listeners and remove the specified
-    // listener when its found
-    for (var i = 0; i < this.eventListeners.length; i++) {
-        var listenerDef = this.eventListeners[i];
-        if ((listenerDef.type == eventType) &&
-                (listenerDef.listener == listener)) {
-            this.eventListeners.splice(i, 1);
-            return;
-        }
-    }
-};
-
-// Factory method for an event object where this object is the source object.
-UIElement.prototype.createEvent = function(type, value) {
-    return { source: this, type: type, value: value };
-};
-
-// Fires an event to all listeners.
-UIElement.prototype.fireEvent = function(event) {
-    // iterate through all event listeners and notify them of the event
-    for (var i = 0; i < this.eventListeners.length; i++) {
-        var listenerDef = this.eventListeners[i];
-        if (listenerDef.type == null || listenerDef.type == event.type) {
-            listenerDef.listener.call(this, event);
-        }
-    }
-};
--- a/org.symbian.tools.wrttools/projecttemplates/WRTKit/UI/UIInit.js	Mon Apr 19 17:52:52 2010 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,25 +0,0 @@
-/**
- * Copyright (c) 2009-2010 Symbian Foundation and/or its subsidiary(-ies).
- * All rights reserved.
- * This component and the accompanying materials are made available
- * under the terms of the License "Eclipse Public License v1.0"
- * which accompanies this distribution, and is available
- * at the URL "http://www.eclipse.org/legal/epl-v10.html".
- *
- * Initial Contributors:
- * Nokia Corporation - initial contribution.
- * 
- * Contributors:
- * 
- * Description:
- * 
- */
-
-///////////////////////////////////////////////////////////////////////////////
-// The UIInit script is included before the rest of the UI scripts to setup
-// any resources needed by the UI toolkit.
-
-// Create UI logger.
-var uiLogger = new Logger();
-uiLogger.level = uiLogger.LOG_LEVEL_OFF;
-uiLogger.filter = ["QECR"];
--- a/org.symbian.tools.wrttools/projecttemplates/WRTKit/UI/UIManager.js	Mon Apr 19 17:52:52 2010 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,216 +0,0 @@
-/**
- * Copyright (c) 2009-2010 Symbian Foundation and/or its subsidiary(-ies).
- * All rights reserved.
- * This component and the accompanying materials are made available
- * under the terms of the License "Eclipse Public License v1.0"
- * which accompanies this distribution, and is available
- * at the URL "http://www.eclipse.org/legal/epl-v10.html".
- *
- * Initial Contributors:
- * Nokia Corporation - initial contribution.
- * 
- * Contributors:
- * 
- * Description:
- * 
- */
-
-///////////////////////////////////////////////////////////////////////////////
-// The UI manager manages a set of views and other user interface elements.
-
-// Constructor.
-function UIManager(viewParentElement, scrollbarParentElement, enableScrollBar, delayInit) {    
-    uiLogger.debug("UIManager(" + viewParentElement + ", " + scrollbarParentElement + ")");
-    if (delayInit == null) {
-        this.init(viewParentElement, enableScrollBar, scrollbarParentElement);
-    }
-}
-
-// Parent element for views.
-UIManager.prototype.viewParentElement = null;
-
-// Parent element for scrollbar.
-UIManager.prototype.scrollbarParentElement = null;
-
-// The currently displayed view.
-UIManager.prototype.currentView = null;
-
-// Reference to the scrollbar.
-UIManager.prototype.scrollbar = null;
-
-// Current scroll Y position.
-UIManager.prototype.scrollY = -1;
-
-// Current viewport height.
-UIManager.prototype.viewportHeight = -1;
-
-// Current document height.
-UIManager.prototype.documentHeight = -1;
-
-// Timer identifier or null if no active timer.
-UIManager.prototype.timerId = null;
-
-// Interval for timer ticks for the UI manager timer (in milliseconds)
-UIManager.prototype.TIMER_INTERVAL = 250;
-
-// Reference to the notification popup used to displays notifications.
-UIManager.prototype.notificationPopup = null;
-
-// is scrollbar enabled
-UIManager.prototype.enableScrollBar = null;
-
-// init function
-UIManager.prototype.init = function(viewParentElement, enableScrollBar, scrollbarParentElement) {
-    this.enableScrollBar = enableScrollBar;
-    
-    // parent element for views
-    if (viewParentElement == null) {
-        // create a parent for views
-        this.viewParentElement = document.createElement("div");
-        this.viewParentElement.className = "ViewContainer";
-        document.body.appendChild(this.viewParentElement);
-    }
-    else {
-        this.viewParentElement = viewParentElement;
-    }
-    
-    // parent element for scrollbar
-    if (enableScrollBar) {
-        if (scrollbarParentElement == null) {
-            // create a parent for the scrollbar
-            this.scrollbarParentElement = document.createElement("div");
-            this.scrollbarParentElement.className = "DocumentScrollbarContainer";
-            document.body.appendChild(this.scrollbarParentElement);
-        }
-        else {
-            this.scrollbarParentElement = scrollbarParentElement;
-        }
-    }
-    
-    // currently selected view
-    this.currentView = null;
-    
-    // create the notification popup
-    // the notification popup adds itself as a child element to the document body
-    this.notificationPopup = new NotificationPopup();
-    
-    // create scrollbar
-    if (enableScrollBar) {
-        this.scrollbar = new Scrollbar(this.scrollbarParentElement);
-    }
-    
-    // setup scrollbar tracking
-    var self = this;
-    this.startTimer();
-    if (enableScrollBar) {
-        window.addEventListener("resize", function(){
-            self.updateScrollbar();
-        }, false);
-        window.addEventListener("scroll", function(){
-            self.updateScrollbar();
-        }, false);
-    }
-};
-
-// Returns the current view.
-UIManager.prototype.getView = function() {
-    return this.currentView;
-};
-
-// Switches to the specified view.
-UIManager.prototype.setView = function(view) {
-    uiLogger.debug("View set to " + view.id);
-    
-    // remove the current view from the parent element
-    if (this.currentView != null) {
-        this.viewParentElement.removeChild(this.currentView.rootElement);
-    }
-    
-    // reset scroll
-    window.scrollTo(0, 0);
-    
-    // add the new view to the parent element
-    if (view != null) {
-        this.currentView = view;
-        this.currentView.resetControlFocusStates();
-        this.viewParentElement.appendChild(this.currentView.rootElement);
-    }
-    
-    // update scrollbar
-    if (this.enableScrollBar) {
-        this.updateScrollbar();
-    }
-    
-    // focus the first focusable control
-    // a timer is used to prevent unwanted focus shift
-    setTimeout(function() { view.focusFirstControl(); }, 1);
-};
-
-// Updates the scrollbar.
-UIManager.prototype.updateScrollbar = function() {
-    if (this.enableScrollBar) {
-        // get current viewport and document position and dimensions
-        var scrollY = window.scrollY;
-        var viewportHeight = window.innerHeight;
-        var documentHeight = Math.max(document.documentElement.scrollHeight, document.height);
-        
-        // check if the scroll position or view has changed
-        if (this.scrollY != scrollY ||
-                this.viewportHeight != viewportHeight ||
-                this.documentHeight != documentHeight) {
-            // scroll position or view has changed
-            this.scrollY = scrollY;
-            this.viewportHeight = viewportHeight;
-            this.documentHeight = documentHeight;
-            
-            // update the scrollbar
-            this.scrollbar.update(scrollY, viewportHeight, documentHeight);
-            uiLogger.debug("Scrollbar updated");
-        }
-    }
-};
-
-// Starts the view manager timer.
-UIManager.prototype.startTimer = function() {
-    if (this.timerId == null) {
-        uiLogger.debug("UIManager timer started");
-        var self = this;
-        // setup the timer
-        this.timerId = setInterval(function() { self.onTimer(); }, this.TIMER_INTERVAL);
-    } else {
-        uiLogger.warn("UIManager timer already running");
-    }
-};
-
-// Stops the view manager timer.
-UIManager.prototype.stopTimer = function() {
-    if (this.timerId != null) {
-        // stop the timer
-        clearTimeout(this.timerId);
-        this.timerId = null;
-    } else {
-        uiLogger.warn("UIManager timer already stopped");
-    }
-};
-
-// Timer callback function.
-UIManager.prototype.onTimer = function() {
-    if (this.enableScrollBar) {
-        // make sure the scrollbar is up to date
-        this.updateScrollbar();
-    }
-};
-
-// Displays a notification.
-UIManager.prototype.showNotification = function(displayTime, type, text, progress) {
-    uiLogger.debug("UIManager.showNotification(" + displayTime + ", " + type + ", " + text + ", " + progress + ")");
-    // use the notification popup to show the notification
-    this.notificationPopup.showNotification(displayTime, type, text, progress);
-};
-
-// Hides the currently displayed notification.
-UIManager.prototype.hideNotification = function() {
-    uiLogger.debug("UIManager.hideNotification()");
-    // hide the notification popup
-    this.notificationPopup.hideNotification();
-};
--- a/org.symbian.tools.wrttools/projecttemplates/WRTKit/UI/View.js	Mon Apr 19 17:52:52 2010 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,66 +0,0 @@
-/**
- * Copyright (c) 2009-2010 Symbian Foundation and/or its subsidiary(-ies).
- * All rights reserved.
- * This component and the accompanying materials are made available
- * under the terms of the License "Eclipse Public License v1.0"
- * which accompanies this distribution, and is available
- * at the URL "http://www.eclipse.org/legal/epl-v10.html".
- *
- * Initial Contributors:
- * Nokia Corporation - initial contribution.
- * 
- * Contributors:
- * 
- * Description:
- * 
- */
-
-///////////////////////////////////////////////////////////////////////////////
-// The View class is an abstract base class for views in the UI toolkit.
-// Don't use the View directly - instead use a concrete subclass like ListView.
-
-// Constructor.
-function View(id) {
-    if (id != UI_NO_INIT_ID) {
-        this.init(id);
-    }
-}
-
-// View inherits from UIElement.
-View.prototype = new UIElement(UI_NO_INIT_ID);
-
-// Currently focused control.
-View.prototype.focusedControl = null;
-
-// Initializer - called from constructor.
-View.prototype.init = function(id) {
-    uiLogger.debug("View.init(" + id + ")");
-    
-    // call superclass initializer
-    UIElement.prototype.init.call(this, id);
-};
-
-// Returns the currently focused control; null if none.
-View.prototype.getFocusedControl = function() {
-    return this.focusedControl;
-};
-
-// Used to notify the view that the focused control has changed.
-View.prototype.focusedControlChanged = function(control) {
-    uiLogger.debug("View.focusedControlChanged(" + control + ")");
-    this.focusedControl = control;
-    // notify event listeners
-    this.fireEvent(this.createEvent("FocusedControlChanged", this.focusedControl));
-};
-
-// Attempts to focus the first focusable control.
-// Override in subclasses as required.
-View.prototype.focusFirstControl = function() {
-    uiLogger.debug("View.focusFirstControl()");
-};
-
-// Attempts to reset all control focus states.
-// Override in subclasses as required.
-View.prototype.resetControlFocusStates = function() {
-    uiLogger.debug("View.resetControlFocusStates()");
-};
--- a/org.symbian.tools.wrttools/projecttemplates/WRTKit/Utils/Logger.js	Mon Apr 19 17:52:52 2010 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,93 +0,0 @@
-/**
- * Copyright (c) 2009-2010 Symbian Foundation and/or its subsidiary(-ies).
- * All rights reserved.
- * This component and the accompanying materials are made available
- * under the terms of the License "Eclipse Public License v1.0"
- * which accompanies this distribution, and is available
- * at the URL "http://www.eclipse.org/legal/epl-v10.html".
- *
- * Initial Contributors:
- * Nokia Corporation - initial contribution.
- * 
- * Contributors:
- * 
- * Description:
- * 
- */
-
-///////////////////////////////////////////////////////////////////////////////
-// Logger utility class that uses the Firebug console class.
-
-// Constructor (everything is static so this is empty).
-function Logger() {
-    // Set default logger level.
-    this.level = this.LOG_LEVEL_OFF;
-}
-
-// Logger levels.
-Logger.prototype.LOG_LEVEL_DEBUG = 0;
-Logger.prototype.LOG_LEVEL_INFO = 1;
-Logger.prototype.LOG_LEVEL_WARN = 2;
-Logger.prototype.LOG_LEVEL_ERROR = 3;
-Logger.prototype.LOG_LEVEL_OFF = 4;
-
-Logger.prototype.level = null;
-Logger.prototype.filter = null;
-
-// Disable logging on other browsers except Firefox.
-Logger.prototype.enabled = (navigator.userAgent.indexOf("Firefox") != -1);
-
-// Dumps an objects properties and methods to the console.
-Logger.prototype.dump = function(obj) {
-    if (this.enabled) {
-        console.dir(obj);
-    }
-};
-
-// Dumps a stracktrace to the console.
-Logger.prototype.trace = function() {
-    if (this.enabled) {
-        console.trace();
-    }
-};
-
-// Prints a debug message to the console.
-Logger.prototype.debug = function(str) {
-    if (this.enabled && this.level <= this.LOG_LEVEL_DEBUG) {
-        if (this.filter == null) {
-            console.debug(str);
-        } else {
-            var show = false;
-            for (i in this.filter) {
-                if (str.indexOf(this.filter[i]) >= 0) {
-                    show = true;
-                    break;
-                }
-            }
-            if (show) {
-                console.debug(str);
-            }
-        }
-    }
-};
-
-// Prints an info message to the console.
-Logger.prototype.info = function(str) {
-    if (this.enabled && this.level <= this.LOG_LEVEL_INFO) {
-        console.info(str);
-    }
-};
-
-// Prints a warning message to the console.
-Logger.prototype.warn = function(str) {
-    if (this.enabled && this.level <= this.LOG_LEVEL_WARN) {
-        console.warn(str);
-    }
-};
-
-// Prints an error message to the console.
-Logger.prototype.error = function(str) {
-    if (this.enabled && this.level <= this.LOG_LEVEL_ERROR) {
-        console.error(str);
-    }
-};
--- a/org.symbian.tools.wrttools/projecttemplates/WRTKit/WRTKit.js	Mon Apr 19 17:52:52 2010 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,66 +0,0 @@
-/**
- * Copyright (c) 2009-2010 Symbian Foundation and/or its subsidiary(-ies).
- * All rights reserved.
- * This component and the accompanying materials are made available
- * under the terms of the License "Eclipse Public License v1.0"
- * which accompanies this distribution, and is available
- * at the URL "http://www.eclipse.org/legal/epl-v10.html".
- *
- * Initial Contributors:
- * Nokia Corporation - initial contribution.
- * 
- * Contributors:
- * 
- * Description:
- * 
- */
-
-///////////////////////////////////////////////////////////////////////////////
-// This script includes the WRTKit for use in a widget.
-
-// WRTKit version (major.minor.revision, e.g. 1.0.0).
-var WRTKIT_VERSION_MAJOR = 1;
-var WRTKIT_VERSION_MINOR = 0;
-var WRTKIT_VERSION_REVISION = 0;
-var WRTKIT_RESOURCE_DIRECTORY = "WRTKit/Resources/";
-
-// Include util script files.
-includeScript("WRTKit/Utils/Logger.js");
-
-// Include UI visual definition.
-includeStyleSheet("WRTKit/Resources/UI.css");
-
-// Include all UI toolkit script files.
-var UI_NO_INIT_ID = "UI_NO_INIT_ID";
-
-includeScript("WRTKit/UI/UIInit.js");
-includeScript("WRTKit/UI/UIElement.js");
-includeScript("WRTKit/UI/Scrollbar.js");
-includeScript("WRTKit/UI/NotificationPopup.js");
-includeScript("WRTKit/UI/UIManager.js");
-includeScript("WRTKit/UI/View.js");
-includeScript("WRTKit/UI/ListView.js");
-includeScript("WRTKit/UI/Control.js");
-includeScript("WRTKit/UI/Separator.js");
-includeScript("WRTKit/UI/Label.js");
-includeScript("WRTKit/UI/ContentPanel.js");
-includeScript("WRTKit/UI/TextEntryControl.js");
-includeScript("WRTKit/UI/TextField.js");
-includeScript("WRTKit/UI/TextArea.js");
-includeScript("WRTKit/UI/SelectionControl.js");
-includeScript("WRTKit/UI/SelectionMenu.js");
-includeScript("WRTKit/UI/SelectionList.js");
-includeScript("WRTKit/UI/ActionControl.js");
-includeScript("WRTKit/UI/FormButton.js");
-includeScript("WRTKit/UI/NavigationButton.js");
-includeScript("WRTKit/UI/Ajax.js");
-
-// Includes a script file by writing a script tag.
-function includeScript(src) {
-    document.write("<script type=\"text/javascript\" src=\"" + src + "\"></script>");
-}
-
-// Includes a style sheet by writing a style tag.
-function includeStyleSheet(src) {
-    document.write("<style type=\"text/css\"> @import url(\"" +  src + "\"); </style>");
-}
Binary file org.symbian.tools.wrttools/projecttemplates/helloWithWRTKit.zip has changed
Binary file org.symbian.tools.wrttools/projecttemplates/rssreader.zip has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.symbian.tools.wrttools/schema/jsLibraries.exsd	Mon Apr 19 18:04:34 2010 -0700
@@ -0,0 +1,129 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<!-- Schema file written by PDE -->
+<schema targetNamespace="org.symbian.tools.wrttools" xmlns="http://www.w3.org/2001/XMLSchema">
+<annotation>
+      <appinfo>
+         <meta.schema plugin="org.symbian.tools.wrttools" id="jsLibraries" name="JavaScript Libraries"/>
+      </appinfo>
+      <documentation>
+         [Enter description of this extension point.]
+      </documentation>
+   </annotation>
+
+   <element name="extension">
+      <annotation>
+         <appinfo>
+            <meta.element />
+         </appinfo>
+      </annotation>
+      <complexType>
+         <sequence minOccurs="1" maxOccurs="unbounded">
+            <element ref="library"/>
+         </sequence>
+         <attribute name="point" type="string" use="required">
+            <annotation>
+               <documentation>
+                  
+               </documentation>
+            </annotation>
+         </attribute>
+         <attribute name="id" type="string">
+            <annotation>
+               <documentation>
+                  
+               </documentation>
+            </annotation>
+         </attribute>
+         <attribute name="name" type="string">
+            <annotation>
+               <documentation>
+                  
+               </documentation>
+               <appinfo>
+                  <meta.attribute translatable="true"/>
+               </appinfo>
+            </annotation>
+         </attribute>
+      </complexType>
+   </element>
+
+   <element name="library">
+      <complexType>
+         <attribute name="id" type="string" use="required">
+            <annotation>
+               <documentation>
+                  
+               </documentation>
+            </annotation>
+         </attribute>
+         <attribute name="name" type="string" use="required">
+            <annotation>
+               <documentation>
+                  
+               </documentation>
+               <appinfo>
+                  <meta.attribute translatable="true"/>
+               </appinfo>
+            </annotation>
+         </attribute>
+         <attribute name="icon" type="string">
+            <annotation>
+               <documentation>
+                  
+               </documentation>
+               <appinfo>
+                  <meta.attribute kind="resource"/>
+               </appinfo>
+            </annotation>
+         </attribute>
+         <attribute name="installer" type="string">
+            <annotation>
+               <documentation>
+                  
+               </documentation>
+               <appinfo>
+                  <meta.attribute kind="java" basedOn=":org.symbian.tools.wrttools.core.libraries.IJSLibraryInstaller"/>
+               </appinfo>
+            </annotation>
+         </attribute>
+      </complexType>
+   </element>
+
+   <annotation>
+      <appinfo>
+         <meta.section type="since"/>
+      </appinfo>
+      <documentation>
+         [Enter the first release in which this extension point appears.]
+      </documentation>
+   </annotation>
+
+   <annotation>
+      <appinfo>
+         <meta.section type="examples"/>
+      </appinfo>
+      <documentation>
+         [Enter extension point usage example here.]
+      </documentation>
+   </annotation>
+
+   <annotation>
+      <appinfo>
+         <meta.section type="apiinfo"/>
+      </appinfo>
+      <documentation>
+         [Enter API information here.]
+      </documentation>
+   </annotation>
+
+   <annotation>
+      <appinfo>
+         <meta.section type="implementation"/>
+      </appinfo>
+      <documentation>
+         [Enter information about supplied implementation of this extension point.]
+      </documentation>
+   </annotation>
+
+
+</schema>
--- a/org.symbian.tools.wrttools/src/org/symbian/tools/wrttools/Activator.java	Mon Apr 19 17:52:52 2010 -0700
+++ b/org.symbian.tools.wrttools/src/org/symbian/tools/wrttools/Activator.java	Mon Apr 19 18:04:34 2010 -0700
@@ -19,14 +19,22 @@
 package org.symbian.tools.wrttools;
 
 import java.io.PrintStream;
+import java.util.Collection;
+import java.util.Comparator;
+import java.util.TreeSet;
 
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.ResourcesPlugin;
 import org.eclipse.core.runtime.IStatus;
 import org.eclipse.core.runtime.Status;
 import org.eclipse.jface.resource.ImageRegistry;
 import org.eclipse.ui.plugin.AbstractUIPlugin;
 import org.osgi.framework.BundleContext;
 import org.symbian.tools.wrttools.core.WRTImages;
+import org.symbian.tools.wrttools.core.libraries.JSLibrary;
+import org.symbian.tools.wrttools.core.libraries.LibraryManager;
 import org.symbian.tools.wrttools.sdt.utils.Logging;
+import org.symbian.tools.wrttools.util.ProjectUtils;
 
 import com.intel.bluetooth.BlueCoveImpl;
 
@@ -45,6 +53,8 @@
 	
 	private static PrintStream savedSysOut;
 	
+    private final LibraryManager manager = new LibraryManager();
+
 	/**
 	 * The constructor
 	 */
@@ -114,4 +124,31 @@
 		Logging.log(getDefault(), status);
 	}
 
+    public static JSLibrary[] getJSLibraries() {
+        return getDefault().manager.getLibraries();
+    }
+
+    public static IProject[] getWrtProjects() {
+        IProject[] projects = ResourcesPlugin.getWorkspace().getRoot().getProjects();
+        Collection<IProject> prjs = new TreeSet<IProject>(new Comparator<IProject>() {
+            public int compare(IProject o1, IProject o2) {
+                if (o1 == o2) {
+                    return 0;
+                } else if (o1 == null) {
+                    return -1;
+                } else if (o2 == null) {
+                    return 1;
+                } else {
+                    return o1.getName().compareTo(o2.getName());
+                }
+            }
+        });
+        for (IProject project : projects) {
+            if (ProjectUtils.hasWrtNature(project)) {
+                prjs.add(project);
+            }
+        }
+        return prjs.toArray(new IProject[prjs.size()]);
+    }
+
 }
--- a/org.symbian.tools.wrttools/src/org/symbian/tools/wrttools/WRTStatusListener.java	Mon Apr 19 17:52:52 2010 -0700
+++ b/org.symbian.tools.wrttools/src/org/symbian/tools/wrttools/WRTStatusListener.java	Mon Apr 19 18:04:34 2010 -0700
@@ -21,16 +21,17 @@
 
 import java.io.IOException;
 
+import org.eclipse.core.resources.IProject;
 import org.eclipse.core.runtime.IStatus;
 import org.eclipse.ui.console.MessageConsoleStream;
-
 import org.symbian.tools.wrttools.core.status.IWRTStatusListener;
 import org.symbian.tools.wrttools.core.status.WRTStatus;
+import org.symbian.tools.wrttools.util.ProjectUtils;
 
 public class WRTStatusListener implements IWRTStatusListener {
 	
-	private MessageConsoleStream consoleStream;
-	private boolean activateOnFirstStatus = true;
+	private final MessageConsoleStream consoleStream;
+	private final boolean activateOnFirstStatus = true;
 	private int statusCount;
 
 	public WRTStatusListener() {
@@ -61,4 +62,8 @@
 		return true;
 	}
 
+    public boolean canPackageWithErrors(IProject project) {
+        return ProjectUtils.canPackageWithErrors(project);
+    }
+
 }
--- a/org.symbian.tools.wrttools/src/org/symbian/tools/wrttools/core/ProjectTemplate.java	Mon Apr 19 17:52:52 2010 -0700
+++ b/org.symbian.tools.wrttools/src/org/symbian/tools/wrttools/core/ProjectTemplate.java	Mon Apr 19 18:04:34 2010 -0700
@@ -19,6 +19,10 @@
 package org.symbian.tools.wrttools.core;
 
 import java.net.URL;
+import java.util.Arrays;
+import java.util.HashSet;
+import java.util.Set;
+import java.util.TreeSet;
 
 import org.eclipse.core.databinding.DataBindingContext;
 import org.eclipse.core.runtime.CoreException;
@@ -28,13 +32,15 @@
 import org.eclipse.jface.resource.ImageDescriptor;
 import org.eclipse.swt.graphics.Image;
 import org.osgi.framework.Bundle;
+import org.symbian.tools.wrttools.Activator;
+import org.symbian.tools.wrttools.core.libraries.JSLibrary;
 import org.symbian.tools.wrttools.wizards.IWizardPageFactory;
 import org.symbian.tools.wrttools.wizards.WRTProjectDetailsWizardPage;
 import org.symbian.tools.wrttools.wizards.WizardContext;
-import org.symbian.tools.wrttools.Activator;
 
 public class ProjectTemplate {
 	private static ProjectTemplate[] templates;
+
 	private final IConfigurationElement element;
 
 	private Image icon;
@@ -70,7 +76,7 @@
 		}
 	}
 	
-	public String[] getLibraryIds() {
+    private String[] getLibraryIds() {
 		IConfigurationElement[] elements = element.getChildren("requires-library");
 		String[] ids = new String[elements.length];
 		for (int i = 0; i < elements.length; i++) {
@@ -140,4 +146,25 @@
 		}
 		return null;
 	}
+
+    public boolean requires(JSLibrary library) {
+        for (String id : getLibraryIds()) {
+            if (library.getId().equals(id)) {
+                return true;
+            }
+        }
+        return false;
+    }
+
+    public JSLibrary[] getRequiredLibraries() {
+        Set<String> ids = new TreeSet<String>(Arrays.asList(getLibraryIds()));
+        Set<JSLibrary> libraries = new HashSet<JSLibrary>();
+        JSLibrary[] jsLibraries = Activator.getJSLibraries();
+        for (JSLibrary jsLibrary : jsLibraries) {
+            if (ids.contains(jsLibrary.getId())) {
+                libraries.add(jsLibrary);
+            }
+        }
+        return libraries.toArray(new JSLibrary[libraries.size()]);
+    }
 }
--- a/org.symbian.tools.wrttools/src/org/symbian/tools/wrttools/core/WRTImages.java	Mon Apr 19 17:52:52 2010 -0700
+++ b/org.symbian.tools.wrttools/src/org/symbian/tools/wrttools/core/WRTImages.java	Mon Apr 19 18:04:34 2010 -0700
@@ -30,6 +30,7 @@
     private static final String IMAGE_EMULATOR = "deploy_widget.gif";
     private static final String IMAGE_BLUETOOTH = "bluetooth.gif";
     private static final String IMAGE_EXCLUDED = "excluded.gif";
+    private static final String IMAGE_WRTKIT = "main16.gif";
 
     public static void init(ImageRegistry reg) {
         add(reg, IMAGE_IMPORT_WIZARD_BANNER);
@@ -38,6 +39,7 @@
         add(reg, IMAGE_EMULATOR);
         add(reg, IMAGE_BLUETOOTH);
         add(reg, IMAGE_EXCLUDED);
+        add(reg, IMAGE_WRTKIT);
     }
 
     private static void add(ImageRegistry reg, String key) {
@@ -72,4 +74,7 @@
         return Activator.getDefault().getImageRegistry().getDescriptor(IMAGE_EXCLUDED);
     }
 
+    public static Image getWrtKitIcon() {
+        return Activator.getDefault().getImageRegistry().get(IMAGE_WRTKIT);
+    }
 }
--- a/org.symbian.tools.wrttools/src/org/symbian/tools/wrttools/core/deploy/PreferenceConstants.java	Mon Apr 19 17:52:52 2010 -0700
+++ b/org.symbian.tools.wrttools/src/org/symbian/tools/wrttools/core/deploy/PreferenceConstants.java	Mon Apr 19 18:04:34 2010 -0700
@@ -43,4 +43,6 @@
 	public static final String SELECTED_EMULATOR_NAME = "selectedEmulatorDeviceName";
 	
 	public static final String DEBUG_ENABLED = "debugEnabled";
+
+    public static final String PACKAGE_WITH_ERRORS = "packageWithErrors";
 }
--- a/org.symbian.tools.wrttools/src/org/symbian/tools/wrttools/core/deploy/PreferenceInitializer.java	Mon Apr 19 17:52:52 2010 -0700
+++ b/org.symbian.tools.wrttools/src/org/symbian/tools/wrttools/core/deploy/PreferenceInitializer.java	Mon Apr 19 18:04:34 2010 -0700
@@ -20,8 +20,8 @@
 package org.symbian.tools.wrttools.core.deploy;
 
 import org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer;
+import org.eclipse.jface.dialogs.MessageDialogWithToggle;
 import org.eclipse.jface.preference.IPreferenceStore;
-
 import org.symbian.tools.wrttools.Activator;
 
 /**
@@ -36,10 +36,8 @@
 	 */
 	public void initializeDefaultPreferences() {
 		IPreferenceStore store = Activator.getDefault().getPreferenceStore();		
-		store.setDefault(PreferenceConstants.WRT_DEPLOY_CHOICE, PreferenceConstants.WRT_DEPLOY_CHOICE_DEVICE);
-		store.setDefault(PreferenceConstants.WRT_DEPLOY_CHOICE, PreferenceConstants.WRT_DEPLOY_CHOICE_EMULATOR);
-//		store.setDefault(PreferenceConstants.WRT_EMULATOR_PATH, "none");	
-		
+
+        store.setDefault(PreferenceConstants.PACKAGE_WITH_ERRORS, MessageDialogWithToggle.PROMPT);
 	}
 
 }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.symbian.tools.wrttools/src/org/symbian/tools/wrttools/core/libraries/AddLibraryPopupMenu.java	Mon Apr 19 18:04:34 2010 -0700
@@ -0,0 +1,150 @@
+/**
+ * Copyright (c) 2010 Symbian Foundation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of the License "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Symbian Foundation - initial contribution.
+ * Contributors:
+ * Description:
+ * Overview:
+ * Details:
+ * Platforms/Drives/Compatibility:
+ * Assumptions/Requirement/Pre-requisites:
+ * Failures and causes:
+ */
+package org.symbian.tools.wrttools.core.libraries;
+
+import java.io.IOException;
+import java.util.Collections;
+import java.util.Map;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.action.ActionContributionItem;
+import org.eclipse.jface.action.IMenuCreator;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.MenuEvent;
+import org.eclipse.swt.events.MenuListener;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Menu;
+import org.eclipse.swt.widgets.MenuItem;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.wst.jsdt.core.IJavaScriptProject;
+import org.eclipse.wst.jsdt.core.JavaScriptCore;
+import org.symbian.tools.wrttools.Activator;
+
+public class AddLibraryPopupMenu extends Action implements IMenuCreator, MenuListener {
+    public static class LibrariesPopupMenu extends ActionContributionItem {
+        public LibrariesPopupMenu() {
+            super(new AddLibraryPopupMenu());
+        }
+
+        @Override
+        public void fill(Menu parent, int index) {
+            IProject project = getSelectedProject();
+            getAction().setEnabled(project != null && hasLibrariesToInstall(project));
+            super.fill(parent, index);
+        }
+    }
+
+    private Menu menu;
+
+    public AddLibraryPopupMenu() {
+        super("Add JavaScript Library", AS_DROP_DOWN_MENU);
+        setMenuCreator(this);
+    }
+
+    protected static boolean hasLibrariesToInstall(IProject project) {
+        JSLibrary[] libraries = Activator.getJSLibraries();
+        for (JSLibrary library : libraries) {
+            if (!library.isInstalled(project)) {
+                return true;
+            }
+        }
+        return false;
+    }
+
+    public void dispose() {
+        // TODO Auto-generated method stub
+
+    }
+
+    public Menu getMenu(Control parent) {
+        return null;
+    }
+
+    public Menu getMenu(Menu parent) {
+        if (menu != null) {
+            menu.dispose();
+        }
+        menu = new Menu(parent);
+        menu.addMenuListener(this);
+        return menu;
+    }
+
+    public void menuHidden(MenuEvent e) {
+        // TODO Auto-generated method stub
+
+    }
+
+    public void menuShown(MenuEvent e) {
+        IProject p = getSelectedProject();
+        if (p != null) {
+            addActions(p);
+        }
+    }
+
+    protected static IProject getSelectedProject() {
+        IProject p = null;
+        ISelection selection = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getSelectionService()
+                .getSelection();
+        if (!selection.isEmpty() && (selection instanceof IStructuredSelection)
+                && ((IStructuredSelection) selection).size() == 1) {
+            Object el = ((IStructuredSelection) selection).getFirstElement();
+            if (el instanceof IAdaptable) {
+                p = (IProject) ((IAdaptable) el).getAdapter(IProject.class);
+            }
+        }
+        return p;
+    }
+
+    private void addActions(IProject p) {
+        IJavaScriptProject jsProject = JavaScriptCore.create(p);
+        JSLibrary[] jsLibraries = Activator.getJSLibraries();
+        for (JSLibrary jsLibrary : jsLibraries) {
+            if (!jsLibrary.isInstalled(jsProject.getProject())) {
+                createMenuItem(menu, jsLibrary, jsProject);
+            }
+        }
+    }
+
+    private void createMenuItem(Menu menu2, final JSLibrary jsLibrary, final IJavaScriptProject jsProject) {
+        MenuItem item = new MenuItem(menu2, SWT.PUSH);
+        item.setText(jsLibrary.getName());
+        item.setImage(jsLibrary.getImage());
+        item.addSelectionListener(new SelectionAdapter() {
+            @Override
+            public void widgetSelected(SelectionEvent e) {
+                Map<String, String> empty = Collections.emptyMap();
+                try {
+                    jsLibrary.install(jsProject.getProject(), empty, new NullProgressMonitor());
+                } catch (CoreException e1) {
+                    Activator.log(e1);
+                } catch (IOException e1) {
+                    Activator.log(e1);
+                }
+            }
+        });
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.symbian.tools.wrttools/src/org/symbian/tools/wrttools/core/libraries/IJSLibraryInstaller.java	Mon Apr 19 18:04:34 2010 -0700
@@ -0,0 +1,32 @@
+/**
+ * Copyright (c) 2010 Symbian Foundation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of the License "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Symbian Foundation - initial contribution.
+ * Contributors:
+ * Description:
+ * Overview:
+ * Details:
+ * Platforms/Drives/Compatibility:
+ * Assumptions/Requirement/Pre-requisites:
+ * Failures and causes:
+ */
+package org.symbian.tools.wrttools.core.libraries;
+
+import java.io.IOException;
+import java.util.Map;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+
+public interface IJSLibraryInstaller {
+    void install(IProject project, Map<String, String> parameters, IProgressMonitor monitor) throws CoreException,
+            IOException;
+    boolean isInstalled(IProject project);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.symbian.tools.wrttools/src/org/symbian/tools/wrttools/core/libraries/JSLibrary.java	Mon Apr 19 18:04:34 2010 -0700
@@ -0,0 +1,112 @@
+/**
+ * Copyright (c) 2010 Symbian Foundation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of the License "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Symbian Foundation - initial contribution.
+ * Contributors:
+ * Description:
+ * Overview:
+ * Details:
+ * Platforms/Drives/Compatibility:
+ * Assumptions/Requirement/Pre-requisites:
+ * Failures and causes:
+ */
+package org.symbian.tools.wrttools.core.libraries;
+
+import java.io.IOException;
+import java.util.Map;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.swt.graphics.Image;
+import org.symbian.tools.wrttools.Activator;
+import org.symbian.tools.wrttools.core.WRTImages;
+
+public class JSLibrary {
+    public class NullInstaller implements IJSLibraryInstaller {
+        public void install(IProject project, Map<String, String> parameters, IProgressMonitor monitor)
+                throws CoreException, IOException {
+            // Do nothing
+        }
+
+        public boolean isInstalled(IProject project) {
+            return false;
+        }
+    }
+
+    private final String id;
+    private Image image;
+    private final String name;
+    private IJSLibraryInstaller installer;
+    private final IConfigurationElement element;
+
+    public JSLibrary(String id, String name, IConfigurationElement element) {
+        this.id = id;
+        this.name = name;
+        this.element = element;
+    }
+
+    public String getId() {
+        return id;
+    }
+
+    public Image getImage() {
+        if (image == null) {
+            String icon = element.getAttribute("icon");
+            if (icon != null) {
+                ImageDescriptor descriptor = Activator.imageDescriptorFromPlugin(element.getContributor().getName(),
+                        icon);
+                if (descriptor != null) {
+                    image = descriptor.createImage();
+                }
+            }
+            if (image == null) {
+                image = WRTImages.getWrtKitIcon();
+            }
+        }
+        return image;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void install(IProject project, Map<String, String> parameters, IProgressMonitor monitor)
+            throws CoreException, IOException {
+        getInstaller().install(project, parameters, monitor);
+    }
+
+    private IJSLibraryInstaller getInstaller() throws CoreException {
+        if (installer == null) {
+            if (element.getAttribute("installer") != null) {
+                installer = (IJSLibraryInstaller) element.createExecutableExtension("installer");
+            }
+            if (installer == null) {
+                installer = new NullInstaller();
+            }
+        }
+        return installer;
+    }
+
+    @Override
+    public String toString() {
+        return String.format("JSLibrary \"%s\"", getId());
+    }
+
+    public boolean isInstalled(IProject project) {
+        try {
+            return getInstaller().isInstalled(project);
+        } catch (CoreException e) {
+            Activator.log(e);
+            return false;
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.symbian.tools.wrttools/src/org/symbian/tools/wrttools/core/libraries/LibrariesUtils.java	Mon Apr 19 18:04:34 2010 -0700
@@ -0,0 +1,110 @@
+/**
+ * Copyright (c) 2010 Symbian Foundation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of the License "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Symbian Foundation - initial contribution.
+ * Contributors:
+ * Description:
+ * Overview:
+ * Details:
+ * Platforms/Drives/Compatibility:
+ * Assumptions/Requirement/Pre-requisites:
+ * Failures and causes:
+ */
+package org.symbian.tools.wrttools.core.libraries;
+
+import java.io.IOException;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.wst.sse.core.StructuredModelManager;
+import org.eclipse.wst.sse.core.internal.provisional.IModelManager;
+import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument;
+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;
+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
+import org.eclipse.wst.xml.core.internal.provisional.format.FormatProcessorXML;
+import org.symbian.tools.wrttools.util.CoreUtil;
+import org.w3c.dom.Element;
+import org.w3c.dom.NodeList;
+
+@SuppressWarnings("restriction")
+public class LibrariesUtils {
+    public static void addJSToHtml(IProject project, String label, String[] js, String[] css) throws CoreException,
+            IOException {
+        if (js == null) {
+            js = new String[0];
+        }
+        if (css == null) {
+            css = new String[0];
+        }
+        if (js.length == 0 && css.length == 0) {
+            return;
+        }
+        IModelManager modelManager = StructuredModelManager.getModelManager();
+        String indexFile = CoreUtil.getIndexFile(project);
+        if (indexFile != null) {
+            IFile file = project.getFile(indexFile);
+            if (file != null & file.exists()) {
+                IStructuredModel model = modelManager.getModelForEdit(file);
+                try {
+                    if (model instanceof IDOMModel) {
+                        ((IDOMModel) model).beginRecording(js, label);
+                        boolean needsSave = false;
+                        for (String jsLib : js) {
+                            needsSave |= change(((IDOMModel) model).getDocument(), jsLib);
+                        }
+                        model.endRecording(js);
+                        if (needsSave) {
+                            model.save();
+                        }
+                    }
+                } finally {
+                    if (model != null) {
+                        model.releaseFromEdit();
+                    }
+                }
+            }
+        }
+    }
+
+    private static boolean change(IDOMDocument document, String jsPath) {
+        NodeList head = document.getElementsByTagName("head");
+        if (head.getLength() == 1) {
+            IDOMElement headNode = ((IDOMElement) head.item(0));
+            NodeList elements = headNode.getElementsByTagName("script");
+            boolean needToAdd = true;
+            IDOMElement last = null;
+            for (int i = 0; i < elements.getLength(); i++) {
+                last = (IDOMElement) elements.item(i);
+                String attribute = last.getAttribute("src");
+                if (jsPath.equalsIgnoreCase(attribute)) {
+                    needToAdd = false;
+                    break;
+                }
+            }
+            if (needToAdd) {
+                Element element = document.createElement("script");
+                element.setAttribute("language", "javascript");
+                element.setAttribute("type", "text/javascript");
+                element.setAttribute("src", jsPath);
+                if (last != null && last.getNextSibling() != null) {
+                    headNode.insertBefore(element, last.getNextSibling());
+                } else {
+                    headNode.appendChild(element);
+                }
+                FormatProcessorXML formatter = new FormatProcessorXML();
+                formatter.formatNode(headNode);
+                return true;
+            }
+        }
+        return false;
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.symbian.tools.wrttools/src/org/symbian/tools/wrttools/core/libraries/LibraryManager.java	Mon Apr 19 18:04:34 2010 -0700
@@ -0,0 +1,78 @@
+/**
+ * Copyright (c) 2010 Symbian Foundation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of the License "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Symbian Foundation - initial contribution.
+ * Contributors:
+ * Description:
+ * Overview:
+ * Details:
+ * Platforms/Drives/Compatibility:
+ * Assumptions/Requirement/Pre-requisites:
+ * Failures and causes:
+ */
+package org.symbian.tools.wrttools.core.libraries;
+
+import java.util.Comparator;
+import java.util.Set;
+import java.util.TreeSet;
+
+import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.core.runtime.IExtensionPoint;
+import org.eclipse.core.runtime.Platform;
+import org.symbian.tools.wrttools.Activator;
+
+public final class LibraryManager {
+    public class LibraryComparator implements Comparator<JSLibrary> {
+        public int compare(JSLibrary o1, JSLibrary o2) {
+            if (o1 == o2) {
+                return 0;
+            } else if (o1 == null) {
+                return -1;
+            } else if (o2 == null) {
+                return 1;
+            } else {
+                return o1.getName().compareTo(o2.getName());
+            }
+        }
+    }
+
+    private JSLibrary[] jsLibraries;
+
+    public JSLibrary[] getLibraries() {
+        if (jsLibraries == null) {
+            final Set<JSLibrary> libs = new TreeSet<JSLibrary>(new LibraryComparator());
+            IExtensionPoint point = Platform.getExtensionRegistry().getExtensionPoint(Activator.PLUGIN_ID,
+                    "jsLibraries");
+            IConfigurationElement[] elements = point.getConfigurationElements();
+            //            for (IConfigurationElement element : elements) {
+            //                IConfigurationElement[] children = element.getChildren();
+            for (IConfigurationElement child : elements) {
+                    JSLibrary lib = createLib(child);
+                    if (lib != null) {
+                        libs.add(lib);
+                    }
+                //                }
+            }
+            jsLibraries = libs.toArray(new JSLibrary[libs.size()]);
+        }
+        return jsLibraries;
+    }
+
+    private JSLibrary createLib(IConfigurationElement element) {
+        String id = element.getAttribute("id");
+        String name = element.getAttribute("name");
+
+        if (id != null && name != null) {
+            return new JSLibrary(id, name, element);
+        } else {
+            return null;
+        }
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.symbian.tools.wrttools/src/org/symbian/tools/wrttools/core/libraries/PhoneGapInstaller.java	Mon Apr 19 18:04:34 2010 -0700
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2010 Symbian Foundation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of the License "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Symbian Foundation - initial contribution.
+ * Contributors:
+ * Description:
+ * Overview:
+ * Details:
+ * Platforms/Drives/Compatibility:
+ * Assumptions/Requirement/Pre-requisites:
+ * Failures and causes:
+ */
+package org.symbian.tools.wrttools.core.libraries;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.Map;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IFolder;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.FileLocator;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.SubProgressMonitor;
+import org.eclipse.wst.jsdt.core.IJavaScriptProject;
+import org.eclipse.wst.jsdt.core.JavaScriptCore;
+import org.eclipse.wst.jsdt.core.JavaScriptModelException;
+import org.symbian.tools.wrttools.Activator;
+
+public class PhoneGapInstaller implements IJSLibraryInstaller {
+    private static final String PHONEGAP_JS = "phonegap.js";
+
+    public void install(IProject project, Map<String, String> parameters, IProgressMonitor monitor)
+            throws CoreException, IOException {
+        String folderName = "script";
+        monitor.beginTask("Installing PhoneGap library", 10);
+        IFolder folder = project.getFolder(folderName);
+        if (!folder.isAccessible()) {
+            folder.create(false, true, new SubProgressMonitor(monitor, 2));
+        }
+        IFile file = folder.getFile(PHONEGAP_JS);
+        if (!file.isAccessible()) {
+            InputStream stream = FileLocator.openStream(Activator.getDefault().getBundle(), new Path("libraries")
+                    .append(PHONEGAP_JS), true);
+            file.create(stream, false, new SubProgressMonitor(monitor, 3));
+        }
+        IPath path = new Path(folderName).append(PHONEGAP_JS);
+        LibrariesUtils.addJSToHtml(project, "Adding PhoneGap", new String[] { path.toString() }, null);
+        monitor.done();
+    }
+
+    public boolean isInstalled(IProject project) {
+        IJavaScriptProject jsProject = JavaScriptCore.create(project);
+        try {
+            return jsProject.findType("Accelerometer") != null && jsProject.findType("Camera") != null
+                    && jsProject.findType("Geolocation") != null;
+        } catch (JavaScriptModelException e) {
+            Activator.log(e);
+        }
+        return false;
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.symbian.tools.wrttools/src/org/symbian/tools/wrttools/core/libraries/WRTKitInstaller.java	Mon Apr 19 18:04:34 2010 -0700
@@ -0,0 +1,70 @@
+/**
+ * Copyright (c) 2010 Symbian Foundation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of the License "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Symbian Foundation - initial contribution.
+ * Contributors:
+ * Description:
+ * Overview:
+ * Details:
+ * Platforms/Drives/Compatibility:
+ * Assumptions/Requirement/Pre-requisites:
+ * Failures and causes:
+ */
+package org.symbian.tools.wrttools.core.libraries;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.Map;
+
+import org.eclipse.core.resources.IFolder;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.FileLocator;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.SubProgressMonitor;
+import org.eclipse.wst.jsdt.core.IJavaScriptProject;
+import org.eclipse.wst.jsdt.core.IType;
+import org.eclipse.wst.jsdt.core.JavaScriptCore;
+import org.eclipse.wst.jsdt.core.JavaScriptModelException;
+import org.symbian.tools.wrttools.Activator;
+import org.symbian.tools.wrttools.util.ProjectUtils;
+
+public class WRTKitInstaller implements IJSLibraryInstaller {
+    private static final String JS_PATH = "WRTKit/WRTKit.js";
+
+    public void install(IProject project, Map<String, String> parameters, IProgressMonitor monitor)
+            throws CoreException, IOException {
+        monitor.beginTask("Installing WRTKit library", 15);
+
+        IFolder folder = project.getFolder("WRTKit");
+        
+        if (folder != null && !folder.exists()) {
+            folder.create(false, true, new SubProgressMonitor(monitor, 1));
+        }
+        InputStream zip = FileLocator.openStream(Activator.getDefault().getBundle(), new Path("/libraries/wrtkit.zip"),
+                true);
+        ProjectUtils.unzip(zip, folder, 0, "WRTKit", new SubProgressMonitor(monitor, 10));
+        
+        LibrariesUtils.addJSToHtml(project, "Adding WRTKit Library", new String[] { JS_PATH }, null);
+        monitor.done();
+    }
+
+    public boolean isInstalled(IProject project) {
+        IJavaScriptProject jsProject = JavaScriptCore.create(project);
+        try {
+            IType npopup = jsProject.findType("NotificationPopup");
+            IType uimanager = jsProject.findType("UIManager");
+            return npopup != null && uimanager != null;
+        } catch (JavaScriptModelException e) {
+            Activator.log(e);
+            return false;
+        }
+    }
+}
--- a/org.symbian.tools.wrttools/src/org/symbian/tools/wrttools/core/libraries/WrtKitLibInitializer.java	Mon Apr 19 17:52:52 2010 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,146 +0,0 @@
-package org.symbian.tools.wrttools.core.libraries;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.URL;
-import java.util.Enumeration;
-import java.util.HashSet;
-import java.util.Set;
-import java.util.TreeSet;
-
-import org.eclipse.core.resources.IContainer;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IFolder;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.FileLocator;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.wst.jsdt.core.IJavaScriptProject;
-import org.eclipse.wst.jsdt.core.JsGlobalScopeContainerInitializer;
-import org.eclipse.wst.jsdt.core.compiler.libraries.LibraryLocation;
-import org.osgi.framework.Bundle;
-import org.symbian.tools.wrttools.Activator;
-
-public class WrtKitLibInitializer extends JsGlobalScopeContainerInitializer implements IWrtIdeContainer {
-
-	public static class WrtKitLocation implements LibraryLocation {
-		private static final WrtKitLocation LOCATION = new WrtKitLocation();
-		
-		public char[][] getLibraryFileNames() {
-			return convert(getFiles());
-		}
-
-		private char[][] convert(String[] files) {
-			final Set<char[]> set = new HashSet<char[]>();
-			for (String string : files) {
-				if (string.endsWith(".js")) {
-					set.add(string.toCharArray());
-				}
-			}
-			return set.toArray(new char[set.size()][]);
-		}
-
-		public IPath getLibraryPathInPlugin() {
-			return new Path("/projecttemplates/WRTKit");
-		}
-		
-		public static WrtKitLocation getInstance() {
-			return LOCATION;
-		}
-		
-		public String[] getFiles() {
-			Bundle bundle = Activator.getDefault().getBundle();
-			String path = getLibraryPathInPlugin().toString();
-
-			final Set<String> set = getEntries(bundle, path);
-			return set.toArray(new String[set.size()]);
-		}
-
-		@SuppressWarnings("unchecked")
-		private Set<String> getEntries(Bundle bundle, String p) {
-			final Set<String> set = new TreeSet<String>();
-			Enumeration entries = bundle.getEntryPaths(p);
-			while (entries.hasMoreElements()) {
-				String path = (String) entries.nextElement();
-				if (path.endsWith("/")) {
-					set.addAll(getEntries(bundle, path));
-				} else {
-					set.add(path.substring(getLibraryPathInPlugin().toString().length()));
-				}
-			}
-			return set;
-		}
-
-		public String getLibraryPath(String name) {
-			System.out.println(name);
-			return null;
-		}
-
-		public String getLibraryPath(char[] name) {
-			Bundle bundle = Activator.getDefault().getBundle();
-			URL url = FileLocator.find(bundle, getLibraryPathInPlugin().append(new String(name)), null);
-			try {
-				URL fileURL = FileLocator.toFileURL(url);
-				return fileURL.getPath();
-			} catch (IOException e) {
-				Activator.log(e);
-			}
-			return null;
-		}
-
-		public IPath getWorkingLibPath() {
-			System.out.println();
-			return null;
-		}
-	}
-
-	public LibraryLocation getLibraryLocation() {
-		return WrtKitLocation.getInstance();
-	}
-
-	@Override
-	public String getDescription() {
-		return "WRTKit Support Library";
-	}
-	
-	@Override
-	public String getDescription(IPath containerPath, IJavaScriptProject project) {
-		return containerPath.lastSegment();
-	}
-
-	public void populateProject(IProject project,
-			IProgressMonitor monitor) throws IOException, CoreException {
-		WrtKitLocation location = WrtKitLocation.getInstance();
-		String[] files = location.getFiles();
-		Bundle bundle = Activator.getDefault().getBundle();
-		monitor.beginTask("Copying library entries", files.length);
-		for (String file : files) {
-			Path path = new Path(file);
-			InputStream stream = FileLocator.openStream(bundle, location.getLibraryPathInPlugin().append(path), false);
-			try {
-				IFile f = project.getFile(new Path("WRTKit").append(path));
-				create(f, stream);
-			} finally {
-				stream.close();
-			}
-			monitor.worked(1);
-		}
-	}
-
-	private void create(IFile f, InputStream stream) throws CoreException {
-		IContainer container = f.getParent();
-		createContainer(container);
-		f.create(stream, false, new NullProgressMonitor());
-	}
-
-	private void createContainer(IContainer container) throws CoreException {
-		if (!container.exists()) {
-			createContainer(container.getParent());
-			((IFolder) container).create(false, true, new NullProgressMonitor());
-		}
-	}
-	
-}
--- a/org.symbian.tools.wrttools/src/org/symbian/tools/wrttools/core/packager/WrtPackageActionDelegate.java	Mon Apr 19 17:52:52 2010 -0700
+++ b/org.symbian.tools.wrttools/src/org/symbian/tools/wrttools/core/packager/WrtPackageActionDelegate.java	Mon Apr 19 18:04:34 2010 -0700
@@ -86,7 +86,7 @@
 						break;
 					}
 				}
-				if(hasErrors) {
+                if (hasErrors && !statusListener.canPackageWithErrors(project)) {
 					reportStatus("For the project "+ project.getLocation());
 					reportStatus(WRTPackagerConstants.STA_PKG_FAILED);
 					reportStatus("See errors from the Problems View for more details...");
--- a/org.symbian.tools.wrttools/src/org/symbian/tools/wrttools/core/status/IWRTStatusListener.java	Mon Apr 19 17:52:52 2010 -0700
+++ b/org.symbian.tools.wrttools/src/org/symbian/tools/wrttools/core/status/IWRTStatusListener.java	Mon Apr 19 18:04:34 2010 -0700
@@ -19,6 +19,8 @@
 
 package org.symbian.tools.wrttools.core.status;
 
+import org.eclipse.core.resources.IProject;
+
 public interface IWRTStatusListener {
 	/**
 	 * Tell if the status should be emitted by this listener,
@@ -36,4 +38,6 @@
     public void emitStatus(WRTStatus status);
 
     public void close();
+
+    public boolean canPackageWithErrors(IProject project);
 }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.symbian.tools.wrttools/src/org/symbian/tools/wrttools/handlers/AddJSLibrary.java	Mon Apr 19 18:04:34 2010 -0700
@@ -0,0 +1,40 @@
+/**
+ * Copyright (c) 2010 Symbian Foundation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of the License "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Symbian Foundation - initial contribution.
+ * Contributors:
+ * Description:
+ * Overview:
+ * Details:
+ * Platforms/Drives/Compatibility:
+ * Assumptions/Requirement/Pre-requisites:
+ * Failures and causes:
+ */
+package org.symbian.tools.wrttools.handlers;
+
+import org.eclipse.core.commands.AbstractHandler;
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.commands.IHandler;
+import org.eclipse.jface.wizard.WizardDialog;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.handlers.HandlerUtil;
+import org.symbian.tools.wrttools.wizards.libraries.AddLibrariesWizard;
+
+public class AddJSLibrary extends AbstractHandler implements IHandler {
+
+    public Object execute(ExecutionEvent event) throws ExecutionException {
+        IWorkbenchWindow window = HandlerUtil.getActiveWorkbenchWindow(event);
+        if (window != null) {
+            new WizardDialog(window.getShell(), new AddLibrariesWizard(HandlerUtil.getCurrentSelection(event))).open();
+        }
+        return null;
+    }
+
+}
--- a/org.symbian.tools.wrttools/src/org/symbian/tools/wrttools/util/ProjectUtils.java	Mon Apr 19 17:52:52 2010 -0700
+++ b/org.symbian.tools.wrttools/src/org/symbian/tools/wrttools/util/ProjectUtils.java	Mon Apr 19 18:04:34 2010 -0700
@@ -21,6 +21,7 @@
 import java.io.File;
 import java.io.FileInputStream;
 import java.io.IOException;
+import java.io.InputStream;
 import java.net.URI;
 import java.text.MessageFormat;
 import java.util.Arrays;
@@ -57,10 +58,13 @@
 import org.eclipse.core.runtime.Status;
 import org.eclipse.core.runtime.SubProgressMonitor;
 import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.jface.dialogs.IDialogConstants;
+import org.eclipse.jface.dialogs.MessageDialogWithToggle;
 import org.eclipse.jface.viewers.ISelection;
 import org.eclipse.jface.viewers.IStructuredSelection;
 import org.eclipse.jface.viewers.StructuredSelection;
 import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Shell;
 import org.eclipse.ui.IEditorPart;
 import org.eclipse.ui.IViewReference;
 import org.eclipse.ui.IWorkbenchPage;
@@ -79,6 +83,7 @@
 import org.eclipse.wst.validation.ValidationFramework;
 import org.symbian.tools.wrttools.Activator;
 import org.symbian.tools.wrttools.WidgetProjectNature;
+import org.symbian.tools.wrttools.core.deploy.PreferenceConstants;
 import org.symbian.tools.wrttools.core.packager.WRTPackagerConstants;
 import org.symbian.tools.wrttools.wizards.WrtLibraryWizardPage;
 
@@ -368,8 +373,13 @@
 
     public static void unzip(String archiveFile, IContainer location, int trimSegments, IProgressMonitor progressMonitor)
             throws IOException, CoreException {
-        progressMonitor.beginTask(MessageFormat.format("Unpacking {0}", archiveFile), IProgressMonitor.UNKNOWN);
-        ZipInputStream stream = new ZipInputStream(new FileInputStream(archiveFile));
+        unzip(new FileInputStream(archiveFile), location, trimSegments, archiveFile, progressMonitor);
+    }
+
+    public static void unzip(InputStream in, IContainer location, int trimSegments, String label,
+            IProgressMonitor progressMonitor) throws IOException, CoreException {
+        progressMonitor.beginTask(MessageFormat.format("Unpacking {0}", label), IProgressMonitor.UNKNOWN);
+        ZipInputStream stream = new ZipInputStream(in);
 
         try {
             ZipEntry nextEntry;
@@ -423,6 +433,9 @@
     }
 
     public static boolean isExcluded(IResource resource) {
+        if (!resource.exists()) {
+            return false;
+        }
         try {
             IMarker[] markers = resource
                     .findMarkers(EXCLUDE_MARKER_ID, false, IResource.DEPTH_ZERO);
@@ -456,4 +469,32 @@
         }
     }
 
+    public static boolean canPackageWithErrors(final IProject project) {
+        final boolean[] flag = new boolean[1];
+        String value = Activator.getDefault().getPreferenceStore().getString(PreferenceConstants.PACKAGE_WITH_ERRORS);
+        if (MessageDialogWithToggle.ALWAYS.equals(value)) {
+            flag[0] = true;
+        } else if (MessageDialogWithToggle.NEVER.equals(value)) {
+            flag[0] = false;
+        } else if (MessageDialogWithToggle.PROMPT.equals(value)) {
+            Display.getDefault().syncExec(new Runnable() {
+                public void run() {
+                    flag[0] = queryUser(project);
+                }
+            });
+        }
+        return flag[0];
+    }
+
+    protected static boolean queryUser(IProject project) {
+        Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell();
+        MessageDialogWithToggle dialog = MessageDialogWithToggle.openYesNoQuestion(shell, "WRT Application Packages",
+                String
+                        .format("Project %s has errors. Are you sure you want to package the project?", project
+                                .getName()), "Remember my selection", false, Activator.getDefault()
+                        .getPreferenceStore(),
+                PreferenceConstants.PACKAGE_WITH_ERRORS);
+        return dialog.getReturnCode() == IDialogConstants.YES_ID;
+    }
+
 }
--- a/org.symbian.tools.wrttools/src/org/symbian/tools/wrttools/wizards/NewJSWizard.java	Mon Apr 19 17:52:52 2010 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,169 +0,0 @@
-/**
- * Copyright (c) 2009 Symbian Foundation and/or its subsidiary(-ies).
- * All rights reserved.
- * This component and the accompanying materials are made available
- * under the terms of the License "Eclipse Public License v1.0"
- * which accompanies this distribution, and is available
- * at the URL "http://www.eclipse.org/legal/epl-v10.html".
- *
- * Initial Contributors:
- * Symbian Foundation - initial contribution.
- * Contributors:
- * Description:
- * Overview:
- * Details:
- * Platforms/Drives/Compatibility:
- * Assumptions/Requirement/Pre-requisites:
- * Failures and causes:
- */
-package org.symbian.tools.wrttools.wizards;
-
-
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.wizard.Wizard;
-import org.eclipse.ui.INewWizard;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.core.runtime.*;
-import org.eclipse.jface.operation.*;
-import java.lang.reflect.InvocationTargetException;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.core.resources.*;
-import org.eclipse.core.runtime.CoreException;
-import java.io.*;
-import org.eclipse.ui.*;
-import org.eclipse.ui.ide.IDE;
-
-/**
- * This is a sample new wizard. Its role is to create a new file 
- * resource in the provided container. If the container resource
- * (a folder or a project) is selected in the workspace 
- * when the wizard is opened, it will accept it as the target
- * container. The wizard creates one file with the extension
- * "mpe". If a sample multi-page editor (also available
- * as a template) is registered for the same extension, it will
- * be able to open it.
- */
-
-public class NewJSWizard extends Wizard implements INewWizard {
-	private NewJSWizardPage page;
-	private ISelection selection;
-
-	/**
-	 * Constructor for SampleNewWizard.
-	 */
-	public NewJSWizard() {
-		super();
-		setNeedsProgressMonitor(true);
-	}
-	
-	/**
-	 * Adding the page to the wizard.
-	 */
-
-	public void addPages() {
-		page = new NewJSWizardPage(selection);
-		addPage(page);
-	}
-
-	/**
-	 * This method is called when 'Finish' button is pressed in
-	 * the wizard. We will create an operation and run it
-	 * using wizard as execution context.
-	 */
-	public boolean performFinish() {
-		final String containerName = page.getContainerName();
-		final String fileName = page.getFileName();
-		IRunnableWithProgress op = new IRunnableWithProgress() {
-			public void run(IProgressMonitor monitor) throws InvocationTargetException {
-				try {
-					doFinish(containerName, fileName, monitor);
-				} catch (CoreException e) {
-					throw new InvocationTargetException(e);
-				} finally {
-					monitor.done();
-				}
-			}
-		};
-		try {
-			getContainer().run(true, false, op);
-		} catch (InterruptedException e) {
-			return false;
-		} catch (InvocationTargetException e) {
-			Throwable realException = e.getTargetException();
-			MessageDialog.openError(getShell(), "Error", realException.getMessage());
-			return false;
-		}
-		return true;
-	}
-	
-	/**
-	 * The worker method. It will find the container, create the
-	 * file if missing or just replace its contents, and open
-	 * the editor on the newly created file.
-	 */
-
-	private void doFinish(
-		String containerName,
-		String fileName,
-		IProgressMonitor monitor)
-		throws CoreException {
-		// create a sample file
-		monitor.beginTask("Creating " + fileName, 2);
-		IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
-		IResource resource = root.findMember(new Path(containerName));
-		if (!resource.exists() || !(resource instanceof IContainer)) {
-			throwCoreException("Container \"" + containerName + "\" does not exist.");
-		}
-		IContainer container = (IContainer) resource;
-		final IFile file = container.getFile(new Path(fileName));
-		try {
-			InputStream stream = openContentStream();
-			if (file.exists()) {
-				file.setContents(stream, true, true, monitor);
-			} else {
-				file.create(stream, true, monitor);
-			}
-			stream.close();
-		} catch (IOException e) {
-		}
-		monitor.worked(1);
-		monitor.setTaskName("Opening file for editing...");
-		getShell().getDisplay().asyncExec(new Runnable() {
-			public void run() {
-				IWorkbenchPage page =
-					PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
-				try {
-					IDE.openEditor(page, file, true);
-				} catch (PartInitException e) {
-				}
-			}
-		});
-		monitor.worked(1);
-	}
-	
-	/**
-	 * We will initialize file contents with a sample text.
-	 */
-
-	private InputStream openContentStream() {
-		String contents =
-			"functions checkError(message, resultList, divId, imgId) { } ";
-		return new ByteArrayInputStream(contents.getBytes());
-	}
-
-	private void throwCoreException(String message) throws CoreException {
-		IStatus status =
-			new Status(IStatus.ERROR, "org.symbian.tools.wrttools", IStatus.OK, message, null);
-		throw new CoreException(status);
-	}
-
-	/**
-	 * We will accept the selection in the workbench to see if
-	 * we can initialize from it.
-	 * @see IWorkbenchWizard#init(IWorkbench, IStructuredSelection)
-	 */
-	public void init(IWorkbench workbench, IStructuredSelection selection) {
-		this.selection = selection;
-	}
-}
--- a/org.symbian.tools.wrttools/src/org/symbian/tools/wrttools/wizards/NewJSWizardPage.java	Mon Apr 19 17:52:52 2010 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,203 +0,0 @@
-/**
- * Copyright (c) 2009 Symbian Foundation and/or its subsidiary(-ies).
- * All rights reserved.
- * This component and the accompanying materials are made available
- * under the terms of the License "Eclipse Public License v1.0"
- * which accompanies this distribution, and is available
- * at the URL "http://www.eclipse.org/legal/epl-v10.html".
- *
- * Initial Contributors:
- * Symbian Foundation - initial contribution.
- * Contributors:
- * Description:
- * Overview:
- * Details:
- * Platforms/Drives/Compatibility:
- * Assumptions/Requirement/Pre-requisites:
- * Failures and causes:
- */
-package org.symbian.tools.wrttools.wizards;
-
-import org.eclipse.core.resources.IContainer;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.wizard.WizardPage;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.dialogs.ContainerSelectionDialog;
-
-/**
- * The "New" wizard page allows setting the container for the new file as well
- * as the file name. The page will only accept file name without the extension
- * OR with the extension that matches the expected one (js).
- */
-
-public class NewJSWizardPage extends WizardPage {
-	private Text containerText;
-
-	private Text fileText;
-
-	private ISelection selection;
-
-	/**
-	 * Constructor for SampleNewWizardPage.
-	 * 
-	 * @param pageName
-	 */
-	public NewJSWizardPage(ISelection selection) {
-		super("wizardPage");
-		setTitle("JavaScript File");
-		setDescription("This wizard creates a new file with *.js extension that can be opened by a JavaScript editor.");
-		this.selection = selection;
-	}
-
-	/**
-	 * @see IDialogPage#createControl(Composite)
-	 */
-	public void createControl(Composite parent) {
-		Composite container = new Composite(parent, SWT.NULL);
-		GridLayout layout = new GridLayout();
-		container.setLayout(layout);
-		layout.numColumns = 3;
-		layout.verticalSpacing = 9;
-		Label label = new Label(container, SWT.NULL);
-		label.setText("&Container:");
-
-		containerText = new Text(container, SWT.BORDER | SWT.SINGLE);
-		GridData gd = new GridData(GridData.FILL_HORIZONTAL);
-		containerText.setLayoutData(gd);
-		containerText.addModifyListener(new ModifyListener() {
-			public void modifyText(ModifyEvent e) {
-				dialogChanged();
-			}
-		});
-
-		Button button = new Button(container, SWT.PUSH);
-		button.setText("Browse...");
-		button.addSelectionListener(new SelectionAdapter() {
-			public void widgetSelected(SelectionEvent e) {
-				handleBrowse();
-			}
-		});
-		label = new Label(container, SWT.NULL);
-		label.setText("&File name:");
-
-		fileText = new Text(container, SWT.BORDER | SWT.SINGLE);
-		gd = new GridData(GridData.FILL_HORIZONTAL);
-		fileText.setLayoutData(gd);
-		fileText.addModifyListener(new ModifyListener() {
-			public void modifyText(ModifyEvent e) {
-				dialogChanged();
-			}
-		});
-		initialize();
-		dialogChanged();
-		setControl(container);
-	}
-
-	/**
-	 * Tests if the current workbench selection is a suitable container to use.
-	 */
-
-	private void initialize() {
-		if (selection != null && selection.isEmpty() == false
-				&& selection instanceof IStructuredSelection) {
-			IStructuredSelection ssel = (IStructuredSelection) selection;
-			if (ssel.size() > 1)
-				return;
-			Object obj = ssel.getFirstElement();
-			if (obj instanceof IResource) {
-				IContainer container;
-				if (obj instanceof IContainer)
-					container = (IContainer) obj;
-				else
-					container = ((IResource) obj).getParent();
-				containerText.setText(container.getFullPath().toString());
-			}
-		}
-		fileText.setText("Main.js");
-	}
-
-	/**
-	 * Uses the standard container selection dialog to choose the new value for
-	 * the container field.
-	 */
-
-	private void handleBrowse() {
-		ContainerSelectionDialog dialog = new ContainerSelectionDialog(
-				getShell(), ResourcesPlugin.getWorkspace().getRoot(), false,
-				"Select new file container");
-		if (dialog.open() == ContainerSelectionDialog.OK) {
-			Object[] result = dialog.getResult();
-			if (result.length == 1) {
-				containerText.setText(((Path) result[0]).toString());
-			}
-		}
-	}
-
-	/**
-	 * Ensures that both text fields are set.
-	 */
-
-	private void dialogChanged() {
-		IResource container = ResourcesPlugin.getWorkspace().getRoot()
-				.findMember(new Path(getContainerName()));
-		String fileName = getFileName();
-
-		if (getContainerName().length() == 0) {
-			updateStatus("File container must be specified");
-			return;
-		}
-		if (container == null
-				|| (container.getType() & (IResource.PROJECT | IResource.FOLDER)) == 0) {
-			updateStatus("File container must exist");
-			return;
-		}
-		if (!container.isAccessible()) {
-			updateStatus("Project must be writable");
-			return;
-		}
-		if (fileName.length() == 0) {
-			updateStatus("File name must be specified");
-			return;
-		}
-		if (fileName.replace('\\', '/').indexOf('/', 1) > 0) {
-			updateStatus("File name must be valid");
-			return;
-		}
-		int dotLoc = fileName.lastIndexOf('.');
-		if (dotLoc != -1) {
-			String ext = fileName.substring(dotLoc + 1);
-			if (ext.equalsIgnoreCase("js") == false) {
-				updateStatus("File extension must be \"js\"");
-				return;
-			}
-		}
-		updateStatus(null);
-	}
-
-	private void updateStatus(String message) {
-		setErrorMessage(message);
-		setPageComplete(message == null);
-	}
-
-	public String getContainerName() {
-		return containerText.getText();
-	}
-
-	public String getFileName() {
-		return fileText.getText();
-	}
-}
--- a/org.symbian.tools.wrttools/src/org/symbian/tools/wrttools/wizards/NewXMLWizard.java	Mon Apr 19 17:52:52 2010 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,167 +0,0 @@
-/**
- * Copyright (c) 2009 Symbian Foundation and/or its subsidiary(-ies).
- * All rights reserved.
- * This component and the accompanying materials are made available
- * under the terms of the License "Eclipse Public License v1.0"
- * which accompanies this distribution, and is available
- * at the URL "http://www.eclipse.org/legal/epl-v10.html".
- *
- * Initial Contributors:
- * Symbian Foundation - initial contribution.
- * Contributors:
- * Description:
- * Overview:
- * Details:
- * Platforms/Drives/Compatibility:
- * Assumptions/Requirement/Pre-requisites:
- * Failures and causes:
- */
-package org.symbian.tools.wrttools.wizards;
-
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.wizard.Wizard;
-import org.eclipse.ui.INewWizard;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.core.runtime.*;
-import org.eclipse.jface.operation.*;
-import java.lang.reflect.InvocationTargetException;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.core.resources.*;
-import org.eclipse.core.runtime.CoreException;
-import java.io.*;
-import org.eclipse.ui.*;
-import org.eclipse.ui.ide.IDE;
-
-/**
- * This is a sample new wizard. Its role is to create a new file 
- * resource in the provided container. If the container resource
- * (a folder or a project) is selected in the workspace 
- * when the wizard is opened, it will accept it as the target
- * container. The wizard creates one file with the extension
- * "xml". If a sample xml editor (also available
- * as a template) is registered for the same extension, it will
- * be able to open it.
- */
-
-public class NewXMLWizard extends Wizard implements INewWizard {
-	private NewXMLWizardPage page;
-	private ISelection selection;
-
-	/**
-	 * Constructor for SampleNewWizard.
-	 */
-	public NewXMLWizard() {
-		super();
-		setNeedsProgressMonitor(true);
-	}
-	
-	/**
-	 * Adding the page to the wizard.
-	 */
-
-	public void addPages() {
-		page = new NewXMLWizardPage(selection);
-		addPage(page);
-	}
-
-	/**
-	 * This method is called when 'Finish' button is pressed in
-	 * the wizard. We will create an operation and run it
-	 * using wizard as execution context.
-	 */
-	public boolean performFinish() {
-		final String containerName = page.getContainerName();
-		final String fileName = page.getFileName();
-		IRunnableWithProgress op = new IRunnableWithProgress() {
-			public void run(IProgressMonitor monitor) throws InvocationTargetException {
-				try {
-					doFinish(containerName, fileName, monitor);
-				} catch (CoreException e) {
-					throw new InvocationTargetException(e);
-				} finally {
-					monitor.done();
-				}
-			}
-		};
-		try {
-			getContainer().run(true, false, op);
-		} catch (InterruptedException e) {
-			return false;
-		} catch (InvocationTargetException e) {
-			Throwable realException = e.getTargetException();
-			MessageDialog.openError(getShell(), "Error", realException.getMessage());
-			return false;
-		}
-		return true;
-	}
-	
-	/**
-	 * The worker method. It will find the container, create the
-	 * file if missing or just replace its contents, and open
-	 * the editor on the newly created file.
-	 */
-
-	private void doFinish(
-		String containerName,
-		String fileName,
-		IProgressMonitor monitor)
-		throws CoreException {
-		// create a sample file
-		monitor.beginTask("Creating " + fileName, 2);
-		IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
-		IResource resource = root.findMember(new Path(containerName));
-		if (!resource.exists() || !(resource instanceof IContainer)) {
-			throwCoreException("Container \"" + containerName + "\" does not exist.");
-		}
-		IContainer container = (IContainer) resource;
-		final IFile file = container.getFile(new Path(fileName));
-		try {
-			InputStream stream = openContentStream();
-			if (file.exists()) {
-				file.setContents(stream, true, true, monitor);
-			} else {
-				file.create(stream, true, monitor);
-			}
-			stream.close();
-		} catch (IOException e) {
-		}
-		monitor.worked(1);
-		monitor.setTaskName("Opening file for editing...");
-		getShell().getDisplay().asyncExec(new Runnable() {
-			public void run() {
-				IWorkbenchPage page =
-					PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
-				try {
-					IDE.openEditor(page, file, true);
-				} catch (PartInitException e) {
-				}
-			}
-		});
-		monitor.worked(1);
-	}
-	
-	/**
-	 * We will initialize file contents with a sample text.
-	 */
-
-	private InputStream openContentStream() {
-		String contents = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>";
-		return new ByteArrayInputStream(contents.getBytes());
-	}
-
-	private void throwCoreException(String message) throws CoreException {
-		IStatus status =
-			new Status(IStatus.ERROR, "JSTestEditor2", IStatus.OK, message, null);
-		throw new CoreException(status);
-	}
-
-	/**
-	 * We will accept the selection in the workbench to see if
-	 * we can initialize from it.
-	 * @see IWorkbenchWizard#init(IWorkbench, IStructuredSelection)
-	 */
-	public void init(IWorkbench workbench, IStructuredSelection selection) {
-		this.selection = selection;
-	}
-}
--- a/org.symbian.tools.wrttools/src/org/symbian/tools/wrttools/wizards/NewXMLWizardPage.java	Mon Apr 19 17:52:52 2010 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,203 +0,0 @@
-/**
- * Copyright (c) 2009 Symbian Foundation and/or its subsidiary(-ies).
- * All rights reserved.
- * This component and the accompanying materials are made available
- * under the terms of the License "Eclipse Public License v1.0"
- * which accompanies this distribution, and is available
- * at the URL "http://www.eclipse.org/legal/epl-v10.html".
- *
- * Initial Contributors:
- * Symbian Foundation - initial contribution.
- * Contributors:
- * Description:
- * Overview:
- * Details:
- * Platforms/Drives/Compatibility:
- * Assumptions/Requirement/Pre-requisites:
- * Failures and causes:
- */
-package org.symbian.tools.wrttools.wizards;
-
-import org.eclipse.core.resources.IContainer;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.wizard.WizardPage;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.dialogs.ContainerSelectionDialog;
-
-/**
- * The "New" wizard page allows setting the container for the new file as well
- * as the file name. The page will only accept file name without the extension
- * OR with the extension that matches the expected one (xml).
- */
-
-public class NewXMLWizardPage extends WizardPage {
-	private Text containerText;
-
-	private Text fileText;
-
-	private ISelection selection;
-
-	/**
-	 * Constructor for SampleNewWizardPage.
-	 * 
-	 * @param pageName
-	 */
-	public NewXMLWizardPage(ISelection selection) {
-		super("wizardPage");
-		setTitle("XML File");
-		setDescription("This wizard creates a new XML file with *.xml extension that can be opened by an XML editor.");
-		this.selection = selection;
-	}
-
-	/**
-	 * @see IDialogPage#createControl(Composite)
-	 */
-	public void createControl(Composite parent) {
-		Composite container = new Composite(parent, SWT.NULL);
-		GridLayout layout = new GridLayout();
-		container.setLayout(layout);
-		layout.numColumns = 3;
-		layout.verticalSpacing = 9;
-		Label label = new Label(container, SWT.NULL);
-		label.setText("&Container:");
-
-		containerText = new Text(container, SWT.BORDER | SWT.SINGLE);
-		GridData gd = new GridData(GridData.FILL_HORIZONTAL);
-		containerText.setLayoutData(gd);
-		containerText.addModifyListener(new ModifyListener() {
-			public void modifyText(ModifyEvent e) {
-				dialogChanged();
-			}
-		});
-
-		Button button = new Button(container, SWT.PUSH);
-		button.setText("Browse...");
-		button.addSelectionListener(new SelectionAdapter() {
-			public void widgetSelected(SelectionEvent e) {
-				handleBrowse();
-			}
-		});
-		label = new Label(container, SWT.NULL);
-		label.setText("&File name:");
-
-		fileText = new Text(container, SWT.BORDER | SWT.SINGLE);
-		gd = new GridData(GridData.FILL_HORIZONTAL);
-		fileText.setLayoutData(gd);
-		fileText.addModifyListener(new ModifyListener() {
-			public void modifyText(ModifyEvent e) {
-				dialogChanged();
-			}
-		});
-		initialize();
-		dialogChanged();
-		setControl(container);
-	}
-
-	/**
-	 * Tests if the current workbench selection is a suitable container to use.
-	 */
-
-	private void initialize() {
-		if (selection != null && selection.isEmpty() == false
-				&& selection instanceof IStructuredSelection) {
-			IStructuredSelection ssel = (IStructuredSelection) selection;
-			if (ssel.size() > 1)
-				return;
-			Object obj = ssel.getFirstElement();
-			if (obj instanceof IResource) {
-				IContainer container;
-				if (obj instanceof IContainer)
-					container = (IContainer) obj;
-				else
-					container = ((IResource) obj).getParent();
-				containerText.setText(container.getFullPath().toString());
-			}
-		}
-		fileText.setText("sample_file.xml");
-	}
-
-	/**
-	 * Uses the standard container selection dialog to choose the new value for
-	 * the container field.
-	 */
-
-	private void handleBrowse() {
-		ContainerSelectionDialog dialog = new ContainerSelectionDialog(
-				getShell(), ResourcesPlugin.getWorkspace().getRoot(), false,
-				"Select new file container");
-		if (dialog.open() == ContainerSelectionDialog.OK) {
-			Object[] result = dialog.getResult();
-			if (result.length == 1) {
-				containerText.setText(((Path) result[0]).toString());
-			}
-		}
-	}
-
-	/**
-	 * Ensures that both text fields are set.
-	 */
-
-	private void dialogChanged() {
-		IResource container = ResourcesPlugin.getWorkspace().getRoot()
-				.findMember(new Path(getContainerName()));
-		String fileName = getFileName();
-
-		if (getContainerName().length() == 0) {
-			updateStatus("File container must be specified");
-			return;
-		}
-		if (container == null
-				|| (container.getType() & (IResource.PROJECT | IResource.FOLDER)) == 0) {
-			updateStatus("File container must exist");
-			return;
-		}
-		if (!container.isAccessible()) {
-			updateStatus("Project must be writable");
-			return;
-		}
-		if (fileName.length() == 0) {
-			updateStatus("File name must be specified");
-			return;
-		}
-		if (fileName.replace('\\', '/').indexOf('/', 1) > 0) {
-			updateStatus("File name must be valid");
-			return;
-		}
-		int dotLoc = fileName.lastIndexOf('.');
-		if (dotLoc != -1) {
-			String ext = fileName.substring(dotLoc + 1);
-			if (ext.equalsIgnoreCase("xml") == false) {
-				updateStatus("File extension must be \"xml\"");
-				return;
-			}
-		}
-		updateStatus(null);
-	}
-
-	private void updateStatus(String message) {
-		setErrorMessage(message);
-		setPageComplete(message == null);
-	}
-
-	public String getContainerName() {
-		return containerText.getText();
-	}
-
-	public String getFileName() {
-		return fileText.getText();
-	}
-}
\ No newline at end of file
--- a/org.symbian.tools.wrttools/src/org/symbian/tools/wrttools/wizards/WRTProjectTemplateWizardPage.java	Mon Apr 19 17:52:52 2010 -0700
+++ b/org.symbian.tools.wrttools/src/org/symbian/tools/wrttools/wizards/WRTProjectTemplateWizardPage.java	Mon Apr 19 18:04:34 2010 -0700
@@ -169,6 +169,5 @@
 	public void setVisible(boolean visible) {
 		super.setVisible(visible);
 		templates.getControl().setFocus();
-		
 	}
 }
--- a/org.symbian.tools.wrttools/src/org/symbian/tools/wrttools/wizards/WRTProjectWizard.java	Mon Apr 19 17:52:52 2010 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,172 +0,0 @@
-/**
- * Copyright (c) 2009 Symbian Foundation and/or its subsidiary(-ies).
- * All rights reserved.
- * This component and the accompanying materials are made available
- * under the terms of the License "Eclipse Public License v1.0"
- * which accompanies this distribution, and is available
- * at the URL "http://www.eclipse.org/legal/epl-v10.html".
- *
- * Initial Contributors:
- * Symbian Foundation - initial contribution.
- * Contributors:
- * Description:
- * Overview:
- * Details:
- * Platforms/Drives/Compatibility:
- * Assumptions/Requirement/Pre-requisites:
- * Failures and causes:
- */
-package org.symbian.tools.wrttools.wizards;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.wizard.Wizard;
-import org.eclipse.ui.INewWizard;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.core.runtime.*;
-import org.eclipse.jface.operation.*;
-import java.lang.reflect.InvocationTargetException;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.core.resources.*;
-import org.eclipse.core.runtime.CoreException;
-import java.io.*;
-import org.eclipse.ui.*;
-import org.eclipse.ui.ide.IDE;
-//import org.eclipse.ui.internal.ide.dialogs.IDEResourceInfoUtils;
-//import org.symbian.tools.wrttools.wizards.IWizardData;
-
-
-	/**
-	 * This is a sample new wizard. Its role is to create a new file 
-	 * resource in the provided container. If the container resource
-	 * (a folder or a project) is selected in the workspace 
-	 * when the wizard is opened, it will accept it as the target
-	 * container. The wizard creates one file with the extension
-	 * "mpe". If a sample multi-page editor (also available
-	 * as a template) is registered for the same extension, it will
-	 * be able to open it.
-	 */
-
-	public class WRTProjectWizard extends Wizard implements INewWizard {
-		private WRTProjectWizardPage page;
-		private ISelection selection;
-		
-
-		/**
-		 * Constructor for SampleNewWizard.
-		 */
-		public WRTProjectWizard() {
-			super();
-			setNeedsProgressMonitor(true);
-		}
-		
-		/**
-		 * Adding the page to the wizard.
-		 */
-
-		
-		public void addPages() {
-			page = new WRTProjectWizardPage(selection);
-			addPage(page);
-		}
-
-		/**
-		 * This method is called when 'Finish' button is pressed in
-		 * the wizard. We will create an operation and run it
-		 * using wizard as execution context.
-		 */
-		public boolean performFinish() {
-			final String containerName = page.getContainerName();
-			final String fileName = page.getFileName();
-			IRunnableWithProgress op = new IRunnableWithProgress() {
-				public void run(IProgressMonitor monitor) throws InvocationTargetException {
-					try {
-						doFinish(containerName, fileName, monitor);
-					} catch (CoreException e) {
-						throw new InvocationTargetException(e);
-					} finally {
-						monitor.done();
-					}
-				}
-			};
-			try {
-				getContainer().run(true, false, op);
-			} catch (InterruptedException e) {
-				return false;
-			} catch (InvocationTargetException e) {
-				Throwable realException = e.getTargetException();
-				MessageDialog.openError(getShell(), "Error", realException.getMessage());
-				return false;
-			}
-			return true;
-		}
-		
-		/**
-		 * The worker method. It will find the container, create the
-		 * file if missing or just replace its contents, and open
-		 * the editor on the newly created file.
-		 */
-
-		private void doFinish(
-			String containerName,
-			String fileName,
-			IProgressMonitor monitor)
-			throws CoreException {
-			// create a sample file
-			monitor.beginTask("Creating " + fileName, 2);
-			IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
-			IResource resource = root.findMember(new Path(containerName));
-			if (!resource.exists() || !(resource instanceof IContainer)) {
-				throwCoreException("Container \"" + containerName + "\" does not exist.");
-			}
-			IContainer container = (IContainer) resource;
-			final IFile file = container.getFile(new Path(fileName));
-			try {
-				InputStream stream = openContentStream();
-				if (file.exists()) {
-					file.setContents(stream, true, true, monitor);
-				} else {
-					file.create(stream, true, monitor);
-				}
-				stream.close();
-			} catch (IOException e) {
-			}
-			monitor.worked(1);
-			monitor.setTaskName("Opening file for editing...");
-			getShell().getDisplay().asyncExec(new Runnable() {
-				public void run() {
-					IWorkbenchPage page =
-						PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
-					try {
-						IDE.openEditor(page, file, true);
-					} catch (PartInitException e) {
-					}
-				}
-			});
-			monitor.worked(1);
-		}
-		
-		/**
-		 * We will initialize file contents with a sample text.
-		 */
-
-		private InputStream openContentStream() {
-			String contents =
-				"functions checkError(message, resultList, divId, imgId) { } ";
-			return new ByteArrayInputStream(contents.getBytes());
-		}
-
-		private void throwCoreException(String message) throws CoreException {
-			IStatus status =
-				new Status(IStatus.ERROR, "org.symbian.tools.wrttools", IStatus.OK, message, null);
-			throw new CoreException(status);
-		}
-
-		/**
-		 * We will accept the selection in the workbench to see if
-		 * we can initialize from it.
-		 * @see IWorkbenchWizard#init(IWorkbench, IStructuredSelection)
-		 */
-		public void init(IWorkbench workbench, IStructuredSelection selection) {
-			this.selection = selection;
-		}
-	}
--- a/org.symbian.tools.wrttools/src/org/symbian/tools/wrttools/wizards/WRTProjectWizardPage.java	Mon Apr 19 17:52:52 2010 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,203 +0,0 @@
-/**
- * Copyright (c) 2009 Symbian Foundation and/or its subsidiary(-ies).
- * All rights reserved.
- * This component and the accompanying materials are made available
- * under the terms of the License "Eclipse Public License v1.0"
- * which accompanies this distribution, and is available
- * at the URL "http://www.eclipse.org/legal/epl-v10.html".
- *
- * Initial Contributors:
- * Symbian Foundation - initial contribution.
- * Contributors:
- * Description:
- * Overview:
- * Details:
- * Platforms/Drives/Compatibility:
- * Assumptions/Requirement/Pre-requisites:
- * Failures and causes:
- */
-package org.symbian.tools.wrttools.wizards;
-
-import org.eclipse.core.resources.IContainer;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.wizard.WizardPage;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.dialogs.ContainerSelectionDialog;
-
-/**
- * The "New" wizard page allows setting the container for the new file as well
- * as the file name. The page will only accept file name without the extension
- * OR with the extension that matches the expected one (js).
- */
-
-public class WRTProjectWizardPage extends WizardPage {
-	private Text containerText;
-
-	private Text fileText;
-
-	private ISelection selection;
-
-	/**
-	 * Constructor for SampleNewWizardPage.
-	 * 
-	 * @param pageName
-	 */
-	public WRTProjectWizardPage(ISelection selection) {
-		super("wizardPage");
-		setTitle("Web Runtime(WRT)");
-		setDescription("This wizard creates a new Web Runtime(WRT) Project.");
-		this.selection = selection;
-	}
-
-	/**
-	 * @see IDialogPage#createControl(Composite)
-	 */
-	public void createControl(Composite parent) {
-		Composite container = new Composite(parent, SWT.NULL);
-		GridLayout layout = new GridLayout();
-		container.setLayout(layout);
-		layout.numColumns = 3;
-		layout.verticalSpacing = 9;
-		Label label = new Label(container, SWT.NULL);
-		label.setText("&Container:");
-
-		containerText = new Text(container, SWT.BORDER | SWT.SINGLE);
-		GridData gd = new GridData(GridData.FILL_HORIZONTAL);
-		containerText.setLayoutData(gd);
-		containerText.addModifyListener(new ModifyListener() {
-			public void modifyText(ModifyEvent e) {
-				dialogChanged();
-			}
-		});
-
-		Button button = new Button(container, SWT.PUSH);
-		button.setText("Browse...");
-		button.addSelectionListener(new SelectionAdapter() {
-			public void widgetSelected(SelectionEvent e) {
-				handleBrowse();
-			}
-		});
-		label = new Label(container, SWT.NULL);
-		label.setText("&File name:");
-
-		fileText = new Text(container, SWT.BORDER | SWT.SINGLE);
-		gd = new GridData(GridData.FILL_HORIZONTAL);
-		fileText.setLayoutData(gd);
-		fileText.addModifyListener(new ModifyListener() {
-			public void modifyText(ModifyEvent e) {
-				dialogChanged();
-			}
-		});
-		initialize();
-		dialogChanged();
-		setControl(container);
-	}
-
-	/**
-	 * Tests if the current workbench selection is a suitable container to use.
-	 */
-
-	private void initialize() {
-		if (selection != null && selection.isEmpty() == false
-				&& selection instanceof IStructuredSelection) {
-			IStructuredSelection ssel = (IStructuredSelection) selection;
-			if (ssel.size() > 1)
-				return;
-			Object obj = ssel.getFirstElement();
-			if (obj instanceof IResource) {
-				IContainer container;
-				if (obj instanceof IContainer)
-					container = (IContainer) obj;
-				else
-					container = ((IResource) obj).getParent();
-				containerText.setText(container.getFullPath().toString());
-			}
-		}
-		fileText.setText("sample_file.js");
-	}
-
-	/**
-	 * Uses the standard container selection dialog to choose the new value for
-	 * the container field.
-	 */
-
-	private void handleBrowse() {
-		ContainerSelectionDialog dialog = new ContainerSelectionDialog(
-				getShell(), ResourcesPlugin.getWorkspace().getRoot(), false,
-				"Select new file container");
-		if (dialog.open() == ContainerSelectionDialog.OK) {
-			Object[] result = dialog.getResult();
-			if (result.length == 1) {
-				containerText.setText(((Path) result[0]).toString());
-			}
-		}
-	}
-
-	/**
-	 * Ensures that both text fields are set.
-	 */
-
-	private void dialogChanged() {
-		IResource container = ResourcesPlugin.getWorkspace().getRoot()
-				.findMember(new Path(getContainerName()));
-		String fileName = getFileName();
-
-		if (getContainerName().length() == 0) {
-			updateStatus("File container must be specified");
-			return;
-		}
-		if (container == null
-				|| (container.getType() & (IResource.PROJECT | IResource.FOLDER)) == 0) {
-			updateStatus("File container must exist");
-			return;
-		}
-		if (!container.isAccessible()) {
-			updateStatus("Project must be writable");
-			return;
-		}
-		if (fileName.length() == 0) {
-			updateStatus("File name must be specified");
-			return;
-		}
-		if (fileName.replace('\\', '/').indexOf('/', 1) > 0) {
-			updateStatus("File name must be valid");
-			return;
-		}
-		int dotLoc = fileName.lastIndexOf('.');
-		if (dotLoc != -1) {
-			String ext = fileName.substring(dotLoc + 1);
-			if (ext.equalsIgnoreCase("js") == false) {
-				updateStatus("File extension must be \"js\"");
-				return;
-			}
-		}
-		updateStatus(null);
-	}
-
-	private void updateStatus(String message) {
-		setErrorMessage(message);
-		setPageComplete(message == null);
-	}
-
-	public String getContainerName() {
-		return containerText.getText();
-	}
-
-	public String getFileName() {
-		return fileText.getText();
-	}
-}
--- a/org.symbian.tools.wrttools/src/org/symbian/tools/wrttools/wizards/WizardContext.java	Mon Apr 19 17:52:52 2010 -0700
+++ b/org.symbian.tools.wrttools/src/org/symbian/tools/wrttools/wizards/WizardContext.java	Mon Apr 19 18:04:34 2010 -0700
@@ -22,10 +22,15 @@
 import java.beans.PropertyChangeSupport;
 import java.net.URI;
 import java.text.MessageFormat;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.HashSet;
 import java.util.Map;
+import java.util.Set;
 import java.util.TreeMap;
 
 import org.symbian.tools.wrttools.core.ProjectTemplate;
+import org.symbian.tools.wrttools.core.libraries.JSLibrary;
 import org.symbian.tools.wrttools.util.Util;
 
 public class WizardContext {
@@ -38,18 +43,20 @@
 	public static final String WIDGET_ID = "widgetId";
 	public static final String WIDGET_NAME = "widgetName";
 	public static final String HOME_SCREEN = "homeScreen";
+    public static final String LIBRARIES = "libraries";
 
 	private String cssFile;
 	private String htmlFile;
 	private String jsFile;
 	private String projectName;
-	private PropertyChangeSupport propertySupport = new PropertyChangeSupport(this);
+	private final PropertyChangeSupport propertySupport = new PropertyChangeSupport(this);
 	private ProjectTemplate template;
 	private String widgetId;
 	private String widgetName;
 	private Map<String, String> extensions = new TreeMap<String, String>();
 	private URI projectUri;
 	private boolean homeScreen;
+    private Set<JSLibrary> libraries = new HashSet<JSLibrary>();
 
 	public void addPropertyChangeListener(PropertyChangeListener arg0) {
 		propertySupport.addPropertyChangeListener(arg0);
@@ -187,6 +194,9 @@
 		if (cssFile == null) {
 			propertySupport.firePropertyChange(CSS_FILE, getCssFile(), css);
 		}
+        if (cssFile == null) {
+            propertySupport.firePropertyChange(LIBRARIES, getCssFile(), css);
+        }
 	}
 
 	public void setWidgetId(String widgetId) {
@@ -275,4 +285,26 @@
 		}
 		return fileName;
 	}
+
+    public boolean isRequiredLibrary(JSLibrary element) {
+        return template != null && template.requires(element);
+    }
+
+    public Set<JSLibrary> getLibraries() {
+        final Set<JSLibrary> set = new HashSet<JSLibrary>(libraries);
+        if (template != null) {
+            set.addAll(Arrays.asList(template.getRequiredLibraries()));
+        }
+        return set;
+    }
+
+    public void setLibraries(Set<JSLibrary> libraries) {
+        Set<JSLibrary> prev = this.libraries;
+        this.libraries = libraries;
+        propertySupport.firePropertyChange(LIBRARIES, prev, libraries);
+    }
+
+    public Map<String, String> getLibraryParameters(JSLibrary library) {
+        return Collections.emptyMap();
+    }
 }
--- a/org.symbian.tools.wrttools/src/org/symbian/tools/wrttools/wizards/WrtWidgetWizard.java	Mon Apr 19 17:52:52 2010 -0700
+++ b/org.symbian.tools.wrttools/src/org/symbian/tools/wrttools/wizards/WrtWidgetWizard.java	Mon Apr 19 18:04:34 2010 -0700
@@ -29,6 +29,7 @@
 import java.net.URL;
 import java.util.HashMap;
 import java.util.Map;
+import java.util.Set;
 import java.util.zip.ZipEntry;
 import java.util.zip.ZipInputStream;
 
@@ -55,245 +56,216 @@
 import org.eclipse.ui.IWorkbench;
 import org.eclipse.ui.dialogs.WizardNewProjectCreationPage;
 import org.eclipse.ui.wizards.newresource.BasicNewProjectResourceWizard;
-import org.eclipse.wst.jsdt.core.JavaScriptCore;
-import org.eclipse.wst.jsdt.core.JsGlobalScopeContainerInitializer;
 import org.symbian.tools.wrttools.Activator;
 import org.symbian.tools.wrttools.core.ProjectTemplate;
 import org.symbian.tools.wrttools.core.WRTImages;
-import org.symbian.tools.wrttools.core.libraries.IWrtIdeContainer;
+import org.symbian.tools.wrttools.core.libraries.JSLibrary;
 import org.symbian.tools.wrttools.util.NonClosingStream;
 import org.symbian.tools.wrttools.util.ProjectUtils;
+import org.symbian.tools.wrttools.wizards.libraries.WRTProjectLibraryWizardPage;
 
 public class WrtWidgetWizard extends Wizard implements INewWizard, IExecutableExtension {
-	private WizardNewProjectCreationPage resourcePage;
-	private WizardContext context;
-	private DataBindingContext bindingContext;
-	private final Map<ProjectTemplate, WRTProjectDetailsWizardPage> templateDetails = new HashMap<ProjectTemplate, WRTProjectDetailsWizardPage>();
-	private WRTProjectTemplateWizardPage templatesPage;
-	private WRTProjectFilesWizardPage filesPage;
-	private IConfigurationElement config;
+    private WizardNewProjectCreationPage resourcePage;
+    private WizardContext context;
+    private DataBindingContext bindingContext;
+    private final Map<ProjectTemplate, WRTProjectDetailsWizardPage> templateDetails = new HashMap<ProjectTemplate, WRTProjectDetailsWizardPage>();
+    private WRTProjectTemplateWizardPage templatesPage;
+    private WRTProjectFilesWizardPage filesPage;
+    private IConfigurationElement config;
 
-	public WrtWidgetWizard() {
+    public WrtWidgetWizard() {
         setDefaultPageImageDescriptor(WRTImages.newWizardBanner());
-		setWindowTitle("New Web Runtime Application");
-		setNeedsProgressMonitor(true);
-	}
+        setWindowTitle("New Web Runtime Application");
+        setNeedsProgressMonitor(true);
+    }
 
-	public boolean performFinish() {
-		final IProject[] holder = new IProject[1];
-		try {
-			getContainer().run(true, true, new IRunnableWithProgress() {
-				public void run(IProgressMonitor monitor)
-						throws InvocationTargetException, InterruptedException {
-					holder[0] = action(monitor);
-				}
-			});
-		} catch (InvocationTargetException e) {
-			Activator.log(e);
-		} catch (InterruptedException e) {
-			Activator.log(e);
-		}
-		BasicNewProjectResourceWizard.updatePerspective(config);
-		if (holder[0] != null) {
-			ProjectUtils.focusOn(holder[0]);
-		}
-		return true;
-	}
+    public boolean performFinish() {
+        final IProject[] holder = new IProject[1];
+        try {
+            getContainer().run(true, true, new IRunnableWithProgress() {
+                public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
+                    holder[0] = action(monitor);
+                }
+            });
+        } catch (InvocationTargetException e) {
+            Activator.log(e);
+        } catch (InterruptedException e) {
+            Activator.log(e);
+        }
+        BasicNewProjectResourceWizard.updatePerspective(config);
+        if (holder[0] != null) {
+            ProjectUtils.focusOn(holder[0]);
+        }
+        return true;
+    }
 
-	protected IProject action(IProgressMonitor monitor) {
-		final IProject[] holder = new IProject[1];
-		try {
-			ResourcesPlugin.getWorkspace().run(new IWorkspaceRunnable() {
-				public void run(IProgressMonitor monitor) throws CoreException {
-					holder[0] = createAndInitProject(monitor);
-				}
-			}, monitor);
-		} catch (CoreException e) {
-			Activator.log(e);
-		}
-		return holder[0];
-	}
-
-	protected IProject createAndInitProject(IProgressMonitor monitor)
-			throws CoreException {
-		monitor.beginTask("Creating project", 100);
-		IProject project = ProjectUtils.createWrtProject(context.getProjectName(), context.getProjectUri(), new SubProgressMonitor(monitor, 30));
-		populateProject(project, new SubProgressMonitor(monitor, 30));
-		try {
-			initLibraries(project, context.getTemplate().getLibraryIds(), new SubProgressMonitor(monitor, 40));
-		} catch (IOException e) {
-			throw new CoreException(new Status(IStatus.ERROR, Activator.PLUGIN_ID, "Failed to setup libraries", e));
-		}
-		monitor.done();
-		return project;
-	}
+    protected IProject action(IProgressMonitor monitor) {
+        final IProject[] holder = new IProject[1];
+        try {
+            ResourcesPlugin.getWorkspace().run(new IWorkspaceRunnable() {
+                public void run(IProgressMonitor monitor) throws CoreException {
+                    holder[0] = createAndInitProject(monitor);
+                }
+            }, monitor);
+        } catch (CoreException e) {
+            Activator.log(e);
+        }
+        return holder[0];
+    }
 
-	private void initLibraries(IProject project, String[] libraryIds, IProgressMonitor progressMonitor) throws IOException, CoreException {
-		if (libraryIds.length == 0) {
-			progressMonitor.done();
-			return;
-		}
-		progressMonitor.beginTask("Installing JS libraries", 100);
-		int perContainer = 90 / libraryIds.length;
-		for (String string : libraryIds) {
-			JsGlobalScopeContainerInitializer containerInitializer = JavaScriptCore.getJsGlobalScopeContainerInitializer(string);
-			if (containerInitializer instanceof IWrtIdeContainer) {
-				((IWrtIdeContainer) containerInitializer).populateProject(project, new SubProgressMonitor(progressMonitor, perContainer));
-			}
-		}
-//		IJavaScriptProject js = JavaScriptCore.create(project);
-//		IIncludePathEntry[] rawIncludepath = js.getRawIncludepath();
-//		int preconfigured = rawIncludepath.length;
-//		IIncludePathEntry[] newIncludepath = new IIncludePathEntry[preconfigured + libraryIds.length];
-//		System.arraycopy(rawIncludepath, 0, newIncludepath, 0, preconfigured);
-//		for (int i = 0; i < libraryIds.length; i++) {
-//			String string = libraryIds[i];
-//			IIncludePathEntry entry = JavaScriptCore.newContainerEntry(new Path(string));
-//			newIncludepath[preconfigured + i] = entry;
-//		}
-//		js.setRawIncludepath(newIncludepath, new SubProgressMonitor(progressMonitor, 10));
-		progressMonitor.done();
-	}
+    protected IProject createAndInitProject(IProgressMonitor monitor) throws CoreException {
+        monitor.beginTask("Creating project", 100);
+        IProject project = ProjectUtils.createWrtProject(context.getProjectName(), context.getProjectUri(),
+                new SubProgressMonitor(monitor, 30));
+        populateProject(project, new SubProgressMonitor(monitor, 30));
+        try {
+            initLibraries(project, context.getLibraries(), new SubProgressMonitor(monitor, 40));
+        } catch (IOException e) {
+            throw new CoreException(new Status(IStatus.ERROR, Activator.PLUGIN_ID, "Failed to setup libraries", e));
+        }
+        monitor.done();
+        return project;
+    }
 
-	private void populateProject(IProject project, IProgressMonitor monitor)
-			throws CoreException {
-		URL projectContents = context.getTemplate().getProjectContents();
-		Map<String, String> vars = context.getTemplateVars();
+    private void initLibraries(IProject project, Set<JSLibrary> set, IProgressMonitor progressMonitor)
+            throws IOException, CoreException {
+        if (set.isEmpty()) {
+            progressMonitor.done();
+            return;
+        }
+        progressMonitor.beginTask("Installing JS libraries", 100);
+        int perContainer = 90 / set.size();
+        for (JSLibrary library: set) {
+            library.install(project, context.getLibraryParameters(library), new SubProgressMonitor(progressMonitor,
+                    perContainer));
+        }
+        progressMonitor.done();
+    }
+
+    private void populateProject(IProject project, IProgressMonitor monitor) throws CoreException {
+        URL projectContents = context.getTemplate().getProjectContents();
+        Map<String, String> vars = context.getTemplateVars();
 
-		ZipInputStream stream = null;
-		try {
-			Velocity.init();
-			VelocityContext ctx = new VelocityContext(vars);
-			stream = new ZipInputStream(projectContents.openStream());
-			monitor.beginTask("Generating project contents",
-					IProgressMonitor.UNKNOWN);
-			ZipEntry entry;
-			while ((entry = stream.getNextEntry()) != null
-					&& !monitor.isCanceled()) {
-				String name = entry.getName();
-				boolean isVelocity = name.endsWith(".velocitytemplate");
-				if (isVelocity) {
-					name = name.substring(0, name.length()
-							- ".velocitytemplate".length());
-				}
-				if (name.startsWith("$")) {
-					int dotLocation = name.indexOf(".");
-					String template = name.substring(1,
-							dotLocation > 1 ? dotLocation : name.length());
-					if (vars.containsKey(template)) {
-						name = vars.get(template)
-								+ name.substring(dotLocation > 1 ? dotLocation
-										: name.length());
-					}
-				}
-				if (entry.isDirectory()) {
-					IFolder folder = project.getFolder(entry.getName());
-					folder.create(false, true, new SubProgressMonitor(monitor, 1));
-				} else if (isVelocity) {
-					copyTemplate(project, name, stream, (int) entry.getSize(),
-							ctx, monitor);
-				} else {
-					ProjectUtils.copyFile(project, name, stream, entry.getSize(), monitor);
-				}
-				stream.closeEntry();
-			}
-			monitor.done();
-		} catch (Exception e) {
-			throw new CoreException(new Status(IStatus.ERROR,
-					Activator.PLUGIN_ID, "Project creation failed", e));
-		} finally {
-			if (stream != null) {
-				try {
-					stream.close();
-				} catch (IOException e) {
-					// Ignore - something really bad happened
-				}
-			}
-		}
-	}
+        ZipInputStream stream = null;
+        try {
+            Velocity.init();
+            VelocityContext ctx = new VelocityContext(vars);
+            stream = new ZipInputStream(projectContents.openStream());
+            monitor.beginTask("Generating project contents", IProgressMonitor.UNKNOWN);
+            ZipEntry entry;
+            while ((entry = stream.getNextEntry()) != null && !monitor.isCanceled()) {
+                String name = entry.getName();
+                boolean isVelocity = name.endsWith(".velocitytemplate");
+                if (isVelocity) {
+                    name = name.substring(0, name.length() - ".velocitytemplate".length());
+                }
+                if (name.startsWith("$")) {
+                    int dotLocation = name.indexOf(".");
+                    String template = name.substring(1, dotLocation > 1 ? dotLocation : name.length());
+                    if (vars.containsKey(template)) {
+                        name = vars.get(template) + name.substring(dotLocation > 1 ? dotLocation : name.length());
+                    }
+                }
+                if (entry.isDirectory()) {
+                    IFolder folder = project.getFolder(entry.getName());
+                    folder.create(false, true, new SubProgressMonitor(monitor, 1));
+                } else if (isVelocity) {
+                    copyTemplate(project, name, stream, (int) entry.getSize(), ctx, monitor);
+                } else {
+                    ProjectUtils.copyFile(project, name, stream, entry.getSize(), monitor);
+                }
+                stream.closeEntry();
+            }
+            monitor.done();
+        } catch (Exception e) {
+            throw new CoreException(new Status(IStatus.ERROR, Activator.PLUGIN_ID, "Project creation failed", e));
+        } finally {
+            if (stream != null) {
+                try {
+                    stream.close();
+                } catch (IOException e) {
+                    // Ignore - something really bad happened
+                }
+            }
+        }
+    }
 
-	private void copyTemplate(IProject project, String name,
-			ZipInputStream stream, int size, VelocityContext ctx,
-			IProgressMonitor monitor) throws IOException, CoreException {
-		// Templates will not be more then a few megs - we can afford the memory
-		ByteArrayOutputStream file = new ByteArrayOutputStream();
+    private void copyTemplate(IProject project, String name, ZipInputStream stream, int size, VelocityContext ctx,
+            IProgressMonitor monitor) throws IOException, CoreException {
+        // Templates will not be more then a few megs - we can afford the memory
+        ByteArrayOutputStream file = new ByteArrayOutputStream();
+
+        Reader reader = new InputStreamReader(new NonClosingStream(stream));
+        Writer writer = new OutputStreamWriter(file);
 
-		Reader reader = new InputStreamReader(new NonClosingStream(stream));
-		Writer writer = new OutputStreamWriter(file);
+        Velocity.evaluate(ctx, writer, name, reader);
+
+        reader.close();
+        writer.close();
 
-		Velocity.evaluate(ctx, writer, name, reader);
-
-		reader.close();
-		writer.close();
+        ByteArrayInputStream contents = new ByteArrayInputStream(file.toByteArray());
+        IFile f = project.getFile(name);
+        f.create(contents, true, new SubProgressMonitor(monitor, 1));
+    }
 
-		ByteArrayInputStream contents = new ByteArrayInputStream(file
-				.toByteArray());
-		IFile f = project.getFile(name);
-		f.create(contents, true, new SubProgressMonitor(monitor, 1));
-	}
+    public void init(IWorkbench workbench, IStructuredSelection selection) {
+        context = new WizardContext();
+        bindingContext = new DataBindingContext();
+    }
 
-	public void init(IWorkbench workbench, IStructuredSelection selection) {
-		context = new WizardContext();
-		bindingContext = new DataBindingContext();
-	}
+    @Override
+    public void addPages() {
+        resourcePage = new WizardNewProjectCreationPage("Resource");
+        resourcePage.setDescription("Create a Web Runtime application project in the workspace or other location");
+        resourcePage.setTitle("Create a New Web Runtime Application Project");
+        addPage(resourcePage);
 
-	@Override
-	public void addPages() {
-		resourcePage = new WizardNewProjectCreationPage("Resource");
-		resourcePage
-				.setDescription("Create a Web Runtime application project in the workspace or other location");
-		resourcePage.setTitle("Create a New Web Runtime Application Project");
-		addPage(resourcePage);
-
-		templatesPage = new WRTProjectTemplateWizardPage(context,
-				bindingContext);
-		addPage(templatesPage);
+        templatesPage = new WRTProjectTemplateWizardPage(context, bindingContext);
+        addPage(templatesPage);
 
-		ProjectTemplate[] templates = ProjectTemplate.getAllTemplates();
-		for (ProjectTemplate projectTemplate : templates) {
-			WRTProjectDetailsWizardPage page = projectTemplate
-					.createWizardPage(context, bindingContext);
-			addPage(page);
-			templateDetails.put(projectTemplate, page);
-		}
+        ProjectTemplate[] templates = ProjectTemplate.getAllTemplates();
+        for (ProjectTemplate projectTemplate : templates) {
+            WRTProjectDetailsWizardPage page = projectTemplate.createWizardPage(context, bindingContext);
+            addPage(page);
+            templateDetails.put(projectTemplate, page);
+        }
 
-		filesPage = new WRTProjectFilesWizardPage(context, bindingContext);
-		addPage(filesPage);
-	}
+        filesPage = new WRTProjectFilesWizardPage(context, bindingContext);
+        addPage(filesPage);
+
+        addPage(new WRTProjectLibraryWizardPage(context, bindingContext));
+    }
 
-	@Override
-	public boolean canFinish() {
-		return super.canFinish()
-				&& getContainer().getCurrentPage() == filesPage;
-	}
+    @Override
+    public boolean canFinish() {
+        return super.canFinish() && getContainer().getCurrentPage() == getPages()[getPageCount() - 1];
+    }
 
-	@Override
-	public IWizardPage getNextPage(IWizardPage page) {
-		if (page == resourcePage) {
-			context.setProjectName(resourcePage.getProjectName());
-			context.setProjectUri(resourcePage.getLocationURI());
-		}
-		if (page == templatesPage) {
-			ProjectTemplate template = context.getTemplate();
-			if (template != null) {
-				WRTProjectDetailsWizardPage activePage = templateDetails
-						.get(template);
-				for (WRTProjectDetailsWizardPage wizardPage : templateDetails
-						.values()) {
-					wizardPage.setActive(wizardPage == activePage);
-				}
-				bindingContext.updateModels();
-				return activePage;
-			}
-		}
-		if (page instanceof WRTProjectDetailsWizardPage) {
-			return filesPage;
-		}
-		return super.getNextPage(page);
-	}
+    @Override
+    public IWizardPage getNextPage(IWizardPage page) {
+        if (page == resourcePage) {
+            context.setProjectName(resourcePage.getProjectName());
+            context.setProjectUri(resourcePage.getLocationURI());
+        }
+        if (page == templatesPage) {
+            ProjectTemplate template = context.getTemplate();
+            if (template != null) {
+                WRTProjectDetailsWizardPage activePage = templateDetails.get(template);
+                for (WRTProjectDetailsWizardPage wizardPage : templateDetails.values()) {
+                    wizardPage.setActive(wizardPage == activePage);
+                }
+                bindingContext.updateModels();
+                return activePage;
+            }
+        }
+        if (page instanceof WRTProjectDetailsWizardPage) {
+            return filesPage;
+        }
+        return super.getNextPage(page);
+    }
 
-	public void setInitializationData(IConfigurationElement config,
-			String propertyName, Object data) throws CoreException {
-		this.config = config;
-	}
+    public void setInitializationData(IConfigurationElement config, String propertyName, Object data)
+            throws CoreException {
+        this.config = config;
+    }
 }
--- a/org.symbian.tools.wrttools/src/org/symbian/tools/wrttools/wizards/deploy/DeployWizard.java	Mon Apr 19 17:52:52 2010 -0700
+++ b/org.symbian.tools.wrttools/src/org/symbian/tools/wrttools/wizards/deploy/DeployWizard.java	Mon Apr 19 18:04:34 2010 -0700
@@ -39,6 +39,7 @@
 import org.symbian.tools.wrttools.core.status.IWRTStatusListener;
 import org.symbian.tools.wrttools.core.status.WRTStatus;
 import org.symbian.tools.wrttools.sdt.utils.Logging;
+import org.symbian.tools.wrttools.util.ProjectUtils;
 
 public class DeployWizard extends Wizard {
     public class PagePrinter implements IWRTStatusListener {
@@ -60,6 +61,10 @@
             // Do nothing
         }
 
+        public boolean canPackageWithErrors(IProject project) {
+            return ProjectUtils.canPackageWithErrors(project);
+        }
+
     }
 
     private final DeployWizardContext context;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.symbian.tools.wrttools/src/org/symbian/tools/wrttools/wizards/libraries/AddLibrariesWizard.java	Mon Apr 19 18:04:34 2010 -0700
@@ -0,0 +1,89 @@
+/**
+ * Copyright (c) 2010 Symbian Foundation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of the License "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Symbian Foundation - initial contribution.
+ * Contributors:
+ * Description:
+ * Overview:
+ * Details:
+ * Platforms/Drives/Compatibility:
+ * Assumptions/Requirement/Pre-requisites:
+ * Failures and causes:
+ */
+package org.symbian.tools.wrttools.wizards.libraries;
+
+import java.io.IOException;
+import java.lang.reflect.InvocationTargetException;
+import java.util.HashMap;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.SubProgressMonitor;
+import org.eclipse.jface.operation.IRunnableWithProgress;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.wizard.Wizard;
+import org.symbian.tools.wrttools.Activator;
+import org.symbian.tools.wrttools.core.libraries.JSLibrary;
+
+public class AddLibrariesWizard extends Wizard {
+    private final IProject project;
+    private LibrarySelectionPage page;
+
+    public AddLibrariesWizard(ISelection currentSelection) {
+        IProject p = null;
+        if (!currentSelection.isEmpty() && currentSelection instanceof IStructuredSelection) {
+            Object sel = ((IStructuredSelection) currentSelection).getFirstElement();
+            if (sel instanceof IAdaptable) {
+                IResource res = (IResource) ((IAdaptable) sel).getAdapter(IResource.class);
+                if (res != null) {
+                    p = res.getProject();
+                }
+            }
+        }
+        project = p;
+    }
+
+    @Override
+    public void addPages() {
+        page = new LibrarySelectionPage(project);
+        setWindowTitle("Add JavaScript Libraries");
+        addPage(page);
+    }
+
+    @Override
+    public boolean performFinish() {
+        final IProject p = page.getProject();
+        final JSLibrary[] libraries = page.getSelectedLibraries();
+        try {
+            getContainer().run(true, false, new IRunnableWithProgress() {
+                public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
+                    monitor.beginTask("Installing libraries", 50 * libraries.length);
+                    for (JSLibrary jsLibrary : libraries) {
+                        try {
+                            jsLibrary.install(p, new HashMap<String, String>(), new SubProgressMonitor(monitor, 50));
+                        } catch (CoreException e) {
+                            Activator.log(e);
+                        } catch (IOException e) {
+                            Activator.log(e);
+                        }
+                    }
+                }
+            });
+        } catch (InvocationTargetException e) {
+            Activator.log(e);
+        } catch (InterruptedException e) {
+            Activator.log(e);
+        }
+        return true;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.symbian.tools.wrttools/src/org/symbian/tools/wrttools/wizards/libraries/LibraryLabelProvider.java	Mon Apr 19 18:04:34 2010 -0700
@@ -0,0 +1,35 @@
+/**
+ * Copyright (c) 2010 Symbian Foundation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of the License "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Symbian Foundation - initial contribution.
+ * Contributors:
+ * Description:
+ * Overview:
+ * Details:
+ * Platforms/Drives/Compatibility:
+ * Assumptions/Requirement/Pre-requisites:
+ * Failures and causes:
+ */
+package org.symbian.tools.wrttools.wizards.libraries;
+
+import org.eclipse.jface.viewers.LabelProvider;
+import org.eclipse.swt.graphics.Image;
+import org.symbian.tools.wrttools.core.libraries.JSLibrary;
+
+public final class LibraryLabelProvider extends LabelProvider {
+    @Override
+    public String getText(Object element) {
+        return ((JSLibrary) element).getName();
+    }
+
+    @Override
+    public Image getImage(Object element) {
+        return ((JSLibrary) element).getImage();
+    }
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.symbian.tools.wrttools/src/org/symbian/tools/wrttools/wizards/libraries/LibrarySelectionPage.java	Mon Apr 19 18:04:34 2010 -0700
@@ -0,0 +1,161 @@
+/**
+ * Copyright (c) 2010 Symbian Foundation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of the License "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Symbian Foundation - initial contribution.
+ * Contributors:
+ * Description:
+ * Overview:
+ * Details:
+ * Platforms/Drives/Compatibility:
+ * Assumptions/Requirement/Pre-requisites:
+ * Failures and causes:
+ */
+package org.symbian.tools.wrttools.wizards.libraries;
+
+import java.util.Collection;
+import java.util.HashSet;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.jface.viewers.ArrayContentProvider;
+import org.eclipse.jface.viewers.CheckStateChangedEvent;
+import org.eclipse.jface.viewers.CheckboxTableViewer;
+import org.eclipse.jface.viewers.ComboViewer;
+import org.eclipse.jface.viewers.ICheckStateListener;
+import org.eclipse.jface.viewers.ICheckStateProvider;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.ISelectionChangedListener;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.SelectionChangedEvent;
+import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.jface.wizard.IWizardPage;
+import org.eclipse.jface.wizard.WizardPage;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.ui.model.WorkbenchLabelProvider;
+import org.symbian.tools.wrttools.Activator;
+import org.symbian.tools.wrttools.core.libraries.JSLibrary;
+
+public class LibrarySelectionPage extends WizardPage implements IWizardPage {
+    public final class CheckStateListener implements ICheckStateListener {
+        public void checkStateChanged(CheckStateChangedEvent event) {
+            JSLibrary library = (JSLibrary) event.getElement();
+            if (selected != null && library.isInstalled(selected)) {
+                event.getCheckable().setChecked(library, true);
+            }
+            validate();
+        }
+    }
+
+    private IProject selected = null;
+    private CheckboxTableViewer libraryList;
+
+    public final class CheckStateProvider implements ICheckStateProvider {
+
+        public boolean isChecked(Object element) {
+            return selected != null && ((JSLibrary) element).isInstalled(selected);
+        }
+
+        public boolean isGrayed(Object element) {
+            return selected != null && ((JSLibrary) element).isInstalled(selected);
+        }
+
+    }
+
+    protected LibrarySelectionPage(IProject project) {
+        super("libraryselectionpage");
+        selected = project;
+        setTitle("Add JavaScript Libraries");
+        setDescription("Select project to add libraries to and select librarires to add");
+    }
+
+    public void createControl(Composite parent) {
+        Composite root = new Composite(parent, SWT.NONE);
+        root.setLayout(new GridLayout(2, false));
+        Label label = new Label(root, SWT.NONE);
+        label.setText("Project:");
+
+        ComboViewer viewer = new ComboViewer(root, SWT.BORDER | SWT.READ_ONLY);
+
+        viewer.addSelectionChangedListener(new ISelectionChangedListener() {
+            public void selectionChanged(SelectionChangedEvent event) {
+                ISelection selection = event.getSelection();
+                if (selection instanceof IStructuredSelection) {
+                    selectProject((IProject) ((IStructuredSelection) selection).getFirstElement());
+                } else {
+                    selectProject(null);
+                }
+            }
+        });
+        viewer.setLabelProvider(new WorkbenchLabelProvider());
+        viewer.setContentProvider(new ArrayContentProvider());
+        viewer.setInput(Activator.getWrtProjects());
+
+        viewer.getControl().setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+
+        libraryList = CheckboxTableViewer.newCheckList(root, SWT.SINGLE | SWT.BORDER);
+
+        GridData data = new GridData(GridData.FILL, GridData.FILL, true, true, 2, 1);
+        libraryList.getControl().setLayoutData(data);
+
+        libraryList.setContentProvider(new ArrayContentProvider());
+        libraryList.setLabelProvider(new LibraryLabelProvider());
+        libraryList.setCheckStateProvider(new CheckStateProvider());
+        libraryList.addCheckStateListener(new CheckStateListener());
+        libraryList.setInput(Activator.getJSLibraries());
+
+        if (selected != null) {
+            viewer.setSelection(new StructuredSelection(selected), true);
+        }
+        selectProject(selected);
+
+        setControl(root);
+        validate();
+    }
+
+    private void selectProject(IProject selected) {
+        this.selected = selected;
+        libraryList.getControl().setEnabled(selected != null);
+        libraryList.refresh();
+        validate();
+    }
+
+    private void validate() {
+        boolean valid = false;
+        if (selected != null) {
+            Object[] checkedElements = libraryList.getCheckedElements();
+            for (Object object : checkedElements) {
+                if (!((JSLibrary) object).isInstalled(selected)) {
+                    valid = true;
+                    break;
+                }
+            }
+        }
+        setPageComplete(valid);
+    }
+
+    public IProject getProject() {
+        return selected;
+    }
+
+    public JSLibrary[] getSelectedLibraries() {
+        final Object[] checkedElements = libraryList.getCheckedElements();
+        final Collection<JSLibrary> libraries = new HashSet<JSLibrary>();
+        for (Object object : checkedElements) {
+            final JSLibrary lib = (JSLibrary) object;
+            if (!lib.isInstalled(selected)) {
+                libraries.add(lib);
+            }
+        }
+        return libraries.toArray(new JSLibrary[libraries.size()]);
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.symbian.tools.wrttools/src/org/symbian/tools/wrttools/wizards/libraries/WRTProjectLibraryWizardPage.java	Mon Apr 19 18:04:34 2010 -0700
@@ -0,0 +1,75 @@
+/**
+ * Copyright (c) 2010 Symbian Foundation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of the License "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Symbian Foundation - initial contribution.
+ * Contributors:
+ * Description:
+ * Overview:
+ * Details:
+ * Platforms/Drives/Compatibility:
+ * Assumptions/Requirement/Pre-requisites:
+ * Failures and causes:
+ */
+package org.symbian.tools.wrttools.wizards.libraries;
+
+import org.eclipse.core.databinding.DataBindingContext;
+import org.eclipse.core.databinding.beans.BeansObservables;
+import org.eclipse.core.databinding.observable.set.IObservableSet;
+import org.eclipse.jface.databinding.viewers.IViewerObservableSet;
+import org.eclipse.jface.databinding.viewers.ViewersObservables;
+import org.eclipse.jface.viewers.ArrayContentProvider;
+import org.eclipse.jface.viewers.CheckStateChangedEvent;
+import org.eclipse.jface.viewers.CheckboxTableViewer;
+import org.eclipse.jface.viewers.ICheckStateListener;
+import org.eclipse.jface.wizard.WizardPage;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.Composite;
+import org.symbian.tools.wrttools.Activator;
+import org.symbian.tools.wrttools.core.libraries.JSLibrary;
+import org.symbian.tools.wrttools.wizards.WizardContext;
+
+public class WRTProjectLibraryWizardPage extends WizardPage {
+    public static final class LibraryCheckStateListener implements ICheckStateListener {
+        private final WizardContext context;
+
+        public LibraryCheckStateListener(WizardContext context) {
+            this.context = context;
+        }
+
+        public void checkStateChanged(CheckStateChangedEvent event) {
+            if (!event.getChecked() && context.isRequiredLibrary((JSLibrary) event.getElement())) {
+                event.getCheckable().setChecked(event.getElement(), true);
+            }
+        }
+
+    }
+    private CheckboxTableViewer list;
+    private final WizardContext context;
+    private final DataBindingContext bindingContext;
+
+    public WRTProjectLibraryWizardPage(WizardContext context, DataBindingContext bindingContext) {
+        super("ProjectLibraries", "WRT Project Libraries", null);
+        this.context = context;
+        this.bindingContext = bindingContext;
+        setDescription("Select libraries to add to your project");
+    }
+
+    public void createControl(Composite parent) {
+        list = CheckboxTableViewer.newCheckList(parent, SWT.BORDER);
+        list.setLabelProvider(new LibraryLabelProvider());
+        list.setContentProvider(new ArrayContentProvider());
+        list.setInput(Activator.getJSLibraries());
+        list.addCheckStateListener(new LibraryCheckStateListener(context));
+        IViewerObservableSet ui = ViewersObservables.observeCheckedElements(list, JSLibrary.class);
+        IObservableSet model = BeansObservables.observeSet(context, WizardContext.LIBRARIES);
+        bindingContext.bindSet(model, ui);
+        setControl(list.getControl());
+    }
+
+}