UIB : setDefaultEditorForIndexHtmlFile() move to function of doAfter() in projectTemp... 54/21054/1
authoryonghwan82.jeon <yonghwan82.jeon@samsung.com>
Thu, 15 May 2014 01:53:22 +0000 (10:53 +0900)
committeryonghwan82.jeon <yonghwan82.jeon@samsung.com>
Thu, 15 May 2014 01:57:00 +0000 (10:57 +0900)
It set the defulat editor for the index.html.
It move to doAfter().

Change-Id: I26b67210be5f6b6bb44bf373a7b2a446c94eadac
Signed-off-by: yonghwan82.jeon <yonghwan82.jeon@samsung.com>
org.tizen.webuibuilder/src/org/tizen/webuibuilder/ui/wizards/project/ProjectTemplateContributor.java

index efcba5c..0b4b522 100644 (file)
@@ -66,13 +66,12 @@ public class ProjectTemplateContributor implements ITemplateContributor {
             newNatures[natures.length] = WebUIBuilderNature.getId();
             description.setNatureIds(newNatures);
             project.setDescription(description, null);
-            setEditorInfo(project);
         } catch (CoreException e) {
             e.printStackTrace();
         }
     }
 
-    private void setEditorInfo(IProject project) throws CoreException{
+    private void setDefaultEditorForIndexHtmlFile(IProject project) {
         if (project == null) {
             return;
         }
@@ -81,7 +80,11 @@ public class ProjectTemplateContributor implements ITemplateContributor {
         if (file == null) {
             return;
         }
-        file.setPersistentProperty(IDE.EDITOR_KEY, PageDesignerForHTML.ID);
+        try {
+            file.setPersistentProperty(IDE.EDITOR_KEY, PageDesignerForHTML.ID);
+        } catch (CoreException e) {
+            e.printStackTrace();
+        }
     }
 
     /*
@@ -93,6 +96,7 @@ public class ProjectTemplateContributor implements ITemplateContributor {
      */
     @Override
     public void doAfter(IProject project) {
+        setDefaultEditorForIndexHtmlFile(project);
         buildProject(project);
         openEditor(project);
     }