org.symbian.tools.wrttools/src/org/symbian/tools/wrttools/wizards/AptanaProjectsImportWizard.java
author Eugene Ostroukhov <eugeneo@symbian.org>
Wed, 20 Jan 2010 18:00:15 -0800
changeset 38 954dbf7baac6
parent 33 71a6ac16b759
child 56 22f918ed49f7
permissions -rw-r--r--
Merged with the most current version
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
3
d3477de62514 Added new wizards for importing WRT projects. Added CSS Validator.
TasneemS@US-TASNEEMS
parents:
diff changeset
     1
/**
d3477de62514 Added new wizards for importing WRT projects. Added CSS Validator.
TasneemS@US-TASNEEMS
parents:
diff changeset
     2
 * Copyright (c) 2009 Symbian Foundation and/or its subsidiary(-ies).
d3477de62514 Added new wizards for importing WRT projects. Added CSS Validator.
TasneemS@US-TASNEEMS
parents:
diff changeset
     3
 * All rights reserved.
d3477de62514 Added new wizards for importing WRT projects. Added CSS Validator.
TasneemS@US-TASNEEMS
parents:
diff changeset
     4
 * This component and the accompanying materials are made available
d3477de62514 Added new wizards for importing WRT projects. Added CSS Validator.
TasneemS@US-TASNEEMS
parents:
diff changeset
     5
 * under the terms of the License "Eclipse Public License v1.0"
d3477de62514 Added new wizards for importing WRT projects. Added CSS Validator.
TasneemS@US-TASNEEMS
parents:
diff changeset
     6
 * which accompanies this distribution, and is available
d3477de62514 Added new wizards for importing WRT projects. Added CSS Validator.
TasneemS@US-TASNEEMS
parents:
diff changeset
     7
 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
d3477de62514 Added new wizards for importing WRT projects. Added CSS Validator.
TasneemS@US-TASNEEMS
parents:
diff changeset
     8
 *
d3477de62514 Added new wizards for importing WRT projects. Added CSS Validator.
TasneemS@US-TASNEEMS
parents:
diff changeset
     9
 * Initial Contributors:
d3477de62514 Added new wizards for importing WRT projects. Added CSS Validator.
TasneemS@US-TASNEEMS
parents:
diff changeset
    10
 * Symbian Foundation - initial contribution.
d3477de62514 Added new wizards for importing WRT projects. Added CSS Validator.
TasneemS@US-TASNEEMS
parents:
diff changeset
    11
 * Contributors:
d3477de62514 Added new wizards for importing WRT projects. Added CSS Validator.
TasneemS@US-TASNEEMS
parents:
diff changeset
    12
 * Description:
d3477de62514 Added new wizards for importing WRT projects. Added CSS Validator.
TasneemS@US-TASNEEMS
parents:
diff changeset
    13
 * Overview:
d3477de62514 Added new wizards for importing WRT projects. Added CSS Validator.
TasneemS@US-TASNEEMS
parents:
diff changeset
    14
 * Details:
d3477de62514 Added new wizards for importing WRT projects. Added CSS Validator.
TasneemS@US-TASNEEMS
parents:
diff changeset
    15
 * Platforms/Drives/Compatibility:
d3477de62514 Added new wizards for importing WRT projects. Added CSS Validator.
TasneemS@US-TASNEEMS
parents:
diff changeset
    16
 * Assumptions/Requirement/Pre-requisites:
d3477de62514 Added new wizards for importing WRT projects. Added CSS Validator.
TasneemS@US-TASNEEMS
parents:
diff changeset
    17
 * Failures and causes:
d3477de62514 Added new wizards for importing WRT projects. Added CSS Validator.
TasneemS@US-TASNEEMS
parents:
diff changeset
    18
 */
d3477de62514 Added new wizards for importing WRT projects. Added CSS Validator.
TasneemS@US-TASNEEMS
parents:
diff changeset
    19
package org.symbian.tools.wrttools.wizards;
d3477de62514 Added new wizards for importing WRT projects. Added CSS Validator.
TasneemS@US-TASNEEMS
parents:
diff changeset
    20
33
71a6ac16b759 WRT wizards will switch to JS perspective on completion
Eugene Ostroukhov <eostroukhov@symbian.org>
parents: 14
diff changeset
    21
import org.eclipse.core.runtime.CoreException;
71a6ac16b759 WRT wizards will switch to JS perspective on completion
Eugene Ostroukhov <eostroukhov@symbian.org>
parents: 14
diff changeset
    22
import org.eclipse.core.runtime.IConfigurationElement;
71a6ac16b759 WRT wizards will switch to JS perspective on completion
Eugene Ostroukhov <eostroukhov@symbian.org>
parents: 14
diff changeset
    23
