RTSDK: improve new app wizard ux & fixed wrong app macro
authorgyeongmin.ju <gyeongmin.ju@samsung.com>
Thu, 30 Mar 2017 05:26:19 +0000 (14:26 +0900)
committergyeongmin.ju <gyeongmin.ju@samsung.com>
Thu, 30 Mar 2017 05:26:19 +0000 (14:26 +0900)
improve new app wizard ux & fixed wrong app macro

Change-Id: If5c51e092a460deafddc39964ced4cd61b8fc141
Signed-off-by: gyeongmin.ju <gyeongmin.ju@samsung.com>
rt-ide/tizen.rt.product.plugin/src/org/tizen/rt/ide/wizards/NewRtAppWizard.java
rt-ide/tizen.rt.product.plugin/src/org/tizen/rt/ide/wizards/NewRtAppWizardPage.java

index dfabe9a..483aa63 100644 (file)
@@ -78,14 +78,14 @@ public class NewRtAppWizard extends Wizard implements INewWizard {
      */
     @Override
     public boolean performFinish() {
-        final String containerName = page.getContainerName();
+        final String appName = page.getAppName();
         final String localtion = page.getFileName();
         final IProject project = page.getProject();
         final String tempFileName = page.getTemplateFileName();
         IRunnableWithProgress op = new IRunnableWithProgress() {
             public void run(IProgressMonitor monitor) throws InvocationTargetException {
                 try {
-                    doFinish(containerName, localtion, tempFileName, project, monitor);
+                    doFinish(appName, localtion, tempFileName, project, monitor);
                 } catch (CoreException e) {
                     throw new InvocationTargetException(e);
                 } finally {
index ab77c9e..af75dd3 100644 (file)
@@ -91,6 +91,7 @@ public class NewRtAppWizardPage extends WizardPage {
         lblProject.setText("Project:");
 
         containerText = new Text(container, SWT.BORDER | SWT.SINGLE);
+        containerText.setEnabled(false);
         containerText.setEditable(false);
         containerText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
 
@@ -171,16 +172,10 @@ public class NewRtAppWizardPage extends WizardPage {
      */
     private void dialogChanged() {
         IResource container = ResourcesPlugin.getWorkspace().getRoot()
-                .findMember(new Path(getContainerName()));
+                .findMember(getProject().getFullPath());
         String fileName = getFileName();
 
-        if (getContainerName().length() == 0) {
-            updateStatus("File container must be specified");
-            return;
-        }
-
-        if (container == null
-                || (container.getType() & (IResource.PROJECT | IResource.FOLDER)) == 0) {
+        if (container == null || (container.getType() & (IResource.PROJECT | IResource.FOLDER)) == 0) {
             updateStatus("File container must exist");
             return;
         }
@@ -193,8 +188,8 @@ public class NewRtAppWizardPage extends WizardPage {
             return;
         }
 
-        IFolder folder = container.getProject().getFolder(fileName);
-        IFile file = container.getProject().getFile(fileName);
+        IFolder folder = project.getFolder(fileName);
+        IFile file = project.getFile(fileName);
         if ((folder != null && folder.exists()) || (file != null && file.exists())) {
             updateStatus("Application path (or file) is already exits");
             return;
@@ -212,8 +207,8 @@ public class NewRtAppWizardPage extends WizardPage {
         return project;
     }
 
-    public String getContainerName() {
-        return containerText.getText();
+    public String getAppName() {
+        return appNameText.getText();
     }
 
     public String getFileName() {