Bluetooth support was refactored on top of a new frameworks
authorEugene Ostroukhov <eugeneo@symbian.org>
Wed, 28 Jul 2010 09:27:51 -0700
changeset 455 5da55957c779
parent 454 38d6944cff88
child 456 12b549765c34
Bluetooth support was refactored on top of a new frameworks
org.symbian.tools.mtw.core/.classpath
org.symbian.tools.mtw.core/.project
org.symbian.tools.mtw.core/.settings/org.eclipse.jdt.core.prefs
org.symbian.tools.mtw.core/META-INF/MANIFEST.MF
org.symbian.tools.mtw.core/build.properties
org.symbian.tools.mtw.core/plugin.xml
org.symbian.tools.mtw.core/schema/packagers.exsd
org.symbian.tools.mtw.core/schema/projectProvider.exsd
org.symbian.tools.mtw.core/schema/runtimes.exsd
org.symbian.tools.mtw.core/src/org/symbian/tools/mtw/core/MTWCore.java
org.symbian.tools.mtw.core/src/org/symbian/tools/mtw/core/internal/projects/ProjectProvider.java
org.symbian.tools.mtw.core/src/org/symbian/tools/mtw/core/internal/projects/ProjectsSupportManager.java
org.symbian.tools.mtw.core/src/org/symbian/tools/mtw/core/internal/runtimes/LazyPackager.java
org.symbian.tools.mtw.core/src/org/symbian/tools/mtw/core/internal/runtimes/MobileWebRuntime.java
org.symbian.tools.mtw.core/src/org/symbian/tools/mtw/core/internal/runtimes/RuntimesManagerImpl.java
org.symbian.tools.mtw.core/src/org/symbian/tools/mtw/core/projects/IMTWProject.java
org.symbian.tools.mtw.core/src/org/symbian/tools/mtw/core/projects/IMTWProjectProvider.java
org.symbian.tools.mtw.core/src/org/symbian/tools/mtw/core/runtimes/IMobileWebRuntime.java
org.symbian.tools.mtw.core/src/org/symbian/tools/mtw/core/runtimes/IMobileWebRuntimeManager.java
org.symbian.tools.mtw.core/src/org/symbian/tools/mtw/core/runtimes/IPackager.java
org.symbian.tools.mtw.core/src/org/symbian/tools/mtw/core/utilities/ZipApplicationVisitor.java
org.symbian.tools.mtw.ui/.classpath
org.symbian.tools.mtw.ui/META-INF/MANIFEST.MF
org.symbian.tools.mtw.ui/build.properties
org.symbian.tools.mtw.ui/icons/full/obj16/bluetooth.gif
org.symbian.tools.mtw.ui/icons/full/obj16/discover.gif
org.symbian.tools.mtw.ui/icons/full/obj16/excluded.gif
org.symbian.tools.mtw.ui/lib/org.bluecove_2.1.1.jar
org.symbian.tools.mtw.ui/plugin.xml
org.symbian.tools.mtw.ui/schema/deploymentTargetsProvider.exsd
org.symbian.tools.mtw.ui/src/org/symbian/tools/mtw/internal/deployment/DeployWizardContext.java
org.symbian.tools.mtw.ui/src/org/symbian/tools/mtw/internal/deployment/DeploymentSummaryWizardPage.java
org.symbian.tools.mtw.ui/src/org/symbian/tools/mtw/internal/deployment/DeploymentTargetProviderDescriptor.java
org.symbian.tools.mtw.ui/src/org/symbian/tools/mtw/internal/deployment/DeploymentTargetProviderRegistry.java
org.symbian.tools.mtw.ui/src/org/symbian/tools/mtw/internal/deployment/DeploymentTargetWizardPage.java
org.symbian.tools.mtw.ui/src/org/symbian/tools/mtw/internal/deployment/DeploymentTargetWrapper.java
org.symbian.tools.mtw.ui/src/org/symbian/tools/mtw/ui/Activator.java
org.symbian.tools.mtw.ui/src/org/symbian/tools/mtw/ui/ConsoleFactory.java
org.symbian.tools.mtw.ui/src/org/symbian/tools/mtw/ui/Images.java
org.symbian.tools.mtw.ui/src/org/symbian/tools/mtw/ui/MTWCoreUI.java
org.symbian.tools.mtw.ui/src/org/symbian/tools/mtw/ui/ProjectMemo.java
org.symbian.tools.mtw.ui/src/org/symbian/tools/mtw/ui/UIUtils.java
org.symbian.tools.mtw.ui/src/org/symbian/tools/mtw/ui/commands/DeployHandler.java
org.symbian.tools.mtw.ui/src/org/symbian/tools/mtw/ui/deployment/DeployWizard.java
org.symbian.tools.mtw.ui/src/org/symbian/tools/mtw/ui/deployment/IDeploymentTarget.java
org.symbian.tools.mtw.ui/src/org/symbian/tools/mtw/ui/deployment/IDeploymentTargetProvider.java
org.symbian.tools.mtw.ui/src/org/symbian/tools/mtw/ui/deployment/bluetooth/BluetoothProvider.java
org.symbian.tools.mtw.ui/src/org/symbian/tools/mtw/ui/deployment/bluetooth/BluetoothRule.java
org.symbian.tools.mtw.ui/src/org/symbian/tools/mtw/ui/deployment/bluetooth/BluetoothTarget.java
org.symbian.tools.mtw.ui/src/org/symbian/tools/mtw/ui/navigator/PackagingInformationDecorator.java
org.symbian.tools.wrttools.product/launch/WRT IDE Product (Windows).launch
org.symbian.tools.wrttools.product/wrt-ide.product
org.symbian.tools.wrttools/.classpath
org.symbian.tools.wrttools/META-INF/MANIFEST.MF
org.symbian.tools.wrttools/icons/bluetooth.gif
org.symbian.tools.wrttools/lib/org.bluecove_2.1.1.jar
org.symbian.tools.wrttools/plugin.xml
org.symbian.tools.wrttools/src/org/symbian/tools/wrttools/Activator.java
org.symbian.tools.wrttools/src/org/symbian/tools/wrttools/ConsoleFactory.java
org.symbian.tools.wrttools/src/org/symbian/tools/wrttools/WRTProject.java
org.symbian.tools.wrttools/src/org/symbian/tools/wrttools/WRTStatusListener.java
org.symbian.tools.wrttools/src/org/symbian/tools/wrttools/core/WRTImages.java
org.symbian.tools.wrttools/src/org/symbian/tools/wrttools/core/deploy/BluetoothRule.java
org.symbian.tools.wrttools/src/org/symbian/tools/wrttools/core/deploy/WrtDeploymentSettingsActionDelegate.java
org.symbian.tools.wrttools/src/org/symbian/tools/wrttools/core/deploy/device/BluetoothDeploymentJob.java
org.symbian.tools.wrttools/src/org/symbian/tools/wrttools/core/deploy/device/DeployDeviceInfo.java
org.symbian.tools.wrttools/src/org/symbian/tools/wrttools/core/deploy/device/DeviceDeployer.java
org.symbian.tools.wrttools/src/org/symbian/tools/wrttools/core/deploy/device/DeviceListProvider.java
org.symbian.tools.wrttools/src/org/symbian/tools/wrttools/core/deploy/device/ServicesProvider.java
org.symbian.tools.wrttools/src/org/symbian/tools/wrttools/core/deploy/device/WrapperRemoteDevice.java
org.symbian.tools.wrttools/src/org/symbian/tools/wrttools/core/deployer/WidgetDeployerFactory.java
org.symbian.tools.wrttools/src/org/symbian/tools/wrttools/core/deployer/deployerMessages.properties
org.symbian.tools.wrttools/src/org/symbian/tools/wrttools/core/packager/ExcludeFileAction.java
org.symbian.tools.wrttools/src/org/symbian/tools/wrttools/core/packager/IWRTPackager.java
org.symbian.tools.wrttools/src/org/symbian/tools/wrttools/core/packager/IncludeFileAction.java
org.symbian.tools.wrttools/src/org/symbian/tools/wrttools/core/packager/PackageException.java
org.symbian.tools.wrttools/src/org/symbian/tools/wrttools/core/packager/PackagerFileManipulation.java
org.symbian.tools.wrttools/src/org/symbian/tools/wrttools/core/packager/PackagerMessages.java
org.symbian.tools.wrttools/src/org/symbian/tools/wrttools/core/packager/PackagerZipFolder.java
org.symbian.tools.wrttools/src/org/symbian/tools/wrttools/core/packager/WRTPackagerConstants.java
org.symbian.tools.wrttools/src/org/symbian/tools/wrttools/core/packager/WidgetPackager.java
org.symbian.tools.wrttools/src/org/symbian/tools/wrttools/core/packager/WrtPackageActionDelegate.java
org.symbian.tools.wrttools/src/org/symbian/tools/wrttools/core/packager/WrtPackager.java
org.symbian.tools.wrttools/src/org/symbian/tools/wrttools/core/packager/packageMessages.properties
org.symbian.tools.wrttools/src/org/symbian/tools/wrttools/core/project/WRTIDEProjectProvider.java
org.symbian.tools.wrttools/src/org/symbian/tools/wrttools/handlers/DeployHandler.java
org.symbian.tools.wrttools/src/org/symbian/tools/wrttools/handlers/PackageApplicationHandler.java
org.symbian.tools.wrttools/src/org/symbian/tools/wrttools/util/ProjectUtils.java
org.symbian.tools.wrttools/src/org/symbian/tools/wrttools/wizards/deploy/DeployWizard.java
org.symbian.tools.wrttools/src/org/symbian/tools/wrttools/wizards/deploy/DeployWizardContext.java
org.symbian.tools.wrttools/src/org/symbian/tools/wrttools/wizards/deploy/DeploymentSummaryWizardPage.java
org.symbian.tools.wrttools/src/org/symbian/tools/wrttools/wizards/deploy/DeploymentTargetRegistry.java
org.symbian.tools.wrttools/src/org/symbian/tools/wrttools/wizards/deploy/DeploymentTargetWizardPage.java
org.symbian.tools.wrttools/src/org/symbian/tools/wrttools/wizards/deploy/PhoneTarget.java
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.symbian.tools.mtw.core/.classpath	Wed Jul 28 09:27:51 2010 -0700
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
+	<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+	<classpathentry kind="src" path="src"/>
+	<classpathentry kind="output" path="bin"/>
+</classpath>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.symbian.tools.mtw.core/.project	Wed Jul 28 09:27:51 2010 -0700
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>org.symbian.tools.mtw.core</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>org.eclipse.jdt.core.javabuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.eclipse.pde.ManifestBuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.eclipse.pde.SchemaBuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>org.eclipse.pde.PluginNature</nature>
+		<nature>org.eclipse.jdt.core.javanature</nature>
+	</natures>
+</projectDescription>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.symbian.tools.mtw.core/.settings/org.eclipse.jdt.core.prefs	Wed Jul 28 09:27:51 2010 -0700
@@ -0,0 +1,8 @@
+#Thu Jul 22 13:09:32 PDT 2010
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.5
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.symbian.tools.mtw.core/META-INF/MANIFEST.MF	Wed Jul 28 09:27:51 2010 -0700
@@ -0,0 +1,17 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: Mobile Tools for Web Core Plug-in
+Bundle-SymbolicName: org.symbian.tools.mtw.core;singleton:=true
+Bundle-Version: 1.0.0.qualifier
+Bundle-Activator: org.symbian.tools.mtw.core.MTWCore
+Bundle-Vendor: Symbian Foundation
+Require-Bundle: org.eclipse.ui,
+ org.eclipse.core.runtime,
+ org.eclipse.core.resources;bundle-version="3.6.0",
+ org.eclipse.core.expressions;bundle-version="3.4.200"
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
+Bundle-ActivationPolicy: lazy
+Export-Package: org.symbian.tools.mtw.core,
+ org.symbian.tools.mtw.core.projects,
+ org.symbian.tools.mtw.core.runtimes,
+ org.symbian.tools.mtw.core.utilities
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.symbian.tools.mtw.core/build.properties	Wed Jul 28 09:27:51 2010 -0700
@@ -0,0 +1,5 @@
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+               .,\
+               plugin.xml
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.symbian.tools.mtw.core/plugin.xml	Wed Jul 28 09:27:51 2010 -0700
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.4"?>
+<plugin>
+   <extension-point id="runtimes" name="Mobile Web Runtimes" schema="schema/runtimes.exsd"/>
+   <extension-point id="packagers" name="Application Packagers" schema="schema/packagers.exsd"/>
+   <extension-point id="projectProvider" name="Project provider" schema="schema/projectProvider.exsd"/>
+
+</plugin>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.symbian.tools.mtw.core/schema/packagers.exsd	Wed Jul 28 09:27:51 2010 -0700
@@ -0,0 +1,122 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<!-- Schema file written by PDE -->
+<schema targetNamespace="org.symbian.tools.mtw.core" xmlns="http://www.w3.org/2001/XMLSchema">
+<annotation>
+      <appinfo>
+         <meta.schema plugin="org.symbian.tools.mtw.core" id="packagers" name="Application Packagers"/>
+      </appinfo>
+      <documentation>
+         Packagers can package given application for specified runtime
+      </documentation>
+   </annotation>
+
+   <element name="extension">
+      <annotation>
+         <appinfo>
+            <meta.element />
+         </appinfo>
+      </annotation>
+      <complexType>
+         <sequence>
+            <element ref="packager"/>
+         </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="packager">
+      <complexType>
+         <attribute name="class" type="string" use="required">
+            <annotation>
+               <documentation>
+                  
+               </documentation>
+               <appinfo>
+                  <meta.attribute kind="java" basedOn=":org.symbian.tools.mtw.core.runtimes.IPackager"/>
+               </appinfo>
+            </annotation>
+         </attribute>
+         <attribute name="targetRuntime" type="string" use="required">
+            <annotation>
+               <documentation>
+                  ID of the runtime that the application will be deployed to.
+               </documentation>
+               <appinfo>
+                  <meta.attribute kind="identifier" basedOn="org.symbian.tools.mtw.core.runtimes/runtime/@id"/>
+               </appinfo>
+            </annotation>
+         </attribute>
+         <attribute name="sourceRuntime" type="string">
+            <annotation>
+               <documentation>
+                  ID of the runtime that the project should support so it could be deployed to targetRuntime. If this attribute is empty then the project should target the targetRuntime directly
+               </documentation>
+               <appinfo>
+                  <meta.attribute kind="identifier" basedOn="org.symbian.tools.mtw.core.runtimes/runtime/@id"/>
+               </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>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.symbian.tools.mtw.core/schema/projectProvider.exsd	Wed Jul 28 09:27:51 2010 -0700
@@ -0,0 +1,107 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<!-- Schema file written by PDE -->
+<schema targetNamespace="org.symbian.tools.mtw.core" xmlns="http://www.w3.org/2001/XMLSchema">
+<annotation>
+      <appinfo>
+         <meta.schema plugin="org.symbian.tools.mtw.core" id="projectProvider" name="Project provider"/>
+      </appinfo>
+      <documentation>
+         These providers enables extension providers to add support for a different project models (i.e. coming from other IDEs). MTW will not provide facilities for creating, converting and configuring non-MTW projects. MTW will only ensure that most features (like deployment and debugging) are available to those projects.
+      </documentation>
+   </annotation>
+
+   <include schemaLocation="schema://org.eclipse.core.expressions/schema/expressionLanguage.exsd"/>
+
+   <element name="extension">
+      <annotation>
+         <appinfo>
+            <meta.element />
+         </appinfo>
+      </annotation>
+      <complexType>
+         <sequence>
+            <element ref="projectProvider" minOccurs="1" maxOccurs="unbounded"/>
+         </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="projectProvider">
+      <complexType>
+         <sequence>
+            <element ref="enablement" minOccurs="0" maxOccurs="1"/>
+         </sequence>
+         <attribute name="class" type="string" use="required">
+            <annotation>
+               <documentation>
+                  
+               </documentation>
+               <appinfo>
+                  <meta.attribute kind="java" basedOn=":org.symbian.tools.mtw.core.projects.IMTWProjectProvider"/>
+               </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>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.symbian.tools.mtw.core/schema/runtimes.exsd	Wed Jul 28 09:27:51 2010 -0700
@@ -0,0 +1,109 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<!-- Schema file written by PDE -->
+<schema targetNamespace="org.symbian.tools.mtw.core" xmlns="http://www.w3.org/2001/XMLSchema">
+<annotation>
+      <appinfo>
+         <meta.schema plugin="org.symbian.tools.mtw.core" id="runtimes" name="Mobile Web Runtimes"/>
+      </appinfo>
+      <documentation>
+         Mobile Web Runtimes are specific sets of JavaScript APIs, specifications and conventions that define how the application needs to be defined so it could be deployed to targets that support given runtime.
+      </documentation>
+   </annotation>
+
+   <element name="extension">
+      <annotation>
+         <appinfo>
+            <meta.element />
+         </appinfo>
+      </annotation>
+      <complexType>
+         <sequence>
+            <element ref="runtime"/>
+         </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="runtime">
+      <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>
+      </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>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.symbian.tools.mtw.core/src/org/symbian/tools/mtw/core/MTWCore.java	Wed Jul 28 09:27:51 2010 -0700
@@ -0,0 +1,75 @@
+package org.symbian.tools.mtw.core;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Plugin;
+import org.eclipse.core.runtime.Status;
+import org.osgi.framework.BundleContext;
+import org.symbian.tools.mtw.core.internal.projects.ProjectsSupportManager;
+import org.symbian.tools.mtw.core.internal.runtimes.RuntimesManagerImpl;
+import org.symbian.tools.mtw.core.projects.IMTWProject;
+import org.symbian.tools.mtw.core.runtimes.IMobileWebRuntimeManager;
+
+/**
+ * The activator class controls the plug-in life cycle
+ */
+public class MTWCore extends Plugin {
+
+    // The plug-in ID
+    public static final String PLUGIN_ID = "org.symbian.tools.mtw.core"; //$NON-NLS-1$
+
+    // The shared instance
+    private static MTWCore plugin;
+
+    private final IMobileWebRuntimeManager runtimesManager = new RuntimesManagerImpl();
+    private final ProjectsSupportManager projectsSupport = new ProjectsSupportManager();
+
+    /**
+     * The constructor
+     */
+    public MTWCore() {
+    }
+
+    /*
+     * (non-Javadoc)
+     * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
+     */
+    public void start(BundleContext context) throws Exception {
+        super.start(context);
+        plugin = this;
+    }
+
+    /*
+     * (non-Javadoc)
+     * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
+     */
+    public void stop(BundleContext context) throws Exception {
+        plugin = null;
+        super.stop(context);
+    }
+
+    public IMobileWebRuntimeManager getRuntimesManager() {
+        return runtimesManager;
+    }
+
+    public IMTWProject create(IProject project) {
+        return projectsSupport.create(project);
+    }
+
+    /**
+     * Returns the shared instance
+     *
+     * @return the shared instance
+     */
+    public static MTWCore getDefault() {
+        return plugin;
+    }
+
+    public static void log(String message, Exception exception) {
+        getDefault().getLog().log(new Status(IStatus.ERROR, PLUGIN_ID, message, exception));
+    }
+
+    public static void log(String message, Object... args) {
+        log(String.format(message, args), (Exception) null);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.symbian.tools.mtw.core/src/org/symbian/tools/mtw/core/internal/projects/ProjectProvider.java	Wed Jul 28 09:27:51 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.mtw.core.internal.projects;
+
+import org.eclipse.core.expressions.EvaluationContext;
+import org.eclipse.core.expressions.EvaluationResult;
+import org.eclipse.core.expressions.Expression;
+import org.eclipse.core.expressions.ExpressionConverter;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IConfigurationElement;
+import org.symbian.tools.mtw.core.MTWCore;
+import org.symbian.tools.mtw.core.projects.IMTWProject;
+import org.symbian.tools.mtw.core.projects.IMTWProjectProvider;
+
+public class ProjectProvider implements IMTWProjectProvider {
+    private final IConfigurationElement element;
+    private final Expression expression;
+    private IMTWProjectProvider provider;
+
+    public ProjectProvider(IConfigurationElement element) throws CoreException {
+        this.element = element;
+        IConfigurationElement[] children = element.getChildren("enablement");
+        if (children.length == 1) {
+            expression = ExpressionConverter.getDefault().perform(children[0]);
+        } else {
+            expression = null;
+            if (children.length > 1) {
+                MTWCore.log(
+                        "Project extension in plugin %s has several <enablement> elements. All expressions will be ignored.",
+                        element.getNamespaceIdentifier());
+            }
+        }
+    }
+
+    public IMTWProject create(IProject project) {
+        return getProvider().create(project);
+    }
+
+    private IMTWProjectProvider getProvider() {
+        if (provider == null) {
+            try {
+                provider = (IMTWProjectProvider) element.createExecutableExtension("class");
+            } catch (CoreException e) {
+                throw new RuntimeException(e);
+            }
+        }
+        return provider;
+    }
+
+    public boolean isSupportedProject(final IProject project) {
+        try {
+            final EvaluationResult result = expression.evaluate(new EvaluationContext(null, project));
+            if (EvaluationResult.TRUE.equals(result)) {
+                return getProvider().isSupportedProject(project);
+            }
+        } catch (CoreException e) {
+            MTWCore.log(null, e);
+        }
+        return false;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.symbian.tools.mtw.core/src/org/symbian/tools/mtw/core/internal/projects/ProjectsSupportManager.java	Wed Jul 28 09:27:51 2010 -0700
@@ -0,0 +1,60 @@
+/**
+ * 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.mtw.core.internal.projects;
+
+import java.util.Collection;
+import java.util.LinkedList;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.core.runtime.Platform;
+import org.symbian.tools.mtw.core.MTWCore;
+import org.symbian.tools.mtw.core.projects.IMTWProject;
+
+public class ProjectsSupportManager {
+    private Collection<ProjectProvider> providers = null;
+
+    public IMTWProject create(IProject project) {
+        if (providers == null) {
+            readProviders();
+        }
+        for (ProjectProvider provider : providers) {
+            if (provider.isSupportedProject(project)) {
+                return provider.create(project);
+            }
+        }
+        return null;
+    }
+
+    private void readProviders() {
+        providers = new LinkedList<ProjectProvider>();
+        IConfigurationElement[] configurationElements = Platform.getExtensionRegistry().getConfigurationElementsFor(
+                MTWCore.PLUGIN_ID, "projectProvider");
+        for (IConfigurationElement element : configurationElements) {
+            if (element.getName().equals("projectProvider")) {
+                try {
+                    providers.add(new ProjectProvider(element));
+                } catch (CoreException e) {
+                    MTWCore.log(null, e);
+                }
+            }
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.symbian.tools.mtw.core/src/org/symbian/tools/mtw/core/internal/runtimes/LazyPackager.java	Wed Jul 28 09:27:51 2010 -0700
@@ -0,0 +1,67 @@
+/**
+ * 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.mtw.core.internal.runtimes;
+
+import java.io.File;
+
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.symbian.tools.mtw.core.MTWCore;
+import org.symbian.tools.mtw.core.projects.IMTWProject;
+import org.symbian.tools.mtw.core.runtimes.IMobileWebRuntime;
+import org.symbian.tools.mtw.core.runtimes.IPackager;
+
+public class LazyPackager implements IPackager {
+    private final IConfigurationElement element;
+    private IPackager packager;
+
+    public LazyPackager(IConfigurationElement element) {
+        this.element = element;
+    }
+
+    public File packageApplication(IMTWProject project, IMobileWebRuntime runtime, IProgressMonitor monitor)
+            throws CoreException {
+        return getPackager().packageApplication(project, runtime, monitor);
+    }
+
+    private IPackager getPackager() {
+        if (packager == null) {
+            try {
+                packager = (IPackager) element.createExecutableExtension("class");
+            } catch (CoreException e) {
+                MTWCore.log(String.format("Cannot instantiate %s from plugin %s", element.getAttribute("class"),
+                        element.getDeclaringExtension().getNamespaceIdentifier()), e);
+                throw new RuntimeException(e);
+            }
+        }
+        return packager;
+    }
+
+    public IPath getPathInPackage(IResource resource) {
+        return getPackager().getPathInPackage(resource);
+    }
+
+    public String getFileType(IMTWProject project) {
+        return getPackager().getFileType(project);
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.symbian.tools.mtw.core/src/org/symbian/tools/mtw/core/internal/runtimes/MobileWebRuntime.java	Wed Jul 28 09:27:51 2010 -0700
@@ -0,0 +1,38 @@
+/**
+ * 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.mtw.core.internal.runtimes;
+
+import org.eclipse.core.runtime.IConfigurationElement;
+import org.symbian.tools.mtw.core.runtimes.IMobileWebRuntime;
+
+public final class MobileWebRuntime implements IMobileWebRuntime {
+    private final IConfigurationElement element;
+
+    public MobileWebRuntime(IConfigurationElement element) {
+        this.element = element;
+    }
+
+    public String getId() {
+        return element.getAttribute("id");
+    }
+
+    public String getName() {
+        return element.getAttribute("name");
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.symbian.tools.mtw.core/src/org/symbian/tools/mtw/core/internal/runtimes/RuntimesManagerImpl.java	Wed Jul 28 09:27:51 2010 -0700
@@ -0,0 +1,101 @@
+/**
+ * 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.mtw.core.internal.runtimes;
+
+import java.util.HashMap;
+import java.util.Map;
+import java.util.TreeMap;
+
+import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.core.runtime.Platform;
+import org.symbian.tools.mtw.core.MTWCore;
+import org.symbian.tools.mtw.core.projects.IMTWProject;
+import org.symbian.tools.mtw.core.runtimes.IMobileWebRuntime;
+import org.symbian.tools.mtw.core.runtimes.IMobileWebRuntimeManager;
+import org.symbian.tools.mtw.core.runtimes.IPackager;
+
+public final class RuntimesManagerImpl implements IMobileWebRuntimeManager {
+    private final Map<String, IMobileWebRuntime> runtimes = new TreeMap<String, IMobileWebRuntime>();
+    private final Map<IMobileWebRuntime, Map<IMobileWebRuntime, IPackager>> packagers = new HashMap<IMobileWebRuntime, Map<IMobileWebRuntime, IPackager>>();
+
+    public RuntimesManagerImpl() {
+        collectRuntimes();
+        collectPackagers();
+    }
+
+    private void collectPackagers() {
+        IConfigurationElement[] elements = Platform.getExtensionRegistry().getConfigurationElementsFor(
+                MTWCore.PLUGIN_ID, "packagers");
+        for (IConfigurationElement element : elements) {
+            final String target = element.getAttribute("targetRuntime");
+            final IMobileWebRuntime targetRuntime = getRuntime(target);
+            if (targetRuntime == null) {
+                MTWCore.log("Runtime %s referenced from plugin %s was not found", target, element
+                        .getDeclaringExtension().getNamespaceIdentifier());
+                break;
+            }
+
+            final String source = element.getAttribute("sourceRuntime");
+            IMobileWebRuntime sourceRuntime;
+            if (source == null) {
+                sourceRuntime = targetRuntime;
+            } else {
+                sourceRuntime = getRuntime(source);
+                if (sourceRuntime == null) {
+                    MTWCore.log("Runtime %s referenced from plugin %s was not found", source, element
+                            .getDeclaringExtension().getNamespaceIdentifier());
+                    break;
+                }
+            }
+            IPackager packager = new LazyPackager(element);
+            Map<IMobileWebRuntime, IPackager> map = packagers.get(targetRuntime);
+            if (map == null) {
+                map = new HashMap<IMobileWebRuntime, IPackager>();
+                packagers.put(targetRuntime, map);
+            }
+            map.put(sourceRuntime, packager);
+        }
+    }
+
+    private void collectRuntimes() {
+        IConfigurationElement[] elements = Platform.getExtensionRegistry().getConfigurationElementsFor(
+                MTWCore.PLUGIN_ID, "runtimes");
+        for (IConfigurationElement element : elements) {
+            final MobileWebRuntime runtime = new MobileWebRuntime(element);
+            runtimes.put(runtime.getId(), runtime);
+        }
+    }
+
+    public IPackager getPackager(IMTWProject project) {
+        return getPackager(project, project.getTargetRuntime());
+    }
+
+    public IPackager getPackager(IMTWProject project, IMobileWebRuntime runtime) {
+        final Map<IMobileWebRuntime, IPackager> map = packagers.get(runtime);
+        if (map != null) {
+            return map.get(project.getTargetRuntime());
+        }
+        return null;
+    }
+
+    public IMobileWebRuntime getRuntime(String id) {
+        return runtimes.get(id);
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.symbian.tools.mtw.core/src/org/symbian/tools/mtw/core/projects/IMTWProject.java	Wed Jul 28 09:27:51 2010 -0700
@@ -0,0 +1,47 @@
+/**
+ * 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.mtw.core.projects;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.symbian.tools.mtw.core.runtimes.IMobileWebRuntime;
+
+public interface IMTWProject {
+    /**
+     * @return primary target runtime of this project. Can never return null.
+     */
+    IMobileWebRuntime getTargetRuntime();
+
+    /**
+     * @return workspace project that back this MTW project.
+     */
+    IProject getProject();
+
+    /**
+     * @return symbolic MTW project name.
+     */
+    String getName();
+
+    /**
+     * Validate project configuration and contents.
+     * 
+     * @return <code>true</code> if the project has no errors. Warnings do not count.
+     */
+    boolean validate(IProgressMonitor monitor);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.symbian.tools.mtw.core/src/org/symbian/tools/mtw/core/projects/IMTWProjectProvider.java	Wed Jul 28 09:27:51 2010 -0700
@@ -0,0 +1,39 @@
+/**
+ * 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.mtw.core.projects;
+
+import org.eclipse.core.resources.IProject;
+
+/**
+ * Bridges between project models.
+ * 
+ * @author Eugene Ostroukhov (eugeneo@symbian.org)
+ */
+public interface IMTWProjectProvider {
+    /**
+     * Returns {@link IMTWProject} object that works with specified {@link IProject} object.
+     * @return non-<code>null</code> object
+     */
+    IMTWProject create(IProject project);
+
+    /**
+     * @return <code>true</code> if the {@link IMTWProject} object can be created.
+     */
+    boolean isSupportedProject(IProject project);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.symbian.tools.mtw.core/src/org/symbian/tools/mtw/core/runtimes/IMobileWebRuntime.java	Wed Jul 28 09:27:51 2010 -0700
@@ -0,0 +1,36 @@
+/**
+ * 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.mtw.core.runtimes;
+
+/**
+ * Represents mobile web runtimes supported by the IDE
+ * 
+ * @author Eugene Ostroukhov (eugeneo@symbian.org)
+ */
+public interface IMobileWebRuntime {
+    /**
+     * @return unique runtime ID
+     */
+    String getId();
+
+    /**
+     * @return user-readable runtime name
+     */
+    String getName();
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.symbian.tools.mtw.core/src/org/symbian/tools/mtw/core/runtimes/IMobileWebRuntimeManager.java	Wed Jul 28 09:27:51 2010 -0700
@@ -0,0 +1,51 @@
+/**
+ * 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.mtw.core.runtimes;
+
+import org.symbian.tools.mtw.core.projects.IMTWProject;
+
+/**
+ * Manages mobile web runtimes.
+ * 
+ * @author Eugene Ostroukhov (eugeneo@symbian.org)
+ */
+public interface IMobileWebRuntimeManager {
+    /**
+     * Shorthand method to obtain packager for project default runtime.
+     */
+    IPackager getPackager(IMTWProject project);
+
+    /**
+     * Returns packager that can create a packaged application for provided 
+     * runtime from the given project.
+     * 
+     * @return <code>null</null> if the project cannot be packaged for 
+     * specified runtime
+     */
+    IPackager getPackager(IMTWProject project, IMobileWebRuntime runtime);
+
+    /**
+     * Returns runtimes for the given ID. Runtime will not be null.
+     * 
+     * @throws IllegalArgumentException if there is no runtime with the 
+     * provided ID. It is assumed that this can only be caused by a broken 
+     * install or coding error on IDE provider side.
+     */
+    IMobileWebRuntime getRuntime(String id);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.symbian.tools.mtw.core/src/org/symbian/tools/mtw/core/runtimes/IPackager.java	Wed Jul 28 09:27:51 2010 -0700
@@ -0,0 +1,54 @@
+/**
+ * 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.mtw.core.runtimes;
+
+import java.io.File;
+
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.symbian.tools.mtw.core.projects.IMTWProject;
+
+/**
+ * Packager creates a runtime-specific application package that can be 
+ * deployed to compatible targets.
+ * 
+ * @author Eugene Ostroukhov (eugeneo@symbian.org)
+ */
+public interface IPackager {
+    /**
+     * Synchronously packages application for the specified runtime.
+     * 
+     * @return URI of the application package that can be deployed to targets
+     */
+    File packageApplication(IMTWProject project, IMobileWebRuntime runtime, IProgressMonitor monitor)
+            throws CoreException;
+
+    /**
+     * @return application package root-relative path where the workspace resource will be packaged. Can be <code>null</code>.
+     */
+    IPath getPathInPackage(IResource resource);
+
+    /**
+     * @return file type of the application archive
+     */
+    String getFileType(IMTWProject project);
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.symbian.tools.mtw.core/src/org/symbian/tools/mtw/core/utilities/ZipApplicationVisitor.java	Wed Jul 28 09:27:51 2010 -0700
@@ -0,0 +1,99 @@
+/**
+ * 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.mtw.core.utilities;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.util.zip.ZipEntry;
+import java.util.zip.ZipOutputStream;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.IResourceVisitor;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.symbian.tools.mtw.core.MTWCore;
+import org.symbian.tools.mtw.core.runtimes.IPackager;
+
+/**
+ * Use this visitor to zip application if the web runtime uses zip archive as application
+ * distribution format.
+ * 
+ * @author Eugene Ostroukhov (eugeneo@symbian.org)
+ */
+public class ZipApplicationVisitor implements IResourceVisitor {
+    private static final int DEFAULT_BUFFER_SIZE = 65536;
+    private final ZipOutputStream zipStream;
+    private final IPackager packager;
+
+    public ZipApplicationVisitor(ZipOutputStream zipStream, IPackager packager) {
+        this.zipStream = zipStream;
+        this.packager = packager;
+    }
+
+    public boolean visit(IResource resource) throws CoreException {
+        IPath path = packager.getPathInPackage(resource);
+        if (path != null && resource.getType() == IResource.FILE) {
+            zip(path, resource);
+        }
+        return true;
+    }
+
+    private void zip(IPath path, IResource file) throws CoreException {
+        ZipEntry zipEntry = new ZipEntry(path.toString());
+        try {
+            zipStream.putNextEntry(zipEntry);
+            if (file.getType() == IResource.FILE) {
+                InputStream contents = ((IFile) file).getContents();
+                try {
+                    copy(contents, zipStream);
+                } finally {
+                    contents.close();
+                }
+            }
+            zipStream.closeEntry();
+        } catch (IOException e) {
+            throw new CoreException(new Status(IStatus.ERROR, MTWCore.PLUGIN_ID, String.format("Can't package %s", file
+                    .getFullPath().toString()), e));
+        }
+    }
+
+    public static int copy(InputStream input, OutputStream output) throws IOException {
+        long count = copyLarge(input, output);
+        if (count > Integer.MAX_VALUE) {
+            return -1;
+        }
+        return (int) count;
+    }
+
+    public static long copyLarge(InputStream input, OutputStream output) throws IOException {
+        byte[] buffer = new byte[DEFAULT_BUFFER_SIZE];
+        long count = 0;
+        int n = 0;
+        while (-1 != (n = input.read(buffer))) {
+            output.write(buffer, 0, n);
+            count += n;
+        }
+        return count;
+    }
+
+}
--- a/org.symbian.tools.mtw.ui/.classpath	Wed Jul 21 11:26:43 2010 -0700
+++ b/org.symbian.tools.mtw.ui/.classpath	Wed Jul 28 09:27:51 2010 -0700
@@ -1,5 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <classpath>
+	<classpathentry exported="true" kind="lib" path="lib/org.bluecove_2.1.1.jar"/>
 	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
 	<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
 	<classpathentry kind="src" path="src"/>
--- a/org.symbian.tools.mtw.ui/META-INF/MANIFEST.MF	Wed Jul 21 11:26:43 2010 -0700
+++ b/org.symbian.tools.mtw.ui/META-INF/MANIFEST.MF	Wed Jul 28 09:27:51 2010 -0700
@@ -3,15 +3,21 @@
 Bundle-Name: Mobile Tools for Web main UI plug-in
 Bundle-SymbolicName: org.symbian.tools.mtw.ui;singleton:=true
 Bundle-Version: 1.0.0.qualifier
-Bundle-Activator: org.symbian.tools.mtw.ui.Activator
+Bundle-Activator: org.symbian.tools.mtw.ui.MTWCoreUI
 Bundle-Vendor: Symbian Foundation
 Require-Bundle: org.eclipse.ui,
  org.eclipse.core.runtime,
  org.eclipse.core.resources;bundle-version="3.6.0",
- org.symbian.tools.wrttools;bundle-version="1.0.0",
  org.eclipse.ui.navigator;bundle-version="3.5.0",
  org.eclipse.ui.navigator.resources;bundle-version="3.4.200",
  org.eclipse.wst.jsdt.ui;bundle-version="1.1.0",
- org.eclipse.wst.jsdt.core;bundle-version="1.1.0"
+ org.eclipse.wst.jsdt.core;bundle-version="1.1.0",
+ org.eclipse.ui.console;bundle-version="3.5.0",
+ org.symbian.tools.mtw.core;bundle-version="1.0.0"
 Bundle-RequiredExecutionEnvironment: J2SE-1.5
 Bundle-ActivationPolicy: lazy
+Bundle-ClassPath: lib/org.bluecove_2.1.1.jar,
+ .
+Export-Package: org.symbian.tools.mtw.ui,
+ org.symbian.tools.mtw.ui.deployment,
+ org.symbian.tools.mtw.ui.deployment.bluetooth
--- a/org.symbian.tools.mtw.ui/build.properties	Wed Jul 21 11:26:43 2010 -0700
+++ b/org.symbian.tools.mtw.ui/build.properties	Wed Jul 28 09:27:51 2010 -0700
@@ -3,4 +3,5 @@
 bin.includes = META-INF/,\
                .,\
                plugin.xml,\
-               icons/
+               icons/,\
+               lib/
Binary file org.symbian.tools.mtw.ui/icons/full/obj16/bluetooth.gif has changed
Binary file org.symbian.tools.mtw.ui/icons/full/obj16/discover.gif has changed
Binary file org.symbian.tools.mtw.ui/icons/full/obj16/excluded.gif has changed
Binary file org.symbian.tools.mtw.ui/lib/org.bluecove_2.1.1.jar has changed
--- a/org.symbian.tools.mtw.ui/plugin.xml	Wed Jul 21 11:26:43 2010 -0700
+++ b/org.symbian.tools.mtw.ui/plugin.xml	Wed Jul 28 09:27:51 2010 -0700
@@ -1,6 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <?eclipse version="3.4"?>
 <plugin>
+   <extension-point id="deploymentTargetsProvider" name="Provides targets for project deployments" schema="schema/deploymentTargetsProvider.exsd"/>
 	<!-- Navigator Extensions -->
 	<extension point="org.eclipse.ui.navigator.viewer">
 	  <viewerActionBinding
@@ -120,5 +121,26 @@
            name="Tools for Mobile Web">
      </category>
   </extension>
+  <extension
+        point="org.eclipse.ui.handlers">
+    <handler
+          class="org.symbian.tools.mtw.ui.commands.DeployHandler"
+          commandId="org.symbian.tools.wrttools.commands.deploy">
+       <enabledWhen>
+          <reference
+                definitionId="org.symbian.tools.wrttools.symbianproject">
+          </reference>
+       </enabledWhen>
+    </handler>
+  </extension>
+  <extension
+        point="org.symbian.tools.mtw.ui.deploymentTargetsProvider">
+     <deployment-target-platform
+           class="org.symbian.tools.mtw.ui.deployment.bluetooth.BluetoothProvider"
+           icon="icons/full/obj16/bluetooth.gif"
+           id="org.symbian.tools.mtw.bluetooth"
+           priority="10">
+     </deployment-target-platform>
+  </extension>
 
 </plugin>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.symbian.tools.mtw.ui/schema/deploymentTargetsProvider.exsd	Wed Jul 28 09:27:51 2010 -0700
@@ -0,0 +1,126 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<!-- Schema file written by PDE -->
+<schema targetNamespace="org.symbian.tools.mtw.ui" xmlns="http://www.w3.org/2001/XMLSchema">
+<annotation>
+      <appinfo>
+         <meta.schema plugin="org.symbian.tools.mtw.ui" id="deploymentTargetsProvider" name="Provides targets for project deployments"/>
+      </appinfo>
+      <documentation>
+         MTW extenders can provide deployment targets - these include bluetooth devices, device emulators etc.
+      </documentation>
+   </annotation>
+
+   <element name="extension">
+      <annotation>
+         <appinfo>
+            <meta.element />
+         </appinfo>
+      </annotation>
+      <complexType>
+         <sequence minOccurs="1" maxOccurs="unbounded">
+            <element ref="deployment-target-platform"/>
+         </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="deployment-target-platform">
+      <complexType>
+         <attribute name="id" type="string" use="required">
+            <annotation>
+               <documentation>
+                  
+               </documentation>
+            </annotation>
+         </attribute>
+         <attribute name="class" type="string" use="required">
+            <annotation>
+               <documentation>
+                  
+               </documentation>
+               <appinfo>
+                  <meta.attribute kind="java" basedOn=":org.symbian.tools.mtw.ui.deployment.IDeploymentTargetProvider"/>
+               </appinfo>
+            </annotation>
+         </attribute>
+         <attribute name="icon" type="string">
+            <annotation>
+               <documentation>
+                  This icon would be used when list of the deployment targets is presented. Dynamic icons can be provided by returning adapters for org.eclipse.ui.model.IWorkbenchAdapter or org.eclipse.ui.model.IWorkbenchAdapter2 in deployment targets.
+               </documentation>
+               <appinfo>
+                  <meta.attribute kind="resource"/>
+               </appinfo>
+            </annotation>
+         </attribute>
+         <attribute name="priority" type="string">
+            <annotation>
+               <documentation>
+                  Numeric value. Targets with lower priority value will be shown first
+               </documentation>
+            </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>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.symbian.tools.mtw.ui/src/org/symbian/tools/mtw/internal/deployment/DeployWizardContext.java	Wed Jul 28 09:27:51 2010 -0700
@@ -0,0 +1,92 @@
+/**
+ * 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.mtw.internal.deployment;
+
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.HashSet;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.SubProgressMonitor;
+import org.symbian.tools.mtw.core.projects.IMTWProject;
+
+public class DeployWizardContext {
+    private DeploymentTargetWrapper target;
+    private final IMTWProject project;
+    private boolean logging;
+
+    public DeployWizardContext(IMTWProject project) {
+        this.project = project;
+    }
+
+    public void setTarget(DeploymentTargetWrapper target) {
+        this.target = target;
+    }
+
+    public DeploymentTargetWrapper getTarget() {
+        return target;
+    }
+
+    public IMTWProject getProject() {
+        return project;
+    }
+
+    public DeploymentTargetWrapper[] getDeploymentTargets() {
+        final DeploymentTargetProviderDescriptor[] providers = DeploymentTargetProviderRegistry.getInstance()
+                .getProviders();
+        Collection<DeploymentTargetWrapper> targets = new HashSet<DeploymentTargetWrapper>();
+
+        for (DeploymentTargetProviderDescriptor provider : providers) {
+            if (provider.supports(project)) {
+                targets.addAll(Arrays.asList(provider.getTargets(project)));
+            }
+        }
+        return targets.toArray(new DeploymentTargetWrapper[targets.size()]);
+    }
+
+    public void doSearch(IProgressMonitor monitor) throws CoreException {
+        final DeploymentTargetProviderDescriptor[] providers = DeploymentTargetProviderRegistry.getInstance()
+                .getProviders();
+        monitor.beginTask("Discovering deployment targets", providers.length * 10);
+        for (DeploymentTargetProviderDescriptor descriptor : providers) {
+            descriptor.discoverTargets(new SubProgressMonitor(monitor, 10));
+        }
+        monitor.done();
+    }
+
+    public boolean areTargetsReady() {
+        final DeploymentTargetProviderDescriptor[] providers = DeploymentTargetProviderRegistry.getInstance()
+                .getProviders();
+        for (DeploymentTargetProviderDescriptor descriptor : providers) {
+            if (!descriptor.targetsDiscovered()) {
+                return false;
+            }
+        }
+        return true;
+    }
+
+    public void setLogging(boolean logging) {
+        this.logging = logging;
+    }
+
+    public boolean isLogging() {
+        return logging;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.symbian.tools.mtw.ui/src/org/symbian/tools/mtw/internal/deployment/DeploymentSummaryWizardPage.java	Wed Jul 28 09:27:51 2010 -0700
@@ -0,0 +1,58 @@
+/**
+ * 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.mtw.internal.deployment;
+
+import org.eclipse.jface.wizard.WizardPage;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Text;
+
+public class DeploymentSummaryWizardPage extends WizardPage {
+    private StringBuilder buffer = new StringBuilder(1000);
+    private Text log;
+
+    public DeploymentSummaryWizardPage() {
+        super("deploy");
+        setTitle("WRT Application Deployment");
+        setDescription("Please wait while deployment is in progress");
+    }
+
+    public void createControl(Composite parent) {
+        log = new Text(parent, SWT.BORDER | SWT.MULTI | SWT.READ_ONLY | SWT.WRAP);
+        setControl(log);
+    }
+
+    public void log(String line) {
+        synchronized (buffer) {
+            buffer.append(line).append("\n");
+        }
+        log.getDisplay().asyncExec(new Runnable() {
+            public void run() {
+                synchronized (buffer) {
+                    log.setText(buffer.toString());
+                }
+            }
+        });
+    }
+
+    public void clear() {
+        log.setText("");
+        buffer = new StringBuilder();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.symbian.tools.mtw.ui/src/org/symbian/tools/mtw/internal/deployment/DeploymentTargetProviderDescriptor.java	Wed Jul 28 09:27:51 2010 -0700
@@ -0,0 +1,148 @@
+/**
+ * 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.mtw.internal.deployment;
+
+import java.util.Map;
+import java.util.WeakHashMap;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.jobs.ISchedulingRule;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.symbian.tools.mtw.core.projects.IMTWProject;
+import org.symbian.tools.mtw.ui.MTWCoreUI;
+import org.symbian.tools.mtw.ui.deployment.IDeploymentTarget;
+import org.symbian.tools.mtw.ui.deployment.IDeploymentTargetProvider;
+
+public final class DeploymentTargetProviderDescriptor implements IDeploymentTargetProvider {
+    public class NullProvider implements IDeploymentTargetProvider {
+        public IDeploymentTarget[] getTargets(IMTWProject project) {
+            return null;
+        }
+
+        public void discoverTargets(IProgressMonitor monitor) throws CoreException {
+            // Do nothing
+        }
+
+        public IDeploymentTarget findTarget(IMTWProject project, String id) {
+            return null;
+        }
+
+        public boolean targetsDiscovered() {
+            return true;
+        }
+
+        public ISchedulingRule getSchedulingRule(IDeploymentTarget target) {
+            return null; // No scheduling
+        }
+    }
+
+    private static final DeploymentTargetWrapper[] NO_TARGETS = new DeploymentTargetWrapper[0];
+    private final IConfigurationElement element;
+    private IDeploymentTargetProvider provider;
+    private final Map<IDeploymentTarget, DeploymentTargetWrapper> wrappers = new WeakHashMap<IDeploymentTarget, DeploymentTargetWrapper>();
+    private ImageDescriptor imageDescriptor = null;
+
+    public DeploymentTargetProviderDescriptor(IConfigurationElement element) {
+        this.element = element;
+    }
+
+    public boolean supports(IMTWProject project) {
+        // We will support more declarative filtering later
+        return true;
+    }
+
+    public DeploymentTargetWrapper[] getTargets(IMTWProject project) {
+        final DeploymentTargetWrapper[] targets = wrap(getProvider().getTargets(project));
+        return targets != null ? targets : NO_TARGETS;
+    }
+
+    private DeploymentTargetWrapper[] wrap(IDeploymentTarget[] targets) {
+        final DeploymentTargetWrapper[] w = new DeploymentTargetWrapper[targets.length];
+        for (int i = 0; i < targets.length; i++) {
+            final IDeploymentTarget target = targets[i];
+            DeploymentTargetWrapper wrapper = wrappers.get(target);
+            if (wrapper == null) {
+                wrapper = new DeploymentTargetWrapper(target, this);
+                wrappers.put(target, wrapper);
+            }
+            w[i] = wrapper;
+        }
+        return w;
+    }
+
+    public void discoverTargets(IProgressMonitor monitor) throws CoreException {
+        getProvider().discoverTargets(monitor);
+    }
+
+    public IDeploymentTarget findTarget(IMTWProject project, String id) {
+        return getProvider().findTarget(project, id);
+    }
+
+    private synchronized IDeploymentTargetProvider getProvider() {
+        if (provider == null) {
+            try {
+                provider = (IDeploymentTargetProvider) element.createExecutableExtension("class");
+            } catch (CoreException e) {
+                MTWCoreUI.log("Cannot instantiate provider " + getId(), e);
+                provider = new NullProvider();
+            }
+        }
+        return provider;
+    }
+
+    public String getId() {
+        return element.getAttribute("id");
+    }
+
+    public boolean targetsDiscovered() {
+        return getProvider().targetsDiscovered();
+    }
+
+    public int getPriority() {
+        final String attribute = element.getAttribute("priority");
+        if (attribute != null && attribute.trim().length() > 0) {
+            try {
+                return Integer.parseInt(attribute);
+            } catch (NumberFormatException e) {
+                MTWCoreUI.log(String.format("%s is not a valid priority value for %s provider", attribute, getId()),
+                        null);
+            }
+        }
+        return 0;
+    }
+
+    public ImageDescriptor getImageDescriptor() {
+        if (imageDescriptor == null) {
+            final String image = element.getAttribute("icon");
+            if (image == null) {
+                imageDescriptor = ImageDescriptor.getMissingImageDescriptor();
+            } else {
+                imageDescriptor = MTWCoreUI.imageDescriptorFromPlugin(element.getNamespaceIdentifier(), image);
+            }
+        }
+        return imageDescriptor;
+    }
+
+    public ISchedulingRule getSchedulingRule(IDeploymentTarget target) {
+        return provider.getSchedulingRule(target);
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.symbian.tools.mtw.ui/src/org/symbian/tools/mtw/internal/deployment/DeploymentTargetProviderRegistry.java	Wed Jul 28 09:27:51 2010 -0700
@@ -0,0 +1,63 @@
+/**
+ * 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.mtw.internal.deployment;
+
+import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.core.runtime.Platform;
+import org.symbian.tools.mtw.ui.deployment.IDeploymentTargetProvider;
+
+public class DeploymentTargetProviderRegistry {
+    private static DeploymentTargetProviderRegistry INSTANCE;
+
+    private DeploymentTargetProviderDescriptor[] descriptors;
+
+    private DeploymentTargetProviderRegistry() {
+        readExtensions();
+    }
+
+    private void readExtensions() {
+        final IConfigurationElement[] elements = Platform.getExtensionRegistry().getConfigurationElementsFor(
+                "org.symbian.tools.mtw.ui.deploymentTargetsProvider");
+        descriptors = new DeploymentTargetProviderDescriptor[elements.length];
+        for (int i = 0; i < elements.length; i++) {
+            descriptors[i] = new DeploymentTargetProviderDescriptor(elements[i]);
+        }
+    }
+
+    public static synchronized DeploymentTargetProviderRegistry getInstance() {
+        if (INSTANCE == null) {
+            INSTANCE = new DeploymentTargetProviderRegistry();
+        }
+        return INSTANCE;
+    }
+
+    public DeploymentTargetProviderDescriptor[] getProviders() {
+        return descriptors;
+    }
+
+    public IDeploymentTargetProvider getProvider(String id) {
+        DeploymentTargetProviderDescriptor[] providers = getProviders();
+        for (DeploymentTargetProviderDescriptor descriptor : providers) {
+            if (descriptor.getId().equals(id)) {
+                return descriptor;
+            }
+        }
+        return null;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.symbian.tools.mtw.ui/src/org/symbian/tools/mtw/internal/deployment/DeploymentTargetWizardPage.java	Wed Jul 28 09:27:51 2010 -0700
@@ -0,0 +1,213 @@
+/**
+ * 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.mtw.internal.deployment;
+
+import java.lang.reflect.InvocationTargetException;
+import java.text.MessageFormat;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.SubProgressMonitor;
+import org.eclipse.jface.operation.IRunnableWithProgress;
+import org.eclipse.jface.util.Policy;
+import org.eclipse.jface.viewers.ArrayContentProvider;
+import org.eclipse.jface.viewers.DoubleClickEvent;
+import org.eclipse.jface.viewers.IDoubleClickListener;
+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.viewers.TableViewer;
+import org.eclipse.jface.viewers.ViewerSorter;
+import org.eclipse.jface.wizard.IWizardContainer;
+import org.eclipse.jface.wizard.WizardDialog;
+import org.eclipse.jface.wizard.WizardPage;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.layout.FormAttachment;
+import org.eclipse.swt.layout.FormData;
+import org.eclipse.swt.layout.FormLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.ui.model.WorkbenchLabelProvider;
+import org.symbian.tools.mtw.ui.MTWCoreUI;
+import org.symbian.tools.mtw.ui.ProjectMemo;
+import org.symbian.tools.mtw.ui.deployment.IDeploymentTarget;
+
+public class DeploymentTargetWizardPage extends WizardPage {
+    private final DeployWizardContext context;
+    private TableViewer list;
+    private Text description;
+    private final IDeploymentTarget prev;
+
+    public DeploymentTargetWizardPage(DeployWizardContext context, ProjectMemo memo) {
+        super("TargetPage", "Select Deployment Target", null);
+        this.context = context;
+        prev = memo.getPreviousDeploymentTarget();
+        setDescription(MessageFormat.format("Select emulator or device to deploy WRT application ''{0}''", context
+                .getProject().getProject().getName()));
+    }
+
+    public void createControl(Composite parent) {
+        Composite root = new Composite(parent, SWT.NONE);
+
+        root.setLayout(new FormLayout());
+
+        list = new TableViewer(root, SWT.BORDER);
+        list.setContentProvider(new ArrayContentProvider());
+        list.setLabelProvider(new WorkbenchLabelProvider());
+        list.setSorter(new ViewerSorter() {
+            @Override
+            public int category(Object element) {
+                return ((DeploymentTargetWrapper) element).getCategory();
+            }
+        });
+        list.addSelectionChangedListener(new ISelectionChangedListener() {
+            public void selectionChanged(SelectionChangedEvent event) {
+                IStructuredSelection selection = ((IStructuredSelection) event.getSelection());
+                DeploymentTargetWrapper target = (DeploymentTargetWrapper) selection.getFirstElement();
+                selectDeploymentTarget(target);
+            }
+        });
+        list.addDoubleClickListener(new IDoubleClickListener() {
+            public void doubleClick(DoubleClickEvent event) {
+                if (getWizard().performFinish()) {
+                    IWizardContainer container = getWizard().getContainer();
+                    if (container instanceof WizardDialog) {
+                        ((WizardDialog) container).close();
+                    }
+                }
+            }
+        });
+        final Button search = new Button(root, SWT.NONE);
+        search.addSelectionListener(new SelectionAdapter() {
+            @Override
+            public void widgetSelected(SelectionEvent e) {
+                doBluetoothSearch(search);
+            }
+        });
+        search.setText("Discover");
+        search.setImage(MTWCoreUI.getImages().getDiscoverButtonIcon());
+
+        description = new Text(root, SWT.BORDER | SWT.READ_ONLY);
+        final Button enableLogging = new Button(root, SWT.CHECK);
+        enableLogging.setText("Enable diagnostic logging");
+        enableLogging.addSelectionListener(new SelectionAdapter() {
+            @Override
+            public void widgetSelected(SelectionEvent e) {
+                toggleLogging(enableLogging.getSelection());
+            }
+        });
+
+        FormData data = new FormData();
+        data.bottom = new FormAttachment(100, -5);
+        data.left = new FormAttachment(0, 5);
+        enableLogging.setLayoutData(data);
+
+        data = new FormData();
+        data.left = new FormAttachment(0, 5);
+        data.right = new FormAttachment(100, -5);
+        data.bottom = new FormAttachment(enableLogging, -20);
+        description.setLayoutData(data);
+
+        data = new FormData();
+        data.top = new FormAttachment(0, 5);
+        data.right = new FormAttachment(100, -5);
+        search.setLayoutData(data);
+
+        data = new FormData();
+        data.left = new FormAttachment(0, 5);
+        data.top = new FormAttachment(0, 5);
+        data.bottom = new FormAttachment(description, -10);
+        data.right = new FormAttachment(search, -10);
+
+        list.getControl().setLayoutData(data);
+
+        list.setInput(context.getDeploymentTargets());
+
+        setPageComplete(false);
+        if (prev != null) {
+            list.setSelection(new StructuredSelection(prev));
+        }
+
+        if (!context.areTargetsReady()) {
+            setMessage("Press \"Discover\" to find more deployment targets", IStatus.WARNING);
+        }
+
+        setControl(root);
+    }
+
+    protected void toggleLogging(boolean logging) {
+        context.setLogging(logging);
+    }
+
+    protected void doBluetoothSearch(final Button search) {
+        try {
+            getContainer().run(true, true, new IRunnableWithProgress() {
+                public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
+                    monitor.beginTask("Searching for Bluetooth devices", IProgressMonitor.UNKNOWN);
+                    try {
+                        context.doSearch(new SubProgressMonitor(monitor, 100));
+                    } catch (CoreException e) {
+                        Policy.getStatusHandler().show(e.getStatus(), "WRT Application Deployment");
+                    }
+                    monitor.done();
+                    search.getDisplay().asyncExec(new Runnable() {
+                        public void run() {
+                            list.setInput(context.getDeploymentTargets());
+                            ISelection selection = list.getSelection();
+                            if (selection.isEmpty()) {
+                                selectDeploymentTarget(null);
+                            } else {
+                                selectDeploymentTarget((DeploymentTargetWrapper) ((IStructuredSelection) selection)
+                                        .getFirstElement());
+                            }
+                        }
+                    });
+                }
+            });
+        } catch (InvocationTargetException e) {
+            MTWCoreUI.log(e);
+        } catch (InterruptedException e) {
+            MTWCoreUI.log(e);
+        }
+    }
+
+    protected void selectDeploymentTarget(DeploymentTargetWrapper target) {
+        if (target != null) {
+            context.setTarget(target);
+            //            String desc = target.getDescription();
+            //            this.description.setText(desc);
+            setMessage(null);
+            setErrorMessage(null);
+            setPageComplete(true);
+        } else {
+            context.setTarget(null);
+            //            description.setText("");
+            setPageComplete(false);
+            setMessage(null);
+            setErrorMessage("Select device or emulator to deploy the application");
+        }
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.symbian.tools.mtw.ui/src/org/symbian/tools/mtw/internal/deployment/DeploymentTargetWrapper.java	Wed Jul 28 09:27:51 2010 -0700
@@ -0,0 +1,128 @@
+/**
+ * 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.mtw.internal.deployment;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.ui.IMemento;
+import org.eclipse.ui.model.IWorkbenchAdapter;
+import org.eclipse.ui.model.WorkbenchAdapter;
+import org.symbian.tools.mtw.core.projects.IMTWProject;
+import org.symbian.tools.mtw.core.runtimes.IMobileWebRuntime;
+import org.symbian.tools.mtw.ui.deployment.IDeploymentTarget;
+import org.symbian.tools.mtw.ui.deployment.IDeploymentTargetProvider;
+
+public class DeploymentTargetWrapper implements IDeploymentTarget {
+    public class TargetWorkbenchAdapter extends WorkbenchAdapter {
+        @Override
+        public String getLabel(Object object) {
+            return getName();
+        }
+
+        @Override
+        public ImageDescriptor getImageDescriptor(Object object) {
+            return provider.getImageDescriptor();
+        }
+    }
+
+    private final DeploymentTargetProviderDescriptor provider;
+    private final IDeploymentTarget target;
+
+    public DeploymentTargetWrapper(IDeploymentTarget target, DeploymentTargetProviderDescriptor provider) {
+        this.target = target;
+        this.provider = provider;
+    }
+
+    public IStatus deploy(IMTWProject project, IMobileWebRuntime runtime, IProgressMonitor monitor)
+            throws CoreException {
+        return target.deploy(project, runtime, monitor);
+    }
+
+    @Override
+    public boolean equals(Object obj) {
+        if (this == obj) {
+            return true;
+        }
+        if (obj == null) {
+            return false;
+        }
+        if (getClass() != obj.getClass()) {
+            return false;
+        }
+        DeploymentTargetWrapper other = (DeploymentTargetWrapper) obj;
+        if (target == null) {
+            if (other.target != null) {
+                return false;
+            }
+        } else if (!target.equals(other.target)) {
+            return false;
+        }
+        return true;
+    }
+
+    public Object getAdapter(@SuppressWarnings("rawtypes") Class adapter) {
+        Object ad = target.getAdapter(adapter);
+        if (ad == null && adapter.equals(IWorkbenchAdapter.class)) {
+            return new TargetWorkbenchAdapter();
+        }
+        return ad;
+    }
+
+    public int getCategory() {
+        return provider.getPriority() * 0xFFFF + (provider.getId().hashCode() & 0xFFFF);
+    }
+
+    public String getId() {
+        return target.getId();
+    }
+
+    public String getName() {
+        return target.getName();
+    }
+
+    public String getProviderId() {
+        return provider.getId();
+    }
+
+    @Override
+    public int hashCode() {
+        final int prime = 31;
+        int result = 1;
+        result = prime * result + ((target == null) ? 0 : target.hashCode());
+        return result;
+    }
+
+    public void save(IMemento child) {
+        target.save(child);
+    }
+
+    public void load(IMemento child) {
+        target.load(child);
+    }
+
+    public IDeploymentTargetProvider getProvider() {
+        return provider;
+    }
+
+    public IDeploymentTarget getActualTarget() {
+        return target;
+    }
+}
--- a/org.symbian.tools.mtw.ui/src/org/symbian/tools/mtw/ui/Activator.java	Wed Jul 21 11:26:43 2010 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,60 +0,0 @@
-package org.symbian.tools.mtw.ui;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.ui.plugin.AbstractUIPlugin;
-import org.osgi.framework.BundleContext;
-
-/**
- * The activator class controls the plug-in life cycle
- */
-public class Activator extends AbstractUIPlugin {
-
-	// The plug-in ID
-	public static final String PLUGIN_ID = "org.symbian.tools.mtw.ui"; //$NON-NLS-1$
-
-	// The shared instance
-	private static Activator plugin;
-	
-	/**
-	 * The constructor
-	 */
-	public Activator() {
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
-	 */
-	public void start(BundleContext context) throws Exception {
-		super.start(context);
-		plugin = this;
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
-	 */
-	public void stop(BundleContext context) throws Exception {
-		plugin = null;
-		super.stop(context);
-	}
-
-	/**
-	 * Returns the shared instance
-	 *
-	 * @return the shared instance
-	 */
-	public static Activator getDefault() {
-		return plugin;
-	}
-
-    public static void log(String message, Exception e) {
-        getDefault().getLog().log(new Status(IStatus.ERROR, PLUGIN_ID, message, e));
-    }
-
-    public static void log(Exception e) {
-        log(null, e);
-    }
-
-}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.symbian.tools.mtw.ui/src/org/symbian/tools/mtw/ui/ConsoleFactory.java	Wed Jul 28 09:27:51 2010 -0700
@@ -0,0 +1,56 @@
+/**
+ * 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.mtw.ui;
+
+import org.eclipse.ui.console.ConsolePlugin;
+import org.eclipse.ui.console.IConsole;
+import org.eclipse.ui.console.IConsoleFactory;
+import org.eclipse.ui.console.IConsoleManager;
+import org.eclipse.ui.console.MessageConsole;
+import org.eclipse.ui.console.MessageConsoleStream;
+
+public class ConsoleFactory implements IConsoleFactory {
+	
+	private static MessageConsole console;
+
+	public void openConsole() {
+		getConsole();
+		console.activate();
+	}
+	
+	public static MessageConsoleStream createStream() {
+		getConsole();
+		return console.newMessageStream();
+	}
+	
+	public static void activateConsole() {
+		getConsole();
+		console.activate();
+	}
+	
+	private synchronized static MessageConsole getConsole() {
+		if (console == null) {
+			console = new MessageConsole("Mobile Web Console", null, true);
+			IConsoleManager consoleManager = ConsolePlugin.getDefault().getConsoleManager();
+			consoleManager.addConsoles(new IConsole[]{console});
+		}
+		return console;
+	}
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.symbian.tools.mtw.ui/src/org/symbian/tools/mtw/ui/Images.java	Wed Jul 28 09:27:51 2010 -0700
@@ -0,0 +1,49 @@
+/**
+ * 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.mtw.ui;
+
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.jface.resource.ImageRegistry;
+import org.eclipse.swt.graphics.Image;
+
+public final class Images {
+    private final String DISCOVER_ICON = "icons/full/obj16/discover.gif";
+    private final String EXCLUDED_ICON = "icons/full/obj16/excluded.gif";
+
+    private final ImageRegistry registry;
+
+    Images(final ImageRegistry registry) {
+        this.registry = registry;
+        add(registry, DISCOVER_ICON);
+        add(registry, EXCLUDED_ICON);
+    }
+
+    private void add(final ImageRegistry registry, String icon) {
+        ImageDescriptor descriptor = MTWCoreUI.imageDescriptorFromPlugin(MTWCoreUI.PLUGIN_ID, icon);
+        registry.put(icon, descriptor);
+    }
+
+    public Image getDiscoverButtonIcon() {
+        return registry.get(DISCOVER_ICON);
+    }
+
+    public ImageDescriptor getExcludedIconDescriptor() {
+        return registry.getDescriptor(EXCLUDED_ICON);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.symbian.tools.mtw.ui/src/org/symbian/tools/mtw/ui/MTWCoreUI.java	Wed Jul 28 09:27:51 2010 -0700
@@ -0,0 +1,92 @@
+package org.symbian.tools.mtw.ui;
+
+import java.util.Map;
+import java.util.WeakHashMap;
+
+import org.eclipse.core.resources.IProject;
+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.mtw.core.projects.IMTWProject;
+
+/**
+ * The activator class controls the plug-in life cycle
+ */
+public class MTWCoreUI extends AbstractUIPlugin {
+    private final Map<IProject, ProjectMemo> MEMOS = new WeakHashMap<IProject, ProjectMemo>();
+
+    // The plug-in ID
+    public static final String PLUGIN_ID = "org.symbian.tools.mtw.ui"; //$NON-NLS-1$
+
+    // The shared instance
+    private static MTWCoreUI plugin;
+    private Images images;
+
+    /**
+     * The constructor
+     */
+    public MTWCoreUI() {
+    }
+
+    @Override
+    protected void initializeImageRegistry(ImageRegistry reg) {
+        super.initializeImageRegistry(reg);
+    }
+
+    /*
+     * (non-Javadoc)
+     * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
+     */
+    public void start(BundleContext context) throws Exception {
+        super.start(context);
+        plugin = this;
+    }
+
+    /*
+     * (non-Javadoc)
+     * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
+     */
+    public void stop(BundleContext context) throws Exception {
+        plugin = null;
+        super.stop(context);
+    }
+
+    /**
+     * Returns the shared instance
+     *
+     * @return the shared instance
+     */
+    public static MTWCoreUI getDefault() {
+        return plugin;
+    }
+
+    public static void log(String message, Exception e) {
+        getDefault().getLog().log(new Status(IStatus.ERROR, PLUGIN_ID, message, e));
+    }
+
+    public static void log(Exception e) {
+        log(null, e);
+    }
+
+    public static ProjectMemo getMemo(IMTWProject project) {
+        return getDefault().getMemoForProject(project);
+    }
+
+    private synchronized ProjectMemo getMemoForProject(IMTWProject project) {
+        ProjectMemo memo = MEMOS.get(project.getProject());
+        if (memo == null) {
+            memo = new ProjectMemo(project);
+            MEMOS.put(project.getProject(), memo);
+        }
+        return memo;
+    }
+
+    public static Images getImages() {
+        if (getDefault().images == null) {
+            getDefault().images = new Images(getDefault().getImageRegistry());
+        }
+        return getDefault().images;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.symbian.tools.mtw.ui/src/org/symbian/tools/mtw/ui/ProjectMemo.java	Wed Jul 28 09:27:51 2010 -0700
@@ -0,0 +1,119 @@
+/**
+ * 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.mtw.ui;
+
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.io.OutputStreamWriter;
+import java.io.Writer;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.ui.IMemento;
+import org.eclipse.ui.XMLMemento;
+import org.symbian.tools.mtw.core.projects.IMTWProject;
+import org.symbian.tools.mtw.internal.deployment.DeploymentTargetProviderRegistry;
+import org.symbian.tools.mtw.ui.deployment.IDeploymentTarget;
+import org.symbian.tools.mtw.ui.deployment.IDeploymentTargetProvider;
+
+public class ProjectMemo {
+    private static final String DEPLOYMENT_PROVIDER = "providerId";
+    private static final String TARGET = "targetId";
+    private static final String TARGET_CONFIGURATION = "target";
+    private static final String MEMO_TYPE = "deployment";
+
+    private final IMTWProject project;
+    private XMLMemento memento;
+
+    public ProjectMemo(IMTWProject project) {
+        this.project = project;
+    }
+
+    public synchronized void setDeploymentTarget(String providerId, IDeploymentTarget target) {
+        try {
+            checkMemento();
+            memento.putString(DEPLOYMENT_PROVIDER, providerId);
+            memento.putString(TARGET, target.getId());
+            final IMemento child = memento.createChild(TARGET_CONFIGURATION);
+            target.save(child);
+            saveMemento();
+        } catch (CoreException e) {
+            MTWCoreUI.log(e);
+        } catch (IOException e) {
+            MTWCoreUI.log(e);
+        }
+    }
+
+    private void saveMemento() throws IOException, CoreException {
+        ByteArrayOutputStream os = new ByteArrayOutputStream();
+        final Writer writer = new OutputStreamWriter(os);
+        memento.save(writer);
+        writer.close();
+        final InputStream stream = new ByteArrayInputStream(os.toByteArray());
+        IFile file = getMemoFile();
+        if (file.exists()) {
+            file.setContents(stream, IFile.KEEP_HISTORY, null);
+        } else {
+            file.create(stream, false, null);
+        }
+    }
+
+    private IFile getMemoFile() {
+        return project.getProject().getFile(new Path(".settings").append(MTWCoreUI.PLUGIN_ID).addFileExtension("xml"));
+    }
+
+    private void checkMemento() throws CoreException, IOException {
+        IFile memoFile = getMemoFile();
+        if (memoFile.exists()) {
+            memento = XMLMemento.createReadRoot(new InputStreamReader(memoFile.getContents(), memoFile.getCharset()));
+        } else {
+            memento = XMLMemento.createWriteRoot(MEMO_TYPE);
+        }
+    }
+
+    public IDeploymentTarget getPreviousDeploymentTarget() {
+        try {
+            checkMemento();
+            String type = memento.getString(DEPLOYMENT_PROVIDER);
+            if (type != null) {
+                final IDeploymentTargetProvider provider = DeploymentTargetProviderRegistry.getInstance().getProvider(
+                        type);
+                if (provider != null) {
+                    IDeploymentTarget target = provider.findTarget(project, memento.getString(TARGET));
+                    if (target != null) {
+                        IMemento child = memento.getChild(TARGET_CONFIGURATION);
+                        if (child != null) {
+                            target.load(child);
+                        }
+                    }
+                }
+            }
+        } catch (CoreException e) {
+            MTWCoreUI.log(e);
+        } catch (IOException e) {
+            MTWCoreUI.log(e);
+        }
+        return null;
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.symbian.tools.mtw.ui/src/org/symbian/tools/mtw/ui/UIUtils.java	Wed Jul 28 09:27:51 2010 -0700
@@ -0,0 +1,54 @@
+/**
+ * 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.mtw.ui;
+
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.IWorkbenchPart;
+import org.eclipse.ui.handlers.HandlerUtil;
+import org.symbian.tools.mtw.core.MTWCore;
+import org.symbian.tools.mtw.core.projects.IMTWProject;
+
+public class UIUtils {
+    public static IMTWProject getProjectFromCommandContext(ExecutionEvent event) {
+        IResource resource = null;
+        IWorkbenchPart activePart = HandlerUtil.getActivePart(event);
+        if (activePart instanceof IEditorPart) {
+            resource = (IResource) ((IEditorPart) activePart).getEditorInput().getAdapter(IResource.class);
+        } else {
+            ISelection selection = HandlerUtil.getCurrentSelection(event);
+            if (!selection.isEmpty() && selection instanceof IStructuredSelection) {
+                Object[] array = ((IStructuredSelection) selection).toArray();
+                if (array.length == 1 && array[0] instanceof IAdaptable) {
+                    resource = (IResource) ((IAdaptable) array[0]).getAdapter(IResource.class);
+                }
+            }
+        }
+        if (resource != null) {
+            IProject project = resource.getProject();
+            return MTWCore.getDefault().create(project);
+        }
+        return null;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.symbian.tools.mtw.ui/src/org/symbian/tools/mtw/ui/commands/DeployHandler.java	Wed Jul 28 09:27:51 2010 -0700
@@ -0,0 +1,98 @@
+/**
+ * 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.mtw.ui.commands;
+
+import java.lang.reflect.InvocationTargetException;
+
+import org.eclipse.core.commands.AbstractHandler;
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.jface.dialogs.ProgressMonitorDialog;
+import org.eclipse.jface.operation.IRunnableWithProgress;
+import org.eclipse.jface.wizard.WizardDialog;
+import org.eclipse.ui.IPageLayout;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.PartInitException;
+import org.eclipse.ui.handlers.HandlerUtil;
+import org.symbian.tools.mtw.core.MTWCore;
+import org.symbian.tools.mtw.core.projects.IMTWProject;
+import org.symbian.tools.mtw.ui.UIUtils;
+import org.symbian.tools.mtw.ui.deployment.DeployWizard;
+
+/**
+ * Our sample handler extends AbstractHandler, an IHandler base class.
+ * @see org.eclipse.core.commands.IHandler
+ * @see org.eclipse.core.commands.AbstractHandler
+ */
+public class DeployHandler extends AbstractHandler {
+    /**
+     * The constructor.
+     */
+    public DeployHandler() {
+    }
+
+    /**
+     * the command has been executed, so extract extract the needed information
+     * from the application context.
+     */
+    public Object execute(ExecutionEvent event) throws ExecutionException {
+        final IWorkbenchWindow window = HandlerUtil.getActiveWorkbenchWindowChecked(event);
+
+        final IMTWProject project = UIUtils.getProjectFromCommandContext(event);
+        if (project != null) {
+            window.getActivePage().saveAllEditors(true);
+            if (validate(project, window)) {
+                new WizardDialog(window.getShell(), new DeployWizard(project)).open();
+            }
+        }
+
+        return null;
+    }
+
+    private boolean validate(final IMTWProject project, final IWorkbenchWindow window) {
+        final boolean[] retvalue = { false };
+        final ProgressMonitorDialog dialog = new ProgressMonitorDialog(window.getShell());
+        try {
+            dialog.run(true, true, new IRunnableWithProgress() {
+                public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
+                    retvalue[0] = project.validate(monitor);
+                }
+            });
+        } catch (InvocationTargetException e) {
+            MTWCore.log(null, e);
+        } catch (InterruptedException e) {
+            MTWCore.log(null, e);
+        }
+        if (!retvalue[0]) {
+            retvalue[0] = MessageDialog.openQuestion(window.getShell(), "Deploying Mobile Web Project",
+                    String.format("Project %s has errors. Are you sure you want to deploy it?", project.getName()));
+            if (!retvalue[0]) {
+                try {
+                    window.getActivePage().showView(IPageLayout.ID_PROBLEM_VIEW);
+                } catch (PartInitException e) {
+                    MTWCore.log(null, e);
+                }
+            }
+        }
+        return retvalue[0];
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.symbian.tools.mtw.ui/src/org/symbian/tools/mtw/ui/deployment/DeployWizard.java	Wed Jul 28 09:27:51 2010 -0700
@@ -0,0 +1,106 @@
+/**
+ * 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.mtw.ui.deployment;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.jobs.ISchedulingRule;
+import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.core.runtime.jobs.MultiRule;
+import org.eclipse.jface.wizard.Wizard;
+import org.eclipse.ui.statushandlers.StatusManager;
+import org.symbian.tools.mtw.core.projects.IMTWProject;
+import org.symbian.tools.mtw.internal.deployment.DeployWizardContext;
+import org.symbian.tools.mtw.internal.deployment.DeploymentTargetWizardPage;
+import org.symbian.tools.mtw.internal.deployment.DeploymentTargetWrapper;
+import org.symbian.tools.mtw.ui.MTWCoreUI;
+import org.symbian.tools.mtw.ui.ProjectMemo;
+
+public class DeployWizard extends Wizard {
+    private final DeployWizardContext context;
+    private final IMTWProject project;
+
+    public DeployWizard(IMTWProject project) {
+        this.project = project;
+        setNeedsProgressMonitor(true);
+        setWindowTitle("Deploy WRT Application");
+        context = new DeployWizardContext(project);
+    }
+
+    @Override
+    public void addPages() {
+        addPage(new DeploymentTargetWizardPage(context, MTWCoreUI.getMemo(project)));
+    }
+
+    @Override
+    public boolean performFinish() {
+        return deploy();
+    }
+
+    @Override
+    public boolean needsPreviousAndNextButtons() {
+        return false;
+    }
+
+    /**
+     * deploys the actual widget.
+     */
+    private boolean deploy() {
+        DeploymentTargetWrapper target = context.getTarget();
+        DeployJob job = new DeployJob(context.getProject(), target);
+        job.schedule();
+        return true;
+    }
+
+    private final class DeployJob extends Job {
+        private final DeploymentTargetWrapper target;
+        private final IMTWProject project;
+
+        private DeployJob(IMTWProject project, DeploymentTargetWrapper deploymentTarget) {
+            super(String.format("Deploying %s to %s", project.getName(), deploymentTarget.getName()));
+            ISchedulingRule rule = deploymentTarget.getProvider().getSchedulingRule(deploymentTarget.getActualTarget());
+            if (rule != null) {
+                rule = MultiRule.combine(rule, project.getProject());
+            } else {
+                rule = project.getProject();
+            }
+            setRule(rule);
+            setUser(true);
+            this.project = project;
+            this.target = deploymentTarget;
+        }
+
+        public IStatus run(IProgressMonitor monitor) {
+            IStatus status;
+            try {
+                status = target.deploy(project, project.getTargetRuntime(), monitor);
+            } catch (CoreException e) {
+                status = e.getStatus();
+            }
+            if (status.getSeverity() != IStatus.ERROR && status.getSeverity() != IStatus.WARNING) {
+                StatusManager.getManager().handle(status, StatusManager.SHOW);
+            }
+            ProjectMemo memo = MTWCoreUI.getMemo(project);
+            memo.setDeploymentTarget(target.getProviderId(), target);
+            return status;
+        }
+
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.symbian.tools.mtw.ui/src/org/symbian/tools/mtw/ui/deployment/IDeploymentTarget.java	Wed Jul 28 09:27:51 2010 -0700
@@ -0,0 +1,82 @@
+/**
+ * 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.mtw.ui.deployment;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.ui.IMemento;
+import org.symbian.tools.mtw.core.projects.IMTWProject;
+import org.symbian.tools.mtw.core.runtimes.IMobileWebRuntime;
+
+/**
+ * <p>This is particular deployment target instance. It can be a Bluetooth phone
+ * connection, installed device emulator, FTP server, etc.</p>
+ * 
+ * <p>Targets can be cached and {@link #setProject(WRTProject)} will be called 
+ * if active project was changed. Targets are single-threaded. This class
+ * methods can be called from non-SWT thread.</p>
+ * 
+ * <p>Following adapters can be provided by either overriding getAdapter method 
+ * or by contributing to org.eclipse.core.runtime.adapters extension point:</p>
+ * <ul><li>{@link org.eclipse.ui.IPersistable} - to persist advanced per-
+ * project target configuration</li><li>
+ * {@link org.eclipse.ui.model.IWorkbenchAdapter} or 
+ * {@link org.eclipse.ui.model.IWorkbenchAdapter2} to customize target 
+ * presentation in IDE user interface.</li></ul>
+ * 
+ * @author Eugene Ostroukhov (eugeneo@symbian.org)
+ */
+public interface IDeploymentTarget extends IAdaptable {
+    /**
+     * Returns unique ID. There is no restriction on ID string format. Cannot 
+     * be <code>null</code>
+     */
+    String getId();
+
+    /**
+     * <p>Returns user-readable name. Can be null if 
+     * {@link org.eclipse.ui.model.IWorkbenchAdapter} is provided.<p>
+     * <p>Name is not used for purposes other then presentation and may change
+     * between invocations</p>
+     */
+    String getName();
+
+    /**
+     * Deploy application to this target.
+     * 
+     * @param project project to deploy to the target
+     * @param runtime runtime that will be used to run packaged application
+     * @param monitor progress monitor to report deployment progress
+     */
+    IStatus deploy(IMTWProject project, IMobileWebRuntime runtime, IProgressMonitor monitor) throws CoreException;
+
+    /**
+     * Save project-specific settings to the memento. Workspace-wide settings 
+     * should be managed separately.
+     */
+    void save(IMemento memento);
+
+    /**
+     * Restore project-specific deployment settings. Target should be reset to 
+     * default state if its state cannot be restored.
+     */
+    void load(IMemento memento);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.symbian.tools.mtw.ui/src/org/symbian/tools/mtw/ui/deployment/IDeploymentTargetProvider.java	Wed Jul 28 09:27:51 2010 -0700
@@ -0,0 +1,65 @@
+/**
+ * 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.mtw.ui.deployment;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.jobs.ISchedulingRule;
+import org.symbian.tools.mtw.core.projects.IMTWProject;
+
+/**
+ * This interface is for deployment targets providers.
+ * 
+ * @author Eugene
+ */
+public interface IDeploymentTargetProvider {
+    /**
+     * Returns list of the targets that accept provided project. Project 
+     * cannot be <code>null</code>.
+     * @return List of the valid deployment targets. Both <code>null</code> and
+     * empty array are a valid return value when there are no available targets.
+     */
+    IDeploymentTarget[] getTargets(IMTWProject project);
+
+    /**
+     * Discovers targets. This can be a long-running task and in most cases
+     * will be triggered by the user.
+     */
+    void discoverTargets(IProgressMonitor monitor) throws CoreException;
+
+    /**
+     * Find target based on project and target ID. This method returns 
+     * <code>null</code> if target with given ID cannot be found or if
+     * the target does not accept project any longer.
+     */
+    IDeploymentTarget findTarget(IMTWProject project, String id);
+
+    /**
+     * Return <code>false</code> if user needs to trigger long-running 
+     * discovery to see all potential deployment targets.
+     */
+    boolean targetsDiscovered();
+
+    /**
+     * @param target that will be used by a {@link org.eclipse.core.runtime.jobs.Job}
+     * @return scheduling rule that will be used to properly schedule jobs to 
+     * avoid resource access conflicts. Can be <code>null</code>
+     */
+    ISchedulingRule getSchedulingRule(IDeploymentTarget target);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.symbian.tools.mtw.ui/src/org/symbian/tools/mtw/ui/deployment/bluetooth/BluetoothProvider.java	Wed Jul 28 09:27:51 2010 -0700
@@ -0,0 +1,207 @@
+/**
+ * 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.mtw.ui.deployment.bluetooth;
+
+import java.io.IOException;
+import java.io.PrintStream;
+import java.util.Collection;
+import java.util.Map;
+import java.util.TreeMap;
+
+import javax.bluetooth.BluetoothStateException;
+import javax.bluetooth.DeviceClass;
+import javax.bluetooth.DiscoveryAgent;
+import javax.bluetooth.DiscoveryListener;
+import javax.bluetooth.LocalDevice;
+import javax.bluetooth.RemoteDevice;
+import javax.bluetooth.ServiceRecord;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.jobs.ISchedulingRule;
+import org.symbian.tools.mtw.core.projects.IMTWProject;
+import org.symbian.tools.mtw.ui.ConsoleFactory;
+import org.symbian.tools.mtw.ui.MTWCoreUI;
+import org.symbian.tools.mtw.ui.deployment.IDeploymentTarget;
+import org.symbian.tools.mtw.ui.deployment.IDeploymentTargetProvider;
+
+import com.intel.bluetooth.BlueCoveImpl;
+
+/**
+ * Discovers Bluetooth-enabled devices. This code is generic and will not 
+ * perform any checks if the discovered device can run application being 
+ * deployed.
+ * 
+ * @author Eugene Ostroukhov (eugeneo@symbian.org)
+ */
+public class BluetoothProvider implements IDeploymentTargetProvider {
+    private final class WrtDiscoveryListener implements DiscoveryListener {
+        final Object inquiryCompletedEvent;
+        boolean isCanceled;
+        final Map<String, BluetoothTarget> prevTargets;
+        final IProgressMonitor progressMonitor;
+
+        private WrtDiscoveryListener(Map<String, BluetoothTarget> previousTargets, Object inquiryCompletedEvent,
+                IProgressMonitor progressMonitor) {
+            this.prevTargets = previousTargets;
+            this.inquiryCompletedEvent = inquiryCompletedEvent;
+            this.progressMonitor = progressMonitor;
+        }
+
+        private void checkCanceled() {
+            if (!isCanceled && progressMonitor != null) {
+                if (progressMonitor.isCanceled()) {
+                    try {
+                        LocalDevice.getLocalDevice().getDiscoveryAgent().cancelInquiry(listener);
+                    } catch (BluetoothStateException e) {
+                        MTWCoreUI.log(e);
+                    }
+                }
+            }
+        }
+
+        public void deviceDiscovered(RemoteDevice btDevice, DeviceClass cod) {
+            try {
+                if (btDevice.getFriendlyName(false) != null && btDevice.getFriendlyName(false).length() > 0) {
+                    final String name = btDevice.getFriendlyName(false);
+
+                    final BluetoothTarget target = prevTargets.get(name);
+                    if (target != null) {
+                        target.setAddress(btDevice);
+                    } else {
+                        targets.put(name, new BluetoothTarget(name, btDevice, BluetoothProvider.this));
+                    }
+                    checkCanceled();
+                }
+            } catch (BluetoothStateException e) {
+                MTWCoreUI.log(e.getMessage(), e);
+            } catch (IOException e) {
+                MTWCoreUI.log(e.getMessage(), e);
+            }
+        }
+
+        public void inquiryCompleted(int discType) {
+            synchronized (inquiryCompletedEvent) {
+                inquiryCompletedEvent.notifyAll();
+            }
+        }
+
+        public void servicesDiscovered(int transID, ServiceRecord[] servRecord) {
+        }
+
+        public void serviceSearchCompleted(int transID, int respCode) {
+        }
+    }
+
+    private static PrintStream savedSysOut;
+    private boolean discovered = false;
+    private WrtDiscoveryListener listener;
+    private Map<String, BluetoothTarget> targets = new TreeMap<String, BluetoothTarget>();
+
+    public BluetoothProvider() {
+        // set parameters for BlueCove
+        String param = Integer.toString(65 * 1024);
+        System.setProperty("bluecove.obex.mtu", param);
+        BlueCoveImpl.setConfigProperty("bluecove.obex.mtu", param);
+    }
+
+    public void discoverTargets(IProgressMonitor monitor) throws CoreException {
+        if (!isBloothToothConnected()) {
+            throw new CoreException(new Status(IStatus.ERROR, MTWCoreUI.PLUGIN_ID, "Bluetooth is not available"));
+        }
+        monitor.beginTask("Discovering Bluetooth devices", IProgressMonitor.UNKNOWN);
+        final Object inquiryCompletedEvent = new Object();
+        final Map<String, BluetoothTarget> previousTargets = targets;
+        targets = new TreeMap<String, BluetoothTarget>();
+
+        listener = new WrtDiscoveryListener(previousTargets, inquiryCompletedEvent, monitor);
+
+        synchronized (inquiryCompletedEvent) {
+            boolean started;
+            try {
+                started = LocalDevice.getLocalDevice().getDiscoveryAgent().startInquiry(DiscoveryAgent.GIAC, listener);
+                if (started) {
+                    inquiryCompletedEvent.wait();
+                    discovered = true;
+                }
+            } catch (BluetoothStateException e) {
+                MTWCoreUI.log(e.getMessage(), e);
+            } catch (InterruptedException e) {
+                MTWCoreUI.log(e.getMessage(), e);
+            }
+        }
+        monitor.done();
+    }
+
+    /** Toggle BlueCove logging
+     */
+    public void enableBlueCoveDiagnostics(boolean enable) {
+        System.setProperty("bluecove.debug", Boolean.valueOf(enable).toString());
+        BlueCoveImpl.instance().enableNativeDebug(enable);
+        if (enable) {
+            System.setOut(new PrintStream(ConsoleFactory.createStream()));
+        } else {
+            System.setOut(savedSysOut);
+        }
+    }
+
+    public IDeploymentTarget findTarget(IMTWProject project, String id) {
+        if (!isBloothToothConnected()) {
+            return null;
+        }
+        if (discovered) {
+            return targets.get(id);
+        } else {
+            BluetoothTarget target = targets.get(id);
+            if (target == null) {
+                target = new BluetoothTarget(id, null, this);
+                targets.put(id, target);
+            }
+            return target;
+        }
+    }
+
+    public IDeploymentTarget[] getTargets(IMTWProject project) {
+        if (targets != null) {
+            final Collection<BluetoothTarget> values = targets.values();
+            return values.toArray(new IDeploymentTarget[values.size()]);
+        } else {
+            return null;
+        }
+    }
+
+    /**
+     * Check whether the bluetooth is on or not.
+     * 
+     * @return whether the device is on.
+     */
+    public boolean isBloothToothConnected() {
+        return LocalDevice.isPowerOn();
+    }
+
+    public boolean targetsDiscovered() {
+        return discovered;
+    }
+
+    public ISchedulingRule getSchedulingRule(IDeploymentTarget target) {
+        return BluetoothRule.INSTANCE;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.symbian.tools.mtw.ui/src/org/symbian/tools/mtw/ui/deployment/bluetooth/BluetoothRule.java	Wed Jul 28 09:27:51 2010 -0700
@@ -0,0 +1,20 @@
+package org.symbian.tools.mtw.ui.deployment.bluetooth;
+
+import org.eclipse.core.runtime.jobs.ISchedulingRule;
+
+public class BluetoothRule implements ISchedulingRule {
+    public static final ISchedulingRule INSTANCE = new BluetoothRule();
+
+    private BluetoothRule() {
+        // No instantiation
+    }
+
+    public boolean contains(ISchedulingRule rule) {
+        return isConflicting(rule);
+    }
+
+    public boolean isConflicting(ISchedulingRule rule) {
+        return rule instanceof BluetoothRule;
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.symbian.tools.mtw.ui/src/org/symbian/tools/mtw/ui/deployment/bluetooth/BluetoothTarget.java	Wed Jul 28 09:27:51 2010 -0700
@@ -0,0 +1,313 @@
+/**
+ * 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.mtw.ui.deployment.bluetooth;
+
+import java.io.EOFException;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.text.MessageFormat;
+import java.util.Collection;
+import java.util.LinkedList;
+
+import javax.bluetooth.BluetoothConnectionException;
+import javax.bluetooth.BluetoothStateException;
+import javax.bluetooth.DeviceClass;
+import javax.bluetooth.DiscoveryListener;
+import javax.bluetooth.LocalDevice;
+import javax.bluetooth.RemoteDevice;
+import javax.bluetooth.ServiceRecord;
+import javax.bluetooth.UUID;
+import javax.microedition.io.Connector;
+import javax.obex.ClientSession;
+import javax.obex.HeaderSet;
+import javax.obex.Operation;
+import javax.obex.ResponseCodes;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.PlatformObject;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.SubProgressMonitor;
+import org.eclipse.ui.IMemento;
+import org.symbian.tools.mtw.core.MTWCore;
+import org.symbian.tools.mtw.core.projects.IMTWProject;
+import org.symbian.tools.mtw.core.runtimes.IMobileWebRuntime;
+import org.symbian.tools.mtw.core.runtimes.IPackager;
+import org.symbian.tools.mtw.ui.deployment.IDeploymentTarget;
+
+public class BluetoothTarget extends PlatformObject implements IDeploymentTarget {
+    private static final UUID OBEX_OBJECT_PUSH = new UUID(0x1105);
+    private String serviceURL;
+    private RemoteDevice device;
+    protected String[] exceptionCodes = new String[] { "OBEX_HTTP_UNSUPPORTED_TYPE", "OBEX_HTTP_FORBIDDEN" };
+    private String message = "Deployment was successful. Please follow on-screen instructions to complete application deployment on your device.";
+    private final String name;
+    private final BluetoothProvider provider;
+    private final Collection<IStatus> statuses = new LinkedList<IStatus>();
+
+    public BluetoothTarget(String name, RemoteDevice device, BluetoothProvider provider) {
+        this.name = name;
+        this.device = device;
+        this.provider = provider;
+    }
+
+    public IStatus deploy(IMTWProject project, IMobileWebRuntime runtime, IProgressMonitor monitor)
+            throws CoreException {
+        monitor.beginTask(String.format("Deploying application %s to %s", project.getName(), name),
+                IProgressMonitor.UNKNOWN);
+        final IPackager packager = MTWCore.getDefault().getRuntimesManager().getPackager(project, runtime);
+        if (packager == null) {
+            return new Status(IStatus.ERROR, MTWCore.PLUGIN_ID, String.format("Project %s does not support runtime %s",
+                    project.getName(), runtime.getName()));
+        }
+        final File application = packager.packageApplication(project, runtime, new SubProgressMonitor(monitor, 100));
+        try {
+            deployWidget(application, packager.getFileType(project), new SubProgressMonitor(monitor, 10));
+        } finally {
+            application.delete();
+        }
+        monitor.done();
+        return new Status(IStatus.OK, MTWCore.PLUGIN_ID, message);
+    }
+
+    private void deployWidget(File inputWidget, String fileType, IProgressMonitor progressMonitor) throws CoreException {
+        if (device == null) {
+            provider.discoverTargets(new SubProgressMonitor(progressMonitor, 10));
+            if (device == null) {
+                throw new CoreException(new Status(IStatus.ERROR, MTWCore.PLUGIN_ID, String.format(
+                        "Device %s is not available", name)));
+            }
+        }
+        progressMonitor.beginTask("Deploying application", IProgressMonitor.UNKNOWN);
+        InputStream in = null;
+        OutputStream os = null;
+        Operation putOperation = null;
+        ClientSession clientSession = null;
+        try {
+            if (!provider.isBloothToothConnected()) {
+                String msg = "Bluetooth is either disabled or not present in the system.";
+                emitStatus(IStatus.ERROR, msg, progressMonitor);
+                return;
+            }
+
+            String message = MessageFormat.format("Searching for the service for the selected device \"{0}\"",
+                    new Object[] { getName() });
+            emitStatus(IStatus.OK, message, progressMonitor);
+            String servicesFound = getServicesFound();
+            if (servicesFound == null || servicesFound.length() < 1) {
+                message = MessageFormat.format("Cannot find service to the device \"{0}\"", new Object[] { getName() });
+                emitStatus(IStatus.ERROR, message, progressMonitor);
+                return;
+            }
+
+            message = MessageFormat.format("Service for the device \"{0}\" found", new Object[] { getName() });
+            emitStatus(IStatus.OK, message, progressMonitor);
+
+            clientSession = (ClientSession) Connector.open(servicesFound);
+            HeaderSet hsConnectReply = clientSession.connect(null);
+            if (hsConnectReply.getResponseCode() != ResponseCodes.OBEX_HTTP_OK) {
+                emitStatus(IStatus.OK, "Failed to connect to the service", progressMonitor);
+            }
+
+            emitStatus(IStatus.OK, "Deployment Started", progressMonitor);
+
+            HeaderSet hsOperation = clientSession.createHeaderSet();
+
+            if (progressMonitor.isCanceled()) {
+                emitStatus(IStatus.CANCEL, "Deployment was canceled", progressMonitor);
+                return;
+            }
+
+            // Send widget to server
+            in = new FileInputStream(inputWidget);
+            message = MessageFormat.format("Deploying file from {0}", new Object[] { inputWidget.getAbsolutePath() });
+            emitStatus(IStatus.OK, message, progressMonitor);
+
+            hsOperation.setHeader(HeaderSet.NAME, inputWidget.getName());
+            hsOperation.setHeader(HeaderSet.TYPE, fileType);
+            int size = (int) inputWidget.length();
+            byte file[] = new byte[size];
+            hsOperation.setHeader(HeaderSet.LENGTH, new Long(file.length));
+
+            // Create PUT Operation
+            putOperation = clientSession.put(hsOperation);
+
+            os = putOperation.openOutputStream();
+
+            long start = System.currentTimeMillis();
+
+            byte[] buf = new byte[16 * 1024];
+            int len;
+            while ((len = in.read(buf)) > 0) {
+                os.write(buf, 0, len);
+                if (progressMonitor.isCanceled()) {
+                    putOperation.abort();
+                    emitStatus(IStatus.CANCEL, "Deployment was canceled", progressMonitor);
+                    return;
+                }
+            }
+
+            os.flush();
+            os.close();
+
+            long elapsed = System.currentTimeMillis() - start;
+            emitStatus(IStatus.OK, "elapsed time: " + elapsed / 1000.0 + " seconds", progressMonitor);
+
+            int responseCode = putOperation.getResponseCode();
+            if (responseCode == ResponseCodes.OBEX_HTTP_OK) {
+                message = MessageFormat.format("File deployed to {0}", new Object[] { getName() });
+                emitStatus(IStatus.OK, message, progressMonitor);
+            } else {
+                message = "Error during deployment, OBEX error: " + responseCode;
+                emitStatus(IStatus.ERROR, message, progressMonitor);
+            }
+
+        } catch (BluetoothConnectionException x) {
+            String message = getExceptionMessage(x.getMessage());
+            emitStatus(IStatus.ERROR, message, progressMonitor);
+        } catch (IOException e) {
+            String message = getExceptionMessage(e.getMessage());
+            emitStatus(IStatus.ERROR, message, progressMonitor);
+        } finally {
+            try {
+                if (in != null) {
+                    in.close();
+                }
+                if (putOperation != null) {
+                    putOperation.close();
+                }
+                if (clientSession != null) {
+                    clientSession.disconnect(null);
+                    clientSession.close();
+                }
+            } catch (EOFException eof) {
+                // EOFException is now caught 
+                // Ignore the error since deployment has already completed
+                //Activator.log(IStatus.ERROR, "EOF encountered while cleaning up Bluetooth deployment", eof);
+            } catch (IOException x) {
+                MTWCore.log("Error cleaning up BlueTooth deployment", x);
+            }
+        }
+        return;
+    }
+
+    protected void emitStatus(int severity, String statusDescription, IProgressMonitor monitor) {
+        statuses.add(new Status(severity, MTWCore.PLUGIN_ID, statusDescription));
+        monitor.setTaskName(statusDescription);
+        if (severity != IStatus.OK) {
+            message = statusDescription;
+        }
+    }
+
+    /**
+     * Returns the customized methods from the exception error code. If it
+     * matches it returns the customized message else returns the exception itself
+     * @param message exception message
+     * @return the customized message
+     */
+    protected String getExceptionMessage(String message) {
+
+        if (message.contains(exceptionCodes[0])) {
+            return "Device does not support the widget deployment";
+        } else if (message.contains(exceptionCodes[1])) {
+            return "Deployment rejected by the device";
+        }
+        return message;
+    }
+
+    public String getId() {
+        return getName();
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public String getServicesFound() {
+        try {
+            serviceURL = "";
+            UUID serviceUUID = OBEX_OBJECT_PUSH;
+
+            final Object serviceSearchCompletedEvent = new Object();
+
+            DiscoveryListener listener = new DiscoveryListener() {
+
+                public void deviceDiscovered(RemoteDevice btDevice, DeviceClass cod) {
+                }
+
+                public void inquiryCompleted(int discType) {
+                }
+
+                public void servicesDiscovered(int transID, ServiceRecord[] servRecord) {
+                    try {
+                        for (int i = 0; i < servRecord.length; i++) {
+                            if (servRecord[i].getHostDevice().getFriendlyName(false).equals(name)) {
+                                serviceURL = servRecord[i].getConnectionURL(ServiceRecord.NOAUTHENTICATE_NOENCRYPT,
+                                        false);
+                            }
+                        }
+                    } catch (BluetoothStateException e) {
+                        MTWCore.log(e.getMessage(), e);
+                    } catch (IOException e) {
+                        MTWCore.log(e.getMessage(), e);
+                    }
+                }
+
+                public void serviceSearchCompleted(int transID, int respCode) {
+                    synchronized (serviceSearchCompletedEvent) {
+                        serviceSearchCompletedEvent.notifyAll();
+                    }
+                }
+
+            };
+
+            UUID[] searchUuidSet = new UUID[] { serviceUUID };
+            int[] attrIDs = new int[] { 0x0100 }; // Service name
+
+            synchronized (serviceSearchCompletedEvent) {
+                LocalDevice.getLocalDevice().getDiscoveryAgent()
+                        .searchServices(attrIDs, searchUuidSet, device, listener);
+                serviceSearchCompletedEvent.wait();
+            }
+
+        } catch (IOException e) {
+            MTWCore.log("Error in Bluetooth service discovery", e);
+        } catch (InterruptedException e) {
+            MTWCore.log("Error in Bluetooth service discovery", e);
+        }
+        return serviceURL;
+    }
+
+    public void load(IMemento memento) {
+        // nothing
+    }
+
+    public void save(IMemento memento) {
+        // nothing
+
+    }
+
+    public void setAddress(RemoteDevice device) {
+        this.device = device;
+    }
+}
--- a/org.symbian.tools.mtw.ui/src/org/symbian/tools/mtw/ui/navigator/PackagingInformationDecorator.java	Wed Jul 21 11:26:43 2010 -0700
+++ b/org.symbian.tools.mtw.ui/src/org/symbian/tools/mtw/ui/navigator/PackagingInformationDecorator.java	Wed Jul 28 09:27:51 2010 -0700
@@ -23,8 +23,10 @@
 import org.eclipse.jface.viewers.IDecoration;
 import org.eclipse.jface.viewers.ILabelProviderListener;
 import org.eclipse.jface.viewers.ILightweightLabelDecorator;
-import org.symbian.tools.wrttools.core.WRTImages;
-import org.symbian.tools.wrttools.util.ProjectUtils;
+import org.symbian.tools.mtw.core.MTWCore;
+import org.symbian.tools.mtw.core.projects.IMTWProject;
+import org.symbian.tools.mtw.core.runtimes.IPackager;
+import org.symbian.tools.mtw.ui.MTWCoreUI;
 
 public class PackagingInformationDecorator implements ILightweightLabelDecorator {
 
@@ -35,8 +37,14 @@
         } else if (element instanceof IAdaptable) {
             resource = (IResource) ((IAdaptable) element).getAdapter(IResource.class);
         }
-        if (resource != null && resource.isAccessible() && ProjectUtils.isExcluded(resource)) {
-            decoration.addOverlay(WRTImages.getExcludedImageDescriptor(), IDecoration.TOP_RIGHT);
+        if (resource != null && resource.isAccessible()) {
+            IMTWProject project = MTWCore.getDefault().create(resource.getProject());
+            if (project != null) {
+                IPackager packager = MTWCore.getDefault().getRuntimesManager().getPackager(project);
+                if (packager.getPathInPackage(resource) != null) {
+                    decoration.addOverlay(MTWCoreUI.getImages().getExcludedIconDescriptor(), IDecoration.TOP_RIGHT);
+                }
+            }
         }
     }
 
--- a/org.symbian.tools.wrttools.product/launch/WRT IDE Product (Windows).launch	Wed Jul 21 11:26:43 2010 -0700
+++ b/org.symbian.tools.wrttools.product/launch/WRT IDE Product (Windows).launch	Wed Jul 28 09:27:51 2010 -0700
@@ -23,7 +23,7 @@
 <booleanAttribute key="restart" value="false"/>
 <stringAttribute key="selectedPlugin" value="org.symbian.tools.wrttools.previewer"/>
 <stringAttribute key="selected_target_plugins" value="org.eclipse.swt.win32.win32.x86@default:false,org.eclipse.core.contenttype@default:default,org.apache.velocity@default:default,org.eclipse.equinox.jsp.jasper@default:default,org.apache.commons.codec*1.3.0.v20100106-1700@default:default,org.eclipse.equinox.app@default:default,org.eclipse.osgi@-1:true,org.eclipse.wst.jsdt.web.ui@default:default,org.eclipse.ui.editors@default:default,org.eclipse.ecf.provider.filetransfer.httpclient.ssl@default:false,org.eclipse.core.jobs@default:default,org.eclipse.ltk.core.refactoring@default:default,org.eclipse.equinox.frameworkadmin@default:default,org.eclipse.core.expressions@default:default,org.eclipse.wst.css.ui@default:default,org.eclipse.debug.core@default:default,org.eclipse.team.cvs.ui@default:default,org.eclipse.wst.xmleditor.doc.user@default:default,org.eclipse.core.variables@default:default,org.eclipse.wst.common.emfworkbench.integration@default:default,org.eclipse.ui.presentations.r21@default:default,org.eclipse.team.ui@default:default,org.eclipse.core.databinding.beans@default:default,org.apache.lucene.analysis@default:default,org.eclipse.emf.ecore.xmi@default:default,javax.xml@default:default,org.eclipse.jface@default:default,org.eclipse.equinox.p2.core@default:default,org.eclipse.ui.navigator@default:default,org.eclipse.wst.validation@default:default,org.eclipse.ecf.filetransfer@default:default,org.eclipse.help.base@default:default,org.eclipse.equinox.security.ui@default:default,org.apache.xerces@default:default,org.mozilla.xulrunner.win32.win32.x86@default:false,org.eclipse.equinox.simpleconfigurator.manipulator@default:default,org.eclipse.core.databinding@default:default,org.eclipse.wst.jsdt.ui@default:default,org.jdom@default:default,org.eclipse.wst.common.frameworks@default:default,org.eclipse.wst.sse.ui@default:default,org.apache.commons.logging*1.0.4.v200904062259@default:default,org.eclipse.wst.internet.monitor.core@default:default,org.eclipse.update.ui@default:default,org.eclipse.text@default:default,org.sat4j.core@default:default,org.eclipse.jsch.ui@default:default,org.eclipse.wst.sse.doc.user@default:default,org.eclipse.compare.core@default:default,org.eclipse.core.runtime@default:true,org.eclipse.team.cvs.ssh2@default:default,java_cup.runtime@default:default,org.eclipse.equinox.common@2:true,org.eclipse.compare.win32@default:default,org.eclipse.ui.views.properties.tabbed@default:default,org.eclipse.wst.xml.core@default:default,org.eclipse.equinox.http.jetty@default:default,org.eclipse.wst.validation.ui@default:default,org.eclipse.ui.net@default:default,org.eclipse.wst.sse.core@default:default,org.eclipse.core.filebuffers@default:default,org.eclipse.wst.common.uriresolver@default:default,org.eclipse.ui.intro.universal@default:default,org.eclipse.equinox.launcher.win32.win32.x86@default:false,org.eclipse.ecf.provider.filetransfer.ssl@default:false,org.eclipse.core.filesystem.win32.x86@default:false,org.apache.lucene@default:default,org.eclipse.update.core@default:default,org.eclipse.ui.navigator.resources@default:default,org.eclipse.ecf@default:default,org.apache.xml.resolver@default:default,org.eclipse.jsch.core@default:default,org.eclipse.platform.doc.user@default:default,org.eclipse.ui.ide@default:default,org.eclipse.equinox.util@default:default,org.eclipse.wst.common.project.facet.core@default:default,org.eclipse.wst.common.emf@default:default,org.eclipse.team.cvs.core@default:default,org.eclipse.equinox.security.win32.x86@default:false,org.eclipse.ui.intro@default:default,org.eclipse.equinox.http.servlet@default:default,org.eclipse.wst.xml.xpath.core@default:default,org.eclipse.wst.html.ui@default:default,org.eclipse.core.commands@default:default,org.eclipse.ui.workbench.texteditor@default:default,org.eclipse.wst.css.core@default:default,org.apache.commons.codec*1.3.0.v20100518-1140@default:default,org.apache.log4j@default:default,org.apache.xalan@default:default,org.eclipse.debug.ui@default:default,org.mortbay.jetty.server@default:default,org.eclipse.wst.common.ui@default:default,org.eclipse.ui.ide.application@default:default,org.eclipse.equinox.frameworkadmin.equinox@default:default,org.eclipse.team.core@default:default,org.eclipse.core.filesystem@default:default,org.eclipse.wst.jsdt.web.core@default:default,org.eclipse.jface.text@default:default,org.eclipse.ecf.ssl@default:false,org.eclipse.wst.common.frameworks.ui@default:default,org.eclipse.wst.common.modulecore@default:default,org.eclipse.ecf.identity@default:default,org.eclipse.core.net@default:default,org.eclipse.ui.console@default:default,org.eclipse.wst.dtd.core@default:default,org.eclipse.wst.doc.user@default:default,org.eclipse.wst.html.ui.infopop@default:default,org.eclipse.core.boot@default:default,org.eclipse.wst.standard.schemas@default:default,org.eclipse.equinox.security@default:default,org.eclipse.wst.jsdt.manipulation@default:default,org.eclipse.core.resources.win32.x86@default:false,org.eclipse.help@default:default,org.eclipse.core.runtime.compatibility.auth@default:default,org.eclipse.wst.html.core@default:default,org.eclipse.wst.internet.cache@default:default,org.eclipse.equinox.p2.repository@default:default,com.jcraft.jsch@default:default,org.apache.commons.httpclient*3.1.0.v20080605-1935@default:default,org.eclipse.wst.common.snippets@default:default,org.eclipse.equinox.jsp.jasper.registry@default:default,org.eclipse.ui.views@default:default,org.apache.commons.collections@default:default,org.mozilla.xpcom@default:default,org.eclipse.core.resources@default:default,org.eclipse.core.databinding.property@default:default,org.eclipse.emf.edit.ui@default:default,org.eclipse.ui.workbench.compatibility@default:false,org.eclipse.wst.jsdt.doc@default:default,org.eclipse.rcp@default:default,javax.servlet.jsp@default:default,org.eclipse.search@default:default,org.eclipse.wst.sse.ui.infopop@default:default,org.eclipse.osgi.services@default:default,org.eclipse.ui.browser@default:default,org.eclipse.equinox.launcher@default:default,org.apache.commons.httpclient*3.1.0.v201005080502@default:default,com.ibm.icu@default:default,org.eclipse.update.core.win32@default:false,org.eclipse.jface.databinding@default:default,org.eclipse.compare@default:default,org.eclipse.swt@default:default,org.eclipse.core.net.win32.x86@default:false,org.eclipse.wst.xml.ui@default:default,org.eclipse.equinox.p2.metadata.generator@default:default,org.eclipse.wst.validation.infopop@default:default,org.eclipse.emf.common@default:default,org.eclipse.emf.ecore.change@default:default,org.apache.commons.lang@default:default,org.eclipse.equinox.simpleconfigurator@1:true,org.apache.bcel@default:default,org.eclipse.equinox.registry@default:default,org.eclipse.wst.common.infopop@default:default,org.eclipse.equinox.concurrent@default:default,org.apache.xml.serializer@default:default,org.eclipse.ui.workbench@default:default,org.eclipse.core.runtime.compatibility@default:default,org.mortbay.jetty.util@default:default,org.eclipse.wst.jsdt.core@default:default,org.eclipse.core.databinding.observable@default:default,org.eclipse.wst.jsdt.support.ie@default:default,org.eclipse.draw2d@default:default,org.eclipse.wst.jsdt.support.firefox@default:default,org.eclipse.wst.xml.xpath.ui@default:default,org.eclipse.equinox.p2.metadata@default:default,org.eclipse.equinox.preferences@default:default,org.eclipse.jem.util@default:default,org.eclipse.emf.common.ui@default:default,org.eclipse.ui.cheatsheets@default:default,org.eclipse.emf.ecore.edit@default:default,org.eclipse.wst.xml.xpath2.processor@default:default,org.eclipse.osgi.util@default:default,org.eclipse.ecf.provider.filetransfer@default:default,org.eclipse.equinox.http.registry@default:default,org.eclipse.help.ui@default:default,org.eclipse.ui.forms@default:default,org.eclipse.gef@default:default,org.eclipse.wst.internet.monitor.ui@default:default,org.mozilla.xulrunner@default:default,org.eclipse.core.runtime.compatibility.registry@default:false,org.eclipse.emf.edit@default:default,org.eclipse.wst.common.environment@default:default,org.eclipse.wst.xml.ui.infopop@default:default,org.eclipse.help.webapp@default:default,org.eclipse.equinox.p2.jarprocessor@default:default,org.eclipse.cvs@default:default,org.apache.jasper@default:default,org.eclipse.ui.win32@default:false,org.eclipse.wst.common.core@default:default,org.eclipse.ltk.ui.refactoring@default:default,org.eclipse.platform@default:default,org.sat4j.pb@default:default,org.eclipse.equinox.p2.engine@default:default,javax.servlet@default:default,org.eclipse.ui@default:default,org.eclipse.emf.ecore@default:default,org.eclipse.equinox.p2.artifact.repository@default:default,org.eclipse.update.configurator@3:true,org.eclipse.ecf.provider.filetransfer.httpclient@default:default,org.apache.commons.el@default:default,org.eclipse.equinox.p2.metadata.repository@default:default,org.eclipse.update.scheduler@default:default,org.eclipse.help.appserver@default:default,org.apache.commons.logging*1.0.4.v201005080501@default:default"/>
-<stringAttribute key="selected_workspace_plugins" value="org.symbian.tools.wrttools.debug.core@default:default,org.chromium.sdk@default:default,org.symbian.tools.wrttools.doc.WebDeveloper@default:default,org.symbian.tools.wrttools.doc.WRTKit@default:default,org.symbian.tools.wrttools.previewer@default:default,org.w3c.css@default:default,org.chromium.debug.core@default:default,org.symbian.tools.wrttools.product@default:default,org.symbian.tools.mtw.ui@default:default,org.chromium.debug.ui@default:default,org.symbian.tools.wrttools@default:default"/>
+<stringAttribute key="selected_workspace_plugins" value="org.symbian.tools.mtw.core@default:default,org.symbian.tools.wrttools.debug.core@default:default,org.chromium.sdk@default:default,org.symbian.tools.wrttools.doc.WebDeveloper@default:default,org.symbian.tools.wrttools.doc.WRTKit@default:default,org.symbian.tools.wrttools.previewer@default:default,org.w3c.css@default:default,org.chromium.debug.core@default:default,org.symbian.tools.wrttools.product@default:default,org.symbian.tools.mtw.ui@default:default,org.chromium.debug.ui@default:default,org.symbian.tools.wrttools@default:default"/>
 <booleanAttribute key="show_selected_only" value="false"/>
 <booleanAttribute key="tracing" value="true"/>
 <mapAttribute key="tracingOptions">
--- a/org.symbian.tools.wrttools.product/wrt-ide.product	Wed Jul 21 11:26:43 2010 -0700
+++ b/org.symbian.tools.wrttools.product/wrt-ide.product	Wed Jul 28 09:27:51 2010 -0700
@@ -278,6 +278,7 @@
       <plugin id="org.mozilla.xulrunner.win32.win32.x86" fragment="true"/>
       <plugin id="org.sat4j.core"/>
       <plugin id="org.sat4j.pb"/>
+      <plugin id="org.symbian.tools.mtw.core"/>
       <plugin id="org.symbian.tools.mtw.ui"/>
       <plugin id="org.symbian.tools.wrttools"/>
       <plugin id="org.symbian.tools.wrttools.debug.core"/>
--- a/org.symbian.tools.wrttools/.classpath	Wed Jul 21 11:26:43 2010 -0700
+++ b/org.symbian.tools.wrttools/.classpath	Wed Jul 28 09:27:51 2010 -0700
@@ -4,6 +4,5 @@
 	<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
 	<classpathentry kind="src" path="src"/>
 	<classpathentry exported="true" kind="lib" path="lib/jtidy-8.0-20060801.131059-3.jar"/>
-	<classpathentry exported="true" kind="lib" path="lib/org.bluecove_2.1.1.jar"/>
 	<classpathentry kind="output" path="bin"/>
 </classpath>
--- a/org.symbian.tools.wrttools/META-INF/MANIFEST.MF	Wed Jul 21 11:26:43 2010 -0700
+++ b/org.symbian.tools.wrttools/META-INF/MANIFEST.MF	Wed Jul 28 09:27:51 2010 -0700
@@ -8,7 +8,6 @@
 Require-Bundle: org.eclipse.ui,
  org.eclipse.core.runtime,
  org.eclipse.core.resources,
- org.eclipse.emf.ecore,
  org.eclipse.core.databinding;bundle-version="1.2.0",
  org.eclipse.core.databinding.beans;bundle-version="1.2.0",
  org.eclipse.core.databinding.property;bundle-version="1.2.0",
@@ -20,8 +19,6 @@
  org.eclipse.wst.validation;bundle-version="1.2.102",
  org.eclipse.wst.sse.core;bundle-version="1.1.400",
  org.eclipse.wst.xml.core;bundle-version="1.1.400",
- 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.wst.xml.ui;bundle-version="1.1.2",
@@ -29,7 +26,8 @@
  org.eclipse.ui.editors,
  org.eclipse.wst.common.snippets,
  org.eclipse.jface.text;bundle-version="3.6.0",
- org.eclipse.wst.jsdt.web.core;bundle-version="1.0.300"
+ org.eclipse.wst.jsdt.web.core;bundle-version="1.0.300",
+ org.symbian.tools.mtw.core;bundle-version="1.0.0"
 Bundle-RequiredExecutionEnvironment: J2SE-1.5,
  JavaSE-1.6
 Bundle-ActivationPolicy: lazy
@@ -55,5 +53,4 @@
  org.symbian.tools.wrttools.util,
  org.symbian.tools.wrttools.wizards
 Bundle-ClassPath: .,
- lib/jtidy-8.0-20060801.131059-3.jar,
- lib/org.bluecove_2.1.1.jar
+ lib/jtidy-8.0-20060801.131059-3.jar
Binary file org.symbian.tools.wrttools/icons/bluetooth.gif has changed
Binary file org.symbian.tools.wrttools/lib/org.bluecove_2.1.1.jar has changed
--- a/org.symbian.tools.wrttools/plugin.xml	Wed Jul 21 11:26:43 2010 -0700
+++ b/org.symbian.tools.wrttools/plugin.xml	Wed Jul 28 09:27:51 2010 -0700
@@ -315,12 +315,6 @@
     </command>
     <command
           categoryId="org.symbian.tools.wrttools.commands.maincategory"
-          description="Packages an application for distribution or deployment"
-          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 Mobile Web projects"
           id="org.symbian.tools.wrttools.addlibrary"
@@ -338,11 +332,6 @@
                 icon="icons/deploy_widget.gif"
                 id="org.symbian.tools.wrttools.toolbars.deploy">
           </command>
-          <command
-                commandId="org.symbian.tools.wrttools.commands.package"
-                icon="icons/package_widget.gif"
-                id="org.symbian.tools.wrttools.toolbars.package">
-          </command>
        </toolbar>
     </menuContribution>
     <menuContribution
@@ -365,11 +354,6 @@
              icon="icons/deploy_widget.gif"
              id="org.symbian.tools.wrttools.toolbars.deploy">
        </command>
-       <command
-             commandId="org.symbian.tools.wrttools.commands.package"
-             icon="icons/package_widget.gif"
-             id="org.symbian.tools.wrttools.toolbars.package">
-       </command>
        <separator
              name="org.symbian.tools.wrttools.endwrt"
              visible="true">
@@ -400,25 +384,6 @@
              </and>
           </visibleWhen>
        </command>
-       <command
-             commandId="org.symbian.tools.wrttools.commands.package"
-             icon="icons/package_widget.gif"
-             id="org.symbian.tools.wrttools.toolbars.package">
-          <visibleWhen>
-             <and>
-                <iterate
-                      ifEmpty="false"
-                      operator="and">
-                   <adapt
-                         type="org.eclipse.core.resources.IProject">
-                   </adapt>
-                </iterate>
-                <count
-                      value="1">
-                </count>
-             </and>
-          </visibleWhen>
-       </command>
        <separator
              name="org.symbian.tools.wrttools.endwrt"
              visible="true">
@@ -455,27 +420,6 @@
     </menuContribution>
  </extension>
  <extension
-       point="org.eclipse.ui.handlers">
-    <handler
-          class="org.symbian.tools.wrttools.handlers.DeployHandler"
-          commandId="org.symbian.tools.wrttools.commands.deploy">
-       <enabledWhen>
-          <reference
-                definitionId="org.symbian.tools.wrttools.symbianproject">
-          </reference>
-       </enabledWhen>
-    </handler>
-    <handler
-          class="org.symbian.tools.wrttools.handlers.PackageApplicationHandler"
-          commandId="org.symbian.tools.wrttools.commands.package">
-       <enabledWhen>
-          <reference
-                definitionId="org.symbian.tools.wrttools.symbianproject">
-          </reference>
-       </enabledWhen>
-    </handler>
- </extension>
- <extension
        point="org.eclipse.core.expressions.definitions">
     <definition
           id="org.symbian.tools.wrttools.symbianproject">
@@ -852,5 +796,35 @@
           </content>
        </item>
     </category>
- </extension>
+ </extension>
+ <extension
+       point="org.symbian.tools.mtw.core.projectProvider">
+    <projectProvider
+          class="org.symbian.tools.wrttools.core.project.WRTIDEProjectProvider">
+       <enablement>
+          <adapt
+                type="org.eclipse.core.resources.IProject">
+             <test
+                   property="org.eclipse.core.resources.projectNature"
+                   value="org.symbian.tools.wrttools.WidgetProjectNature">
+             </test>
+          </adapt>
+       </enablement>
+    </projectProvider>
+ </extension>
+   <extension
+        point="org.symbian.tools.mtw.core.runtimes">
+     <runtime
+           id="org.symbian.wrt11"
+           name="Symbian WRT 1.1">
+     </runtime>
+  </extension>
+   <extension
+         point="org.symbian.tools.mtw.core.packagers">
+      <packager
+            class="org.symbian.tools.wrttools.core.packager.WrtPackager"
+            targetRuntime="org.symbian.wrt11">
+      </packager>
+   </extension>
+ 
 </plugin>
--- a/org.symbian.tools.wrttools/src/org/symbian/tools/wrttools/Activator.java	Wed Jul 21 11:26:43 2010 -0700
+++ b/org.symbian.tools.wrttools/src/org/symbian/tools/wrttools/Activator.java	Wed Jul 28 09:27:51 2010 -0700
@@ -18,7 +18,6 @@
  */
 package org.symbian.tools.wrttools;
 
-import java.io.PrintStream;
 import java.util.Collection;
 import java.util.Comparator;
 import java.util.TreeSet;
@@ -37,8 +36,6 @@
 import org.symbian.tools.wrttools.sdt.utils.Logging;
 import org.symbian.tools.wrttools.util.ProjectUtils;
 
-import com.intel.bluetooth.BlueCoveImpl;
-
 /**
  * The activator class controls the plug-in life cycle
  */
@@ -50,8 +47,6 @@
 	// The shared instance
 	private static Activator plugin;
 	
-	private static PrintStream savedSysOut;
-	
     private final LibraryManager manager = new LibraryManager();
 
 	/**
@@ -68,10 +63,6 @@
 		super.start(context);
 		plugin = this;
 		
-		// set parameters for BlueCove
-		String param = Integer.toString(65*1024);
-		System.setProperty("bluecove.obex.mtu", param);
-		BlueCoveImpl.setConfigProperty("bluecove.obex.mtu", param);
         JsIndexManager.getInstance();
 	}
 
@@ -88,18 +79,7 @@
     protected void initializeImageRegistry(ImageRegistry reg) {
         WRTImages.init(reg);
     }
-	
-	/** Toggle BlueCove logging
-	 */
-	public static void enableBlueCoveDiagnostics(boolean enable) {
-		System.setProperty("bluecove.debug", Boolean.valueOf(enable).toString());
-		BlueCoveImpl.instance().enableNativeDebug(enable);
-		if (enable) {
-			System.setOut(new PrintStream(ConsoleFactory.createStream()));
-		} else {
-			System.setOut(savedSysOut);
-		}
-	}
+
 
 
 	/**
--- a/org.symbian.tools.wrttools/src/org/symbian/tools/wrttools/ConsoleFactory.java	Wed Jul 21 11:26:43 2010 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,56 +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;
-
-import org.eclipse.ui.console.ConsolePlugin;
-import org.eclipse.ui.console.IConsole;
-import org.eclipse.ui.console.IConsoleFactory;
-import org.eclipse.ui.console.IConsoleManager;
-import org.eclipse.ui.console.MessageConsole;
-import org.eclipse.ui.console.MessageConsoleStream;
-
-public class ConsoleFactory implements IConsoleFactory {
-	
-	private static MessageConsole console;
-
-	public void openConsole() {
-		getConsole();
-		console.activate();
-	}
-	
-	public static MessageConsoleStream createStream() {
-		getConsole();
-		return console.newMessageStream();
-	}
-	
-	public static void activateConsole() {
-		getConsole();
-		console.activate();
-	}
-	
-	private synchronized static MessageConsole getConsole() {
-		if (console == null) {
-			console = new MessageConsole("Mobile Web Console", null, true);
-			IConsoleManager consoleManager = ConsolePlugin.getDefault().getConsoleManager();
-			consoleManager.addConsoles(new IConsole[]{console});
-		}
-		return console;
-	}
-
-}
--- a/org.symbian.tools.wrttools/src/org/symbian/tools/wrttools/WRTProject.java	Wed Jul 21 11:26:43 2010 -0700
+++ b/org.symbian.tools.wrttools/src/org/symbian/tools/wrttools/WRTProject.java	Wed Jul 28 09:27:51 2010 -0700
@@ -26,26 +26,64 @@
 import java.util.Properties;
 
 import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IMarker;
 import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.IncrementalProjectBuilder;
 import org.eclipse.core.runtime.CoreException;
 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.jface.preference.IPreferenceStore;
+import org.symbian.tools.mtw.core.MTWCore;
+import org.symbian.tools.mtw.core.projects.IMTWProject;
+import org.symbian.tools.mtw.core.runtimes.IMobileWebRuntime;
 import org.symbian.tools.wrttools.wizards.deploy.DeploymentTarget;
-import org.symbian.tools.wrttools.wizards.deploy.DeploymentTargetRegistry;
 
-public class WRTProject {
-    private static final IPath PROPERTIES_FILE = new Path(".settings").append(Activator.PLUGIN_ID + ".properties");
+public class WRTProject implements IMTWProject {
     private static final String PROP_DEPLOYMENT_TARGET_NAME = "deployment.target.name";
+
     private static final String PROP_DEPLOYMENT_TARGET_TYPE = "deployment.target.type";
     private static final String PROP_PREFERED_SCREEN = "preferred.screen.size";
+    private static final IPath PROPERTIES_FILE = new Path(".settings").append(Activator.PLUGIN_ID + ".properties");
+    public static final String WRT11_RUNTIME = "org.symbian.wrt11";
     private final IProject project;
 
     public WRTProject(IProject project) {
         this.project = project;
     }
 
+    public String getName() {
+        return getProject().getName();
+    }
+
+    public String getPreferredScreenSize() {
+        return getProps().getProperty(PROP_PREFERED_SCREEN);
+    }
+
+    //    public DeploymentTarget getDeploymentTarget() {
+    //        Properties props = getProps();
+    //        String property = props.getProperty(PROP_DEPLOYMENT_TARGET_NAME);
+    //        if (property != null) {
+    //            return DeploymentTargetRegistry.getRegistry().findTarget(property,
+    //                    props.getProperty(PROP_DEPLOYMENT_TARGET_TYPE));
+    //        } else {
+    //            IPreferenceStore store = Activator.getDefault().getPreferenceStore();
+    //            String name = store.getString(PROP_DEPLOYMENT_TARGET_NAME);
+    //            if (name != null) {
+    //                return DeploymentTargetRegistry.getRegistry().findTarget(name,
+    //                        store.getString(PROP_DEPLOYMENT_TARGET_TYPE));
+    //            }
+    //
+    //        }
+    //        return null;
+    //    }
+
+    public IProject getProject() {
+        return project;
+    }
+
     private Properties getProps() {
         Properties props = new Properties();
         IFile file = project.getFile(PROPERTIES_FILE);
@@ -68,32 +106,8 @@
         return props;
     }
 
-    public void setDeploymentTarget(DeploymentTarget target) {
-        Properties props = getProps();
-        props.setProperty(PROP_DEPLOYMENT_TARGET_NAME, target.getName());
-        props.setProperty(PROP_DEPLOYMENT_TARGET_TYPE, target.getType());
-        IPreferenceStore store = Activator.getDefault().getPreferenceStore();
-        store.setValue(PROP_DEPLOYMENT_TARGET_NAME, target.getName());
-        store.setValue(PROP_DEPLOYMENT_TARGET_TYPE, target.getType());
-        saveProperties(props);
-    }
-
-    public DeploymentTarget getDeploymentTarget() {
-        Properties props = getProps();
-        String property = props.getProperty(PROP_DEPLOYMENT_TARGET_NAME);
-        if (property != null) {
-            return DeploymentTargetRegistry.getRegistry().findTarget(property,
-                    props.getProperty(PROP_DEPLOYMENT_TARGET_TYPE));
-        } else {
-            IPreferenceStore store = Activator.getDefault().getPreferenceStore();
-            String name = store.getString(PROP_DEPLOYMENT_TARGET_NAME);
-            if (name != null) {
-                return DeploymentTargetRegistry.getRegistry().findTarget(name,
-                        store.getString(PROP_DEPLOYMENT_TARGET_TYPE));
-            }
-
-        }
-        return null;
+    public IMobileWebRuntime getTargetRuntime() {
+        return MTWCore.getDefault().getRuntimesManager().getRuntime(WRT11_RUNTIME);
     }
 
     private void saveProperties(Properties props) {
@@ -113,8 +127,14 @@
         }
     }
 
-    public IProject getProject() {
-        return project;
+    public void setDeploymentTarget(DeploymentTarget target) {
+        Properties props = getProps();
+        props.setProperty(PROP_DEPLOYMENT_TARGET_NAME, target.getName());
+        props.setProperty(PROP_DEPLOYMENT_TARGET_TYPE, target.getType());
+        IPreferenceStore store = Activator.getDefault().getPreferenceStore();
+        store.setValue(PROP_DEPLOYMENT_TARGET_NAME, target.getName());
+        store.setValue(PROP_DEPLOYMENT_TARGET_TYPE, target.getType());
+        saveProperties(props);
     }
 
     public void setPreferredScreenSize(String screenSize) {
@@ -127,7 +147,23 @@
         saveProperties(props);
     }
 
-    public String getPreferredScreenSize() {
-        return getProps().getProperty(PROP_PREFERED_SCREEN);
+    public boolean validate(IProgressMonitor monitor) {
+        try {
+            project.build(IncrementalProjectBuilder.FULL_BUILD, monitor);
+            IMarker[] markers = project.findMarkers(IMarker.PROBLEM, true, IResource.DEPTH_INFINITE);
+
+            boolean hasErrors = false;
+            for (IMarker marker : markers) {
+                if (marker.getAttribute(IMarker.SEVERITY, IMarker.SEVERITY_INFO) == IMarker.SEVERITY_ERROR) {
+                    hasErrors = true;
+                    break;
+                }
+            }
+            return !hasErrors;
+        } catch (CoreException e1) {
+            // Proofing from coding exceptions in JSDT
+            Activator.log(e1);
+        }
+        return false;
     }
 }
--- a/org.symbian.tools.wrttools/src/org/symbian/tools/wrttools/WRTStatusListener.java	Wed Jul 21 11:26:43 2010 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,69 +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;
-
-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 final MessageConsoleStream consoleStream;
-	private final boolean activateOnFirstStatus = true;
-	private int statusCount;
-
-	public WRTStatusListener() {
-		consoleStream = ConsoleFactory.createStream();
-	}
-	
-	public void close() {
-		try {
-			consoleStream.close();
-		} catch (IOException x) {
-			Activator.log(IStatus.ERROR, "Error closing console stream", x);
-		}
-	}
-
-	public void emitStatus(WRTStatus status) {		
-		Object description = status.getStatusDescription();
-		if (description != null) {
-			++statusCount;
-			if (activateOnFirstStatus && statusCount == 1) {
-				ConsoleFactory.activateConsole();
-			}
-
-			consoleStream.println(description.toString());
-		}
-	}
-
-	public boolean isStatusHandled(WRTStatus status) {
-		return true;
-	}
-
-    public boolean canPackageWithErrors(IProject project) {
-        return ProjectUtils.canPackageWithErrors(project);
-    }
-
-}
--- a/org.symbian.tools.wrttools/src/org/symbian/tools/wrttools/core/WRTImages.java	Wed Jul 21 11:26:43 2010 -0700
+++ b/org.symbian.tools.wrttools/src/org/symbian/tools/wrttools/core/WRTImages.java	Wed Jul 28 09:27:51 2010 -0700
@@ -28,7 +28,7 @@
     private static final String IMAGE_IMPORT_WGZ_BANNER = "import_w_banner.png";
     private static final String IMAGE_NEW_WIZARD_BANNER = "WRT_wizard_banner.png";
     private static final String IMAGE_EMULATOR = "deploy_widget.gif";
-    private static final String IMAGE_BLUETOOTH = "bluetooth.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";
 
@@ -37,7 +37,7 @@
         add(reg, IMAGE_IMPORT_WGZ_BANNER);
         add(reg, IMAGE_NEW_WIZARD_BANNER);
         add(reg, IMAGE_EMULATOR);
-        add(reg, IMAGE_BLUETOOTH);
+        //        add(reg, IMAGE_BLUETOOTH);
         add(reg, IMAGE_EXCLUDED);
         add(reg, IMAGE_WRTKIT);
     }
@@ -62,9 +62,9 @@
         return Activator.getDefault().getImageRegistry().get(IMAGE_EMULATOR);
     }
 
-    public static Image getBluetoothImage() {
-        return Activator.getDefault().getImageRegistry().get(IMAGE_BLUETOOTH);
-    }
+    //    public static Image getBluetoothImage() {
+    //        return Activator.getDefault().getImageRegistry().get(IMAGE_BLUETOOTH);
+    //    }
 
     public static Image getExcludedImage() {
         return Activator.getDefault().getImageRegistry().get(IMAGE_EXCLUDED);
--- a/org.symbian.tools.wrttools/src/org/symbian/tools/wrttools/core/deploy/BluetoothRule.java	Wed Jul 21 11:26:43 2010 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,38 +0,0 @@
-/**
- * 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.deploy;
-
-import org.eclipse.core.runtime.jobs.ISchedulingRule;
-
-public class BluetoothRule implements ISchedulingRule {
-    public static final ISchedulingRule INSTANCE = new BluetoothRule();
-
-    private BluetoothRule() {
-        // No instantiation
-    }
-
-    public boolean contains(ISchedulingRule rule) {
-        return isConflicting(rule);
-    }
-
-    public boolean isConflicting(ISchedulingRule rule) {
-        return rule instanceof BluetoothRule;
-    }
-
-}
--- a/org.symbian.tools.wrttools/src/org/symbian/tools/wrttools/core/deploy/WrtDeploymentSettingsActionDelegate.java	Wed Jul 21 11:26:43 2010 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,37 +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.core.deploy;
-
-import org.eclipse.jface.action.IAction;
-import org.eclipse.ui.IObjectActionDelegate;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.actions.ActionDelegate;
-import org.eclipse.ui.dialogs.PreferencesUtil;
-
-public class WrtDeploymentSettingsActionDelegate extends ActionDelegate
-													implements IObjectActionDelegate {
-
-	public void run(IAction action) {
-		PreferencesUtil.createPreferenceDialogOn(null, PreferenceConstants.DEPLOYMENT_SETTINGE_PAGE, null, null).open();
-	}
-
-	public void setActivePart(IAction arg0, IWorkbenchPart arg1) {
-	}
-}
--- a/org.symbian.tools.wrttools/src/org/symbian/tools/wrttools/core/deploy/device/BluetoothDeploymentJob.java	Wed Jul 21 11:26:43 2010 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,233 +0,0 @@
-/**
- * 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.deploy.device;
-
-import java.io.EOFException;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.text.MessageFormat;
-import java.util.Collection;
-import java.util.LinkedList;
-
-import javax.bluetooth.BluetoothConnectionException;
-import javax.microedition.io.Connector;
-import javax.obex.ClientSession;
-import javax.obex.HeaderSet;
-import javax.obex.Operation;
-import javax.obex.ResponseCodes;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.MultiStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.core.runtime.jobs.Job;
-import org.eclipse.ui.statushandlers.StatusManager;
-import org.symbian.tools.wrttools.Activator;
-import org.symbian.tools.wrttools.core.deploy.BluetoothRule;
-import org.symbian.tools.wrttools.core.deployer.DeployerMessages;
-import org.symbian.tools.wrttools.core.deployer.IWidgetDeployerConstants;
-
-public class BluetoothDeploymentJob extends Job {
-    protected String[] exceptionCodes = new String[] { "OBEX_HTTP_UNSUPPORTED_TYPE", "OBEX_HTTP_FORBIDDEN" }; //$NON-NLS-1$ //$NON-NLS-2$
-
-    private final Collection<IStatus> statuses = new LinkedList<IStatus>();
-    private String message = "Deployment was successful. Please follow on-screen instructions to complete application deployment on your device.";
-    private final File inputWidget;
-    private final String device;
-
-    public BluetoothDeploymentJob(final File inputWidget, final String device) {
-        super(String.format("Deploy %s to %s", inputWidget.getName(), device));
-        this.device = device;
-        this.inputWidget = inputWidget;
-        setRule(BluetoothRule.INSTANCE);
-        setUser(true);
-    }
-
-    @Override
-    protected IStatus run(IProgressMonitor monitor) {
-        deployWidget(inputWidget, device, monitor);
-        MultiStatus multiStatus = new MultiStatus(Activator.PLUGIN_ID, 0, statuses.toArray(new IStatus[0]), message, null);
-        if (multiStatus.getSeverity() != IStatus.ERROR && multiStatus.getSeverity() != IStatus.WARNING) {
-            StatusManager.getManager().handle(multiStatus, StatusManager.SHOW);
-        }
-        return multiStatus;
-    }
-
-    /**
-     * Deploys the widget using the bluetooth.
-     * 
-     * @param inputWidget
-     *            the input widget which has to be deployed.
-     * @param device
-     *            the device to which the widget is deployed
-     * @param progressMonitor 
-     * @throws Exception
-     *             if the exception is throws
-     */
-    private void deployWidget(File inputWidget, String device, IProgressMonitor progressMonitor) {
-        progressMonitor.beginTask("Deploying application", IProgressMonitor.UNKNOWN);
-        InputStream in = null;
-        OutputStream os = null;
-        Operation putOperation = null;
-        ClientSession clientSession = null;
-        try {
-            if (!DeviceListProvider.isBloothToothConnected()) {
-                String msg = DeployerMessages.getString("Deployer.bluetooth.notconnected.msg");
-                emitStatus(IStatus.ERROR, msg, progressMonitor);
-                return;
-            }
-
-            String message = MessageFormat.format(
-                    DeployerMessages.getString("Deployer.searchservice.msg"), new Object[] { device });//$NON-NLS-1$
-            emitStatus(IStatus.OK, message, progressMonitor);
-            String servicesFound = ServicesProvider.getServicesFound(device);
-            if (servicesFound == null || servicesFound.length() < 1) {
-                message = MessageFormat.format(
-                        DeployerMessages.getString("Deployer.servicenotfound.err.msg"), new Object[] { device });//$NON-NLS-1$
-                emitStatus(IStatus.ERROR, message, progressMonitor);
-                return;
-            }
-
-            message = MessageFormat.format(
-                    DeployerMessages.getString("Deployer.servicefound.msg"), new Object[] { device });//$NON-NLS-1$
-            emitStatus(IStatus.OK, message, progressMonitor);
-
-            clientSession = (ClientSession) Connector.open(servicesFound);
-            HeaderSet hsConnectReply = clientSession.connect(null);
-            if (hsConnectReply.getResponseCode() != ResponseCodes.OBEX_HTTP_OK) {
-                emitStatus(IStatus.OK, DeployerMessages.getString("Deployer.services.connect.err.msg"), progressMonitor);//$NON-NLS-1$
-            }
-
-            emitStatus(IStatus.OK, DeployerMessages.getString("Deployer.begin.msg"), progressMonitor);
-
-            HeaderSet hsOperation = clientSession.createHeaderSet();
-
-            if (progressMonitor.isCanceled()) {
-                emitStatus(IStatus.CANCEL, "Deployment was canceled", progressMonitor);
-                return;
-            }
-
-            // Send widget to server
-            in = new FileInputStream(inputWidget);
-            message = MessageFormat
-                    .format(DeployerMessages.getString("Deployer.inputfile.msg"), new Object[] { inputWidget.getAbsolutePath() });//$NON-NLS-1$
-            emitStatus(IStatus.OK, message, progressMonitor);
-
-            hsOperation.setHeader(HeaderSet.NAME, inputWidget.getName());
-            hsOperation.setHeader(HeaderSet.TYPE, IWidgetDeployerConstants.WIDGET_FILE_TYPE);
-            int size = (int) inputWidget.length();
-            byte file[] = new byte[size];
-            hsOperation.setHeader(HeaderSet.LENGTH, new Long(file.length));
-
-            // Create PUT Operation
-            putOperation = clientSession.put(hsOperation);
-
-            os = putOperation.openOutputStream();
-
-            long start = System.currentTimeMillis();
-
-            byte[] buf = new byte[16 * 1024];
-            int len;
-            while ((len = in.read(buf)) > 0) {
-                os.write(buf, 0, len);
-                if (progressMonitor.isCanceled()) {
-                    putOperation.abort();
-                    emitStatus(IStatus.CANCEL, "Deployment was canceled", progressMonitor);
-                    return;
-                }
-            }
-
-            os.flush();
-            os.close();
-
-            long elapsed = System.currentTimeMillis() - start;
-            emitStatus(IStatus.OK, "elapsed time: " + elapsed / 1000.0 + " seconds", progressMonitor);
-
-            int responseCode = putOperation.getResponseCode();
-            if (responseCode == ResponseCodes.OBEX_HTTP_OK) {
-                message = MessageFormat.format(
-                        DeployerMessages.getString("Deployer.outputfile.msg"), new Object[] { device });//$NON-NLS-1$
-                emitStatus(IStatus.OK, message, progressMonitor);
-            } else {
-                message = "Error during deployment, OBEX error: " + responseCode;
-                emitStatus(IStatus.ERROR, message, progressMonitor);
-            }
-
-        } catch (BluetoothConnectionException x) {
-            String message = getExceptionMessage(x.getMessage());
-            emitStatus(IStatus.ERROR, message, progressMonitor);
-        } catch (IOException e) {
-            String message = getExceptionMessage(e.getMessage());
-            emitStatus(IStatus.ERROR, message, progressMonitor);
-        } finally {
-            try {
-                if (in != null) {
-                    in.close();
-                }
-                if (putOperation != null) {
-                    putOperation.close();
-                }
-                if (clientSession != null) {
-                    clientSession.disconnect(null);
-                    clientSession.close();
-                }
-            } catch (EOFException eof) {
-                // EOFException is now caught 
-                // Ignore the error since deployment has already completed
-                //Activator.log(IStatus.ERROR, "EOF encountered while cleaning up Bluetooth deployment", eof);
-            } catch (IOException x) {
-                Activator.log(IStatus.ERROR, "Error cleaning up BlueTooth deployment", x);
-            }
-        }
-        return;
-    }
-
-    /**
-     * Creates the status specific to the widget deployer
-     * @param statusDescription the description of the status
-     * @param monitor TODO
-     * @return the WRTStatus created
-     */
-    protected void emitStatus(int severity, String statusDescription, IProgressMonitor monitor) {
-        statuses.add(new Status(severity, Activator.PLUGIN_ID, statusDescription));
-        monitor.setTaskName(statusDescription);
-        if (severity != IStatus.OK) {
-            message = statusDescription;
-        }
-    }
-
-    /**
-     * Returns the customized methods from the exception error code. If it
-     * matches it returns the customized message else returns the exception itself
-     * @param message exception message
-     * @return the customized message
-     */
-    protected String getExceptionMessage(String message) {
-
-        if (message.contains(exceptionCodes[0])) {
-            return DeployerMessages.getString("Deployer.device.notsupport.err.msg"); //$NON-NLS-1$
-        } else if (message.contains(exceptionCodes[1])) {
-            return DeployerMessages.getString("Deployer.device.rejected.err.msg"); //$NON-NLS-1$
-        }
-        return message;
-    }
-}
--- a/org.symbian.tools.wrttools/src/org/symbian/tools/wrttools/core/deploy/device/DeployDeviceInfo.java	Wed Jul 21 11:26:43 2010 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,57 +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.core.deploy.device;
-
-import org.symbian.tools.wrttools.sdt.utils.Check;
-
-/**
- * Holds the information about the Device to be used for the deployment
- * through bluetooth
- * @author avraina
- *
- */
-public class DeployDeviceInfo {
-
-	private String deviceName;
-	private String deviceBlueToothAddress;
-	
-	public DeployDeviceInfo(String deviceName, String deviceBlueToothAddress) {
-		Check.checkArg(deviceName);
-		Check.checkArg(deviceBlueToothAddress);
-		this.deviceName = deviceName;
-		this.deviceBlueToothAddress = deviceBlueToothAddress;
-	}	
-	
-	/**
-	 * Returns the device name.
-	 * @return the address
-	 */
-	public String getDeviceName() {
-		return deviceName;
-	}
-
-	/**
-	 * Returns the bluetooth address of the device
-	 * @return the address
-	 */
-	public String getDeviceBlueToothAddress() {
-		return deviceBlueToothAddress;
-	}
-}
--- a/org.symbian.tools.wrttools/src/org/symbian/tools/wrttools/core/deploy/device/DeviceDeployer.java	Wed Jul 21 11:26:43 2010 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,54 +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.core.deploy.device;
-
-import java.io.File;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.symbian.tools.wrttools.core.deployer.WidgetDeployer;
-import org.symbian.tools.wrttools.core.status.IWRTConstants;
-
-/**
- * The class needed for the deployment of the widget to device using bluetooth.
- * 
- * @author avraina
- */
-public class DeviceDeployer extends WidgetDeployer {
-
-	public IStatus deploy(String fileName, String device, IProgressMonitor progressMonitor) {
-		File inputFile = new File(fileName);
-        // If the archive is directly deployed than directly deploy it
-		// else deploy from the folder path.
-		if (fileName.toLowerCase()
-				.endsWith(IWRTConstants.WIDGET_FILE_EXTENSION)) {
-            new BluetoothDeploymentJob(inputFile, device).schedule();
-		}
-        emitStatus("Background deployment job started");//$NON-NLS-1$
-        return Status.OK_STATUS;
-	}
-
-
-    @Override
-    public boolean needsReport() {
-        return false;
-    }
-}
--- a/org.symbian.tools.wrttools/src/org/symbian/tools/wrttools/core/deploy/device/DeviceListProvider.java	Wed Jul 21 11:26:43 2010 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,188 +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.core.deploy.device;
-
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.bluetooth.BluetoothStateException;
-import javax.bluetooth.DeviceClass;
-import javax.bluetooth.DiscoveryAgent;
-import javax.bluetooth.DiscoveryListener;
-import javax.bluetooth.LocalDevice;
-import javax.bluetooth.RemoteDevice;
-import javax.bluetooth.ServiceRecord;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.NullProgressMonitor;
-
-import org.symbian.tools.wrttools.Activator;
-
-public class DeviceListProvider {
-
-	private static final List<DeployDeviceInfo> deviceInfo = new ArrayList<DeployDeviceInfo>();
-
-	private static WrtDiscoveryListener listener;
-
-	/**
-	 * Check whether the bluetooth is on or not.
-	 * 
-	 * @return whether the device is on.
-	 */
-	public static boolean isBloothToothConnected() {
-		return LocalDevice.isPowerOn();
-	}
-
-	public static String getDeviceAddress(String deviceName,
-			boolean allowDiscovery) {
-		String result = null;
-		for (DeployDeviceInfo deployDeviceInfo : deviceInfo) {
-			if (deployDeviceInfo.getDeviceName().equals(deviceName)) {
-				result = deployDeviceInfo.getDeviceBlueToothAddress();
-			}
-		}
-		if (result == null && allowDiscovery) {
-			discoverDevices(new NullProgressMonitor(), deviceName);
-			for (DeployDeviceInfo deployDeviceInfo : deviceInfo) {
-				if (deployDeviceInfo.getDeviceName().equals(deviceName)) {
-					result = deployDeviceInfo.getDeviceBlueToothAddress();
-				}
-			}
-		}
-		return result;
-	}
-
-	public static List<DeployDeviceInfo> getDevices(
-			IProgressMonitor progressMonitor) {
-		discoverDevices(progressMonitor, null);
-		return new ArrayList<DeployDeviceInfo>(deviceInfo);
-	}
-
-	/**
-	 * Discover devices. Finds all devices if desiredDevice is null. If non-null
-	 * search stops when the desired device is found.
-	 */
-	private static void discoverDevices(final IProgressMonitor progressMonitor,
-			final String desiredDevice) {
-
-		final Object inquiryCompletedEvent = new Object();
-		deviceInfo.clear();
-
-		listener = new WrtDiscoveryListener(desiredDevice,
-				inquiryCompletedEvent, progressMonitor);
-
-		synchronized (inquiryCompletedEvent) {
-			boolean started;
-			try {
-				started = LocalDevice.getLocalDevice().getDiscoveryAgent()
-						.startInquiry(DiscoveryAgent.GIAC, listener);
-				if (started) {
-					inquiryCompletedEvent.wait();
-				}
-			} catch (BluetoothStateException e) {
-				Activator.log(IStatus.ERROR, e.getMessage(), e);
-			} catch (InterruptedException e) {
-				Activator.log(IStatus.ERROR, e.getMessage(), e);
-			}
-		}
-	}
-
-	public static boolean isCanceled() {
-		return listener != null && listener.isCanceled;
-	}
-
-	public static void cancelSearch() {
-		if (listener != null) {
-			try {
-				listener.isCanceled = true;
-				if (listener.progressMonitor != null &&
-					!listener.progressMonitor.isCanceled()) {
-						listener.progressMonitor.setCanceled(true);
-				}
-				LocalDevice.getLocalDevice().getDiscoveryAgent().cancelInquiry(
-						listener);
-			} catch (BluetoothStateException e) {
-				Activator.log(IStatus.ERROR, e.getMessage(), e);
-			}
-		}
-	}
-
-	private static final class WrtDiscoveryListener implements
-			DiscoveryListener {
-		final String desiredDevice;
-		final Object inquiryCompletedEvent;
-		final IProgressMonitor progressMonitor;
-		boolean isCanceled;
-
-		private WrtDiscoveryListener(String desiredDevice,
-				Object inquiryCompletedEvent,
-				IProgressMonitor progressMonitor) {
-			this.desiredDevice = desiredDevice;
-			this.inquiryCompletedEvent = inquiryCompletedEvent;
-			this.progressMonitor = progressMonitor;
-		}
-
-		public void deviceDiscovered(RemoteDevice btDevice, DeviceClass cod) {
-			try {
-				if (btDevice.getFriendlyName(false) != null
-						&& btDevice.getFriendlyName(false).length() > 0) {
-					DeployDeviceInfo deployDeviceInfo = new DeployDeviceInfo(
-							btDevice.getFriendlyName(false), btDevice
-							.getBluetoothAddress());
-					deviceInfo.add(deployDeviceInfo);
-					//System.out.println("Friendly name  :  "+ (btDevice.getFriendlyName(false)));
-					// System.out.println("----device size   :"+deviceInfo.
-					// size());
-					if (desiredDevice != null
-							&& desiredDevice.equals(deployDeviceInfo
-									.getDeviceName())) {
-						cancelSearch();
-					}
-					checkCanceled();
-				}
-			} catch (BluetoothStateException e) {
-				Activator.log(IStatus.ERROR, e.getMessage(), e);
-			} catch (IOException e) {
-				Activator.log(IStatus.ERROR, e.getMessage(), e);
-			}
-		}
-		
-		private void checkCanceled() {
-			if (!isCanceled && progressMonitor != null) {
-				if (progressMonitor.isCanceled()) {
-					cancelSearch();
-				}
-			}
-		}
-
-		public void inquiryCompleted(int discType) {
-			synchronized (inquiryCompletedEvent) {
-				inquiryCompletedEvent.notifyAll();
-			}
-		}
-
-		public void serviceSearchCompleted(int transID, int respCode) {
-		}
-
-		public void servicesDiscovered(int transID, ServiceRecord[] servRecord) {
-		}
-	}
-}
--- a/org.symbian.tools.wrttools/src/org/symbian/tools/wrttools/core/deploy/device/ServicesProvider.java	Wed Jul 21 11:26:43 2010 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,100 +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.core.deploy.device;
-
-import java.io.IOException;
-
-import javax.bluetooth.BluetoothStateException;
-import javax.bluetooth.DeviceClass;
-import javax.bluetooth.DiscoveryListener;
-import javax.bluetooth.LocalDevice;
-import javax.bluetooth.RemoteDevice;
-import javax.bluetooth.ServiceRecord;
-import javax.bluetooth.UUID;
-
-import org.eclipse.core.runtime.IStatus;
-
-import org.symbian.tools.wrttools.Activator;
-
-public class ServicesProvider {
-	
-	static final UUID OBEX_OBJECT_PUSH = new UUID(0x1105);
-	 
-	private static String serviceURL;
-	private static String btAddress;
-	
-	public static String getServicesFound(final String deviceName){
-		try {
-			serviceURL="";
-			btAddress = DeviceListProvider.getDeviceAddress(deviceName, true);
-
-
-	        UUID serviceUUID = OBEX_OBJECT_PUSH;
-
-	        final Object serviceSearchCompletedEvent = new Object();
-
-	        DiscoveryListener listener = new DiscoveryListener() {
-
-	            public void deviceDiscovered(RemoteDevice btDevice, DeviceClass cod) {
-	            }
-
-	            public void inquiryCompleted(int discType) {
-	            }
-
-	            public void servicesDiscovered(int transID, ServiceRecord[] servRecord) {
-	            	try{	            		
-	            		for (int i = 0; i < servRecord.length; i++) {
-	            			if(servRecord[i].getHostDevice().getFriendlyName(false).equals(deviceName)){	            				
-	            				serviceURL = servRecord[i].getConnectionURL(ServiceRecord.NOAUTHENTICATE_NOENCRYPT, false);
-	            			}
-	            		}
-	            	} catch(BluetoothStateException e){
-	            		Activator.log(IStatus.ERROR, e.getMessage(), e);
-	            	} catch (IOException e) {
-	            		Activator.log(IStatus.ERROR, e.getMessage(), e);
-					}
-	            }
-
-	            public void serviceSearchCompleted(int transID, int respCode) {
-	                synchronized(serviceSearchCompletedEvent){
-	                    serviceSearchCompletedEvent.notifyAll();
-	                }
-	            }
-
-	        };
-
-	        UUID[] searchUuidSet = new UUID[] { serviceUUID };
-	        int[] attrIDs =  new int[] {
-	                0x0100 // Service name
-	        };
-	        
-	        RemoteDevice bt = new WrapperRemoteDevice(btAddress);
-	        synchronized(serviceSearchCompletedEvent) {
-	        	LocalDevice.getLocalDevice().getDiscoveryAgent().searchServices(attrIDs, searchUuidSet, bt, listener);
-	        	serviceSearchCompletedEvent.wait();
-	        }
-
-	    } catch(IOException e){
-	    	Activator.log(IStatus.ERROR, "Error in Bluetooth service discovery", e);		
-		} catch (InterruptedException e) {
-			Activator.log(IStatus.ERROR, "Error in Bluetooth service discovery", e);		
-		}	    
-	    return serviceURL;
-	}
-}
\ No newline at end of file
--- a/org.symbian.tools.wrttools/src/org/symbian/tools/wrttools/core/deploy/device/WrapperRemoteDevice.java	Wed Jul 21 11:26:43 2010 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,35 +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.core.deploy.device;
-
-import javax.bluetooth.RemoteDevice;
-
-/**
- * A wrapper class around the Remote Device.
- * This will be used while deploying to the device.
- * @author avraina
- *
- */
-public class WrapperRemoteDevice extends RemoteDevice{
-
-	public WrapperRemoteDevice(String address) {
-		super(address);
-	}
-}
--- a/org.symbian.tools.wrttools/src/org/symbian/tools/wrttools/core/deployer/WidgetDeployerFactory.java	Wed Jul 21 11:26:43 2010 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,54 +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.core.deployer;
-
-import org.symbian.tools.wrttools.core.deploy.device.DeviceDeployer;
-import org.symbian.tools.wrttools.core.deploy.emulator.EmulatorDeployer;
-import org.symbian.tools.wrttools.core.status.IWRTStatusListener;
-
-/**
- * Factory class which returns the emulator based on the input provided.
- * @author avraina
- *
- */
-public class WidgetDeployerFactory {
-	
-	/**
-	 * @param deployerType
-	 * @return
-	 */
-	public static IWidgetDeployer createWidgetDeployer(String deployerType, IWRTStatusListener statusListener){
-		int ordinal = IWidgetDeployerConstants.DeployerType.valueOf(deployerType.toUpperCase()).ordinal();
-		IWidgetDeployer widgetDeployer;
-		
-		switch(ordinal){		
-		case 0: 
-			widgetDeployer = new EmulatorDeployer();
-			widgetDeployer.setStatusListener(statusListener);
-			return widgetDeployer;
-				
-		case 2:
-			widgetDeployer = new DeviceDeployer();
-			widgetDeployer.setStatusListener(statusListener);
-			return widgetDeployer;
-		}
-		return null;
-	}
-}
--- a/org.symbian.tools.wrttools/src/org/symbian/tools/wrttools/core/deployer/deployerMessages.properties	Wed Jul 21 11:26:43 2010 -0700
+++ b/org.symbian.tools.wrttools/src/org/symbian/tools/wrttools/core/deployer/deployerMessages.properties	Wed Jul 28 09:27:51 2010 -0700
@@ -1,16 +1,6 @@
-Deployer.begin.msg=Deployment Started.
 Deployer.ends.msg=Deployment Successful.
 Deployer.completed.msg=Deployment Completed.
 Deployer.cancelled.msg=Deployment Cancelled.
-Deployer.inputfile.msg=Deploying file from -->{0}
-Deployer.outputfile.msg=File deployed to -->{0}
-Deployer.searchservice.msg=Searching for the service for the selected device "{0}"......
-Deployer.servicefound.msg=Service for the device "{0}" found
-Deployer.services.connect.err.msg=Failed to connect to the service
-Deployer.servicenotfound.err.msg=Cannot find service to the device "{0}"
 Deployer.cannotdeploy.err.msg=Cannot deploy to the device "{0}"
 Deployer.failed.err.msg=Deployment Failed.
-Deployer.device.notsupport.err.msg=Device does not support the widget deployment.
-Deployer.device.rejected.err.msg=Deployment rejected by the device.
-Deployer.bluetooth.notconnected.msg=Bluetooth is either disabled or not present in the system.
 Deployer.preperation.msg=Preparing Widget Deployment. 
\ No newline at end of file
--- a/org.symbian.tools.wrttools/src/org/symbian/tools/wrttools/core/packager/ExcludeFileAction.java	Wed Jul 21 11:26:43 2010 -0700
+++ b/org.symbian.tools.wrttools/src/org/symbian/tools/wrttools/core/packager/ExcludeFileAction.java	Wed Jul 28 09:27:51 2010 -0700
@@ -67,7 +67,7 @@
 		PlatformUI.getWorkbench().getDecoratorManager().update("org.symbian.tools.wrttools.decorator"); 
 	}
 	
-    @SuppressWarnings("unchecked")
+    @SuppressWarnings("rawtypes")
     public void selectionChanged(IAction action, ISelection selection) {
 		selectedFiles.clear();
 		selectedFolders.clear();
--- a/org.symbian.tools.wrttools/src/org/symbian/tools/wrttools/core/packager/IWRTPackager.java	Wed Jul 21 11:26:43 2010 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,51 +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.core.packager;
-
-import java.io.IOException;
-import java.util.List;
-
-import org.symbian.tools.wrttools.core.exception.WRTException;
-
-/**
- * Main Interface for Packaging.
- * @author Nutan 
- *
- */
-public interface IWRTPackager   {
-
-	/**
-	 * This method is used to check user Input for Packaging (A project folder or .Zip file)
-	 * Returns 0 for file type .zip and 1 for Project folder and 2 for any thing else
-	 * @return  int returns project input type format
-	 * @throws WRTException 
-	 */
-	public int checkInputType() throws PackageException;
-	
-	/**
-	 * This method will convert validated folder into .zip file
-	 * Method implementation using java.util.zip package
-	 * This method will rename the file from .zip extension to .wgz
-	 * @throws PackageException 
-	 * @throws IOException 
-	 */
-	public void packageWidget(String sPath, String dPath, List<String> fileList) throws PackageException ;
-	
-}
--- a/org.symbian.tools.wrttools/src/org/symbian/tools/wrttools/core/packager/IncludeFileAction.java	Wed Jul 21 11:26:43 2010 -0700
+++ b/org.symbian.tools.wrttools/src/org/symbian/tools/wrttools/core/packager/IncludeFileAction.java	Wed Jul 28 09:27:51 2010 -0700
@@ -40,79 +40,77 @@
 import org.symbian.tools.wrttools.util.ProjectUtils;
 
 public class IncludeFileAction implements IObjectActionDelegate {
-	
-	private final List<IFile> selectedFiles = new ArrayList<IFile>();
-	private final List<IFolder> selectedFolders = new ArrayList<IFolder>();
+
+    private final List<IFile> selectedFiles = new ArrayList<IFile>();
+    private final List<IFolder> selectedFolders = new ArrayList<IFolder>();
 
 
 	public IncludeFileAction() {
-		super();
-	}
+        super();
+    }
 
 	public void setActivePart(IAction action, IWorkbenchPart targetPart) {
-	}
+    }
 
 	public void run(IAction action) {
-		for (IFile file : selectedFiles) {			
+        for (IFile file : selectedFiles) {
             ProjectUtils.include(file);
-		}
-		
-		for(IFolder folder : selectedFolders){
-			try{
+        }
+
+        for (IFolder folder : selectedFolders) {
+            try {
                 ProjectUtils.include(folder);
-				includeFolder( folder);				
-			}
-			catch (CoreException x) {
-				Activator.log(IStatus.ERROR, "error setting exclude property on folder: "+folder.getName(), x);
-			}
-		}
-		/*Refresh project tree when property is changed */ 
-		PlatformUI.getWorkbench().getDecoratorManager().update("org.symbian.tools.wrttools.decorator"); 
-	}
-	
-	/**
-	 * @see IActionDelegate#selectionChanged(IAction, ISelection)
-	 */
-    @SuppressWarnings("unchecked")
+                includeFolder(folder);
+            } catch (CoreException x) {
+                Activator.log(IStatus.ERROR, "error setting exclude property on folder: " + folder.getName(), x);
+            }
+        }
+        /*Refresh project tree when property is changed */
+        PlatformUI.getWorkbench().getDecoratorManager().update("org.symbian.tools.wrttools.decorator");
+    }
+
+    /**
+     * @see IActionDelegate#selectionChanged(IAction, ISelection)
+     */
+    @SuppressWarnings({ "rawtypes" })
     public void selectionChanged(IAction action, ISelection selection) {
-		selectedFiles.clear();
-		selectedFolders.clear();
-		if (selection instanceof IStructuredSelection) {
-			IStructuredSelection ss = (IStructuredSelection) selection;
-			for (Iterator iter = ss.iterator(); iter.hasNext();) {
-				Object obj = iter.next();
-				if (obj instanceof IFile) {
-					IFile file = (IFile) obj;
-					selectedFiles.add(file);
-				}
-				
-				if(obj instanceof IFolder){
-					IFolder folder = (IFolder) obj;
-					selectedFolders.add(folder);
-				}
-			}
-		}		
-	}	
-	
-	/**
-	 * 
-	 * @param folder
-	 * @throws CoreException
-	 */
-	
-	private void includeFolder(IFolder folder) throws CoreException{
-		folder.accept(new IResourceVisitor() {
-			public boolean visit(IResource resource)	throws CoreException {
-				if (resource instanceof IFile) {
-					IFile file = (IFile) resource;
+        selectedFiles.clear();
+        selectedFolders.clear();
+        if (selection instanceof IStructuredSelection) {
+            IStructuredSelection ss = (IStructuredSelection) selection;
+            for (Iterator iter = ss.iterator(); iter.hasNext();) {
+                Object obj = iter.next();
+                if (obj instanceof IFile) {
+                    IFile file = (IFile) obj;
+                    selectedFiles.add(file);
+                }
+
+                if (obj instanceof IFolder) {
+                    IFolder folder = (IFolder) obj;
+                    selectedFolders.add(folder);
+                }
+            }
+        }
+    }
+
+    /**
+     * 
+     * @param folder
+     * @throws CoreException
+     */
+
+    private void includeFolder(IFolder folder) throws CoreException {
+        folder.accept(new IResourceVisitor() {
+            public boolean visit(IResource resource) throws CoreException {
+                if (resource instanceof IFile) {
+                    IFile file = (IFile) resource;
                     ProjectUtils.include(file);
-				}
-				else if (resource instanceof IFolder) {
-					IFolder folder = (IFolder) resource;
+                } else if (resource instanceof IFolder) {
+                    IFolder folder = (IFolder) resource;
                     ProjectUtils.include(folder);
-				}
-				return true;
-			}
-		});
-	}
+                }
+                return true;
+            }
+        });
+    }
 }
--- a/org.symbian.tools.wrttools/src/org/symbian/tools/wrttools/core/packager/PackageException.java	Wed Jul 21 11:26:43 2010 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,60 +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.core.packager;
-
-import org.symbian.tools.wrttools.core.exception.WRTException;
-
-public class PackageException extends WRTException {
-
-	/**
-	 * Default serial version ID 
-	 */
-	private static final long serialVersionUID = 1L;
-	
-	/**
-	 * Default constructor.
-	 */
-	public PackageException() {
-		super();
-	}
-
-	/**
-	 * @param message
-	 * @param cause
-	 */
-	public PackageException(String message, Throwable cause) {
-		super(message, cause);
-	}
-
-	/**
-	 * @param message
-	 */
-	public PackageException(String message) {
-		super(message);
-	}
-
-	/**
-	 * @param cause
-	 */
-	public PackageException(Throwable cause) {
-		super(cause);
-	}
-
-}
--- a/org.symbian.tools.wrttools/src/org/symbian/tools/wrttools/core/packager/PackagerFileManipulation.java	Wed Jul 21 11:26:43 2010 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,132 +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.core.packager;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-import org.symbian.tools.wrttools.core.exception.WRTException;
-
-public class PackagerFileManipulation {
-	
-	private Logger logger = Logger.getLogger(getClass().getName());
-	public PackagerFileManipulation() {
-	}
-	
-	/**
-	 * This method copies zip file from source folder to destination folder.
-	 * @param sPath
-	 * @param dPath
-	 * @throws PackagerException 
-	 * @throws PackageException 
-	 * @throws IOException 
-	 * @throws WRTException 
-	 * @throws IOException 
-	 */
-	public void copyFile(String fromFileName, String toFileName) throws PackageException {
-	    File fromFile = new File(fromFileName);
-	    File toFile = new File(toFileName);
-	    FileInputStream from = null;
-	    FileOutputStream to = null;
-	    
-	    if (!fromFile.exists())
-	    	logAndThrowErrors(Level.SEVERE, WRTPackagerConstants.LOG_SOURCE_NOT_FOUND,
-	    			WRTPackagerConstants.ERR_SOURCE_NOT_FOUND);
-	    if (fromFile.isDirectory())
-	    	logAndThrowErrors(Level.SEVERE, WRTPackagerConstants.LOG_FILE_COPY_FAIL,
-	    			WRTPackagerConstants.ERR_FILE_COPY_FAIL);
-	    if (!fromFile.canRead())
-	        logAndThrowErrors(Level.SEVERE, WRTPackagerConstants.LOG_UNREADABLE, 
-	        		WRTPackagerConstants.ERR_UNREADABLE);
-	    	
-	    if (toFile.isDirectory())
-	    	toFile = new File(toFile, fromFile.getName());
-
-	    if (toFile.exists()) {
-	    	if (!toFile.canWrite())
-	    		logAndThrowErrors(Level.SEVERE, WRTPackagerConstants.LOG_NOT_WRITABLE,
-	    				WRTPackagerConstants.ERR_NOT_WRITABLE);
-	      
-	    } else {
-	    	String parent = toFile.getParent();
-	    	if (parent == null)
-	    		parent = System.getProperty(PackagerMessages.getString("PackagerFileManipulation.useDir")); //$NON-NLS-1$
-	    	File dir = new File(parent);
-	    	if (!dir.exists())
-	    		logAndThrowErrors(Level.SEVERE, WRTPackagerConstants.LOG_DEST_NOT_FOUND,
-	    				WRTPackagerConstants.ERR_DEST_NOT_FOUND);
-	    	if (dir.isFile())
-	    		logAndThrowErrors(Level.SEVERE, WRTPackagerConstants.LOG_FILE_COPY_FAIL,
-	    			  WRTPackagerConstants.ERR_FILE_COPY_FAIL);
-	    	if (!dir.canWrite())
-	    		logAndThrowErrors(Level.SEVERE, WRTPackagerConstants.LOG_NOT_WRITABLE,
-	    				WRTPackagerConstants.ERR_NOT_WRITABLE);
-	    }
-
-	    try {
-	    	from = new FileInputStream(fromFile);
-	    	to = new FileOutputStream(toFile);
-	    	byte[] buffer = new byte[4096];
-	    	int bytesRead;
-
-	    	while ((bytesRead = from.read(buffer)) != -1)
-	    		to.write(buffer, 0, bytesRead); // write
-	    } catch (FileNotFoundException e) {
-	    	logAndThrowErrors(Level.SEVERE, WRTPackagerConstants.LOG_READ_WRITE_FAIL,
-	    			e.getMessage());
-		} catch (IOException e) {
-			logAndThrowErrors(Level.SEVERE, WRTPackagerConstants.LOG_READ_WRITE_FAIL,
-	    			  e.getMessage());
-		}
-	    finally {
-	      if (from != null)
-			try {
-				from.close();
-			} catch (IOException e) {
-				logAndThrowErrors(Level.SEVERE, WRTPackagerConstants.LOG_FILE_CLOSE_FAIL,
-		    			  e.getMessage());
-			}
-	      if (to != null)
-			try {
-				to.close();
-			} catch (IOException e) {
-				logAndThrowErrors(Level.SEVERE, WRTPackagerConstants.LOG_FILE_CLOSE_FAIL,
-		    			  e.getMessage());
-			}
-	    }
-	}
-
-	/**
-	 * This method is used for logging and exception handling
-	 * @param lev -- severity Level
-	 * @param logMessage -- message to log
-	 * @param errException -- exception to throw
-	 * @throws PackagerException
-	 */
-	private void logAndThrowErrors(Level lev , String logMessage, String errException) throws PackageException {
-		logger.log(lev, logMessage);
-		throw new PackageException(errException);
-	}
-}
--- a/org.symbian.tools.wrttools/src/org/symbian/tools/wrttools/core/packager/PackagerMessages.java	Wed Jul 21 11:26:43 2010 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,40 +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.core.packager;
-
-import java.util.MissingResourceException;
-import java.util.ResourceBundle;
-
-public class PackagerMessages {
-	private static final String BUNDLE_NAME = "org.symbian.tools.wrttools.core.packager.packageMessages"; //$NON-NLS-1$
-
-	private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle
-			.getBundle(BUNDLE_NAME);
-
-	private PackagerMessages() {
-	}
-
-	public static String getString(String key) {
-		try {
-			return RESOURCE_BUNDLE.getString(key);
-		} catch (MissingResourceException e) {
-			return '!' + key + '!';
-		}
-	}
-}
--- a/org.symbian.tools.wrttools/src/org/symbian/tools/wrttools/core/packager/PackagerZipFolder.java	Wed Jul 21 11:26:43 2010 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,349 +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.core.packager;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileOutputStream;
-
-
-import java.io.IOException;
-import java.text.MessageFormat;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-import java.util.zip.ZipEntry;
-import java.util.zip.ZipOutputStream;
-
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.io.OutputStream;
-
-
-//import org.apache.commons.io.IOUtils;
-
-import org.symbian.tools.wrttools.core.status.IWRTConstants;
-import org.symbian.tools.wrttools.core.status.IWRTStatusListener;
-import org.symbian.tools.wrttools.core.status.WRTStatus;
-import org.symbian.tools.wrttools.util.Util;
-
-/**
- * A class is used to Zip folders and files in the same way as WinZip does.
- * @author ranoliya
- *
- */
-class PackagerZipFolder {
-
-	//ZIP output stream
-	private ZipOutputStream pkgZipOutputStream = null;
-	
-	//Logger to log info. errors and messages
-	private Logger logger = Logger.getLogger(getClass().getName());
-	
-	//List of files to be zipped
-	private List<String> fileList;
-	
-	//Status handler for status reporting to GUI
-	private IWRTStatusListener statusListener;
-	
-	//Source path from where files are to be zipped
-	private String srcPath;
-	
-	//Widget file to be zipped
-	private File wFile;
-	
-	//package root folder path
-	private String rootFolderPath="";
-
-	 /**
-     * The default buffer size to use.
-     */
-    private static final int DEFAULT_BUFFER_SIZE = 1024 * 4;
-	
-	/**
-	 * This method creates a zip file for the given input at the given destination path
-	 * @param srcpath - Input for the zip
-	 * @param destPath - The destination path 
-	 * @param listOfFiles - list of files to be included in the zip. for null list it will zip all the files and folders
-	 * @param statushandler - Status handler form GUI
-	 * @throws PackageException - exception during Zipping 
-	 */
-	public void zipProjectFolder(String srcpath, String destPath, List<String> listOfFiles, IWRTStatusListener statushandler) throws PackageException{
-		fileList = listOfFiles;
-		this.statusListener = statushandler;
-		this.srcPath=srcpath;
-		try
-		{
-			wFile = new File (srcPath);
-			//invlid file or directory
-			if (!wFile.isFile() && !wFile.isDirectory()
-					|| null == destPath || !(destPath.length()>0)) {
-				logAndThrowErrors(Level.SEVERE, WRTPackagerConstants.LOG_SOURCE_NOT_FOUND,null);
-			}
-			
-			//create zip outputstream
-			FileOutputStream outzip=null;
-
-			outzip=new FileOutputStream(destPath);
-			
-			pkgZipOutputStream = new ZipOutputStream(outzip);
-				
-			zipFilesInFolder( wFile, rootFolderPath);
-			
-			
-			pkgZipOutputStream.finish();
-			pkgZipOutputStream.close();
-		}catch (IOException e){
-			e.printStackTrace();
-			logAndThrowErrors(Level.SEVERE, WRTPackagerConstants.LOG_ZIP_FAILED,e);
-		}
-		
-	}
-
-	public void zipProjectFolder(String srcpath, String destPath, List<String> listOfFiles) throws PackageException{
-		fileList = listOfFiles;
-//		this.statusListener = statushandler;
-		this.srcPath=srcpath;
-		try
-		{
-			wFile = new File (srcPath);
-			//invlid file or directory
-			if (!wFile.isFile() && !wFile.isDirectory()
-					|| null == destPath || !(destPath.length()>0)) {
-				logAndThrowErrors(Level.SEVERE, WRTPackagerConstants.LOG_SOURCE_NOT_FOUND,null);
-			}
-			
-			//create zip outputstream
-		
-			
-			pkgZipOutputStream = new ZipOutputStream(new FileOutputStream(destPath));				
-			zipFilesInFolder( wFile, rootFolderPath);
-			pkgZipOutputStream.finish();
-			pkgZipOutputStream.close();
-		}catch (IOException e){
-			e.printStackTrace();
-			logAndThrowErrors(Level.SEVERE, WRTPackagerConstants.LOG_ZIP_FAILED,e);
-		}
-		
-	}
-
-
-	/**
-	 * This method scans one by one files inside the srcPath and 
-	 * add it to the zip folder
-	 * Method is called recursively to add each file of the folder to the Zip entry
-	 * @param pkgFile -- File or folder to add to zip 
-	 * @param baseName -- name under which it will add the pkgFile
-	 * @throws PackageException - exception from Zip
-	 */
-	private void zipFilesInFolder(File pkgFile, String baseName) throws PackageException {
-		
-		if (pkgFile.isDirectory()) {
-			File [] fList = pkgFile.listFiles() ;
-			if(fList.length>0){
-				//package selected files
-				if(null != fileList && fileList.size()>0){
-					for (int i=0; i< fList.length; i++){
-//					System.out.println(i+"      fileList name -----------------     :"+fileList.get(i));
-						rootFolderPath="";
-						retrieveFileName(fList[i]);
-						//if directory then call function to add all files in it
-						if(fList[i].isDirectory())
-						{
-							zipFilesInFolder(fList[i], baseName);
-						}
-						for(int j=0; j<fileList.size(); j++){
-							//if file is in list then zip it
-							String compareStr = rootFolderPath.concat(fList[i].getName().toString().trim());
-							if(compareStr.equals(fileList.get(j).toString())){
-								if(fList[i].exists()){
-										zipFilesInFolder( fList[i],fileList.get(j).toString()) ;
-								}
-							}
-						}
-					}
-				}
-				// package all the files if given fileList is null
-				else
-				{
-					for (int i=0; i< fList.length; i++){
-						if(fList[i].exists())
-							zipFilesInFolder( fList[i],baseName) ;
-					}
-				}
-			}
-		} 
-		// Add a file to the zip entry
-		else {
-			//Discard .wgz files from packaging
-			String name = pkgFile.getName();
-			String compare ="";
-			if(name.length()>3 && null!= name){
-				String tempStr = name.substring(name.length()-4, name.length());
-				compare = tempStr;
-			}
-			
-			//Discard .wgz file
-			if(compare.length()>0 && compare.equalsIgnoreCase(".wgz")){
-				logger.log(Level.INFO, ".wgz file discarded for Package: "+name);
-				reportStatus(MessageFormat.format(PackagerMessages.getString("package.discard.wgz")
-						,new Object[] {name}));
-			}
-			else{
-				FileInputStream fis = null;
-				try {
-					fis = new FileInputStream(pkgFile);
-					
-					ZipEntry zipEntry = new ZipEntry(baseName);
-					pkgZipOutputStream.putNextEntry(zipEntry);
-					
-					
-//					System.out.println("Copy >>>-->>    ");
-					try{
-						copy(fis, pkgZipOutputStream);
-						
-//						IOUtils.copy(fis, pkgZipOutputStream);
-//						IOUtils.copyLarge(fis, pkgZipOutputStream);
-						
-					
-					} catch (Exception e) {
-							
-						e.printStackTrace();
-						
-					}
-//					System.out.println("Copy <<----<<    ");
-					
-					pkgZipOutputStream.closeEntry();
-					fis.close();
-				} catch (IOException e) {
-					logAndThrowErrors(Level.SEVERE, WRTPackagerConstants.LOG_ZIP_FAILED,e);
-				}
-				finally{
-					try {
-						pkgZipOutputStream.closeEntry();
-						fis.close();
-					} catch (IOException e) {
-						logAndThrowErrors(Level.SEVERE, e.getMessage(), e);
-					}
-				}
-			}
-		}
-	}
-	
-	/**
-	 * retrieve file name from source folder to current path
-	 * @param file
-	 */
-	private void retrieveFileName(File file) {
-		if(null !=file.getParent()){
-			rootFolderPath=file.getParentFile().getName().toString().trim().concat("/") //$NON-NLS-1$
-								.concat(rootFolderPath);
-			//if it reaches to package source filder then return
-//			if(file.getParentFile().getName().toString().trim().equals(wFile.getName())){
-			if(file.getParentFile().getAbsolutePath().toString().trim()
-					.equalsIgnoreCase(wFile.getAbsolutePath())){
-				return;
-			}
-			else{
-				retrieveFileName(file.getParentFile());
-			}
-		}
-		
-	}
-
-
-	/**
-	 * Reporting status to the GUI
-	 * @param statusMessage - message to be delivered
-	 */
-	public void reportStatus(String statusMessage) {
-		WRTStatus status = new WRTStatus();
-		status.setStatusSource(IWRTConstants.StatusSourceType.PACKAGER.name());
-		status.setStatusDescription(statusMessage);
-		statusListener.emitStatus(status);
-		
-		
-	}
-	/**
-	 * This method is used for logging and exception handling
-	 * @param lev -- severity Level
-	 * @param logMessage -- message to log
-	 * @param e -- exception to throw, if its not an exception then it should be null
-	 * @throws PackagerException
-	 */
-	private void logAndThrowErrors(Level lev , String logMessage, Exception e) throws PackageException {
-		logger.log(lev, logMessage);
-		reportStatus(WRTPackagerConstants.STA_PKG_FAILED);
-		//for exceptions log error message and stack trace
-		if(null!=e){
-			Util.logEvent(logger, Level.SEVERE, e);
-			throw new PackageException(e);
-		}
-	}
-/**
- * 
- * @param input
- * @param output
- * @return
- * @throws IOException
- */	
-	
-    public static int copy(InputStream input, OutputStream output) throws IOException {
-    	
-        long count = copyLarge(input, output);
-        if (count > Integer.MAX_VALUE) {
-            return -1;
-        }
-        
-        return (int) count;
-    }
-
-    /**
-     * Copy bytes from a large (over 2GB) <code>InputStream</code> to an
-     * <code>OutputStream</code>.
-     * <p>
-     * This method buffers the input internally, so there is no need to use a
-     * <code>BufferedInputStream</code>.
-     * 
-     * @param input  the <code>InputStream</code> to read from
-     * @param output  the <code>OutputStream</code> to write to
-     * @return the number of bytes copied
-     * @throws NullPointerException if the input or output is null
-     * @throws IOException if an I/O error occurs
-     * 
-     *      */
-    public static long copyLarge(InputStream input, OutputStream output)
-            throws IOException {
-    	
-        byte[] buffer = new byte[DEFAULT_BUFFER_SIZE];
-        long count = 0;
-        int n = 0;
-        while (-1 != (n = input.read(buffer))) {
-            output.write(buffer, 0, n);
-            count += n;
-        }
-        
-        return count;
-    }
-	
-
-
-}
--- a/org.symbian.tools.wrttools/src/org/symbian/tools/wrttools/core/packager/WRTPackagerConstants.java	Wed Jul 21 11:26:43 2010 -0700
+++ b/org.symbian.tools.wrttools/src/org/symbian/tools/wrttools/core/packager/WRTPackagerConstants.java	Wed Jul 28 09:27:51 2010 -0700
@@ -22,45 +22,6 @@
 import org.eclipse.core.runtime.QualifiedName;
 
 public class WRTPackagerConstants {
-	
-	public static QualifiedName EXCLUDE_PROPERTY = new QualifiedName("org.symbian.tools.wrttools.core.packager", "exclude");
-	
-
-	public static String STA_PKG_PASSED = PackagerMessages.getString("WRTPackagerConstants.success"); //$NON-NLS-1$
-	public static String STA_PKG_FAILED = PackagerMessages.getString("WRTPackagerConstants.failed"); //$NON-NLS-1$
-
-	public static String ERR_PKG_MAN_PLIST_FILE_MISSING = PackagerMessages.getString("WRTPackagerConstants.package.missing.mandatory.files.plist"); //$NON-NLS-1$
-	public static String ERR_PKG_MAN_HTML_FILE_MISSING = PackagerMessages.getString("WRTPackagerConstants.package.missing.mandatory.files.html"); //$NON-NLS-1$
-
-	
-	
-	public static String STA_PKG_PROGRESS = PackagerMessages.getString("WRTPackagerConstants.inProgress"); //$NON-NLS-1$
-	public static String STA_PKG_START = PackagerMessages.getString("WRTPackagerConstants.started"); //$NON-NLS-1$
-	
-	public static String LOG_NULL_INPUT= PackagerMessages.getString("WRTPackagerConstants.nullpera"); //$NON-NLS-1$
-	public static String ERR_NULL= PackagerMessages.getString("WRTPackagerConstants.nullInput"); //$NON-NLS-1$
-	public static String LOG_DIR_CREATE_FAIL= PackagerMessages.getString("WRTPackagerConstants.directoryCreateErr"); //$NON-NLS-1$
-	public static String ERR_DIR_CREATE_FAIL= PackagerMessages.getString("WRTPackagerConstants.checkPermission"); //$NON-NLS-1$
-	public static String LOG_UNSUPPORTED_INPUT= PackagerMessages.getString("WRTPackagerConstants.unSupportedInput"); //$NON-NLS-1$
-	public static String ERR_UNSUPPORTED_INPUT= PackagerMessages.getString("WRTPackagerConstants.InputNotSupported"); //$NON-NLS-1$
-	public static String LOG_RENAME_FAIL= PackagerMessages.getString("WRTPackagerConstants.renameFailed"); //$NON-NLS-1$
-	public static String ERR_RENAME_FAIL= PackagerMessages.getString("WRTPackagerConstants.failureGenerate"); //$NON-NLS-1$
-	public static String LOG_SOURCE_NOT_FOUND= PackagerMessages.getString("WRTPackagerConstants.srcNotFound"); //$NON-NLS-1$
-	public static String ERR_SOURCE_NOT_FOUND= PackagerMessages.getString("WRTPackagerConstants.inputSourceNotFound"); //$NON-NLS-1$
-	public static String LOG_UNREADABLE= PackagerMessages.getString("WRTPackagerConstants.srcNotReadable"); //$NON-NLS-1$
-	public static String ERR_UNREADABLE= PackagerMessages.getString("WRTPackagerConstants.unReadable"); //$NON-NLS-1$
-	public static String LOG_FILE_COPY_FAIL= PackagerMessages.getString("WRTPackagerConstants.canNotcopy"); //$NON-NLS-1$
-	public static String ERR_FILE_COPY_FAIL= PackagerMessages.getString("WRTPackagerConstants.copyErr"); //$NON-NLS-1$
-	public static String LOG_DEST_NOT_FOUND= PackagerMessages.getString("WRTPackagerConstants.NoDestination"); //$NON-NLS-1$
-	public static String ERR_DEST_NOT_FOUND= PackagerMessages.getString("WRTPackagerConstants.noLocateDest"); //$NON-NLS-1$
-	public static String LOG_NOT_WRITABLE= PackagerMessages.getString("WRTPackagerConstants.destNotWritable"); //$NON-NLS-1$
-	public static String ERR_NOT_WRITABLE= PackagerMessages.getString("WRTPackagerConstants.destNotwritableErr"); //$NON-NLS-1$
-	public static String LOG_READ_WRITE_FAIL= PackagerMessages.getString("WRTPackagerConstants.readWriteFail"); //$NON-NLS-1$
-	public static String ERR_READ_WRITE_FAIL= PackagerMessages.getString("WRTPackagerConstants.readWritePermission"); //$NON-NLS-1$
-	public static String LOG_FILE_CLOSE_FAIL= PackagerMessages.getString("WRTPackagerConstants.closeFile"); //$NON-NLS-1$
-	public static String ERR_FILE_CLOSE_FAIL= PackagerMessages.getString("WRTPackagerConstants.closeFileerr"); //$NON-NLS-1$
-	public static String LOG_ZIP_FAILED= PackagerMessages.getString("WRTPackagerConstants.ZipFailed"); //$NON-NLS-1$
-	public static String ERR_ZIP_FAILED= PackagerMessages.getString("WRTPackagerConstants.packFailed"); //$NON-NLS-1$
-	public static String LOG_EMPTY_SRC= PackagerMessages.getString("WRTPackagerConstants.emptyInputFolder"); //$NON-NLS-1$
-	public static String ERR_EMPTY_SRC= PackagerMessages.getString("WRTPackagerConstants.emptyFolderErr"); //$NON-NLS-1$
+    public static QualifiedName EXCLUDE_PROPERTY = new QualifiedName("org.symbian.tools.wrttools.core.packager",
+            "exclude");
 }
--- a/org.symbian.tools.wrttools/src/org/symbian/tools/wrttools/core/packager/WidgetPackager.java	Wed Jul 21 11:26:43 2010 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,352 +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.core.packager;
-
-import java.io.File;
-import java.text.MessageFormat;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-import org.symbian.tools.wrttools.core.status.IWRTConstants;
-import org.symbian.tools.wrttools.core.status.IWRTStatusListener;
-import org.symbian.tools.wrttools.core.status.WRTStatus;
-import org.symbian.tools.wrttools.core.status.WRTStatusHandler;
-import org.symbian.tools.wrttools.util.Util;
-
-/**
- * This is the main class for core component Packager.
- * This class reads from the given source file and creates widget package at 
- * the given destination path
- * @author ranoliya
- *
- */
-public class WidgetPackager implements IWRTPackager {
-	
-	// source path for packager
-	private String srcPath = "";
-	
-	//destination path for packager
-	private String destPath = ""; 
-	
-	//name of the package
-	private String packageName = "";
-	
-	//list of files to package
-	private List<String> listOfFiles ;
-
-	//status handler for creating status listener
-	private WRTStatusHandler statusHandler;
-	
-	private IWRTStatusListener statusListener;
-	
-	//Logger to log errors and info
-	private Logger logger = Logger.getLogger(getClass().getName());
-	
-	private String errorMessage = "";
-			
-	/**
-	 * Class Constructor the packaging process
-	 */
-	public WidgetPackager(IWRTStatusListener  wrtStatusListener) {
-		statusHandler = new WRTStatusHandler();
-		statusHandler.addListener(wrtStatusListener);
-		statusListener = wrtStatusListener;
-	}
-
-	/**
-	 * Method packages the input folder, Initial step for Packaging
-	 * @param sPath -- Project Source path
-	 * @param dPath -- Package destination path
-	 * @param fileList -- List of files to be included in the package
-	 * @throws PackageException
-	 */
-	public void packageWidget(String sPath, String dPath,List<String> fileList) throws PackageException
-	{
-		if(null != sPath || null != dPath){
-		
-			listOfFiles = new ArrayList<String>();
-			this.listOfFiles = fileList;	
-		
-			sPath = Util.replaceChar(sPath, File.separatorChar, '/');
-			this.srcPath = sPath;	
-			reportStatus(WRTPackagerConstants.STA_PKG_START);
-			if(!validateFilesToPackage()){
-				
-				reportStatus(WRTPackagerConstants.STA_PKG_FAILED);
-				errorMessage = PackagerMessages.getString("package.missing.mandatory.files");
-				throw new PackageException(PackagerMessages.getString("package.missing.mandatory.files"));
-
-			}				
-			// if destination path is not specified
-			if(dPath.equals("")){ //$NON-NLS-1$
-				dPath=sPath;
-			}			
-			this.packageName=new File(dPath).getName();			
-			File destDir = new File(dPath);
-			dPath = destDir.getParentFile().getAbsolutePath().concat("/");
-			this.destPath = Util.replaceChar(dPath, File.separatorChar, '/');	
-			
-
-			initPackage();
-		}
-		else
-		{
-			reportStatus(WRTPackagerConstants.LOG_NULL_INPUT);
-			logAndThrowErrors(Level.SEVERE, WRTPackagerConstants.LOG_NULL_INPUT, null);
-		}
-	}
-	
-	/**
-	 * This is the packager invocation  method that calls packager main API
-	 * @throws PackagerException
-	 */
-	private void initPackage() throws PackageException {
-		File destFile = new File(destPath);
-		if(!destFile.canWrite() || !destFile.exists()|| (destFile.exists() && destFile.isFile())){ // to avoid considering file as existing dir
-			boolean success = destFile.mkdir();
-			if(!success){
-				reportStatus(WRTPackagerConstants.ERR_DIR_CREATE_FAIL);
-				reportStatus(WRTPackagerConstants.STA_PKG_FAILED);
-				throw new PackageException();
-//				return;
-			}
-		}
-		
-		
-		int fileType = checkInputType();
-		
-		String srcStatus = MessageFormat.format(PackagerMessages.getString("WidgetPackager.WidgetPackager.filesFrom")
-				,new Object[]{srcPath}); 
-		
-		
-		
-		reportStatus(srcStatus);
-		
-		boolean pass = createWidgetPackage(fileType);
-		if(pass){
-			String destStatus =  MessageFormat.format(PackagerMessages.getString("WidgetPackager.WidgetPackager.fileDest")
-					,new Object[]{destPath.concat(packageName)});
-			reportStatus(destStatus);
-			reportStatus(WRTPackagerConstants.STA_PKG_PASSED);
-		}
-	}
-
-	
-	/**
-	 * This method checks for the user input for Packager and returns File Type
-	 * @return int -- File Type
-	 * @throws PackagerException 
-	 */
-	public int checkInputType() throws PackageException {
-		int fileType = 2;
-		File checkInput ;
-		
-		checkInput = new File(srcPath);
-		if(checkInput.exists()){
-		
-			// user input for packaging is project directory
-			if (checkInput.isDirectory()) {
-				fileType = 1; 
-			}
-			
-			// user input is unknown to packager - report to status
-			else {
-				fileType = 2;
-				
-				logAndThrowErrors(Level.SEVERE, WRTPackagerConstants.LOG_UNSUPPORTED_INPUT,null);
-			}
-		}
-		return fileType;
-	}
-
-	/**
-	 * This method returns the Destination path for the packaged widget
-	 * @return
-	 */
-	public String getDestPath() {
-		return destPath;
-	}
-
-	/**
-	 * Reporting status
-	 * @param statusMessage
-	 */
-	public void reportStatus(String statusMessage) {
-		WRTStatus status = new WRTStatus();
-		status.setStatusSource(IWRTConstants.StatusSourceType.PACKAGER.name());
-		status.setStatusDescription(statusMessage);
-		statusListener.emitStatus(status);
-	}
-	
-	/**
-	 * This method is used for logging and exception handling
-	 * @param lev -- severity Level
-	 * @param logMessage -- message to log
-	 * @param e -- exception to throw, if its not an exception then it should be null
-	 * @throws PackagerException
-	 */
-	private void logAndThrowErrors(Level lev , String logMessage, Exception e) throws PackageException {
-		logger.log(lev, logMessage);
-		
-		//for exceptions log error message and stack trace
-		if(null!=e){
-			reportStatus(WRTPackagerConstants.STA_PKG_FAILED);
-			Util.logEvent(logger, Level.SEVERE, e);
-			throw new PackageException(e);
-		}
-	}
-
-	/**
-	 * This method creates Widget package-- overridden  
-	 * @param - Input file type 
-	 */
-	private boolean createWidgetPackage(int fileType) throws PackageException {
-		String widgetPath= ""; 
-		String zipPath = ""; 
-		boolean sucess = false;
-		boolean packageDone = false;
-		PackagerZipFolder zipFolder = new PackagerZipFolder();
-		
-		widgetPath = destPath.concat(packageName); //$NON-NLS-1$
-		File reWrite = new File(widgetPath);
-		if(reWrite.exists())
-			reWrite.delete();
-		//if source path and destination path are same
-		if(srcPath.equals(destPath)){
-			// Project folder as an input
-			if (fileType==1){
-				zipPath = destPath.concat("tmpwid.zip"); //$NON-NLS-1$
-				zipFolder.zipProjectFolder(srcPath, zipPath,listOfFiles,statusListener);
-//				zipFolder.zipProjectFolder(srcPath, zipPath,listOfFiles);
-				
-			}
-			//unsupported file type
-			else{
-				logAndThrowErrors(Level.SEVERE, WRTPackagerConstants.LOG_UNSUPPORTED_INPUT,null);
-			}
-		}
-		else {
-			if (fileType==1){
-				zipPath = destPath.concat("tmpwid.zip");//$NON-NLS-1$
-//				zipFolder.zipProjectFolder(srcPath,zipPath,listOfFiles,statusListener );
-				zipFolder.zipProjectFolder(srcPath, zipPath,listOfFiles);
-			}
-			else{
-				logAndThrowErrors(Level.SEVERE, WRTPackagerConstants.LOG_UNSUPPORTED_INPUT, null);
-			}
-		}
-		
-		//rename file
-		//created zip file
-		File zFile = new File(zipPath);
-
-
-		//new package name to use for rename  appended wgz.  This logic should be removed from package zip folder.
-		File newFile = new File(widgetPath+".wgz");
-		
-		//delete .wgz if already exists
-		if(newFile.exists()){
-			newFile.delete();
-		}
-		//rename file
-		if(zFile.exists()){
-			sucess = zFile.renameTo(newFile);
-		}
-		//overwrite the existing file
-		if(!sucess)
-		{
-				logAndThrowErrors(Level.WARNING, PackagerMessages.getString("WidgetPackager.fileOverwriteMsg"),null); 
-		}
-		
-		File tempZip = new File(zipPath);
-		//delete temp file if exists
-		if(tempZip.exists())
-		{
-			tempZip.delete();
-		}
-		packageDone = true;
-		return packageDone;
-	}
-
-	public String getErrorMessage() {
-		return errorMessage;
-	}
-	
-	/**
-	 * This method validates basic files (.html and .plist) checked in packaging option tree
-	 * @return -- mandatory files exists or not 
-	 */
-	private boolean validateFilesToPackage(){
-		boolean isPlist = false;
-		boolean isHtml = false;
-		File srcDir = new File(srcPath);
-		String plistFile = srcDir.getName().concat("/info.plist");
-		
-		if(listOfFiles.size()>0 && null != listOfFiles){
-			for (String fileName : listOfFiles) {	
-				try{
-					if (fileName.equalsIgnoreCase(plistFile)) {
-					isPlist = true;
-				}				
-				int len = fileName.lastIndexOf("/");
-				String fName=fileName.substring(len+1, fileName.length());
-//				 files with out extention  will have index out of bound exception
-				int extLen = fName.lastIndexOf('.');
-                String extention = "";
-                if(extLen > 0){
-                	extention = fName.substring(extLen, fName.length());
-                }
-				
-				String htmlFile = srcDir.getName().concat("/").concat(fName);
-				if(htmlFile.equalsIgnoreCase(fileName) && 
-						(extention.equalsIgnoreCase(".htm")|| extention.equalsIgnoreCase(".html"))){
-					isHtml = true;
-				}
-				
-				if(isPlist && isHtml){
-					return true;
-				}
-			}
-			// files with out extention  will have index out of bound exception
-//				try catch will catch that and will proceed to the next file in the 
-//				for loop
-			catch(Exception e){
-//				e.printStackTrace();
-				}
-		}
-			}
-		String srcStatus = MessageFormat.format(PackagerMessages.getString("WidgetPackager.WidgetPackager.filesFrom")
-				,new Object[]{srcPath});
-		reportStatus( srcStatus);
-		if(!isPlist ){
-			 reportStatus( WRTPackagerConstants.ERR_PKG_MAN_PLIST_FILE_MISSING);
-			
-		}
-		if(!isHtml){
-			 reportStatus( WRTPackagerConstants.ERR_PKG_MAN_HTML_FILE_MISSING);
-			
-		}
-		
-		return (isPlist && isHtml);
-	}
-	
-}
--- a/org.symbian.tools.wrttools/src/org/symbian/tools/wrttools/core/packager/WrtPackageActionDelegate.java	Wed Jul 21 11:26:43 2010 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,215 +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.core.packager;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IMarker;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.IResourceVisitor;
-import org.eclipse.core.resources.IncrementalProjectBuilder;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.ui.IObjectActionDelegate;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.actions.ActionDelegate;
-import org.symbian.tools.wrttools.Activator;
-import org.symbian.tools.wrttools.WRTStatusListener;
-import org.symbian.tools.wrttools.core.status.IWRTConstants;
-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 WrtPackageActionDelegate extends ActionDelegate implements
-		IObjectActionDelegate {
-
-
-	/**
-	 * @see ActionDelegate#run(IAction)
-	 */
-
-	private final List<IProject> projectList = new ArrayList<IProject>();
-	
-
-	public void run(IAction action) {		
-		PlatformUI.getWorkbench().saveAllEditors(true);
-		if (projectList != null && projectList.size() > 0) {
-			for (IProject project : projectList) {
-				if (project != null) {
-                    WRTStatusListener statusListener = new WRTStatusListener();
-                    packageProject(project, statusListener);
-				}
-			}
-		}
-	}
-
-    public boolean packageProject(IProject project, IWRTStatusListener statusListener) {
-		boolean packaedSucess=false;
-		if (project != null) {
-			try {
-				project.build(IncrementalProjectBuilder.FULL_BUILD, new NullProgressMonitor());
-				IMarker[] markers = project.findMarkers(IMarker.PROBLEM, true, IResource.DEPTH_INFINITE);
-				
-				boolean hasErrors = false;
-				for (IMarker marker : markers) {
-					if (marker.getAttribute(IMarker.SEVERITY, IMarker.SEVERITY_INFO) == IMarker.SEVERITY_ERROR) {
-						hasErrors = true;
-						break;
-					}
-				}
-                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...");
-					return packaedSucess;
-				}
-			} catch (CoreException e1) {
-                // Proofing from coding exceptions in JSDT
-				Activator.log(e1);
-            }
-
-			try {
-				final List<String> fileList = new ArrayList<String>();
-				//--->>
-				project.accept(new IResourceVisitor() {
-					public boolean visit(IResource resource)	throws CoreException {
-						if (resource instanceof IFile) {
-							IFile file = (IFile) resource;
-							boolean add = true;
-							// skip user-excluded and automatically-excluded files
-                            boolean value = ProjectUtils.isExcluded(file);
-                            if (value) {
-								add = false;
-							}
-							String name = file.getName();
-							// skip Aptana temporarily generated files
-							if (name.startsWith(".tmp_")) {
-								add = false;
-							}
-							//Bug fix when import project with different name was unable to package it
-							if(name.endsWith(".wgz")){
-								add = false;
-							}
-							if (add) {
-								if(file.getProject().getLocation().toString().endsWith(file.getProject().getName())){
-									fileList.add(file.getLocation().toString().substring(file.getProject().getLocation().toString().length()-file.getProject().getName().length()));
-									}
-								else{
-									String projectDir=file.getProject().getLocation().toString().substring(file.getProject().getLocation().toString().lastIndexOf("/")+1);
-									String fullpath=file.getFullPath().toString();
-									fullpath=fullpath.substring(fullpath.indexOf(file.getProject().getName())+file.getProject().getName().length());
-									fullpath=projectDir+fullpath;								
-									fileList.add(fullpath);
-						
-								}						
-							}									
-						}		
-						return true;
-					}
-
-				});
-				//<<--<<
-
-				String projectPath = project.getLocation().toString();
-				String prjName = project.getName();
-				String dprojectPath = projectPath+"/"+prjName;
-				WidgetPackager widgetPackager = new WidgetPackager(statusListener);
-
-				try {
-					IProgressMonitor pm = new NullProgressMonitor();
-					// deleting the previous build --->>
-					IPath wgzPath = new Path(project.getName()+".wgz");
-					IFile wgz = project.getFile(wgzPath);
-					//do not delete the here, delete only if packaging is success
-					/*if (wgz.exists()) {
-						wgz.delete(true, false, pm);
-					}*/
-					widgetPackager.packageWidget(projectPath, dprojectPath, fileList);
-					packaedSucess=true;
-					project.refreshLocal(IResource.DEPTH_ONE, pm);
-					wgz = project.getFile(wgzPath);
-					if (wgz.exists()) {
-                        ProjectUtils.exclude(wgz);
-					}
-					
-				} catch (PackageException e) {
-					Activator.log(IStatus.ERROR, "Error packaging widget archive", e);
-				} finally {
-					statusListener.close();
-				}
-			} catch (CoreException x) {
-				Activator.log(IStatus.ERROR,	"Error packaging widget archive", x);
-			}
-			
-		}	
-		return packaedSucess;
-	}
-
-    /**
-     * Reporting status
-     * @param statusMessage
-     */
-	private void reportStatus(String statusMessage) {
-		WRTStatus status = new WRTStatus();
-		WRTStatusListener statusListener = new WRTStatusListener();
-		status.setStatusSource(IWRTConstants.StatusSourceType.PACKAGER.name());
-		status.setStatusDescription(statusMessage);
-		statusListener.emitStatus(status);
-	}
-	@SuppressWarnings("unchecked")
-	@Override
-	public void selectionChanged(IAction action, ISelection selection) {
-		if (selection instanceof IStructuredSelection) {
-			projectList.clear();
-			IStructuredSelection ss = (IStructuredSelection) selection;
-			for (Iterator iter = ss.iterator(); iter.hasNext();) {
-
-				Object obj = iter.next();
-				if (obj instanceof IProject) {
-					projectList.add((IProject) obj);
-
-				}
-			}
-		}
-	}
-
-	/**
-	 * @see IObjectActionDelegate#setActivePart(IAction, IWorkbenchPart)
-	 */
-	public void setActivePart(IAction action, IWorkbenchPart targetPart) {
-
-	}
-	
-	
-	
-}
-
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.symbian.tools.wrttools/src/org/symbian/tools/wrttools/core/packager/WrtPackager.java	Wed Jul 28 09:27:51 2010 -0700
@@ -0,0 +1,67 @@
+/**
+ * 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.packager;
+
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.util.zip.ZipOutputStream;
+
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.symbian.tools.mtw.core.projects.IMTWProject;
+import org.symbian.tools.mtw.core.runtimes.IMobileWebRuntime;
+import org.symbian.tools.mtw.core.runtimes.IPackager;
+import org.symbian.tools.mtw.core.utilities.ZipApplicationVisitor;
+import org.symbian.tools.wrttools.Activator;
+import org.symbian.tools.wrttools.util.ProjectUtils;
+
+public class WrtPackager implements IPackager {
+    public File packageApplication(IMTWProject project, IMobileWebRuntime runtime, IProgressMonitor monitor)
+            throws CoreException {
+        monitor.beginTask(String.format("Packaging %s", project.getName()), IProgressMonitor.UNKNOWN);
+
+        IPath stateLocation = Activator.getDefault().getStateLocation();
+        final File f = stateLocation.append(project.getName()).addFileExtension(getFileType(project)).toFile(); // It should be OK to overwrite - this is private location
+        f.getParentFile().mkdirs();
+        try {
+            ZipOutputStream zip = new ZipOutputStream(new FileOutputStream(f));
+            project.getProject().accept(new ZipApplicationVisitor(zip, this));
+            zip.close();
+        } catch (IOException e) {
+            throw new CoreException(new Status(IStatus.ERROR, Activator.PLUGIN_ID, String.format(
+                    "Packaging application %s failed", project.getName()), e));
+        }
+        monitor.done();
+        return f;
+    }
+
+    public String getFileType(IMTWProject project) {
+        return "wgz";
+    }
+
+    public IPath getPathInPackage(IResource resource) {
+        return ProjectUtils.isExcluded(resource) ? null : resource.getFullPath().makeRelative();
+    }
+
+}
--- a/org.symbian.tools.wrttools/src/org/symbian/tools/wrttools/core/packager/packageMessages.properties	Wed Jul 21 11:26:43 2010 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,42 +0,0 @@
-WidgetPackager.pathAppend=\\
-WidgetPackager.WidgetPackager.filesFrom=Packaging Files from : "{0}"
-WidgetPackager.WidgetPackager.fileDest=Packaged files to destination\: "{0}" 
-WRTPackagerConstants.success=Packaging Successful\n
-WRTPackagerConstants.failed=Packaging Failed\n
-WRTPackagerConstants.inProgress=Packaging in Progress...
-WRTPackagerConstants.started=Packaging Started...
-WRTPackagerConstants.nullpera=Input parameters are NULL
-WRTPackagerConstants.nullInput=Selected input is NULL -- Invalid input
-WRTPackagerConstants.directoryCreateErr=Can not create output directory
-WRTPackagerConstants.checkPermission=Can not create specified directory at the destination.
-WRTPackagerConstants.unSupportedInput=Any input other then a folder is not supported
-WRTPackagerConstants.InputNotSupported=Input type not supported by Mobile Web Packager
-WRTPackagerConstants.renameFailed=Packager failed while renaming a .zip file
-WRTPackagerConstants.failureGenerate=Packager failed while generating package files
-WRTPackagerConstants.srcNotFound=Source folder not found
-WRTPackagerConstants.inputSourceNotFound=Input source not Found
-WRTPackagerConstants.srcNotReadable=Package source is not readable
-WRTPackagerConstants.unReadable=Unreadable Input, Please check Source and Destination
-WRTPackagerConstants.canNotcopy=Can not copy file
-WRTPackagerConstants.copyErr=Packager can not copy required files
-WRTPackagerConstants.NoDestination=Destination directory does not exists
-WRTPackagerConstants.noLocateDest=Packager could not locate destination directory
-WRTPackagerConstants.destNotWritable=Destination directory is not writable
-WRTPackagerConstants.destNotwritableErr=packager can not write to destination directory, check permissions
-WRTPackagerConstants.readWriteFail=File read/write Failed
-WRTPackagerConstants.readWritePermission=Packager read/write failed, check for permissions
-WRTPackagerConstants.closeFile=Can not close files
-WRTPackagerConstants.closeFileerr=Package could not close files
-WRTPackagerConstants.ZipFailed=File Zipping failed
-WRTPackagerConstants.packFailed=Packager could not perform packaging, File I/O not available for zip utility 
-WRTPackagerConstants.emptyInputFolder=Input project folder is empty 
-WRTPackagerConstants.emptyFolderErr=Input project folder is empty, Please give a valid source folder
-PackagerFileManipulation.useDir=user.dir
-
-package.missing.mandatory.files = Please select mandatory files
-package.discard.wgz = \nDiscarded already packaged file - "{0}" ... \n
-
-WRTPackagerConstants.package.missing.mandatory.files.plist = Mandatory Plist file is Misssing 
-WRTPackagerConstants.package.missing.mandatory.files.html = Mandatory Html file is Missing
-
-
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.symbian.tools.wrttools/src/org/symbian/tools/wrttools/core/project/WRTIDEProjectProvider.java	Wed Jul 28 09:27:51 2010 -0700
@@ -0,0 +1,46 @@
+/**
+ * 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.project;
+
+import java.util.Map;
+import java.util.WeakHashMap;
+
+import org.eclipse.core.resources.IProject;
+import org.symbian.tools.mtw.core.projects.IMTWProject;
+import org.symbian.tools.mtw.core.projects.IMTWProjectProvider;
+import org.symbian.tools.wrttools.WRTProject;
+import org.symbian.tools.wrttools.util.ProjectUtils;
+
+public class WRTIDEProjectProvider implements IMTWProjectProvider {
+    private final Map<IProject, IMTWProject> projects = new WeakHashMap<IProject, IMTWProject>();
+
+    public IMTWProject create(IProject project) {
+        IMTWProject p = projects.get(project);
+        if (p == null) {
+            p = new WRTProject(project);
+            projects.put(project, p);
+        }
+        return p;
+    }
+
+    public boolean isSupportedProject(IProject project) {
+        return ProjectUtils.hasWrtNature(project);
+    }
+
+}
--- a/org.symbian.tools.wrttools/src/org/symbian/tools/wrttools/handlers/DeployHandler.java	Wed Jul 21 11:26:43 2010 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,60 +0,0 @@
-/**
- * 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.resources.IProject;
-import org.eclipse.jface.wizard.WizardDialog;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.handlers.HandlerUtil;
-import org.symbian.tools.wrttools.WRTProject;
-import org.symbian.tools.wrttools.util.ProjectUtils;
-import org.symbian.tools.wrttools.wizards.deploy.DeployWizard;
-
-/**
- * Our sample handler extends AbstractHandler, an IHandler base class.
- * @see org.eclipse.core.commands.IHandler
- * @see org.eclipse.core.commands.AbstractHandler
- */
-public class DeployHandler extends AbstractHandler {
-    /**
-     * The constructor.
-     */
-    public DeployHandler() {
-    }
-
-    /**
-     * the command has been executed, so extract extract the needed information
-     * from the application context.
-     */
-    public Object execute(ExecutionEvent event) throws ExecutionException {
-        IWorkbenchWindow window = HandlerUtil.getActiveWorkbenchWindowChecked(event);
-
-        IProject project = ProjectUtils.getProjectFromCommandContext(event);
-        if (project != null) {
-            window.getActivePage().saveAllEditors(true);
-            WizardDialog dialog = new WizardDialog(window.getShell(), new DeployWizard(new WRTProject(project)));
-            dialog.open();
-        }
-
-        return null;
-    }
-}
--- a/org.symbian.tools.wrttools/src/org/symbian/tools/wrttools/handlers/PackageApplicationHandler.java	Wed Jul 21 11:26:43 2010 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,65 +0,0 @@
-/**
- * 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.core.resources.IProject;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.core.runtime.jobs.Job;
-import org.eclipse.ui.PlatformUI;
-import org.symbian.tools.wrttools.WRTStatusListener;
-import org.symbian.tools.wrttools.core.packager.WrtPackageActionDelegate;
-import org.symbian.tools.wrttools.util.ProjectUtils;
-
-public class PackageApplicationHandler extends AbstractHandler implements IHandler {
-    private final class JobExtension extends Job {
-        private final IProject project;
-
-        private JobExtension(IProject project) {
-            super(String.format("Package %s", project.getName()));
-            setRule(ResourcesPlugin.getWorkspace().getRoot());
-            this.project = project;
-        }
-
-        @Override
-        protected IStatus run(IProgressMonitor monitor) {
-            WRTStatusListener statusListener = new WRTStatusListener();
-            new WrtPackageActionDelegate().packageProject(project, statusListener);
-            return Status.OK_STATUS;
-        }
-    }
-
-    public Object execute(ExecutionEvent event) throws ExecutionException {
-        final IProject project = ProjectUtils.getProjectFromCommandContext(event);
-        if (project != null) {
-            PlatformUI.getWorkbench().saveAllEditors(true);
-            if (project != null) {
-                new JobExtension(project).schedule();
-            }
-        }
-        return null;
-    }
-
-}
--- a/org.symbian.tools.wrttools/src/org/symbian/tools/wrttools/util/ProjectUtils.java	Wed Jul 21 11:26:43 2010 -0700
+++ b/org.symbian.tools.wrttools/src/org/symbian/tools/wrttools/util/ProjectUtils.java	Wed Jul 28 09:27:51 2010 -0700
@@ -35,7 +35,6 @@
 
 import javax.swing.filechooser.FileSystemView;
 
-import org.eclipse.core.commands.ExecutionEvent;
 import org.eclipse.core.resources.ICommand;
 import org.eclipse.core.resources.IContainer;
 import org.eclipse.core.resources.IFile;
@@ -49,7 +48,6 @@
 import org.eclipse.core.resources.IWorkspaceRunnable;
 import org.eclipse.core.resources.ResourcesPlugin;
 import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IAdaptable;
 import org.eclipse.core.runtime.IPath;
 import org.eclipse.core.runtime.IProgressMonitor;
 import org.eclipse.core.runtime.IStatus;
@@ -60,18 +58,14 @@
 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.IPageLayout;
 import org.eclipse.ui.IViewReference;
 import org.eclipse.ui.IWorkbenchPage;
 import org.eclipse.ui.IWorkbenchPart;
 import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.handlers.HandlerUtil;
 import org.eclipse.ui.ide.IDE;
 import org.eclipse.ui.internal.wizards.datatransfer.TarEntry;
 import org.eclipse.ui.part.ISetSelectionTarget;
@@ -416,29 +410,6 @@
         return false;
     }
 
-    public static IProject getProjectFromCommandContext(ExecutionEvent event) {
-        IResource resource = null;
-        IWorkbenchPart activePart = HandlerUtil.getActivePart(event);
-        if (activePart instanceof IEditorPart) {
-            resource = (IResource) ((IEditorPart) activePart).getEditorInput().getAdapter(IResource.class);
-        } else {
-            ISelection selection = HandlerUtil.getCurrentSelection(event);
-            if (!selection.isEmpty() && selection instanceof IStructuredSelection) {
-                Object[] array = ((IStructuredSelection) selection).toArray();
-                if (array.length == 1 && array[0] instanceof IAdaptable) {
-                    resource = (IResource) ((IAdaptable) array[0]).getAdapter(IResource.class);
-                }
-            }
-        }
-        if (resource != null) {
-            IProject project = resource.getProject();
-            if (hasWrtNature(project)) {
-                return project;
-            }
-        }
-        return null;
-    }
-
     public static boolean isExcluded(IResource resource) {
         if (!resource.exists()) {
             return false;
--- a/org.symbian.tools.wrttools/src/org/symbian/tools/wrttools/wizards/deploy/DeployWizard.java	Wed Jul 21 11:26:43 2010 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,177 +0,0 @@
-/**
- * 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.deploy;
-
-import java.io.IOException;
-import java.lang.reflect.InvocationTargetException;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.jface.operation.IRunnableWithProgress;
-import org.eclipse.jface.wizard.Wizard;
-import org.symbian.tools.wrttools.Activator;
-import org.symbian.tools.wrttools.WRTProject;
-import org.symbian.tools.wrttools.core.deployer.DeployException;
-import org.symbian.tools.wrttools.core.deployer.IWidgetDeployer;
-import org.symbian.tools.wrttools.core.packager.WrtPackageActionDelegate;
-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 {
-        private final DeploymentSummaryWizardPage page;
-
-        public PagePrinter(DeploymentSummaryWizardPage summaryPage) {
-            page = summaryPage;
-        }
-
-        public void emitStatus(WRTStatus status) {
-            page.log(status.getStatusDescription().toString());
-        }
-
-        public boolean isStatusHandled(WRTStatus status) {
-            return true;
-        }
-
-        public void close() {
-            // Do nothing
-        }
-
-        public boolean canPackageWithErrors(IProject project) {
-            return ProjectUtils.canPackageWithErrors(project);
-        }
-
-    }
-
-    private final DeployWizardContext context;
-    private final DeploymentSummaryWizardPage summaryPage = new DeploymentSummaryWizardPage();
-    private final WRTProject project;
-
-    public DeployWizard(WRTProject project) {
-        this.project = project;
-        setNeedsProgressMonitor(true);
-        setWindowTitle("Deploy WRT Application");
-        context = new DeployWizardContext(project);
-    }
-
-    @Override
-    public void addPages() {
-        addPage(new DeploymentTargetWizardPage(context, project.getDeploymentTarget()));
-        addPage(summaryPage);
-    }
-
-    @Override
-    public boolean performFinish() {
-        summaryPage.clear();
-        getContainer().showPage(summaryPage);
-        return deploy();
-    }
-
-    @Override
-    public boolean needsPreviousAndNextButtons() {
-        return false;
-    }
-
-    /**
-     * deploys the actual widget.
-     */
-    private boolean deploy() {
-        DeploymentTarget target = context.getTarget();
-        DeployJob job = new DeployJob(context.getProject(), target);
-        try {
-            getContainer().run(true, true, job);
-        } catch (InvocationTargetException e) {
-            Activator.log(e);
-        } catch (InterruptedException e) {
-            Activator.log(e);
-        }
-        return job.isSuccessful();
-    }
-
-    private final class DeployJob implements IRunnableWithProgress {
-        private final DeploymentTarget target;
-        private final WrtPackageActionDelegate packagerAction = new WrtPackageActionDelegate();
-        private final IProject project;
-        private boolean successful = false;
-
-        private DeployJob(IProject project, DeploymentTarget deploymentTarget) {
-            this.project = project;
-            this.target = deploymentTarget;
-        }
-
-        public boolean isSuccessful() {
-            return successful;
-        }
-
-        public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
-            IWRTStatusListener statusListener = new PagePrinter(summaryPage);
-            IWidgetDeployer wd = target.createDeployer(statusListener);
-
-            IStatus result = new Status(IStatus.OK, Activator.PLUGIN_ID, 0, "", null);
-
-            if (project != null) {
-                /* package the files before deployment */
-                boolean packageSuccess = packagerAction.packageProject(project, statusListener);
-                if (!packageSuccess) {
-                    return;
-                }
-                String packagedPath;
-                try {
-                    IPath wgzPath = new Path(project.getName() + ".wgz");
-                    IFile wgz = project.getFile(wgzPath);
-                    packagedPath = wgz.getLocation().toFile().getCanonicalFile().toString();
-                    try {
-                        result = wd.deploy(packagedPath, target.getName(), monitor);
-                        if (result.isOK()) {
-                            DeployWizard.this.project.setDeploymentTarget(target);
-                            successful = true;
-                            if (wd.needsReport()) {
-                                signalDeploymentComplete(target);
-                            }
-                        }
-                    } catch (DeployException e) {
-                        result = new Status(IStatus.ERROR, Activator.PLUGIN_ID, 0, e.getMessage(), e);
-                        Logging.log(Activator.getDefault(), result);
-                    }
-                } catch (IOException e) {
-                    Activator.log(IStatus.ERROR, "Error deploying widget", e);
-                }
-            }
-        }
-
-    }
-
-    private void signalDeploymentComplete(final DeploymentTarget target) {
-        if (target.getDeployMessage() != null) {
-            getShell().getDisplay().asyncExec(new Runnable() {
-                public void run() {
-                    MessageDialog.openWarning(getShell(), "WRT Application Deployment", target.getDeployMessage());
-                }
-            });
-        }
-    }
-}
--- a/org.symbian.tools.wrttools/src/org/symbian/tools/wrttools/wizards/deploy/DeployWizardContext.java	Wed Jul 21 11:26:43 2010 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,66 +0,0 @@
-/**
- * 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.deploy;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.SubProgressMonitor;
-import org.symbian.tools.wrttools.WRTProject;
-
-public class DeployWizardContext {
-    private DeploymentTarget target;
-    private final WRTProject project;
-    private boolean logging;
-
-    public DeployWizardContext(WRTProject project) {
-        this.project = project;
-    }
-
-    public void setTarget(DeploymentTarget target) {
-        this.target = target;
-    }
-
-    public DeploymentTarget getTarget() {
-        return target;
-    }
-
-    public IProject getProject() {
-        return project.getProject();
-    }
-
-    public DeploymentTarget[] getDeploymentTargets() {
-        return DeploymentTargetRegistry.getRegistry().getDeploymentTargets();
-    }
-
-    public void doSearch(SubProgressMonitor monitor) throws CoreException {
-        DeploymentTargetRegistry.getRegistry().doSearch(monitor);
-    }
-
-    public boolean didBluetoothLookup() {
-        return DeploymentTargetRegistry.getRegistry().didBluetoothLookup();
-    }
-
-    public void setLogging(boolean logging) {
-        this.logging = logging;
-    }
-
-    public boolean isLogging() {
-        return logging;
-    }
-}
--- a/org.symbian.tools.wrttools/src/org/symbian/tools/wrttools/wizards/deploy/DeploymentSummaryWizardPage.java	Wed Jul 21 11:26:43 2010 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,58 +0,0 @@
-/**
- * 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.deploy;
-
-import org.eclipse.jface.wizard.WizardPage;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Text;
-
-public class DeploymentSummaryWizardPage extends WizardPage {
-    private StringBuilder buffer = new StringBuilder(1000);
-    private Text log;
-
-    protected DeploymentSummaryWizardPage() {
-        super("deploy");
-        setTitle("WRT Application Deployment");
-        setDescription("Please wait while deployment is in progress");
-    }
-
-    public void createControl(Composite parent) {
-        log = new Text(parent, SWT.BORDER | SWT.MULTI | SWT.READ_ONLY | SWT.WRAP);
-        setControl(log);
-    }
-
-    public void log(String line) {
-        synchronized (buffer) {
-            buffer.append(line).append("\n");
-        }
-        log.getDisplay().asyncExec(new Runnable() {
-            public void run() {
-                synchronized (buffer) {
-                    log.setText(buffer.toString());
-                }
-            }
-        });
-    }
-
-    public void clear() {
-        log.setText("");
-        buffer = new StringBuilder();
-    }
-}
--- a/org.symbian.tools.wrttools/src/org/symbian/tools/wrttools/wizards/deploy/DeploymentTargetRegistry.java	Wed Jul 21 11:26:43 2010 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,129 +0,0 @@
-/**
- * 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.deploy;
-
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map.Entry;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.symbian.tools.wrttools.Activator;
-import org.symbian.tools.wrttools.core.deploy.device.DeployDeviceInfo;
-import org.symbian.tools.wrttools.core.deploy.device.DeviceListProvider;
-import org.symbian.tools.wrttools.core.deploy.emulator.EmulatorListProvider;
-import org.symbian.tools.wrttools.core.deployer.DeployerMessages;
-
-public class DeploymentTargetRegistry {
-    private static DeploymentTargetRegistry INSTANCE;
-
-    public synchronized static DeploymentTargetRegistry getRegistry() {
-        if (INSTANCE == null) {
-            INSTANCE = new DeploymentTargetRegistry();
-        }
-        return INSTANCE;
-    }
-    private final DeploymentTarget[] emulators;
-    private DeploymentTarget[] phones = new DeploymentTarget[0];
-
-    private DeploymentTargetRegistry() {
-        HashMap<String, String> map = EmulatorListProvider.populateEmulators();
-        Iterator<Entry<String, String>> iterator = map.entrySet().iterator();
-        emulators = new DeploymentTarget[map.size()];
-
-        for (int i = 0; i < emulators.length; i++) {
-            emulators[i] = new EmulatorTarget(iterator.next());
-        }
-    }
-
-    private boolean didLookup = false;
-
-    public synchronized void doSearch(IProgressMonitor monitor) throws CoreException {
-        didLookup = true;
-        monitor.beginTask("Bluetooth search", IProgressMonitor.UNKNOWN);
-        if (DeviceListProvider.isBloothToothConnected()) {
-            loadDevices(monitor);
-        } else {
-            throw new CoreException(new Status(IStatus.ERROR, Activator.PLUGIN_ID, DeployerMessages
-                    .getString("Deployer.bluetooth.notconnected.msg")));
-        }
-
-    }
-
-    private DeploymentTarget findOrCreate(DeploymentTarget[] prev, DeployDeviceInfo next) {
-        for (DeploymentTarget deploymentTarget : prev) {
-            if (deploymentTarget instanceof PhoneTarget
-                    && deploymentTarget.getName().equals(next.getDeviceName())) {
-                ((PhoneTarget) deploymentTarget).update(next);
-                return deploymentTarget;
-            }
-        }
-        return new PhoneTarget(next);
-    }
-
-    public synchronized DeploymentTarget[] getDeploymentTargets() {
-        ProgramTarget target = ProgramTarget.getInstance();
-        DeploymentTarget[] all = new DeploymentTarget[emulators.length + phones.length + (target != null ? 1 : 0)];
-        System.arraycopy(emulators, 0, all, 0, emulators.length);
-        System.arraycopy(phones, 0, all, emulators.length, phones.length);
-        if (target != null) {
-            all[all.length - 1] = target;
-        }
-        return all;
-    }
-
-    /**
-     * Runs a thread to load the devices present for the deployment.
-     * Does not effect the loading of the UI.
-     * @param device the device earlier saved .
-     * @param monitor 
-     */
-    private void loadDevices(IProgressMonitor monitor) {
-        List<DeployDeviceInfo> devices = DeviceListProvider.getDevices(monitor);
-        Iterator<DeployDeviceInfo> iterator = devices.iterator();
-        final DeploymentTarget[] prev = phones;
-        phones = new DeploymentTarget[devices.size()];
-        for (int i = 0; i < phones.length; i++) {
-            phones[i] = findOrCreate(prev, iterator.next());
-        }
-    }
-
-    public DeploymentTarget findTarget(String name, String type) {
-        DeploymentTarget[] targets = getDeploymentTargets();
-        for (DeploymentTarget deploymentTarget : targets) {
-            if (deploymentTarget.getName().equals(name) && deploymentTarget.getType().equals(type)) {
-                return deploymentTarget;
-            }
-        }
-        if (type.equals(PhoneTarget.TYPE) && phones.length == 0) {
-            DeploymentTarget target = new PhoneTarget(name);
-            phones = new DeploymentTarget[] { target };
-            return target;
-        }
-        return null;
-    }
-
-    public boolean didBluetoothLookup() {
-        return didLookup;
-    }
-
-}
--- a/org.symbian.tools.wrttools/src/org/symbian/tools/wrttools/wizards/deploy/DeploymentTargetWizardPage.java	Wed Jul 21 11:26:43 2010 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,242 +0,0 @@
-/**
- * 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.deploy;
-
-import java.lang.reflect.InvocationTargetException;
-import java.text.MessageFormat;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.SubProgressMonitor;
-import org.eclipse.jface.operation.IRunnableWithProgress;
-import org.eclipse.jface.util.Policy;
-import org.eclipse.jface.viewers.ArrayContentProvider;
-import org.eclipse.jface.viewers.DoubleClickEvent;
-import org.eclipse.jface.viewers.IColorProvider;
-import org.eclipse.jface.viewers.IDoubleClickListener;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.viewers.TableViewer;
-import org.eclipse.jface.viewers.ViewerSorter;
-import org.eclipse.jface.wizard.IWizardContainer;
-import org.eclipse.jface.wizard.WizardDialog;
-import org.eclipse.jface.wizard.WizardPage;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.layout.FormAttachment;
-import org.eclipse.swt.layout.FormData;
-import org.eclipse.swt.layout.FormLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Text;
-import org.symbian.tools.wrttools.Activator;
-import org.symbian.tools.wrttools.core.WRTImages;
-
-public class DeploymentTargetWizardPage extends WizardPage {
-    public class EmulatorBluetoothLabelProvider extends LabelProvider implements ILabelProvider, IColorProvider {
-        @Override
-        public Image getImage(Object element) {
-            return ((DeploymentTarget) element).getIcon();
-        }
-
-        @Override
-        public String getText(Object element) {
-            return ((DeploymentTarget) element).getName();
-        }
-
-        public Color getBackground(Object element) {
-            return null;
-        }
-
-        public Color getForeground(Object element) {
-            Display display = DeploymentTargetWizardPage.this.getContainer().getShell().getDisplay();
-            if (((DeploymentTarget) element).isResolved()) {
-                return null;
-            } else {
-                return display.getSystemColor(SWT.COLOR_DARK_GRAY);
-            }
-        }
-    }
-
-    private final DeployWizardContext context;
-    private TableViewer list;
-    private Text description;
-    private final DeploymentTarget prev;
-
-    public DeploymentTargetWizardPage(DeployWizardContext context, DeploymentTarget prev) {
-        super("TargetPage", "Select Deployment Target", null);
-        this.context = context;
-        this.prev = prev;
-        setDescription(MessageFormat.format("Select emulator or device to deploy WRT application ''{0}''", context
-                .getProject().getName()));
-    }
-
-    public void createControl(Composite parent) {
-        Composite root = new Composite(parent, SWT.NONE);
-
-        root.setLayout(new FormLayout());
-
-        list = new TableViewer(root, SWT.BORDER);
-        list.setContentProvider(new ArrayContentProvider());
-        list.setLabelProvider(new EmulatorBluetoothLabelProvider());
-        list.setSorter(new ViewerSorter() {
-            @Override
-            public int category(Object element) {
-                return ((DeploymentTarget) element).getType().charAt(0);
-            }
-        });
-        list.addSelectionChangedListener(new ISelectionChangedListener() {
-            public void selectionChanged(SelectionChangedEvent event) {
-                IStructuredSelection selection = ((IStructuredSelection) event.getSelection());
-                DeploymentTarget target = (DeploymentTarget) selection.getFirstElement();
-                selectDeploymentTarget(target);
-            }
-        });
-        list.addDoubleClickListener(new IDoubleClickListener() {
-            public void doubleClick(DoubleClickEvent event) {
-                if (getWizard().performFinish()) {
-                    IWizardContainer container = getWizard().getContainer();
-                    if (container instanceof WizardDialog) {
-                        ((WizardDialog) container).close();
-                    }
-                }
-            }
-        });
-        final Button search = new Button(root, SWT.NONE);
-        search.addSelectionListener(new SelectionAdapter() {
-            @Override
-            public void widgetSelected(SelectionEvent e) {
-                doBluetoothSearch(search);
-            }
-        });
-        search.setText("Discover");
-        search.setImage(WRTImages.getBluetoothImage());
-
-        description = new Text(root, SWT.BORDER | SWT.READ_ONLY);
-        final Button enableLogging = new Button(root, SWT.CHECK);
-        enableLogging.setText("Enable diagnostic logging");
-        enableLogging.addSelectionListener(new SelectionAdapter() {
-            @Override
-            public void widgetSelected(SelectionEvent e) {
-                toggleLogging(enableLogging.getSelection());
-            }
-        });
-
-        FormData data = new FormData();
-        data.bottom = new FormAttachment(100, -5);
-        data.left = new FormAttachment(0, 5);
-        enableLogging.setLayoutData(data);
-
-        data = new FormData();
-        data.left = new FormAttachment(0, 5);
-        data.right = new FormAttachment(100, -5);
-        data.bottom = new FormAttachment(enableLogging, -20);
-        description.setLayoutData(data);
-
-        data = new FormData();
-        data.top = new FormAttachment(0, 5);
-        data.right = new FormAttachment(100, -5);
-        search.setLayoutData(data);
-
-        data = new FormData();
-        data.left = new FormAttachment(0, 5);
-        data.top = new FormAttachment(0, 5);
-        data.bottom = new FormAttachment(description, -10);
-        data.right = new FormAttachment(search, -10);
-
-        list.getControl().setLayoutData(data);
-
-        list.setInput(context.getDeploymentTargets());
-
-        setPageComplete(false);
-        if (prev != null) {
-            list.setSelection(new StructuredSelection(prev));
-        }
-
-        if (!context.didBluetoothLookup()) {
-            setMessage("Press \"Discover\" to find Bluetooth-enabled devices", IStatus.WARNING);
-        }
-
-        setControl(root);
-    }
-
-    protected void toggleLogging(boolean logging) {
-        context.setLogging(logging);
-    }
-
-    protected void doBluetoothSearch(final Button search) {
-        try {
-            getContainer().run(true, true, new IRunnableWithProgress() {
-                public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
-                    monitor.beginTask("Searching for Bluetooth devices", IProgressMonitor.UNKNOWN);
-                    try {
-                        context.doSearch(new SubProgressMonitor(monitor, 100));
-                    } catch (CoreException e) {
-                        Policy.getStatusHandler().show(e.getStatus(), "WRT Application Deployment");
-                    }
-                    monitor.done();
-                    search.getDisplay().asyncExec(new Runnable() {
-                        public void run() {
-                            list.setInput(context.getDeploymentTargets());
-                            ISelection selection = list.getSelection();
-                            if (selection.isEmpty()) {
-                                selectDeploymentTarget(null);
-                            } else {
-                                selectDeploymentTarget((DeploymentTarget) ((IStructuredSelection) selection)
-                                        .getFirstElement());
-                            }
-                        }
-                    });
-                }
-            });
-        } catch (InvocationTargetException e) {
-            Activator.log(e);
-        } catch (InterruptedException e) {
-            Activator.log(e);
-        }
-    }
-
-    protected void selectDeploymentTarget(DeploymentTarget target) {
-        if (target != null) {
-            context.setTarget(target);
-            String desc = target.getDescription();
-            this.description.setText(desc);
-            setMessage(null);
-            setErrorMessage(null);
-            setPageComplete(true);
-        } else {
-            context.setTarget(null);
-            description.setText("");
-            setPageComplete(false);
-            setMessage(null);
-            setErrorMessage("Select device or emulator to deploy the application");
-        }
-    }
-
-}
--- a/org.symbian.tools.wrttools/src/org/symbian/tools/wrttools/wizards/deploy/PhoneTarget.java	Wed Jul 21 11:26:43 2010 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,85 +0,0 @@
-/**
- * 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.deploy;
-
-import java.text.MessageFormat;
-
-import org.eclipse.swt.graphics.Image;
-import org.symbian.tools.wrttools.core.WRTImages;
-import org.symbian.tools.wrttools.core.deploy.device.DeployDeviceInfo;
-import org.symbian.tools.wrttools.core.deploy.device.DeviceDeployer;
-import org.symbian.tools.wrttools.core.deployer.IWidgetDeployer;
-import org.symbian.tools.wrttools.core.status.IWRTStatusListener;
-
-public class PhoneTarget extends DeploymentTarget {
-    public static final String TYPE = "bluetooth";
-    private boolean discovered;
-
-    public PhoneTarget(DeployDeviceInfo deviceInfo) {
-        super(deviceInfo.getDeviceName());
-        addr = deviceInfo.getDeviceBlueToothAddress();
-        discovered = true;
-    }
-
-    public PhoneTarget(String name) {
-        super(name);
-        discovered = false;
-    }
-
-    @Override
-    public String getDescription() {
-        if (isResolved()) {
-            return MessageFormat.format("Bluetooth address: {0}", getAddr());
-        } else {
-            return "This device was used in the previous session and might not be available";
-        }
-    }
-
-    @Override
-    public IWidgetDeployer createDeployer(IWRTStatusListener statusListener) {
-        IWidgetDeployer widgetDeployer = new DeviceDeployer();
-        widgetDeployer.setStatusListener(statusListener);
-        return widgetDeployer;
-    }
-
-    public void update(DeployDeviceInfo info) {
-        addr = info.getDeviceBlueToothAddress();
-        discovered = true;
-    }
-
-    @Override
-    public String getType() {
-        return TYPE;
-    }
-
-    @Override
-    public boolean isResolved() {
-        return discovered;
-    }
-
-    @Override
-    public Image getIcon() {
-        return WRTImages.getBluetoothImage();
-    }
-
-    @Override
-    public String getDeployMessage() {
-        return "The application was sent to your phone.\nYou need to complete the installation on your phone before running the application.";
-    }
-}