import org.eclipse.core.runtime.IExecutableExtension;
3
d3477de62514 Added new wizards for importing WRT projects. Added CSS Validator.
TasneemS@US-TASNEEMS
parents:
diff changeset
    24
import org.eclipse.jface.viewers.IStructuredSelection;
d3477de62514 Added new wizards for importing WRT projects. Added CSS Validator.
TasneemS@US-TASNEEMS
parents:
diff changeset
    25
import org.eclipse.jface.wizard.Wizard;
d3477de62514 Added new wizards for importing WRT projects. Added CSS Validator.
TasneemS@US-TASNEEMS
parents:
diff changeset
    26
import org.eclipse.ui.IImportWizard;
38
954dbf7baac6 Merged with the most current version
Eugene Ostroukhov <eugeneo@symbian.org>
parents: 33
diff changeset
    27
import org.eclipse.ui.INewWizard;
3
d3477de62514 Added new wizards for importing WRT projects. Added CSS Validator.
TasneemS@US-TASNEEMS
parents:
diff changeset
    28
import org.eclipse.ui.IWorkbench;
33
71a6ac16b759 WRT wizards will switch to JS perspective on completion
Eugene Ostroukhov <eostroukhov@symbian.org>
parents: 14
diff changeset
    29
import org.eclipse.ui.wizards.newresource.BasicNewProjectResourceWizard;
3
d3477de62514 Added new wizards for importing WRT projects. Added CSS Validator.
TasneemS@US-TASNEEMS
parents:
diff changeset
    30
33
71a6ac16b759 WRT wizards will switch to JS perspective on completion
Eugene Ostroukhov <eostroukhov@symbian.org>
parents: 14
diff changeset
    31
