Nokia validation code is now integrated with WTP framework
authorEugene Ostroukhov <eugeneo@symbian.org>
Fri, 05 Feb 2010 09:17:58 -0800
changeset 98 b6d252d808df
parent 92 e5c37ce1b003
child 99 2196d1511a17
Nokia validation code is now integrated with WTP framework
org.symbian.tools.wrttools.debug.core/.classpath
org.symbian.tools.wrttools.jseditors/.classpath
org.symbian.tools.wrttools.previewer/.classpath
org.symbian.tools.wrttools.previewer/src/org/symbian/tools/wrttools/previewer/http/WorkspaceResourcesServlet.java
org.symbian.tools.wrttools.product/.classpath
org.symbian.tools.wrttools/.classpath
org.symbian.tools.wrttools/plugin.xml
org.symbian.tools.wrttools/src/org/symbian/tools/wrttools/core/validator/HtmlValidator.java
org.symbian.tools.wrttools/src/org/symbian/tools/wrttools/core/validator/WidgetValidator.java
org.symbian.tools.wrttools/src/org/symbian/tools/wrttools/util/CoreUtil.java
org.symbian.tools.wrttools/src/org/symbian/tools/wrttools/util/ProjectUtils.java
org.symbian.tools.wrttools/src/org/symbian/tools/wrttools/wizards/WrtWidgetWizard.java
--- a/org.symbian.tools.wrttools.debug.core/.classpath	Wed Feb 03 10:45:34 2010 -0800
+++ b/org.symbian.tools.wrttools.debug.core/.classpath	Fri Feb 05 09:17:58 2010 -0800
@@ -1,6 +1,6 @@
 <?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/JavaSE-1.6"/>
+	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
 	<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
 	<classpathentry kind="src" path="src"/>
 	<classpathentry kind="output" path="bin"/>
--- a/org.symbian.tools.wrttools.jseditors/.classpath	Wed Feb 03 10:45:34 2010 -0800
+++ b/org.symbian.tools.wrttools.jseditors/.classpath	Fri Feb 05 09:17:58 2010 -0800
@@ -1,6 +1,6 @@
 <?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/JavaSE-1.6"/>
+	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
 	<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
 	<classpathentry kind="src" path="src"/>
 	<classpathentry kind="output" path="bin"/>
--- a/org.symbian.tools.wrttools.previewer/.classpath	Wed Feb 03 10:45:34 2010 -0800
+++ b/org.symbian.tools.wrttools.previewer/.classpath	Fri Feb 05 09:17:58 2010 -0800
@@ -1,6 +1,6 @@
 <?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/JavaSE-1.6"/>
+	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
 	<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
 	<classpathentry kind="src" path="src"/>
 	<classpathentry kind="output" path="bin"/>
--- a/org.symbian.tools.wrttools.previewer/src/org/symbian/tools/wrttools/previewer/http/WorkspaceResourcesServlet.java	Wed Feb 03 10:45:34 2010 -0800
+++ b/org.symbian.tools.wrttools.previewer/src/org/symbian/tools/wrttools/previewer/http/WorkspaceResourcesServlet.java	Fri Feb 05 09:17:58 2010 -0800
@@ -47,14 +47,13 @@
 import org.eclipse.core.runtime.IPath;
 import org.eclipse.core.runtime.Path;
 import org.symbian.tools.wrttools.previewer.PreviewerPlugin;
