org.symbian.tools.wrttools/src/org/symbian/tools/wrttools/wizards/AptanaProjectsImportWizard.java
changeset 33 71a6ac16b759
parent 14 e3d48d24826c
child 38 954dbf7baac6
equal deleted inserted replaced
32:04290bdab225 33:71a6ac16b759
    16  * Assumptions/Requirement/Pre-requisites:
    16  * Assumptions/Requirement/Pre-requisites:
    17  * Failures and causes:
    17  * Failures and causes:
    18  */
    18  */
    19 package org.symbian.tools.wrttools.wizards;
    19 package org.symbian.tools.wrttools.wizards;
    20 
    20 
       
    21 import org.eclipse.core.runtime.CoreException;
       
    22 import org.eclipse.core.runtime.IConfigurationElement;
       
    23 import org.eclipse.core.runtime.IExecutableExtension;
    21 import org.eclipse.jface.viewers.IStructuredSelection;
    24 import org.eclipse.jface.viewers.IStructuredSelection;
    22 import org.eclipse.jface.wizard.Wizard;
    25 import org.eclipse.jface.wizard.Wizard;
    23 import org.eclipse.ui.IImportWizard;
    26 import org.eclipse.ui.IImportWizard;
    24 import org.eclipse.ui.IWorkbench;
    27 import org.eclipse.ui.IWorkbench;
       
    28 import org.eclipse.ui.wizards.newresource.BasicNewProjectResourceWizard;
    25 
    29 
    26 public class AptanaProjectsImportWizard extends Wizard implements IImportWizard {
    30 public class AptanaProjectsImportWizard extends Wizard implements
       
    31 		IImportWizard, IExecutableExtension {
    27 
    32 
    28 	private AptanaProjectLocationWizardPage mainPage;
    33 	private AptanaProjectLocationWizardPage mainPage;
       
    34 	private IConfigurationElement config;
    29 
    35 
    30 	public AptanaProjectsImportWizard() {
    36 	public AptanaProjectsImportWizard() {
    31 		setWindowTitle("Import Aptana Project");
    37 		setWindowTitle("Import Aptana Project");
    32 		setNeedsProgressMonitor(true);
    38 		setNeedsProgressMonitor(true);
    33 	}
    39 	}
    38 		return true;
    44 		return true;
    39 	}
    45 	}
    40 
    46 
    41 	@Override
    47 	@Override
    42 	public boolean performFinish() {
    48 	public boolean performFinish() {
    43 		return mainPage.createProjects();
    49 		if (mainPage.createProjects()) {
       
    50 			BasicNewProjectResourceWizard.updatePerspective(config);
       
    51 			return true;
       
    52 		} else {
       
    53 			return false;
       
    54 		}
    44 	}
    55 	}
    45 
    56 
    46 	@Override
    57 	@Override
    47 	public void addPages() {
    58 	public void addPages() {
    48 		mainPage = new AptanaProjectLocationWizardPage();
    59 		mainPage = new AptanaProjectLocationWizardPage();
    49 		addPage(mainPage);
    60 		addPage(mainPage);
    50 	}
    61 	}
    51 	
    62 
    52 	@Override
    63 	@Override
    53 	public void init(IWorkbench workbench, IStructuredSelection selection) {
    64 	public void init(IWorkbench workbench, IStructuredSelection selection) {
    54 		// Do nothing
    65 		// Do nothing
    55 	}
    66 	}
    56 
    67 
       
    68 	@Override
       
    69 	public void setInitializationData(IConfigurationElement config,
       
    70 			String propertyName, Object data) throws CoreException {
       
    71 		this.config = config;
       
    72 	}
    57 }
    73 }