public class AptanaProjectsImportWizard extends Wizard implements
38
954dbf7baac6 Merged with the most current version
Eugene Ostroukhov <eugeneo@symbian.org>
parents: 33
diff changeset
    32
		IImportWizard, INewWizard, IExecutableExtension {
3
d3477de62514 Added new wizards for importing WRT projects. Added CSS Validator.
TasneemS@US-TASNEEMS
parents:
diff changeset
    33
d3477de62514 Added new wizards for importing WRT projects. Added CSS Validator.
TasneemS@US-TASNEEMS
parents:
diff changeset
    34
	private AptanaProjectLocationWizardPage mainPage;
33
71a6ac16b759 WRT wizards will switch to JS perspective on completion
Eugene Ostroukhov <eostroukhov@symbian.org>
parents: 14
diff changeset
    35
	private IConfigurationElement config;
3
d3477de62514 Added new wizards for importing WRT projects. Added CSS Validator.
TasneemS@US-TASNEEMS
parents:
diff changeset
    36
d3477de62514 Added new wizards for importing WRT projects. Added CSS Validator.
TasneemS@US-TASNEEMS
parents:
diff changeset
    37
	public AptanaProjectsImportWizard() {
d3477de62514 Added new wizards for importing WRT projects. Added CSS Validator.
TasneemS@US-TASNEEMS
parents:
diff changeset
    38
		setWindowTitle("Import Aptana Project");
14
e3d48d24826c UI refresh
Eugene Ostroukhov <eostroukhov@symbian.org>
parents: 11
diff changeset
    39
		setNeedsProgressMonitor(true);
3
d3477de62514 Added new wizards for importing WRT projects. Added CSS Validator.
TasneemS@US-TASNEEMS
parents:
diff changeset
    40
	}
d3477de62514 Added new wizards for importing WRT projects. Added CSS Validator.
TasneemS@US-TASNEEMS
parents:
diff changeset
    41
d3477de62514 Added new wizards for importing WRT projects. Added CSS Validator.
TasneemS@US-TASNEEMS
parents:
diff changeset
    42
	@Override
d3477de62514 Added new wizards for importing WRT projects. Added CSS Validator.
TasneemS@US-TASNEEMS
parents:
diff changeset
    43
	public boolean performCancel() {
d3477de62514 Added new wizards for importing WRT projects. Added CSS Validator.
TasneemS@US-TASNEEMS
parents:
diff changeset
    44
		mainPage.performCancel();
d3477de62514 Added new wizards for importing WRT projects. Added CSS Validator.
TasneemS@US-TASNEEMS
parents:
diff changeset
    45
		return true;
d3477de62514 Added new wizards for importing WRT projects. Added CSS Validator.
TasneemS@US-TASNEEMS
parents:
diff changeset
    46
	}
d3477de62514 Added new wizards for importing WRT projects. Added CSS Validator.
TasneemS@US-TASNEEMS
parents:
diff changeset
    47
d3477de62514 Added new wizards for importing WRT projects. Added CSS Validator.
TasneemS@US-TASNEEMS
parents:
diff changeset
    48
	@Override
d3477de62514 Added new wizards for importing WRT projects. Added CSS Validator.
TasneemS@US-TASNEEMS
parents:
diff changeset
    49
	public boolean performFinish() {
33
71a6ac16b759 WRT wizards will switch to JS perspective on completion
Eugene Ostroukhov <eostroukhov@symbian.org>
parents: 14
diff changeset
    50
		if (mainPage.createProjects()) {
71a6ac16b759 WRT wizards will switch to JS perspective on completion
Eugene Ostroukhov <eostroukhov@symbian.org>
parents: 14
diff changeset
    51
			BasicNewProjectResourceWizard.updatePerspective(config);
71a6ac16b759 WRT wizards will switch to JS perspective on completion
Eugene Ostroukhov <eostroukhov@symbian.org>
parents: 14
diff changeset
    52
			return true;
71a6ac16b759 WRT wizards will switch to JS perspective on completion
Eugene Ostroukhov <eostroukhov@symbian.org>
parents: 14
diff changeset
    53
		} else {
71a6ac16b759 WRT wizards will switch to JS perspective on completion
Eugene Ostroukhov <eostroukhov@symbian.org>
parents: 14
diff changeset
    54
			return false;
71a6ac16b759 WRT wizards will switch to JS perspective on completion
Eugene Ostroukhov <eostroukhov@symbian.org>
parents: 14
diff changeset
    55
		}
3
d3477de62514 Added new wizards for importing WRT projects. Added CSS Validator.
TasneemS@US-TASNEEMS
parents:
diff changeset
    56
	}
d3477de62514 Added new wizards for importing WRT projects. Added CSS Validator.
TasneemS@US-TASNEEMS
parents:
diff changeset
    57
d3477de62514 Added new wizards for importing WRT projects. Added CSS Validator.
TasneemS@US-TASNEEMS
parents:
diff changeset
    58
	@Override
d3477de62514 Added new wizards for importing WRT projects. Added CSS Validator.
TasneemS@US-TASNEEMS
parents:
diff changeset
    59
	public void addPages() {
d3477de62514 Added new wizards for importing WRT projects. Added CSS Validator.
TasneemS@US-TASNEEMS
parents:
diff changeset
    60
		mainPage = new AptanaProjectLocationWizardPage();
d3477de62514 Added new wizards for importing WRT projects. Added CSS Validator.
TasneemS@US-TASNEEMS
parents:
diff changeset
    61
		addPage(mainPage);
d3477de62514 Added new wizards for importing WRT projects. Added CSS Validator.
TasneemS@US-TASNEEMS
parents:
diff changeset
    62
	}
33
71a6ac16b759 WRT wizards will switch to JS perspective on completion
Eugene Ostroukhov <eostroukhov@symbian.org>
parents: 14
diff changeset
    63
3
d3477de62514 Added new wizards for importing WRT projects. Added CSS Validator.
TasneemS@US-TASNEEMS
parents:
diff changeset
    64
	@Override
d3477de62514 Added new wizards for importing WRT projects. Added CSS Validator.
TasneemS@US-TASNEEMS
parents:
diff changeset
    65
	public void init(IWorkbench workbench, IStructuredSelection selection) {
11
05e53cfc29d8 Import previewer implemented
Eugene Ostroukhov
parents: 3
diff changeset
    66
		// Do nothing
3
d3477de62514 Added new wizards for importing WRT projects. Added CSS Validator.
TasneemS@US-TASNEEMS
parents:
diff changeset
    67
	}
d3477de62514 Added new wizards for importing WRT projects. Added CSS Validator.
TasneemS@US-TASNEEMS
parents:
diff changeset
    68
33
71a6ac16b759 WRT wizards will switch to JS perspective on completion
Eugene Ostroukhov <eostroukhov@symbian.org>
parents: 14
diff changeset
    69
	@Override
71a6ac16b759 WRT wizards will switch to JS perspective on completion
Eugene Ostroukhov <eostroukhov@symbian.org>
parents: 14
diff changeset
    70
	public void setInitializationData(IConfigurationElement config,
71a6ac16b759 WRT wizards will switch to JS perspective on completion
Eugene Ostroukhov <eostroukhov@symbian.org>
parents: 14
diff changeset
    71
			String propertyName, Object data) throws CoreException {
71a6ac16b759 WRT wizards will switch to JS perspective on completion
Eugene Ostroukhov <eostroukhov@symbian.org>
parents: 14
diff changeset
    72
		this.config = config;
71a6ac16b759 WRT wizards will switch to JS perspective on completion
Eugene Ostroukhov <eostroukhov@symbian.org>
parents: 14
diff changeset
    73
	}
3
d3477de62514 Added new wizards for importing WRT projects. Added CSS Validator.
TasneemS@US-TASNEEMS
parents:
diff changeset
    74
}