+import org.symbian.tools.wrttools.util.CoreUtil;
 
 public class WorkspaceResourcesServlet extends HttpServlet {
 	private static final String STARTING_PAGE = "preview-frame.html";
 	private static final String INDEX_PAGE = "wrt_preview_main.html";
 	private static final long serialVersionUID = -3217197074249607950L;
 
-	private static final Pattern HTML_FILE_NAME_PROPERTY = Pattern
-			.compile("<key>\\s*MainHTML\\s*</key>\\s*<string>\\s*(.*)\\s*</string>", Pattern.CASE_INSENSITIVE);
 	private static final Pattern HEAD_TAG_PATTERN = Pattern.compile("<head(\\s*\\w*=\"(^\")*\")*\\s*>", Pattern.CASE_INSENSITIVE);
 	private static final String SCRIPT = "<script language=\"JavaScript\" type=\"text/javascript\" src=\"preview/script/lib/loader.js\"></script>";
 
@@ -103,7 +102,7 @@
 		IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(
 				projectName);
 		if (project.isAccessible()) {
-			String indexFileName = getIndexFileName(project);
+			String indexFileName = CoreUtil.getIndexFileName(readFile(project, "Info.plist"));
 			if (indexFileName != null) {
 				String string = readFile(project, indexFileName);
 				if (string != null) {
@@ -118,18 +117,6 @@
 		return null;
 	}
 
-	private String getIndexFileName(IProject project) throws CoreException,
-			UnsupportedEncodingException, IOException {
-		String buffer = readFile(project, "Info.plist");
-		if (buffer != null) {
-			Matcher matcher = HTML_FILE_NAME_PROPERTY.matcher(buffer);
-			if (matcher.find()) {
-				return matcher.group(1);
-			}
-		}
-		return null;
-	}
-
 	private String readFile(IProject project, String fileName)
 			throws CoreException, UnsupportedEncodingException, IOException {
 		IFile file = getFile(project, fileName);
--- a/org.symbian.tools.wrttools.product/.classpath	Wed Feb 03 10:45:34 2010 -0800
+++ b/org.symbian.tools.wrttools.product/.classpath	Fri Feb 05 09:17:58 2010 -0800
@@ -1,6 +1,6 @@
 <?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/JavaSE-1.6"/>
+	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
 	<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
 	<classpathentry kind="src" path="src"/>
 	<classpathentry kind="output" path="bin"/>
--- a/org.symbian.tools.wrttools/.classpath	Wed Feb 03 10:45:34 2010 -0800
+++ b/org.symbian.tools.wrttools/.classpath	Fri Feb 05 09:17:58 2010 -0800
@@ -1,6 +1,6 @@
 <?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/JavaSE-1.6"/>
+	<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="src" path="cssvalidation-src/"/>
--- a/org.symbian.tools.wrttools/plugin.xml	Wed Feb 03 10:45:34 2010 -0800
+++ b/org.symbian.tools.wrttools/plugin.xml	Fri Feb 05 09:17:58 2010 -0800
@@ -42,22 +42,18 @@
         </extension>
         
 <!-- WRT Validators -->		
-	<extension
+<!--	<extension
 			point="org.eclipse.wst.validation.validatorV2"
 			id="org.symbian.tools.wrttools.core.validator"
 			name="%VALIDATOR.Name">
 		<validator class="org.symbian.tools.wrttools.core.validator.ValidateAction">
          	<include>
          	     <rules>
-		               <fileext ext="xml"/>
-		               <fileext ext="html"/>
-		               <fileext ext="js"/>
-		               <fileext ext="css"/>
 		               <fileext ext="plist"/>
 		         </rules>
             </include>
 		</validator>
-    </extension> 
+    </extension> --> 
     
 <!-- Validator Marker -->
    
@@ -614,4 +610,23 @@
             id="org.symbian.wrtkit">
     </JsGlobalScopeContainerPage>    
   </extension>
+ <extension
+       id="org.symbian.tools.wrttools.core.plistvalidator"
+       name="WRT Application Descriptor Validator"
+       point="org.eclipse.wst.validation.validatorV2">
+    <validator
+          build="true"
+          class="org.symbian.tools.wrttools.core.internal.validation.WrtApplicationValidator"
+          manual="true"
+          markerId="org.symbian.tools.wrttools.core.cssValidationMarker"
+          version="0.0.1">
+       <include>
+          <rules>
+             <projectNature
+                   id="org.symbian.tools.wrttools.WidgetProjectNature">
+             </projectNature>
+          </rules>
+       </include>
+    </validator>
+ </extension>
 </plugin>
--- a/org.symbian.tools.wrttools/src/org/symbian/tools/wrttools/core/validator/HtmlValidator.java	Wed Feb 03 10:45:34 2010 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,259 +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.validator;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.text.MessageFormat;
-import java.util.List;
-import java.util.Stack;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-import org.w3c.tidy.Node;
-import org.w3c.tidy.Tidy;
-import org.w3c.tidy.TidyMessage;
-import org.w3c.tidy.TidyMessageListener;
-
-import org.symbian.tools.wrttools.core.report.Message;
-import org.symbian.tools.wrttools.core.report.MessageHandler;
-import org.symbian.tools.wrttools.core.status.IWRTConstants;
-import org.symbian.tools.wrttools.core.widgetmodel.WidgetModel;
-import org.symbian.tools.wrttools.util.FileUtil;
-import org.symbian.tools.wrttools.util.Util;
-
-/**
-* Html Validator
-* Accepts the MessageManager .
-* Accept File projDir.
-* Use xmlParser to get all elements in a stack.
-* Call rule methods() passing the MessageManager and the stack of elements.
-*
-* @author Sailaja duvvuri
-*/
-public class HtmlValidator implements IValidator {
-    boolean htmlValidationStaus;
-    private String htmlFileName=null;
-    private String htmlPlistFileName=null;
-    private File htmlFile=null;
-    private Logger log = Logger.getLogger(getClass().getName());
-    private MessageHandler messageHandler;
-    private WidgetModel widgetModel;
-    private boolean allRulesPassed;
-    
-    
-
-	public WidgetModel getWidgetModel() {
-		return widgetModel;
-	}
-
-	public void setWidgetModel(WidgetModel widgetModel) {
-		this.widgetModel = widgetModel;
-	}
-	
-
-	public MessageHandler getMessageHandler() {
-		return messageHandler;
-	}
-
-
-	public void setMessageHandler(MessageHandler messageHandler) {
-		this.messageHandler = messageHandler;
-	}
-    
-	public boolean validate( File projDir) {
-	
-			Stack<String> htmlElements = null;
-		FileUtil fileUtil = new FileUtil();
-		List<File> dirList = fileUtil.getCurrDirFiles(projDir);
-		htmlFileName=widgetModel.getMainHtml();
-
-		 try {
-			
-				htmlFile = fileUtil.getFile(dirList, htmlFileName);
-			
-			if (htmlFile != null){
-				htmlFileName = htmlFile.getName();
-			if (widgetModel.getHtmlXmlFile()!=null) {
-					checkWellformed(htmlFile,true);
-					for(int i=0;i<widgetModel.getReferencedHtmlFiles().size();i++){
-						File refHtmlFile=new File(widgetModel.widgetDirectory+widgetModel.widgetName+"/"+widgetModel.getReferencedHtmlFiles().get(i));
-						if(refHtmlFile!=null)
-						checkWellformed(refHtmlFile,true);
-					}
-					for(int i=0;i<widgetModel.getReferencedCssFiles().size();i++){
-						File refHtmlFile=new File(widgetModel.widgetDirectory+widgetModel.widgetName+"/"+widgetModel.getReferencedCssFiles().get(i));
-						if(refHtmlFile!=null)
-						checkWellformed(refHtmlFile,false);
-					}
-					for(int i=0;i<widgetModel.getReferencedJavaScriptFiles().size();i++){
-						File refHtmlFile=new File(widgetModel.widgetDirectory+widgetModel.widgetName+"/"+widgetModel.getReferencedJavaScriptFiles().get(i));
-						if(refHtmlFile!=null)
-						checkWellformed(refHtmlFile,false);
-					}	
-					for(int i=0;i<widgetModel.getReferencedImageFiles().size();i++){
-						File refHtmlFile=new File(widgetModel.widgetDirectory+widgetModel.widgetName+"/"+widgetModel.getReferencedImageFiles().get(i));
-						if(refHtmlFile!=null)
-						checkWellformed(refHtmlFile,false);
-					}	
-					for(int i=0;i<widgetModel.getReferencedIFrameFiles().size();i++){
-						File refHtmlFile=new File(widgetModel.widgetDirectory+widgetModel.widgetName+"/"+widgetModel.getReferencedIFrameFiles().get(i));
-						if(refHtmlFile!=null)
-						checkWellformed(refHtmlFile,false);
-					}	
-					for(int i=0;i<widgetModel.getReferencedEmbedFiles().size();i++){
-						File refHtmlFile=new File(widgetModel.widgetDirectory+widgetModel.widgetName+"/"+widgetModel.getReferencedEmbedFiles().get(i));
-						if(refHtmlFile!=null)
-						checkWellformed(refHtmlFile,false);
-					}	
-				
-			} else {
-				Message msg = new Message();
-				msg.setMessageSource(IWRTConstants.VALIDATOR);
-				msg.setMessageKey("no.html.element");
-				msg.setMessage(ValidatorPropMessages.getString("no.html.element"));
-				msg.setFileTypeZip(messageHandler.isFileTypeZip());
-				msg.setTargetObject(htmlFileName);
-				msg.setFullPath(htmlFile.getAbsolutePath());
-				msg.setSeverity(IWRTConstants.ERROR);
-				msg.setRecommendAction(ValidatorPropMessages.getString("todo.no.html.element"));
-				messageHandler.publishMessage(msg);
-				allRulesPassed = false;
-
-			}
-		 }else{
-			 Message msg = new Message();
-				msg.setMessageSource(IWRTConstants.VALIDATOR);
-				msg.setMessage(ValidatorPropMessages.getString("html.File.Not.Present"));
-				msg.setFileTypeZip(messageHandler.isFileTypeZip());
-				msg.setSeverity(IWRTConstants.FATAL);
-				messageHandler.publishMessage(msg);
-		 }
-
-		} catch (Exception e) {
-
-			Util.logEvent(log, Level.SEVERE, e);
-			Message msg = new Message();
-			msg.setMessageSource(IWRTConstants.VALIDATOR);
-			msg.setMessageKey("html.File.Not.Present");
-			
-			msg.setMessage(ValidatorPropMessages.getString("html.File.Not.Present"));
-			msg.setFileTypeZip(messageHandler.isFileTypeZip());
-			msg.setSeverity(IWRTConstants.FATAL);
-			messageHandler.publishMessage(msg);
-		}
-
-		log.info("validate<<---<<");
-
-		return allRulesPassed;
-	}
-
-	public String getHtmlPlistFileName() {
-		return htmlPlistFileName;
-	}
-
-
-
-	public void setHtmlPlistFileName(String htmlPlistFileName) {
-		this.htmlPlistFileName = htmlPlistFileName;
-	}
-	//---------------------------------code for Jtidy--------------------------------------->>
-  private boolean checkWellformed(File htmlfile, boolean isParsingNeeded) {
-	  String userDir = System.getProperty("user.dir");
-	  String outputFile = userDir+ "/tidy.html";
-	  //htmlfile will behave as directory when src field in html is blank (src =""), so skipping that.
-	  if(htmlfile.isDirectory()){
-		  return true;
-	  }
-      InputStream inStream;
-      try {
-		inStream = new FileInputStream(htmlfile);
-		OutputStream outStream = new FileOutputStream(outputFile);
-		//Parsing here is required only for html, coz js, css files cannot have reference files.
-		//fixing bug 742
-		if(isParsingNeeded){
-		  Tidy jtidy = new Tidy();
-		  TMessageListener msglis= new TMessageListener();
-		  jtidy.setMessageListener(msglis);	  
-		  Node xmlDocument = jtidy.parse(inStream, outStream);
-		}
-		  inStream.close();
-      } catch (FileNotFoundException e) {
-		Message msg = new Message();
-		msg.setMessageSource(IWRTConstants.VALIDATOR);
-		msg.setMessageKey("no.element");
-		msg.setMessage(htmlfile.getName()+ " referred in main html" + " could not be found");
-		msg.setFileTypeZip(messageHandler.isFileTypeZip());
-		msg.setTargetObject(htmlfile.toString());
-		msg.setFullPath(htmlfile.getAbsolutePath());
-		msg.setSeverity(IWRTConstants.WARN);
-		msg.setRecommendAction(ValidatorPropMessages.getString("todo.no.html.element"));
-		messageHandler.publishMessage(msg);
-		Util.logEvent(log, Level.SEVERE, e);			
-		log.severe(e.getMessage());
-	} catch (IOException e) {
-		 Util.logEvent(log, Level.SEVERE, e);			
-			log.severe(e.getMessage());
-	}
-	return false;
-}
-	
-	public class TMessageListener implements TidyMessageListener {
-
-		public void messageReceived(TidyMessage tdyMsg) {
-			
-			if (tdyMsg.getLevel().equals(TidyMessage.Level.ERROR)) {
-				log.info("line     :" + tdyMsg.getLine());
-				log.info("message  :" + tdyMsg.getMessage());
-				Message msg = new Message();
-				msg.setMessageSource(IWRTConstants.VALIDATOR);
-				msg.setMessageKey("html.wellform.error");
-				msg.setMessage(tdyMsg.getMessage());
-				msg.setFileTypeZip(messageHandler.isFileTypeZip());
-				msg.setTargetObject(htmlFileName);
-				msg.setFullPath(htmlFile.getAbsolutePath());
-				msg.setSeverity(IWRTConstants.WARN);
-				msg.setLineNumber(tdyMsg.getLine());
-				// msg.setRecommendAction(ValidatorPropMessages.getString("todo.correct.html.tag")+
-				// tdyMsg.getLine()+" of "+htmlFileName);
-				Object[] arguments = { tdyMsg.getLine(), " of , ", htmlFileName };
-				String message = MessageFormat.format(ValidatorPropMessages
-						.getString("todo.correct.html.tag")
-						+ "{0}" + "{1}" + "{2}", arguments);
-				msg.setRecommendAction(message);
-
-				// set all msg fields
-				// For generating TO DO list
-				messageHandler.publishMessage(msg);
-				allRulesPassed = false;
-
-			}
-
-		}
-	}
-//////<<<-----------------------------------code for Jtidy---------------------------------------//
-
-
-}
\ No newline at end of file
--- a/org.symbian.tools.wrttools/src/org/symbian/tools/wrttools/core/validator/WidgetValidator.java	Wed Feb 03 10:45:34 2010 -0800
+++ b/org.symbian.tools.wrttools/src/org/symbian/tools/wrttools/core/validator/WidgetValidator.java	Fri Feb 05 09:17:58 2010 -0800
@@ -68,7 +68,6 @@
 	private boolean htmlVal;
 	private MandatoryFilesValidator manFilevalidator;
 	private PlistValidator plistValidator;
-	private HtmlValidator htmlValidator;
 	
 	private MessageHandler messageHandler;
 	private IMessageListener msgListener;
@@ -160,7 +159,6 @@
 		log.info("ValidateMandatoryFiles  is done");
 		validatePlist( widgetProjFile);
 		log.info("Validate plist is done");
-		validateHtml( widgetProjFile);	
 		
 		} catch (ReportException e) {
 			 Util.logEvent(log, Level.INFO, e);	
@@ -199,7 +197,6 @@
 		ValidateMandatoryFiles(widgetProjFile);
 		validatePlist( widgetProjFile);
 		log.info("Validate plist is done");
-		validateHtml( widgetProjFile);	
 		
 		} catch (ReportException e) {
 			 Util.logEvent(log, Level.INFO, e);	
@@ -276,32 +273,6 @@
 		return plistVal;
 	}
 	
-	
-	private boolean validateHtml(File fileName) throws ReportException {
-		log.info("validateHtml-->>-->>");
-		try{
-		emitStatus(ValidatorPropMessages.getString("validate.html.started"));
-//		statusHandler.emitStatus(status);		
-		htmlValidator=new HtmlValidator();
-		htmlValidator.setWidgetModel(widgetModel);
-		htmlValidator.setMessageHandler(getMessageHandler());
-		
-		if (widgetModel.isHtmlPresent()) {
-			htmlValidator.setHtmlPlistFileName(widgetModel.getMainHtml());
-			htmlVal = htmlValidator.validate( fileName);
-		}
-		log.info("validateHtml--<<--<<");
-		emitStatus(ValidatorPropMessages.getString("validate.html.finished"));
-//		statusHandler.emitStatus(status);
-		} catch (Exception e) {
-			 Util.logEvent(log, Level.INFO, e);	
-			 status.setStatusDescription("Exception "+e.getMessage());
-				
-		}
-		return htmlVal;
-
-	}
-	
 	protected void emitStatus(String statusDescription) {
 		WRTStatus status = new WRTStatus();
 		status.setStatusSource(IWRTConstants.StatusSourceType.VALIDATOR.name());
--- a/org.symbian.tools.wrttools/src/org/symbian/tools/wrttools/util/CoreUtil.java	Wed Feb 03 10:45:34 2010 -0800
+++ b/org.symbian.tools.wrttools/src/org/symbian/tools/wrttools/util/CoreUtil.java	Fri Feb 05 09:17:58 2010 -0800
@@ -1,8 +1,15 @@
 package org.symbian.tools.wrttools.util;
 
+import java.text.MessageFormat;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
 import org.eclipse.core.runtime.Platform;
+import org.eclipse.jface.text.IRegion;
+import org.eclipse.jface.text.Region;
 
 public class CoreUtil {
+	public static final String PROPERTY_PATTERN = "<key>\\s*{0}\\s*</key>\\s*<string>\\s*(.*)\\s*</string>";
 
 	public static boolean isWindows() {
 		return "windows".equals(Platform.getOS());
@@ -15,4 +22,27 @@
 	public static boolean isLinux() {
 		return "linux".equals(Platform.getOS());
 	}
+
+	public static String getIndexFileName(String buffer) {
+		if (buffer != null) {
+			Matcher matcher = getPropertyLookupPattern("MainHTML").matcher(buffer);
+			if (matcher.find()) {
+				return matcher.group(1);
+			}
+		}
+		return null;
+	}
+
+	public static Pattern getPropertyLookupPattern(String propertyName) {
+		return Pattern.compile(MessageFormat.format(PROPERTY_PATTERN, propertyName), Pattern.CASE_INSENSITIVE);
+	}
+
+	public static IRegion getIndexFileNameRegion(String string) {
+		Matcher matcher = getPropertyLookupPattern("MainHTML").matcher(string);
+		if (matcher.find()) {
+			int start = matcher.start(1);
+			return new Region(start, matcher.end(1) - start);
+		}
+		return null;
+	}
 }
--- a/org.symbian.tools.wrttools/src/org/symbian/tools/wrttools/util/ProjectUtils.java	Wed Feb 03 10:45:34 2010 -0800
+++ b/org.symbian.tools.wrttools/src/org/symbian/tools/wrttools/util/ProjectUtils.java	Fri Feb 05 09:17:58 2010 -0800
@@ -217,4 +217,9 @@
 			((IFolder) parent).create(false, true, new NullProgressMonitor());
 		}
 	}
+
+	public static boolean isPlist(IResource resource) {
+		return resource.getType() == IResource.FILE
+				&& resource.getName().equalsIgnoreCase("info.plist");
+	}
 }
--- a/org.symbian.tools.wrttools/src/org/symbian/tools/wrttools/wizards/WrtWidgetWizard.java	Wed Feb 03 10:45:34 2010 -0800
+++ b/org.symbian.tools.wrttools/src/org/symbian/tools/wrttools/wizards/WrtWidgetWizard.java	Fri Feb 05 09:17:58 2010 -0800
@@ -59,7 +59,6 @@
 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;
@@ -78,6 +77,7 @@
 
 	public WrtWidgetWizard() {
 		setWindowTitle("New WRT Widget");
+		setNeedsProgressMonitor(true);
 	}
 
 	public boolean performFinish() {
@@ -135,17 +135,17 @@
 				((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));
+//		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();
 	}