Merged heads
authorEugene Ostroukhov <eugeneo@symbian.org>
Tue, 02 Feb 2010 13:54:21 -0800
changeset 85 c77287342938
parent 84 b24e6a27768d (diff)
parent 81 f60819888c52 (current diff)
child 87 02d2e9112f8c
child 88 aeba352033d2
Merged heads
--- a/org.symbian.tools.wrttools.previewer/plugin.xml	Tue Feb 02 12:43:30 2010 -0800
+++ b/org.symbian.tools.wrttools.previewer/plugin.xml	Tue Feb 02 13:54:21 2010 -0800
@@ -5,6 +5,7 @@
          point="org.eclipse.ui.views">
       <view
             allowMultiple="false"
+            category="org.symbian.tools.wrttools.views"
             class="org.symbian.tools.wrttools.previewer.preview.PreviewView"
             icon="icons/obj16/html-editor.gif"
             id="org.symbian.tools.wrttools.editing.wrtpreview"
--- a/org.symbian.tools.wrttools.previewer/src/org/symbian/tools/wrttools/previewer/preview/MozillaPreviewPage.java	Tue Feb 02 12:43:30 2010 -0800
+++ b/org.symbian.tools.wrttools.previewer/src/org/symbian/tools/wrttools/previewer/preview/MozillaPreviewPage.java	Tue Feb 02 13:54:21 2010 -0800
@@ -92,9 +92,11 @@
 		try{
 			nsIServiceManager servMgr = null;
 			try {
+				Mozilla.getInstance().initialize(null);
 				servMgr = Mozilla.getInstance().getServiceManager();
 				if (servMgr == null) return;
 			} catch (Exception x) {
+				PreviewerPlugin.log(x);
 				// known to throw NullPointException on Mac OS when you're not using 
 				// Mozilla. We don't want to pollute the error log with this
 				return;
--- a/org.symbian.tools.wrttools.previewer/src/org/symbian/tools/wrttools/previewer/preview/PreviewView.java	Tue Feb 02 12:43:30 2010 -0800
+++ b/org.symbian.tools.wrttools.previewer/src/org/symbian/tools/wrttools/previewer/preview/PreviewView.java	Tue Feb 02 13:54:21 2010 -0800
@@ -7,7 +7,9 @@
 import java.io.IOException;
 import java.io.InputStream;
 import java.io.OutputStream;
+import java.net.URL;
 import java.util.Collection;
+import java.util.Enumeration;
 import java.util.HashMap;
 import java.util.HashSet;
 import java.util.Map;
@@ -24,6 +26,8 @@
 import org.eclipse.core.resources.IWorkspaceRoot;
 import org.eclipse.core.resources.ResourcesPlugin;
 import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.FileLocator;
+import org.eclipse.core.runtime.Path;
 import org.eclipse.core.runtime.Platform;
 import org.eclipse.jface.dialogs.IDialogConstants;
 import org.eclipse.jface.dialogs.MessageDialogWithToggle;
@@ -35,9 +39,9 @@
 import org.eclipse.ui.part.MessagePage;
 import org.eclipse.ui.part.PageBook;
 import org.eclipse.ui.part.PageBookView;
-import org.symbian.tools.wrttools.previewer.PreviewerPlugin;
+import org.osgi.framework.Bundle;
 import org.symbian.tools.wrttools.previewer.IWrtEditingPreferences;
-import org.symbian.tools.wrttools.util.CoreUtil;
+import org.symbian.tools.wrttools.previewer.PreviewerPlugin;
 import org.symbian.tools.wrttools.util.ProjectUtils;
 
 public class PreviewView extends PageBookView {
@@ -61,13 +65,15 @@
 
 	private final IResourceChangeListener resourceListener = new IResourceChangeListener() {
 		public void resourceChanged(IResourceChangeEvent event) {
-			ChangedResourcesCollector visitor = new ChangedResourcesCollector();
-			try {
-				event.getDelta().accept(visitor);
-			} catch (CoreException e) {
-				PreviewerPlugin.log(e);
+			if (event.getDelta() != null) {
+				ChangedResourcesCollector visitor = new ChangedResourcesCollector();
+				try {
+					event.getDelta().accept(visitor);
+				} catch (CoreException e) {
+					PreviewerPlugin.log(e);
+				}
+				refreshPages(visitor.files);
 			}
-			refreshPages(visitor.files);
 		}
 	};
 
@@ -86,6 +92,14 @@
 
 	@Override
 	public void createPartControl(Composite parent) {
+		Bundle bundle = Platform.getBundle("org.eclipse.wst.sse.ui");
+		Enumeration findEntries = bundle.findEntries("/icons/full/", "*", true);
+		URL resolved;
+		try {
+			resolved = FileLocator.resolve((URL) findEntries.nextElement());
+			System.out.println(resolved);
+		} catch (IOException e) {
+		}
 		super.createPartControl(parent);
 		ResourcesPlugin.getWorkspace().addResourceChangeListener(
 				resourceListener);
@@ -146,7 +160,8 @@
 				.getPreferenceStore();
 		String value = preferenceStore
 				.getString(IWrtEditingPreferences.PREF_AUTO_REFRESH);
-		if (value == null || value.trim().length() == 0 || MessageDialogWithToggle.PROMPT.equals(value)) {
+		if (value == null || value.trim().length() == 0
+				|| MessageDialogWithToggle.PROMPT.equals(value)) {
 			return MessageDialogWithToggle
 					.openYesNoQuestion(
 							getSite().getShell(),
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.symbian.tools.wrttools.product/launch/WRT IDE Product (Linux).launch	Tue Feb 02 13:54:21 2010 -0800
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<launchConfiguration type="org.eclipse.pde.ui.RuntimeWorkbench">
+<booleanAttribute key="append.args" value="true"/>
+<booleanAttribute key="askclear" value="true"/>
+<booleanAttribute key="automaticAdd" value="false"/>
+<booleanAttribute key="automaticValidate" value="false"/>
+<stringAttribute key="bootstrap" value=""/>
+<stringAttribute key="checked" value="[NONE]"/>
+<booleanAttribute key="clearConfig" value="false"/>
+<booleanAttribute key="clearws" value="false"/>
+<booleanAttribute key="clearwslog" value="false"/>
+<stringAttribute key="configLocation" value="${workspace_loc}/.metadata/.plugins/org.eclipse.pde.core/WRT IDE Product (Windows) (1)"/>
+<booleanAttribute key="default" value="false"/>
+<booleanAttribute key="includeOptional" value="true"/>
+<stringAttribute key="location" value="${workspace_loc}/../runtime-wrt-ide.product"/>
+<stringAttribute key="org.eclipse.jdt.launching.JRE_CONTAINER" value="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
+<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="-os ${target.os} -ws ${target.ws} -arch ${target.arch} -nl ${target.nl} -os ${target.os} -ws ${target.ws} -arch ${target.arch} -nl ${target.nl}"/>
+<stringAttribute key="org.eclipse.jdt.launching.SOURCE_PATH_PROVIDER" value="org.eclipse.pde.ui.workbenchClasspathProvider"/>
+<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Xms128m -Xmx768m -XX:MaxPermSize=192m"/>
+<stringAttribute key="pde.version" value="3.3"/>
+<stringAttribute key="product" value="org.symbian.tools.wrttools.product.product"/>
+<stringAttribute key="productFile" value="\org.symbian.tools.wrttools.product\wrt-ide.product"/>
+<booleanAttribute key="restart" value="false"/>
+<stringAttribute key="selected_target_plugins" value="org.eclipse.equinox.p2.publisher@default:default,org.eclipse.draw2d@default:default,org.eclipse.wst.validation@default:default,org.eclipse.ui.views.log@default:default,org.eclipse.help.webapp@default:default,org.eclipse.equinox.security.ui@default:default,org.eclipse.update.core.linux@default:false,org.apache.xml.resolver@default:default,org.eclipse.equinox.http.jetty@default:default,org.eclipse.debug.ui@default:default,org.eclipse.emf.edit.ui@default:default,org.eclipse.gef@default:default,org.eclipse.emf.mapping.ecore2xml@default:default,org.eclipse.swt.win32.win32.x86@default:false,org.apache.oro@default:default,org.eclipse.osgi@-1:true,org.eclipse.ecf.provider.filetransfer.httpclient@default:default,org.sat4j.core@default:default,org.eclipse.jem.util@default:default,org.eclipse.equinox.p2.repository@default:default,org.eclipse.ui.cocoa@default:false,org.eclipse.wst.validation.ui@default:default,org.eclipse.core.runtime@default:true,org.eclipse.emf.mapping.ecore@default:default,org.apache.velocity@default:default,org.apache.xml.serializer@default:default,org.eclipse.wst.command.env.infopop@default:default,org.eclipse.jsch.ui@default:default,org.eclipse.ecf.provider.filetransfer.ssl@default:false,org.apache.commons.net@default:default,org.eclipse.ui.win32@default:false,org.eclipse.wst.validation.infopop@default:default,org.eclipse.wst.common.environment@default:default,org.eclipse.emf.mapping@default:default,org.objectweb.asm@default:default,org.eclipse.ui.intro.universal@default:default,org.eclipse.core.runtime.compatibility.auth@default:default,org.eclipse.equinox.launcher.gtk.linux.x86@default:false,org.apache.lucene@default:default,org.eclipse.cvs@default:default,org.eclipse.emf.common@default:default,org.eclipse.equinox.p2.ui@default:default,org.eclipse.emf.databinding@default:default,org.apache.commons.jxpath@default:default,javax.servlet.jsp@default:default,org.eclipse.equinox.p2.artifact.repository@default:default,org.eclipse.wst.command.env@default:default,org.apache.xerces@default:default,org.eclipse.core.jobs@default:default,org.eclipse.ui.navigator@default:default,org.eclipse.wst.common.ui@default:default,org.eclipse.emf.ecore.change@default:default,org.eclipse.wst.standard.schemas@default:default,org.eclipse.ui.presentations.r21@default:default,org.mozilla.xulrunner.gtk.linux.x86@default:false,org.eclipse.core.runtime.compatibility.registry@default:false,org.eclipse.help@default:default,org.eclipse.ecf@default:default,org.eclipse.equinox.app@default:default,org.eclipse.ui.forms@default:default,org.eclipse.equinox.launcher@default:default,org.eclipse.wst.jsdt.ui@default:default,org.eclipse.core.runtime.compatibility@default:default,org.eclipse.rcp@default:default,org.eclipse.emf.common.ui@default:default,org.eclipse.wst.dtd.core@default:default,javax.transaction@default:false,org.eclipse.wtp.epp.package.jee.intro@default:default,org.eclipse.team.cvs.ssh@default:default,org.eclipse.compare@default:default,org.eclipse.wst.xml.ui.infopop@default:default,org.eclipse.ui.browser@default:default,org.eclipse.wst.xml.xpath.core@default:default,org.eclipse.equinox.p2.jarprocessor@default:default,org.eclipse.wst.common.project.facet.core@default:default,org.eclipse.wst.internet.cache@default:default,org.eclipse.equinox.frameworkadmin@default:default,org.apache.commons.discovery@default:default,org.eclipse.wst.command.env.doc.user@default:default,org.eclipse.wst.xml.core@default:default,org.eclipse.equinox.security.macosx@default:false,org.eclipse.text@default:default,com.ibm.icu@default:default,org.eclipse.ui.cheatsheets@default:default,org.apache.commons.lang*2.3.0.v200803061910@default:default,net.sourceforge.lpg.lpgjavaruntime@default:default,org.eclipse.equinox.p2.director@default:default,org.eclipse.wst.html.core@default:default,org.eclipse.team.core@default:default,org.eclipse.wst.doc.user@default:default,org.eclipse.wst.command.env.core@default:default,org.eclipse.osgi.util@default:default,org.eclipse.team.cvs.ssh2@default:default,org.eclipse.ui.externaltools@default:default,org.eclipse.help.appserver@default:default,org.eclipse.ui.views.properties.tabbed@default:default,org.eclipse.wst.jsdt.doc@default:default,org.eclipse.equinox.jsp.jasper@default:default,org.eclipse.core.contenttype@default:default,org.eclipse.core.databinding.observable@default:default,org.eclipse.core.net.win32.x86@default:false,org.eclipse.equinox.launcher.cocoa.macosx.x86_64@default:false,org.eclipse.ecf.ssl@default:false,org.eclipse.help.base@default:default,javax.servlet@default:default,org.eclipse.ui.ide@default:default,org.eclipse.compare.win32@default:default,org.eclipse.equinox.p2.ui.sdk@default:default,javax.xml.stream@default:default,org.eclipse.emf.ecore.change.edit@default:default,org.eclipse.swt.cocoa.macosx.x86_64@default:false,org.eclipse.core.expressions@default:default,org.eclipse.emf.ecore.xmi@default:default,org.eclipse.equinox.p2.updatesite@default:default,org.eclipse.equinox.p2.garbagecollector@default:default,org.eclipse.wst.common.snippets@default:default,org.eclipse.equinox.p2.metadata.generator@default:default,org.eclipse.equinox.launcher.win32.win32.x86@default:false,org.eclipse.equinox.p2.directorywatcher@default:default,org.eclipse.swt@default:default,org.eclipse.equinox.p2.console@default:default,org.eclipse.wst.xmleditor.doc.user@default:default,org.eclipse.core.commands@default:default,org.eclipse.equinox.security@default:default,org.eclipse.core.resources.win32.x86@default:false,org.eclipse.equinox.simpleconfigurator.manipulator@default:default,org.eclipse.wst.html.ui.infopop@default:default,org.eclipse.team.cvs.ui@default:default,org.jdom@default:default,org.eclipse.equinox.ds@1:true,org.eclipse.epp.package.jee@default:default,javax.mail*1.4.0.v200905040518@default:default,org.eclipse.wst.css.core@default:default,org.apache.lucene.analysis@default:default,org.eclipse.ui.workbench.texteditor@default:default,org.apache.xalan@default:default,org.mortbay.jetty.server@default:default,org.eclipse.search@default:default,org.apache.bcel@default:default,org.eclipse.debug.core@default:default,org.eclipse.wst.jsdt.web.core@default:default,org.hamcrest.core@default:default,org.eclipse.equinox.util@default:default,org.eclipse.wst.xml.xpath.ui@default:default,org.eclipse.ui.intro@default:default,java_cup.runtime@default:default,org.eclipse.ui@default:default,org.eclipse.equinox.frameworkadmin.equinox@default:default,org.eclipse.emf@default:default,org.eclipse.equinox.p2.updatechecker@default:default,org.eclipse.emf.mapping.ui@default:default,javax.persistence@default:default,org.mortbay.jetty.util@default:default,org.eclipse.ecf.provider.filetransfer@default:default,org.mozilla.xulrunner.win32.win32.x86@default:false,org.eclipse.ui.net@default:default,org.eclipse.equinox.p2.repository.tools@default:default,org.eclipse.net4j.jms.api@default:default,org.eclipse.update.core@default:default,org.apache.commons.httpclient@default:default,org.eclipse.equinox.p2.engine@default:default,org.eclipse.core.databinding@default:default,org.eclipse.jface.databinding@default:default,org.eclipse.equinox.p2.metadata.repository@default:default,org.eclipse.equinox.p2.exemplarysetup@default:default,org.eclipse.team.ui@default:default,org.eclipse.core.filesystem@default:default,com.jcraft.jsch@default:default,org.eclipse.wst.html.ui@default:default,org.eclipse.ui.editors@default:default,org.eclipse.ui.views@default:default,org.mozilla.xpcom@default:default,org.eclipse.wst.css.ui@default:default,org.eclipse.wst.jsdt.manipulation@default:default,org.eclipse.equinox.p2.director.app@default:default,org.eclipse.ui.workbench.compatibility@default:false,org.eclipse.core.databinding.beans@default:default,org.eclipse.equinox.p2.core@default:default,org.eclipse.jface@default:default,org.eclipse.equinox.simpleconfigurator@1:true,org.eclipse.equinox.jsp.jasper.registry@default:default,org.mozilla.xulrunner@default:default,org.eclipse.ecf.filetransfer@default:default,org.eclipse.wst.internet.monitor.core@default:default,org.eclipse.equinox.http.servlet@default:default,org.eclipse.wst.xml.ui@default:default,org.eclipse.equinox.p2.touchpoint.eclipse@default:default,org.eclipse.core.net.linux.x86@default:false,org.eclipse.wst.common.core@default:default,org.eclipse.wst.common.emf@default:default,org.eclipse.wst.jsdt.support.ie@default:default,org.eclipse.ui.navigator.resources@default:default,org.eclipse.core.filesystem.linux.x86@default:false,org.eclipse.jem@default:default,org.eclipse.wst.sse.core@default:default,javax.xml@default:default,org.eclipse.jdt.launching.macosx@default:default,org.eclipse.team.cvs.core@default:default,org.eclipse.emf.ecore@default:default,org.eclipse.wst.common.emfworkbench.integration@default:default,org.eclipse.ui.ide.application@default:default,org.eclipse.wst.jsdt.support.firefox@default:default,org.eclipse.core.resources@default:default,org.apache.commons.logging@default:default,org.eclipse.core.resources.compatibility@default:false,org.eclipse.platform.doc.user@default:default,org.eclipse.wst.internet.monitor.ui@default:default,org.eclipse.ltk.ui.refactoring@default:default,javax.xml.bind@default:default,org.eclipse.update.ui@default:default,org.eclipse.help.ui@default:default,org.eclipse.jsch.core@default:default,org.eclipse.wst.xml.xpath2.processor@default:default,org.eclipse.jface.text@default:default,org.eclipse.equinox.p2.reconciler.dropins@default:default,org.eclipse.ui.workbench@default:default,org.apache.jasper@default:default,org.eclipse.equinox.p2.touchpoint.natives@default:default,org.eclipse.wst.jsdt.core@default:default,org.eclipse.equinox.p2.ui.sdk.scheduler@default:default,org.eclipse.equinox.registry@default:default,org.eclipse.equinox.common@2:true,org.eclipse.equinox.p2.extensionlocation@default:default,org.eclipse.osgi.services@default:default,org.eclipse.core.net@default:default,org.eclipse.wst.common.frameworks@default:default,org.eclipse.wst.common.frameworks.ui@default:default,org.eclipse.ui.console@default:default,org.apache.commons.el@default:default,org.eclipse.update.configurator@3:true,org.eclipse.wst.sse.doc.user@default:default,org.eclipse.core.databinding.property@default:default,org.eclipse.ecf.provider.filetransfer.httpclient.ssl@default:false,org.eclipse.equinox.p2.metadata@default:default,org.eclipse.wst.common.uriresolver@default:default,org.apache.commons.collections@default:default,org.eclipse.emf.mapping.ecore.editor@default:default,org.eclipse.update.scheduler@default:default,org.eclipse.update.core.win32@default:false,org.eclipse.dstore.core@default:default,org.apache.commons.codec@default:default,org.eclipse.jdt.launching.ui.macosx@default:default,org.eclipse.ltk.core.refactoring@default:default,org.eclipse.wst.sse.ui@default:default,org.sat4j.pb@default:default,org.eclipse.platform@default:default,org.eclipse.wst.common.infopop@default:default,org.eclipse.emf.databinding.edit@default:default,org.eclipse.wst.jsdt.web.ui@default:default,org.eclipse.emf.mapping.ecore2ecore@default:default,org.apache.axis@default:default,org.eclipse.emf.ecore.edit@default:default,org.eclipse.dstore.extra@default:default,org.eclipse.core.filebuffers@default:default,org.apache.log4j@default:default,org.eclipse.equinox.http.registry@default:default,org.eclipse.emf.edit@default:default,org.eclipse.equinox.security.win32.x86@default:false,javax.xml.rpc@default:default,org.eclipse.equinox.preferences@default:default,commonj.sdo@default:default,org.eclipse.wst.sse.ui.infopop@default:default,org.eclipse.core.variables@default:default,org.eclipse.compare.core@default:default,javax.wsdl@default:default,org.eclipse.core.filesystem.macosx@default:false,javax.activation*1.1.0.v200906290531@default:default,org.eclipse.ecf.identity@default:default,javax.xml.soap@default:default,org.eclipse.swt.gtk.linux.x86@default:false,org.eclipse.core.boot@default:default,org.eclipse.equinox.concurrent@default:default,org.eclipse.wst.common.modulecore@default:default,org.eclipse.core.filesystem.win32.x86@default:false"/>
+<stringAttribute key="selected_workspace_plugins" value="org.chromium.debug.ui@default:default,org.chromium.debug.core@default:default,org.symbian.tools.wrttools.debug.core@default:default,org.chromium.sdk@default:default,org.symbian.tools.wrttools@default:default,org.symbian.tools.wrttools.previewer@default:default,org.symbian.tools.wrttools.product@default:default"/>
+<booleanAttribute key="show_selected_only" value="false"/>
+<booleanAttribute key="tracing" value="false"/>
+<booleanAttribute key="useDefaultConfig" value="true"/>
+<booleanAttribute key="useDefaultConfigArea" value="true"/>
+<booleanAttribute key="useProduct" value="true"/>
+<booleanAttribute key="usefeatures" value="false"/>
+</launchConfiguration>
--- a/org.symbian.tools.wrttools.product/wrt-ide.product	Tue Feb 02 12:43:30 2010 -0800
+++ b/org.symbian.tools.wrttools.product/wrt-ide.product	Tue Feb 02 13:54:21 2010 -0800
@@ -85,7 +85,6 @@
       <plugin id="org.eclipse.core.filebuffers"/>
       <plugin id="org.eclipse.core.filesystem"/>
       <plugin id="org.eclipse.core.filesystem.linux.x86" fragment="true"/>
-      <plugin id="org.eclipse.core.filesystem.linux.x86_64" fragment="true"/>
       <plugin id="org.eclipse.core.filesystem.macosx" fragment="true"/>
       <plugin id="org.eclipse.core.filesystem.win32.x86" fragment="true"/>
       <plugin id="org.eclipse.core.jobs"/>
@@ -140,9 +139,8 @@
       <plugin id="org.eclipse.equinox.jsp.jasper"/>
       <plugin id="org.eclipse.equinox.jsp.jasper.registry"/>
       <plugin id="org.eclipse.equinox.launcher"/>
-      <plugin id="org.eclipse.equinox.launcher.cocoa.macosx.x86_64" fragment="true"/>
+      <plugin id="org.eclipse.equinox.launcher.cocoa.macosx" fragment="true"/>
       <plugin id="org.eclipse.equinox.launcher.gtk.linux.x86" fragment="true"/>
-      <plugin id="org.eclipse.equinox.launcher.gtk.linux.x86_64" fragment="true"/>
       <plugin id="org.eclipse.equinox.launcher.win32.win32.x86" fragment="true"/>
       <plugin id="org.eclipse.equinox.p2.artifact.repository"/>
       <plugin id="org.eclipse.equinox.p2.console"/>
@@ -200,9 +198,8 @@
       <plugin id="org.eclipse.rcp"/>
       <plugin id="org.eclipse.search"/>
       <plugin id="org.eclipse.swt"/>
-      <plugin id="org.eclipse.swt.cocoa.macosx.x86_64" fragment="true"/>
+      <plugin id="org.eclipse.swt.cocoa.macosx" fragment="true"/>
       <plugin id="org.eclipse.swt.gtk.linux.x86" fragment="true"/>
-      <plugin id="org.eclipse.swt.gtk.linux.x86_64" fragment="true"/>
       <plugin id="org.eclipse.swt.win32.win32.x86" fragment="true"/>
       <plugin id="org.eclipse.team.core"/>
       <plugin id="org.eclipse.team.cvs.core"/>
@@ -289,6 +286,7 @@
       <plugin id="org.mortbay.jetty.util"/>
       <plugin id="org.mozilla.xpcom"/>
       <plugin id="org.mozilla.xulrunner"/>
+      <plugin id="org.mozilla.xulrunner.carbon.macosx" fragment="true"/>
       <plugin id="org.mozilla.xulrunner.gtk.linux.x86" fragment="true"/>
       <plugin id="org.mozilla.xulrunner.win32.win32.x86" fragment="true"/>
       <plugin id="org.objectweb.asm"/>
--- a/org.symbian.tools.wrttools/plugin.xml	Tue Feb 02 12:43:30 2010 -0800
+++ b/org.symbian.tools.wrttools/plugin.xml	Tue Feb 02 13:54:21 2010 -0800
@@ -208,42 +208,45 @@
          </description>
 		</projectTemplate>
       <projectTemplate
+      		name="Basic WRT Project with WRTKit Support"
             archive="projecttemplates/wrtkit.zip"
             default-css-name="basic"
             default-html-name="index"
             default-js-name="basic"
             icon="icons/main16.gif"
-            id-pattern="com.{0}.basic.widget"
-            name="Basic WRT Project with WRTKit Support">
+            id-pattern="com.{0}.basic.widget">
          <description>
             This wizard generates an basic project with a minimal Info.plist, html,css and js along with WRTKit.
          </description>
+         <requires-library>org.symbian.wrtkit</requires-library>
       </projectTemplate>
       <projectTemplate
+            name="Flickr Application Project"
             archive="projecttemplates/flickr.zip"
             default-css-name="Flickr"
             default-html-name="index"
             default-js-name="Flickr"
             icon="icons/flickr.gif"
             id-pattern="com.{0}.flickr.widget"
-            name="Flickr Application Project"
             wizard-page-factory="org.symbian.tools.wrttools.wizards.FlickrProjectDetailsWizardPage$Factory">
          <description>
             This wizard generates an Flickr project with a minimal Info.plist, html,css and js and WRTKit.
          </description>
+         <requires-library>org.symbian.wrtkit</requires-library>
       </projectTemplate>
       <projectTemplate
+            name="RSS Reader Application Project"
             archive="projecttemplates/rssreader.zip"
             default-css-name="RSSReader"
             default-html-name="index"
             default-js-name="RSSReader"
             icon="icons/rss.gif"
             id-pattern="com.{0}.rssreader.widget"
-            name="RSS Reader Application Project"
             wizard-page-factory="org.symbian.tools.wrttools.wizards.RssReaderProjectDetailsWizardPage$Factory">
          <description>
             This wizard generates an RSS Reader project with a minimal Info.plist, html,css and js and WRTKit.
          </description>
+         <requires-library>org.symbian.wrtkit</requires-library>
       </projectTemplate>
 	</extension>
 	
@@ -256,7 +259,14 @@
 			icon="icons/main16.gif" id="org.symbian.tools.wrttools.import.aptanaImport"
 			name="Aptana IDE WRT Project">
 		</wizard>
-	</extension>
+       <wizard
+          category="org.symbian.tools.wrttools.import"
+          class="org.symbian.tools.wrttools.wizards.WgzImportWizard"
+          icon="icons/main16.gif"
+          id="org.symbian.tools.wrttools.importwgz"
+          name="Import WRT Application Archive">
+       </wizard>
+    </extension>
 	
 <!-- Problem Markers -->
 	<extension id="org.symbian.tools.wrt.xmlProblem" name="XML Problem"
@@ -543,9 +553,29 @@
                 <adapt
                       type="org.eclipse.core.resources.IResource">
                 </adapt>
-                <count
-                      value="0">
-                </count>
+                <adapt
+                      type="java.util.Collection">
+	                <count
+	                      value="0">
+	                </count>
+                </adapt>
+             </or>
+          </enablement>
+       </commonWizard>
+       <commonWizard
+             type="import"
+             wizardId="org.symbian.tools.wrttools.importwgz">
+          <enablement>
+             <or>
+                <adapt
+                      type="org.eclipse.core.resources.IResource">
+                </adapt>
+                <adapt
+                      type="java.util.Collection">
+	                <count
+	                      value="0">
+	                </count>
+                </adapt>
              </or>
           </enablement>
        </commonWizard>
@@ -569,4 +599,19 @@
        </commonSorter>
     </navigatorContent>
  </extension>
+ <extension
+       point="org.eclipse.wst.jsdt.core.JsGlobalScopeContainerInitializer">
+    <JsGlobalScopeContainerInitializer
+       class="org.symbian.tools.wrttools.core.libraries.WrtKitLibInitializer"
+       id="org.symbian.wrtkit">
+    </JsGlobalScopeContainerInitializer>
+ </extension>
+ <extension
+        point="org.eclipse.wst.jsdt.ui.JsGlobalScopeContainerPage">
+    <JsGlobalScopeContainerPage
+            name="WRTKit"
+            class="org.symbian.tools.wrttools.wizards.WrtKitLibraryWizardPage"
+            id="org.symbian.wrtkit">
+    </JsGlobalScopeContainerPage>    
+  </extension>
 </plugin>
--- a/org.symbian.tools.wrttools/schema/projectTemplates.exsd	Tue Feb 02 12:43:30 2010 -0800
+++ b/org.symbian.tools.wrttools/schema/projectTemplates.exsd	Tue Feb 02 13:54:21 2010 -0800
@@ -49,8 +49,11 @@
 
    <element name="projectTemplate">
       <complexType>
-         <sequence>
-            <element ref="description" minOccurs="0" maxOccurs="1"/>
+         <sequence minOccurs="1" maxOccurs="unbounded">
+            <choice>
+               <element ref="description"/>
+               <element ref="requires-library" minOccurs="0" maxOccurs="unbounded"/>
+            </choice>
          </sequence>
          <attribute name="name" type="string" use="required">
             <annotation>
@@ -131,6 +134,9 @@
       </annotation>
    </element>
 
+   <element name="requires-library" type="string">
+   </element>
+
    <annotation>
       <appinfo>
          <meta.section type="since"/>
--- a/org.symbian.tools.wrttools/src/org/symbian/tools/wrttools/core/ProjectTemplate.java	Tue Feb 02 12:43:30 2010 -0800
+++ b/org.symbian.tools.wrttools/src/org/symbian/tools/wrttools/core/ProjectTemplate.java	Tue Feb 02 13:54:21 2010 -0800
@@ -70,6 +70,16 @@
 		}
 	}
 	
+	public String[] getLibraryIds() {
+		IConfigurationElement[] elements = element.getChildren("requires-library");
+		String[] ids = new String[elements.length];
+		for (int i = 0; i < elements.length; i++) {
+			IConfigurationElement element = elements[i];
+			ids[i] = element.getValue();
+		}
+		return ids;
+	}
+	
 	public static ProjectTemplate[] getAllTemplates() {
 		if (templates == null) {
 			IExtensionPoint point = Platform.getExtensionRegistry().getExtensionPoint(Activator.PLUGIN_ID, "projectTemplates");
--- a/org.symbian.tools.wrttools/src/org/symbian/tools/wrttools/util/ProjectUtils.java	Tue Feb 02 12:43:30 2010 -0800
+++ b/org.symbian.tools.wrttools/src/org/symbian/tools/wrttools/util/ProjectUtils.java	Tue Feb 02 13:54:21 2010 -0800
@@ -54,6 +54,9 @@
 	public static final String PREVIEW_MAIN_FILE = "wrt_preview_main.html";
 
 	private static boolean isDefaultProjectLocation(URI uri) {
+		if (uri == null) {
+			return true;
+		}
 		File file = new File(uri);
 		IPath project = new Path(file.getAbsolutePath());
 		IPath workspace = ResourcesPlugin.getWorkspace().getRoot()
--- a/org.symbian.tools.wrttools/src/org/symbian/tools/wrttools/wizards/WrtWidgetWizard.java	Tue Feb 02 12:43:30 2010 -0800
+++ b/org.symbian.tools.wrttools/src/org/symbian/tools/wrttools/wizards/WrtWidgetWizard.java	Tue Feb 02 13:54:21 2010 -0800
@@ -45,6 +45,7 @@
 import org.eclipse.core.runtime.IExecutableExtension;
 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.core.runtime.SubProgressMonitor;
 import org.eclipse.jface.operation.IRunnableWithProgress;
@@ -55,8 +56,14 @@
 import org.eclipse.ui.IWorkbench;
 import org.eclipse.ui.dialogs.WizardNewProjectCreationPage;
 import org.eclipse.ui.wizards.newresource.BasicNewProjectResourceWizard;
+import org.eclipse.wst.jsdt.core.IIncludePathEntry;
+import org.eclipse.wst.jsdt.core.IJavaScriptProject;
+import org.eclipse.wst.jsdt.core.JavaScriptCore;
+import org.eclipse.wst.jsdt.core.JavaScriptModelException;
+import org.eclipse.wst.jsdt.core.JsGlobalScopeContainerInitializer;
 import org.symbian.tools.wrttools.Activator;
 import org.symbian.tools.wrttools.core.ProjectTemplate;
+import org.symbian.tools.wrttools.core.libraries.IWrtIdeContainer;
 import org.symbian.tools.wrttools.util.NonClosingStream;
 import org.symbian.tools.wrttools.util.ProjectUtils;
 
@@ -106,10 +113,42 @@
 			throws CoreException {
 		monitor.beginTask("Creating project", 100);
 		IProject project = ProjectUtils.createWrtProject(context.getProjectName(), context.getProjectUri(), new SubProgressMonitor(monitor, 30));
-		populateProject(project, new SubProgressMonitor(monitor, 70));
+		populateProject(project, new SubProgressMonitor(monitor, 30));
+		try {
+			initLibraries(project, context.getTemplate().getLibraryIds(), new SubProgressMonitor(monitor, 40));
+		} catch (IOException e) {
+			throw new CoreException(new Status(IStatus.ERROR, Activator.PLUGIN_ID, "Failed to setup libraries", e));
+		}
 		monitor.done();
 	}
 
+	private void initLibraries(IProject project, String[] libraryIds, IProgressMonitor progressMonitor) throws IOException, CoreException {
+		if (libraryIds.length == 0) {
+			progressMonitor.done();
+			return;
+		}
+		progressMonitor.beginTask("Installing JS libraries", 100);
+		int perContainer = 90 / libraryIds.length;
+		for (String string : libraryIds) {
+			JsGlobalScopeContainerInitializer containerInitializer = JavaScriptCore.getJsGlobalScopeContainerInitializer(string);
+			if (containerInitializer instanceof IWrtIdeContainer) {
+				((IWrtIdeContainer) containerInitializer).populateProject(project, new SubProgressMonitor(progressMonitor, perContainer));
+			}
+		}
+		IJavaScriptProject js = JavaScriptCore.create(project);
+		IIncludePathEntry[] rawIncludepath = js.getRawIncludepath();
+		int preconfigured = rawIncludepath.length;
+		IIncludePathEntry[] newIncludepath = new IIncludePathEntry[preconfigured + libraryIds.length];
+		System.arraycopy(rawIncludepath, 0, newIncludepath, 0, preconfigured);
+		for (int i = 0; i < libraryIds.length; i++) {
+			String string = libraryIds[i];
+			IIncludePathEntry entry = JavaScriptCore.newContainerEntry(new Path(string));
+			newIncludepath[preconfigured + i] = entry;
+		}
+		js.setRawIncludepath(newIncludepath, new SubProgressMonitor(progressMonitor, 10));
+		progressMonitor.done();
+	}
+
 	private void populateProject(IProject project, IProgressMonitor monitor)
 			throws CoreException {
 		URL projectContents = context.getTemplate().getProjectContents();