Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 389037
Collapse All | Expand All

(-)src/org/eclipse/php/internal/core/facet/PHPFacets.java (+12 lines)
Lines 177-180 Link Here
177
		facetedProject.installProjectFacet(convertToFacetVersion(phpVersion),
177
		facetedProject.installProjectFacet(convertToFacetVersion(phpVersion),
178
				null, monitor);
178
				null, monitor);
179
	}
179
	}
180
181
	/**
182
	 * Returns the faceted version of the core facet
183
	 * 
184
	 * @return core facet
185
	 */
186
	public static IProjectFacetVersion getCoreVersion() {
187
		IProjectFacet coreFacet = ProjectFacetsManager
188
				.getProjectFacet(PHPFacetsConstants.PHP_CORE_COMPONENT);
189
		return coreFacet.getDefaultVersion();
190
	}
191
180
}
192
}
(-)META-INF/MANIFEST.MF (-1 / +3 lines)
Lines 41-47 Link Here
41
 org.eclipse.wst.css.core,
41
 org.eclipse.wst.css.core,
42
 org.eclipse.wst.css.ui,
42
 org.eclipse.wst.css.ui,
43
 org.eclipse.emf.common,
43
 org.eclipse.emf.common,
44
 org.eclipse.dltk.core.manipulation
44
 org.eclipse.dltk.core.manipulation,
45
 org.eclipse.wst.common.project.facet.core,
46
 org.eclipse.wst.common.project.facet.ui
45
Bundle-ActivationPolicy: lazy
47
Bundle-ActivationPolicy: lazy
46
Export-Package: org.eclipse.php.internal.ui;x-internal:=true,
48
Export-Package: org.eclipse.php.internal.ui;x-internal:=true,
47
 org.eclipse.php.internal.ui.actions;x-internal:=true,
49
 org.eclipse.php.internal.ui.actions;x-internal:=true,
(-)src/org/eclipse/php/internal/ui/PHPUIMessages.java (+2 lines)
Lines 167-172 Link Here
167
	public static String PhpTemplateNumberVariableResolver_2;
167
	public static String PhpTemplateNumberVariableResolver_2;
168
	public static String Search_Error_openEditor_message;
168
	public static String Search_Error_openEditor_message;
169
	public static String PHPProjectCreationWizard_Page1Title;
169
	public static String PHPProjectCreationWizard_Page1Title;
170
	public static String PHPProjectCreationWizard_PageFacetsTitle;
170
	public static String PHPSearchResultPage_sortByName;
171
	public static String PHPSearchResultPage_sortByName;
171
	public static String newPhpFile_wizard_templatePage_usePhpTemplate;
172
	public static String newPhpFile_wizard_templatePage_usePhpTemplate;
172
	public static String ShowInNavigatorView_dialog_title;
173
	public static String ShowInNavigatorView_dialog_title;
Lines 296-301 Link Here
296
	public static String DragAdapter_problemTitle;
297
	public static String DragAdapter_problemTitle;
297
	public static String CustomFiltersDialog_filterList_label;
298
	public static String CustomFiltersDialog_filterList_label;
298
	public static String PHPProjectCreationWizard_Page1Description;
299
	public static String PHPProjectCreationWizard_Page1Description;
300
	public static String PHPProjectCreationWizard_PageFacetsDescription;
299
	public static String typingPage_autoAdd_phpDoc_tags;
301
	public static String typingPage_autoAdd_phpDoc_tags;
300
	public static String PHPBuildPreferencePage_title;
302
	public static String PHPBuildPreferencePage_title;
301
	public static String PHPOutlineElementComparer_2;
303
	public static String PHPOutlineElementComparer_2;
(-)src/org/eclipse/php/internal/ui/PHPUIMessages.properties (+2 lines)
Lines 375-380 Link Here
375
PHPProjectCreationWizard_WizardTitle=New PHP Project
375
PHPProjectCreationWizard_WizardTitle=New PHP Project
376
PHPProjectCreationWizard_Page1Title=Create a PHP Project
376
PHPProjectCreationWizard_Page1Title=Create a PHP Project
377
PHPProjectCreationWizard_Page1Description=Create a PHP project in the workspace or in an external location.
377
PHPProjectCreationWizard_Page1Description=Create a PHP project in the workspace or in an external location.
378
PHPProjectCreationWizard_PageFacetsTitle=PHP Facets
379
PHPProjectCreationWizard_PageFacetsDescription=Modify the PHP Facets
378
PHPProjectCreationWizard_Page2Title=PHP Include Path
380
PHPProjectCreationWizard_Page2Title=PHP Include Path
379
PHPProjectCreationWizard_Page2Description=Configure PHP Include Path
381
PHPProjectCreationWizard_Page2Description=Configure PHP Include Path
380
PHPProjectCreationWizard_Page3Title=PHP Build Path
382
PHPProjectCreationWizard_Page3Title=PHP Build Path
(-)src/org/eclipse/php/internal/ui/wizards/PHPProjectCreationWizard.java (-1 / +10 lines)
Lines 42-47 Link Here
42
42
43
	protected int fLastPageIndex = -1;
43
	protected int fLastPageIndex = -1;
44
44
45
	private PHPProjectWizardFacetsPage fFacetsPage;
46
45
	public PHPProjectCreationWizard() {
47
	public PHPProjectCreationWizard() {
46
		setDefaultPageImageDescriptor(PHPPluginImages.DESC_WIZBAN_ADD_PHP_PROJECT);
48
		setDefaultPageImageDescriptor(PHPPluginImages.DESC_WIZBAN_ADD_PHP_PROJECT);
47
		setDialogSettings(DLTKUIPlugin.getDefault().getDialogSettings());
49
		setDialogSettings(DLTKUIPlugin.getDefault().getDialogSettings());
Lines 57-62 Link Here
57
		fFirstPage
59
		fFirstPage
58
				.setDescription(PHPUIMessages.PHPProjectCreationWizard_Page1Description);
60
				.setDescription(PHPUIMessages.PHPProjectCreationWizard_Page1Description);
59
		addPage(fFirstPage);
61
		addPage(fFirstPage);
62
63
		fFacetsPage = new PHPProjectWizardFacetsPage(fFirstPage);
64
		fFacetsPage
65
				.setTitle(PHPUIMessages.PHPProjectCreationWizard_PageFacetsTitle);
66
		fFacetsPage
67
				.setDescription(PHPUIMessages.PHPProjectCreationWizard_PageFacetsDescription);
68
		addPage(fFacetsPage);
60
69
61
		// Second page (Include Path)
70
		// Second page (Include Path)
62
		fSecondPage = new PHPProjectWizardSecondPage(fFirstPage);
71
		fSecondPage = new PHPProjectWizardSecondPage(fFirstPage);
Lines 145-151 Link Here
145
154
146
	public boolean performCancel() {
155
	public boolean performCancel() {
147
		if (!fFirstPage.isExistingLocation())
156
		if (!fFirstPage.isExistingLocation())
148
			fLastPage.performCancel();
157
			fFirstPage.performCancel();
149
		return super.performCancel();
158
		return super.performCancel();
150
	}
159
	}
151
160
(-)src/org/eclipse/php/internal/ui/wizards/PHPProjectWizardFacetsPage.java (+207 lines)
Added Link Here
1
/*******************************************************************************
2
 * Copyright (c) 2009 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
6
 * http://www.eclipse.org/legal/epl-v10.html
7
 * 
8
 * Contributors:
9
 *     IBM Corporation - initial API and implementation
10
 *     Zend Technologies
11
 *******************************************************************************/
12
package org.eclipse.php.internal.ui.wizards;
13
14
import org.eclipse.core.resources.IProject;
15
import org.eclipse.core.runtime.CoreException;
16
import org.eclipse.core.runtime.IStatus;
17
import org.eclipse.core.runtime.NullProgressMonitor;
18
import org.eclipse.dltk.ui.wizards.NewElementWizardPage;
19
import org.eclipse.jface.wizard.IWizardPage;
20
import org.eclipse.php.internal.core.PHPCorePlugin;
21
import org.eclipse.php.internal.core.facet.PHPFacets;
22
import org.eclipse.swt.SWT;
23
import org.eclipse.swt.layout.GridData;
24
import org.eclipse.swt.layout.GridLayout;
25
import org.eclipse.swt.widgets.Composite;
26
import org.eclipse.swt.widgets.TabFolder;
27
import org.eclipse.wst.common.project.facet.core.IFacetedProjectWorkingCopy;
28
import org.eclipse.wst.common.project.facet.core.IPreset;
29
import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion;
30
import org.eclipse.wst.common.project.facet.core.ProjectFacetsManager;
31
import org.eclipse.wst.common.project.facet.core.events.IFacetedProjectEvent;
32
import org.eclipse.wst.common.project.facet.core.events.IFacetedProjectListener;
33
import org.eclipse.wst.common.project.facet.core.events.IProjectFacetsChangedEvent;
34
import org.eclipse.wst.common.project.facet.core.util.AbstractFilter;
35
import org.eclipse.wst.common.project.facet.core.util.FilterEvent;
36
import org.eclipse.wst.common.project.facet.core.util.IFilter;
37
import org.eclipse.wst.common.project.facet.ui.PresetSelectionPanel;
38
39
public class PHPProjectWizardFacetsPage extends NewElementWizardPage implements
40
		IPHPProjectCreateWizardPage {
41
42
	private PHPProjectWizardFirstPage fFirstPage;
43
44
	private IFacetedProjectWorkingCopy fpjwc;
45
	private final IFacetedProjectListener fpjwcListener;
46
	private IFacetedProjectListener fpjwcListenerForPreset;
47
48
	private Composite ppanelParent;
49
50
	private PresetSelectionPanel ppanel;
51
52
	private TabFolder tabFolder;
53
54
	private Composite top;
55
56
	/**
57
	 * Constructor for ScriptProjectWizardSecondPage.
58
	 */
59
	public PHPProjectWizardFacetsPage(PHPProjectWizardFirstPage mainPage) {
60
		super("PHPProjectWizardFacetsPage");
61
		fFirstPage = mainPage;
62
63
		this.fpjwcListener = new IFacetedProjectListener() {
64
			public void handleEvent(final IFacetedProjectEvent event) {
65
				final Runnable runnable = new Runnable() {
66
					public void run() {
67
						validateFacets();
68
					}
69
				};
70
71
				getContainer().getShell().getDisplay().asyncExec(runnable);
72
			}
73
		};
74
	}
75
76
	/**
77
	 * taken from org.eclipse.wst.web.ui.internal.wizards.
78
	 * DataModelFacetCreationWizardPage
79
	 * 
80
	 * @param top
81
	 */
82
	protected void createPresetPanel(Composite top) {
83
		final IFilter<IPreset> filter = new AbstractFilter<IPreset>() {
84
			{
85
				fpjwcListenerForPreset = new IFacetedProjectListener() {
86
					public void handleEvent(final IFacetedProjectEvent event) {
87
						handleProjectFacetsChangedEvent((IProjectFacetsChangedEvent) event);
88
					}
89
				};
90
			}
91
92
			public boolean check(final IPreset preset) {
93
				final IProjectFacetVersion primaryFacetVersion = PHPFacets
94
						.getCoreVersion();
95
				return preset.getProjectFacets().contains(primaryFacetVersion);
96
			}
97
98
			private void handleProjectFacetsChangedEvent(
99
					final IProjectFacetsChangedEvent event) {
100
				for (IProjectFacetVersion fv : event
101
						.getFacetsWithChangedVersions()) {
102
					if (fv.getProjectFacet() == PHPFacets.getCoreVersion()) {
103
						final IFilterEvent<IPreset> filterEvent = new FilterEvent<IPreset>(
104
								this, IFilterEvent.Type.FILTER_CHANGED);
105
106
						notifyListeners(filterEvent);
107
					}
108
				}
109
110
				checkTabChanges();
111
			}
112
		};
113
114
		ppanel = new PresetSelectionPanel(top, fpjwc, filter);
115
116
		ppanel.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
117
	}
118
119
	private void validateFacets() {
120
		final IStatus status = this.fpjwc.validate();
121
		if (status != null && !status.isOK()) {
122
			setErrorMessage(status.getMessage());
123
		} else {
124
			setErrorMessage(null);
125
		}
126
	}
127
128
	private void checkTabChanges() {
129
		// TODO
130
	}
131
132
	public void createControl(Composite parent) {
133
		top = createTopLevelComposite(parent);
134
		addExtendedControls(top);
135
		setControl(top);
136
	}
137
138
	private void addExtendedControls(Composite top) {
139
		this.tabFolder = new TabFolder(top, SWT.NONE);
140
		this.tabFolder.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
141
		// invisible as long as there are additional configuration pages
142
		this.tabFolder.setVisible(false);
143
	}
144
145
	protected Composite createTopLevelComposite(Composite parent) {
146
		final Composite top = new Composite(parent, SWT.NONE);
147
		top.setLayout(new GridLayout(1, true));
148
		top.setLayoutData(new GridData(GridData.FILL_BOTH));
149
		this.ppanelParent = new Composite(top, SWT.NONE);
150
		this.ppanelParent.setLayout(new GridLayout());
151
		this.ppanelParent.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
152
		return top;
153
	}
154
155
	@Override
156
	public void setVisible(boolean visible) {
157
		super.setVisible(visible);
158
159
		if (this.fpjwc == null) {
160
			// we are coming from first page. Do not do anything. First page
161
			// will call initPage
162
			return;
163
		}
164
165
		if (visible) {
166
			internalInit();
167
		} else {
168
			this.fpjwc.removeListener(this.fpjwcListener);
169
			this.fpjwc.removeListener(this.fpjwcListenerForPreset);
170
171
			IWizardPage currentPage = getContainer().getCurrentPage();
172
			if (currentPage instanceof IPHPProjectCreateWizardPage) {
173
				// going forward from facets page to 2nd one (or first page)
174
				((IPHPProjectCreateWizardPage) currentPage).initPage();
175
			}
176
		}
177
	}
178
179
	private void internalInit() {
180
		this.fpjwc.addListener(this.fpjwcListener,
181
				IFacetedProjectEvent.Type.VALIDATION_PROBLEMS_CHANGED);
182
		this.fpjwc.addListener(fpjwcListenerForPreset,
183
				IFacetedProjectEvent.Type.PROJECT_FACETS_CHANGED);
184
	}
185
186
	public void initPage() {
187
		final IProject project = this.fFirstPage.getProjectHandle();
188
		try {
189
			if (this.ppanel != null && !this.ppanel.isDisposed()) {
190
				ppanel.setVisible(false);
191
				ppanel.dispose();
192
			}
193
			PHPFacets.createFacetedProject(project,
194
					this.fFirstPage.getPHPVersionValue(),
195
					new NullProgressMonitor());
196
			this.fpjwc = ProjectFacetsManager.create(project)
197
					.createWorkingCopy();
198
			createPresetPanel(ppanelParent);
199
			checkTabChanges();
200
			top.layout(true);
201
			internalInit();
202
		} catch (CoreException e) {
203
			PHPCorePlugin.log(e);
204
		}
205
	}
206
207
}
(-)src/org/eclipse/php/internal/ui/wizards/PHPProjectWizardFirstPage.java (-4 / +317 lines)
Lines 11-35 Link Here
11
 *******************************************************************************/
11
 *******************************************************************************/
12
package org.eclipse.php.internal.ui.wizards;
12
package org.eclipse.php.internal.ui.wizards;
13
13
14
import java.io.File;
14
import java.io.*;
15
import java.lang.reflect.InvocationTargetException;
15
import java.net.URI;
16
import java.net.URI;
17
import java.net.URISyntaxException;
16
import java.util.Map;
18
import java.util.Map;
17
import java.util.Observable;
19
import java.util.Observable;
18
import java.util.Observer;
20
import java.util.Observer;
19
21
22
import org.eclipse.core.filesystem.EFS;
23
import org.eclipse.core.filesystem.IFileStore;
20
import org.eclipse.core.resources.IProject;
24
import org.eclipse.core.resources.IProject;
21
import org.eclipse.core.resources.IResource;
25
import org.eclipse.core.resources.IResource;
22
import org.eclipse.core.resources.IWorkspace;
26
import org.eclipse.core.resources.IWorkspace;
23
import org.eclipse.core.resources.ResourcesPlugin;
27
import org.eclipse.core.resources.ResourcesPlugin;
24
import org.eclipse.core.runtime.*;
28
import org.eclipse.core.runtime.*;
29
import org.eclipse.dltk.core.DLTKCore;
25
import org.eclipse.dltk.core.environment.EnvironmentManager;
30
import org.eclipse.dltk.core.environment.EnvironmentManager;
26
import org.eclipse.dltk.core.environment.IEnvironment;
31
import org.eclipse.dltk.core.environment.IEnvironment;
32
import org.eclipse.dltk.internal.corext.util.Messages;
33
import org.eclipse.dltk.internal.ui.util.CoreUtility;
27
import org.eclipse.dltk.internal.ui.wizards.NewWizardMessages;
34
import org.eclipse.dltk.internal.ui.wizards.NewWizardMessages;
28
import org.eclipse.dltk.internal.ui.wizards.dialogfields.*;
35
import org.eclipse.dltk.internal.ui.wizards.dialogfields.*;
29
import org.eclipse.dltk.ui.DLTKUIPlugin;
36
import org.eclipse.dltk.ui.DLTKUIPlugin;
30
import org.eclipse.dltk.ui.environment.IEnvironmentUI;
37
import org.eclipse.dltk.ui.environment.IEnvironmentUI;
38
import org.eclipse.dltk.ui.util.ExceptionHandler;
31
import org.eclipse.jface.dialogs.Dialog;
39
import org.eclipse.jface.dialogs.Dialog;
32
import org.eclipse.jface.dialogs.IDialogConstants;
40
import org.eclipse.jface.dialogs.IDialogConstants;
41
import org.eclipse.jface.operation.IRunnableWithProgress;
33
import org.eclipse.jface.wizard.IWizardPage;
42
import org.eclipse.jface.wizard.IWizardPage;
34
import org.eclipse.jface.wizard.WizardPage;
43
import org.eclipse.jface.wizard.WizardPage;
35
import org.eclipse.php.internal.core.PHPVersion;
44
import org.eclipse.php.internal.core.PHPVersion;
Lines 37-42 Link Here
37
import org.eclipse.php.internal.ui.PHPUIMessages;
46
import org.eclipse.php.internal.ui.PHPUIMessages;
38
import org.eclipse.php.internal.ui.PHPUiPlugin;
47
import org.eclipse.php.internal.ui.PHPUiPlugin;
39
import org.eclipse.php.internal.ui.preferences.*;
48
import org.eclipse.php.internal.ui.preferences.*;
49
import org.eclipse.php.ui.util.PHPProjectUtils;
40
import org.eclipse.swt.SWT;
50
import org.eclipse.swt.SWT;
41
import org.eclipse.swt.events.SelectionEvent;
51
import org.eclipse.swt.events.SelectionEvent;
42
import org.eclipse.swt.events.SelectionListener;
52
import org.eclipse.swt.events.SelectionListener;
Lines 44-49 Link Here
44
import org.eclipse.swt.layout.GridLayout;
54
import org.eclipse.swt.layout.GridLayout;
45
import org.eclipse.swt.widgets.*;
55
import org.eclipse.swt.widgets.*;
46
import org.eclipse.ui.PlatformUI;
56
import org.eclipse.ui.PlatformUI;
57
import org.eclipse.ui.actions.WorkspaceModifyDelegatingOperation;
47
import org.eclipse.ui.dialogs.PreferencesUtil;
58
import org.eclipse.ui.dialogs.PreferencesUtil;
48
import org.eclipse.ui.preferences.IWorkbenchPreferenceContainer;
59
import org.eclipse.ui.preferences.IWorkbenchPreferenceContainer;
49
60
Lines 52-57 Link Here
52
 */
63
 */
53
public class PHPProjectWizardFirstPage extends WizardPage implements
64
public class PHPProjectWizardFirstPage extends WizardPage implements
54
		IPHPProjectCreateWizardPage {
65
		IPHPProjectCreateWizardPage {
66
55
	public PHPProjectWizardFirstPage() {
67
	public PHPProjectWizardFirstPage() {
56
		super(PAGE_NAME);
68
		super(PAGE_NAME);
57
		setPageComplete(false);
69
		setPageComplete(false);
Lines 59-64 Link Here
59
		setDescription(NewWizardMessages.ScriptProjectWizardFirstPage_page_description);
71
		setDescription(NewWizardMessages.ScriptProjectWizardFirstPage_page_description);
60
		fInitialName = ""; //$NON-NLS-1$
72
		fInitialName = ""; //$NON-NLS-1$
61
	}
73
	}
74
75
	private static final String FILENAME_PROJECT = ".project"; //$NON-NLS-1$
76
	protected static final String FILENAME_BUILDPATH = ".buildpath"; //$NON-NLS-1$
77
	protected URI fCurrProjectLocation; // null if location is platform location
78
79
	private boolean fKeepContent;
80
81
	private File fDotProjectBackup;
82
	private File fDotBuildpathBackup;
83
	private Boolean fIsAutobuild;
62
84
63
	private static final String PAGE_NAME = NewWizardMessages.ScriptProjectWizardFirstPage_page_title;
85
	private static final String PAGE_NAME = NewWizardMessages.ScriptProjectWizardFirstPage_page_title;
64
	public static final String ERROR_MESSAGE = "ErrorMessage";
86
	public static final String ERROR_MESSAGE = "ErrorMessage";
Lines 617-632 Link Here
617
	public void setVisible(boolean visible) {
639
	public void setVisible(boolean visible) {
618
		super.setVisible(visible);
640
		super.setVisible(visible);
619
641
620
		IWizardPage currentPage = getContainer().getCurrentPage();
642
		if (visible) {
621
		if (!visible && currentPage != null) {
643
			// if there is a project we are going from 2nd to 1st
622
			// going forward from 1st page to 2nd one
644
			// remove the project
645
			removeProject();
646
		} else {
647
			IWizardPage currentPage = getContainer().getCurrentPage();
623
			if (currentPage instanceof IPHPProjectCreateWizardPage) {
648
			if (currentPage instanceof IPHPProjectCreateWizardPage) {
649
				// going forward from 1st page to 2nd one
650
				changeToNewProject();
624
				((IPHPProjectCreateWizardPage) currentPage).initPage();
651
				((IPHPProjectCreateWizardPage) currentPage).initPage();
625
			}
652
			}
626
		}
653
		}
627
654
628
	}
655
	}
629
656
657
	private void removeProject() {
658
		if (fNameGroup == null || fNameGroup.getName() == null
659
				|| fNameGroup.getName().length() == 0) {
660
			return;
661
		}
662
		if (getProjectHandle() == null || !getProjectHandle().exists()) {
663
			return;
664
		}
665
666
		IRunnableWithProgress op = new IRunnableWithProgress() {
667
			public void run(IProgressMonitor monitor)
668
					throws InvocationTargetException, InterruptedException {
669
				doRemoveProject(monitor);
670
			}
671
		};
672
673
		try {
674
			getContainer().run(true, true,
675
					new WorkspaceModifyDelegatingOperation(op));
676
		} catch (InvocationTargetException e) {
677
			final String title = NewWizardMessages.ScriptProjectWizardSecondPage_error_remove_title;
678
			final String message = NewWizardMessages.ScriptProjectWizardSecondPage_error_remove_message;
679
			ExceptionHandler.handle(e, getShell(), title, message);
680
		} catch (InterruptedException e) {
681
			// cancel pressed
682
		}
683
	}
684
685
	final void doRemoveProject(IProgressMonitor monitor)
686
			throws InvocationTargetException {
687
		final boolean noProgressMonitor = (fCurrProjectLocation == null); // inside
688
		// workspace
689
		if (monitor == null || noProgressMonitor) {
690
			monitor = new NullProgressMonitor();
691
		}
692
		monitor.beginTask(
693
				NewWizardMessages.ScriptProjectWizardSecondPage_operation_remove,
694
				3);
695
		try {
696
			try {
697
				URI projLoc = getProjectHandle().getLocationURI();
698
699
				boolean removeContent = !fKeepContent
700
						&& getProjectHandle().isSynchronized(
701
								IResource.DEPTH_INFINITE);
702
				getProjectHandle().delete(removeContent, false,
703
						new SubProgressMonitor(monitor, 2));
704
705
			} finally {
706
				CoreUtility.enableAutoBuild(fIsAutobuild.booleanValue()); // fIsAutobuild
707
				// must
708
				// be
709
				// set
710
				fIsAutobuild = null;
711
			}
712
		} catch (CoreException e) {
713
			throw new InvocationTargetException(e);
714
		} finally {
715
			monitor.done();
716
			fKeepContent = false;
717
		}
718
	}
719
720
	private void changeToNewProject() {
721
		fKeepContent = this.getDetect();
722
723
		final IRunnableWithProgress op = new IRunnableWithProgress() {
724
			public void run(IProgressMonitor monitor)
725
					throws InvocationTargetException, InterruptedException {
726
				try {
727
					if (fIsAutobuild == null) {
728
						fIsAutobuild = Boolean.valueOf(CoreUtility
729
								.enableAutoBuild(false));
730
					}
731
					updateProject(monitor);
732
				} catch (CoreException e) {
733
					throw new InvocationTargetException(e);
734
				} catch (OperationCanceledException e) {
735
					throw new InterruptedException();
736
				} finally {
737
					monitor.done();
738
				}
739
			}
740
		};
741
742
		try {
743
			getContainer().run(true, false,
744
					new WorkspaceModifyDelegatingOperation(op));
745
		} catch (InvocationTargetException e) {
746
			final String title = NewWizardMessages.ScriptProjectWizardSecondPage_error_title;
747
			final String message = NewWizardMessages.ScriptProjectWizardSecondPage_error_message;
748
			ExceptionHandler.handle(e, getShell(), title, message);
749
		} catch (InterruptedException e) {
750
			// cancel pressed
751
		}
752
	}
753
754
	/**
755
	 * Called from the wizard on cancel.
756
	 */
757
	public void performCancel() {
758
		removeProject();
759
	}
760
761
	/**
762
	 * Helper method to create and open a IProject. The project location is
763
	 * configured. No natures are added.
764
	 * 
765
	 * @param project
766
	 *            The handle of the project to create.
767
	 * @param locationURI
768
	 *            The location of the project or <code>null</code> to create the
769
	 *            project in the workspace
770
	 * @param monitor
771
	 *            a progress monitor to report progress or <code>null</code> if
772
	 *            progress reporting is not desired
773
	 * @throws CoreException
774
	 *             if the project couldn't be created
775
	 * @see org.eclipse.core.resources.IProjectDescription#setLocationURI(java.net.URI)
776
	 * 
777
	 */
778
	public void createProject(IProject project, URI locationURI,
779
			IProgressMonitor monitor) throws CoreException {
780
		PHPProjectUtils.createProjectAt(project, locationURI, monitor);
781
	}
782
783
	protected void rememberExistingFiles(URI projectLocation)
784
			throws CoreException {
785
		fDotProjectBackup = null;
786
		fDotBuildpathBackup = null;
787
788
		IFileStore file = EFS.getStore(projectLocation);
789
		if (file.fetchInfo().exists()) {
790
			IFileStore projectFile = file.getChild(FILENAME_PROJECT);
791
			if (projectFile.fetchInfo().exists()) {
792
				fDotProjectBackup = createBackup(projectFile, "project-desc"); //$NON-NLS-1$ 
793
			}
794
			IFileStore buildpathFile = file.getChild(FILENAME_BUILDPATH);
795
			if (buildpathFile.fetchInfo().exists()) {
796
				fDotBuildpathBackup = createBackup(buildpathFile,
797
						"buildpath-desc"); //$NON-NLS-1$ 
798
			}
799
		}
800
	}
801
802
	private void restoreExistingFiles(URI projectLocation,
803
			IProgressMonitor monitor) throws CoreException {
804
		int ticks = ((fDotProjectBackup != null ? 1 : 0) + (fDotBuildpathBackup != null ? 1
805
				: 0)) * 2;
806
		monitor.beginTask("", ticks); //$NON-NLS-1$
807
		try {
808
			if (fDotProjectBackup != null) {
809
				IFileStore projectFile = EFS.getStore(projectLocation)
810
						.getChild(FILENAME_PROJECT);
811
				projectFile
812
						.delete(EFS.NONE, new SubProgressMonitor(monitor, 1));
813
				copyFile(fDotProjectBackup, projectFile,
814
						new SubProgressMonitor(monitor, 1));
815
			}
816
		} catch (IOException e) {
817
			IStatus status = new Status(
818
					IStatus.ERROR,
819
					DLTKUIPlugin.PLUGIN_ID,
820
					IStatus.ERROR,
821
					NewWizardMessages.ScriptProjectWizardSecondPage_problem_restore_project,
822
					e);
823
			throw new CoreException(status);
824
		}
825
		try {
826
			if (fDotBuildpathBackup != null) {
827
				IFileStore buildpathFile = EFS.getStore(projectLocation)
828
						.getChild(FILENAME_BUILDPATH);
829
				buildpathFile.delete(EFS.NONE, new SubProgressMonitor(monitor,
830
						1));
831
				copyFile(fDotBuildpathBackup, buildpathFile,
832
						new SubProgressMonitor(monitor, 1));
833
			}
834
		} catch (IOException e) {
835
			IStatus status = new Status(
836
					IStatus.ERROR,
837
					DLTKUIPlugin.PLUGIN_ID,
838
					IStatus.ERROR,
839
					NewWizardMessages.ScriptProjectWizardSecondPage_problem_restore_buildpath,
840
					e);
841
			throw new CoreException(status);
842
		}
843
	}
844
845
	private File createBackup(IFileStore source, String name)
846
			throws CoreException {
847
		try {
848
			File bak = File.createTempFile("eclipse-" + name, ".bak"); //$NON-NLS-1$//$NON-NLS-2$
849
			copyFile(source, bak);
850
			return bak;
851
		} catch (IOException e) {
852
			IStatus status = new Status(
853
					IStatus.ERROR,
854
					DLTKUIPlugin.PLUGIN_ID,
855
					IStatus.ERROR,
856
					Messages.format(
857
							NewWizardMessages.ScriptProjectWizardSecondPage_problem_backup,
858
							name), e);
859
			throw new CoreException(status);
860
		}
861
	}
862
863
	private void copyFile(IFileStore source, File target) throws IOException,
864
			CoreException {
865
		InputStream is = source.openInputStream(EFS.NONE, null);
866
		FileOutputStream os = new FileOutputStream(target);
867
		copyFile(is, os);
868
	}
869
870
	private void copyFile(File source, IFileStore target,
871
			IProgressMonitor monitor) throws IOException, CoreException {
872
		FileInputStream is = new FileInputStream(source);
873
		OutputStream os = target.openOutputStream(EFS.NONE, monitor);
874
		copyFile(is, os);
875
	}
876
877
	private void copyFile(InputStream is, OutputStream os) throws IOException {
878
		try {
879
			byte[] buffer = new byte[8192];
880
			while (true) {
881
				int bytesRead = is.read(buffer);
882
				if (bytesRead == -1)
883
					break;
884
885
				os.write(buffer, 0, bytesRead);
886
			}
887
		} finally {
888
			try {
889
				is.close();
890
			} finally {
891
				os.close();
892
			}
893
		}
894
	}
895
896
	protected URI getProjectLocationURI() throws CoreException {
897
		if (this.isInWorkspace()) {
898
			return null;
899
		}
900
		return this.getLocationURI();
901
	}
902
903
	protected void updateProject(IProgressMonitor monitor)
904
			throws CoreException, InterruptedException {
905
906
		IProject projectHandle = this.getProjectHandle();
907
		DLTKCore.create(projectHandle);
908
		fCurrProjectLocation = getProjectLocationURI();
909
910
		if (monitor == null) {
911
			monitor = new NullProgressMonitor();
912
		}
913
		try {
914
			monitor.beginTask(
915
					NewWizardMessages.ScriptProjectWizardSecondPage_operation_initialize,
916
					70);
917
			if (monitor.isCanceled()) {
918
				throw new OperationCanceledException();
919
			}
920
921
			URI realLocation = fCurrProjectLocation;
922
			if (fCurrProjectLocation == null) { // inside workspace
923
				try {
924
					URI rootLocation = ResourcesPlugin.getWorkspace().getRoot()
925
							.getLocationURI();
926
					realLocation = new URI(rootLocation.getScheme(), null, Path
927
							.fromPortableString(rootLocation.getPath())
928
							.append(projectHandle.getName()).toString(), null);
929
				} catch (URISyntaxException e) {
930
					Assert.isTrue(false, "Can't happen"); //$NON-NLS-1$
931
				}
932
			}
933
934
			rememberExistingFiles(realLocation);
935
936
			createProject(projectHandle, fCurrProjectLocation,
937
					new SubProgressMonitor(monitor, 20));
938
		} finally {
939
			monitor.done();
940
		}
941
	}
942
630
	public void initPage() {
943
	public void initPage() {
631
	}
944
	}
632
945
(-)src/org/eclipse/php/internal/ui/wizards/PHPProjectWizardSecondPage.java (-228 lines)
Lines 11-36 Link Here
11
 *******************************************************************************/
11
 *******************************************************************************/
12
package org.eclipse.php.internal.ui.wizards;
12
package org.eclipse.php.internal.ui.wizards;
13
13
14
import java.io.*;
15
import java.lang.reflect.InvocationTargetException;
14
import java.lang.reflect.InvocationTargetException;
16
import java.net.URI;
15
import java.net.URI;
17
import java.net.URISyntaxException;
18
import java.util.ArrayList;
16
import java.util.ArrayList;
19
import java.util.List;
17
import java.util.List;
20
18
21
import org.eclipse.core.filesystem.EFS;
22
import org.eclipse.core.filesystem.IFileStore;
23
import org.eclipse.core.resources.IFolder;
19
import org.eclipse.core.resources.IFolder;
24
import org.eclipse.core.resources.IProject;
20
import org.eclipse.core.resources.IProject;
25
import org.eclipse.core.resources.IResource;
26
import org.eclipse.core.resources.ResourcesPlugin;
27
import org.eclipse.core.runtime.*;
21
import org.eclipse.core.runtime.*;
28
import org.eclipse.dltk.core.*;
22
import org.eclipse.dltk.core.*;
29
import org.eclipse.dltk.internal.corext.util.Messages;
30
import org.eclipse.dltk.internal.ui.util.CoreUtility;
23
import org.eclipse.dltk.internal.ui.util.CoreUtility;
31
import org.eclipse.dltk.internal.ui.wizards.BuildpathDetector;
24
import org.eclipse.dltk.internal.ui.wizards.BuildpathDetector;
32
import org.eclipse.dltk.internal.ui.wizards.NewWizardMessages;
25
import org.eclipse.dltk.internal.ui.wizards.NewWizardMessages;
33
import org.eclipse.dltk.ui.DLTKUIPlugin;
34
import org.eclipse.dltk.ui.util.ExceptionHandler;
26
import org.eclipse.dltk.ui.util.ExceptionHandler;
35
import org.eclipse.dltk.ui.util.IStatusChangeListener;
27
import org.eclipse.dltk.ui.util.IStatusChangeListener;
36
import org.eclipse.dltk.ui.wizards.BuildpathsBlock;
28
import org.eclipse.dltk.ui.wizards.BuildpathsBlock;
Lines 74-81 Link Here
74
66
75
	private boolean fKeepContent;
67
	private boolean fKeepContent;
76
68
77
	private File fDotProjectBackup;
78
	private File fDotBuildpathBackup;
79
	private Boolean fIsAutobuild;
69
	private Boolean fIsAutobuild;
80
70
81
	/**
71
	/**
Lines 85-93 Link Here
85
		fFirstPage = mainPage;
75
		fFirstPage = mainPage;
86
		fCurrProjectLocation = null;
76
		fCurrProjectLocation = null;
87
		fKeepContent = false;
77
		fKeepContent = false;
88
89
		fDotProjectBackup = null;
90
		fDotBuildpathBackup = null;
91
		fIsAutobuild = null;
78
		fIsAutobuild = null;
92
	}
79
	}
93
80
Lines 97-123 Link Here
97
84
98
	protected boolean useNewSourcePage() {
85
	protected boolean useNewSourcePage() {
99
		return true;
86
		return true;
100
	}
101
102
	/*
103
	 * (non-Javadoc)
104
	 * 
105
	 * @see org.eclipse.jface.dialogs.IDialogPage#setVisible(boolean)
106
	 */
107
	public void setVisible(boolean visible) {
108
		super.setVisible(visible);
109
		IWizardPage currentPage = getContainer().getCurrentPage();
110
		if (!visible && currentPage != null) {
111
			// going back from 2nd page to 1st one
112
			if (currentPage instanceof PHPProjectWizardFirstPage) {
113
				IWizardPage nextPage = currentPage.getNextPage();
114
				if (nextPage instanceof PHPProjectWizardSecondPage) {
115
					((PHPProjectWizardSecondPage) nextPage).removeProject();
116
				} else {
117
					throw (new IllegalStateException());
118
				}
119
			}
120
		}
121
	}
87
	}
122
88
123
	private void changeToNewProject() {
89
	private void changeToNewProject() {
Lines 172-192 Link Here
172
			if (monitor.isCanceled()) {
138
			if (monitor.isCanceled()) {
173
				throw new OperationCanceledException();
139
				throw new OperationCanceledException();
174
			}
140
			}
175
176
			URI realLocation = fCurrProjectLocation;
177
			if (fCurrProjectLocation == null) { // inside workspace
178
				try {
179
					URI rootLocation = ResourcesPlugin.getWorkspace().getRoot()
180
							.getLocationURI();
181
					realLocation = new URI(rootLocation.getScheme(), null, Path
182
							.fromPortableString(rootLocation.getPath())
183
							.append(getProject().getName()).toString(), null);
184
				} catch (URISyntaxException e) {
185
					Assert.isTrue(false, "Can't happen"); //$NON-NLS-1$
186
				}
187
			}
188
189
			rememberExistingFiles(realLocation);
190
141
191
			createProject(getProject(), fCurrProjectLocation,
142
			createProject(getProject(), fCurrProjectLocation,
192
					new SubProgressMonitor(monitor, 20));
143
					new SubProgressMonitor(monitor, 20));
Lines 394-512 Link Here
394
		return fFirstPage.getLocationURI();
345
		return fFirstPage.getLocationURI();
395
	}
346
	}
396
347
397
	protected void rememberExistingFiles(URI projectLocation)
398
			throws CoreException {
399
		fDotProjectBackup = null;
400
		fDotBuildpathBackup = null;
401
402
		IFileStore file = EFS.getStore(projectLocation);
403
		if (file.fetchInfo().exists()) {
404
			IFileStore projectFile = file.getChild(FILENAME_PROJECT);
405
			if (projectFile.fetchInfo().exists()) {
406
				fDotProjectBackup = createBackup(projectFile, "project-desc"); //$NON-NLS-1$ 
407
			}
408
			IFileStore buildpathFile = file.getChild(FILENAME_BUILDPATH);
409
			if (buildpathFile.fetchInfo().exists()) {
410
				fDotBuildpathBackup = createBackup(buildpathFile,
411
						"buildpath-desc"); //$NON-NLS-1$ 
412
			}
413
		}
414
	}
415
416
	private void restoreExistingFiles(URI projectLocation,
417
			IProgressMonitor monitor) throws CoreException {
418
		int ticks = ((fDotProjectBackup != null ? 1 : 0) + (fDotBuildpathBackup != null ? 1
419
				: 0)) * 2;
420
		monitor.beginTask("", ticks); //$NON-NLS-1$
421
		try {
422
			if (fDotProjectBackup != null) {
423
				IFileStore projectFile = EFS.getStore(projectLocation)
424
						.getChild(FILENAME_PROJECT);
425
				projectFile
426
						.delete(EFS.NONE, new SubProgressMonitor(monitor, 1));
427
				copyFile(fDotProjectBackup, projectFile,
428
						new SubProgressMonitor(monitor, 1));
429
			}
430
		} catch (IOException e) {
431
			IStatus status = new Status(
432
					IStatus.ERROR,
433
					DLTKUIPlugin.PLUGIN_ID,
434
					IStatus.ERROR,
435
					NewWizardMessages.ScriptProjectWizardSecondPage_problem_restore_project,
436
					e);
437
			throw new CoreException(status);
438
		}
439
		try {
440
			if (fDotBuildpathBackup != null) {
441
				IFileStore buildpathFile = EFS.getStore(projectLocation)
442
						.getChild(FILENAME_BUILDPATH);
443
				buildpathFile.delete(EFS.NONE, new SubProgressMonitor(monitor,
444
						1));
445
				copyFile(fDotBuildpathBackup, buildpathFile,
446
						new SubProgressMonitor(monitor, 1));
447
			}
448
		} catch (IOException e) {
449
			IStatus status = new Status(
450
					IStatus.ERROR,
451
					DLTKUIPlugin.PLUGIN_ID,
452
					IStatus.ERROR,
453
					NewWizardMessages.ScriptProjectWizardSecondPage_problem_restore_buildpath,
454
					e);
455
			throw new CoreException(status);
456
		}
457
	}
458
459
	private File createBackup(IFileStore source, String name)
460
			throws CoreException {
461
		try {
462
			File bak = File.createTempFile("eclipse-" + name, ".bak"); //$NON-NLS-1$//$NON-NLS-2$
463
			copyFile(source, bak);
464
			return bak;
465
		} catch (IOException e) {
466
			IStatus status = new Status(
467
					IStatus.ERROR,
468
					DLTKUIPlugin.PLUGIN_ID,
469
					IStatus.ERROR,
470
					Messages.format(
471
							NewWizardMessages.ScriptProjectWizardSecondPage_problem_backup,
472
							name), e);
473
			throw new CoreException(status);
474
		}
475
	}
476
477
	private void copyFile(IFileStore source, File target) throws IOException,
478
			CoreException {
479
		InputStream is = source.openInputStream(EFS.NONE, null);
480
		FileOutputStream os = new FileOutputStream(target);
481
		copyFile(is, os);
482
	}
483
484
	private void copyFile(File source, IFileStore target,
485
			IProgressMonitor monitor) throws IOException, CoreException {
486
		FileInputStream is = new FileInputStream(source);
487
		OutputStream os = target.openOutputStream(EFS.NONE, monitor);
488
		copyFile(is, os);
489
	}
490
491
	private void copyFile(InputStream is, OutputStream os) throws IOException {
492
		try {
493
			byte[] buffer = new byte[8192];
494
			while (true) {
495
				int bytesRead = is.read(buffer);
496
				if (bytesRead == -1)
497
					break;
498
499
				os.write(buffer, 0, bytesRead);
500
			}
501
		} finally {
502
			try {
503
				is.close();
504
			} finally {
505
				os.close();
506
			}
507
		}
508
	}
509
510
	/**
348
	/**
511
	 * Called from the wizard on finish.
349
	 * Called from the wizard on finish.
512
	 */
350
	 */
Lines 554-618 Link Here
554
		ProjectOptions.setPhpVersion(phpVersion, getProject());
392
		ProjectOptions.setPhpVersion(phpVersion, getProject());
555
	}
393
	}
556
394
557
	private void removeProject() {
558
		if (getProject() == null || !getProject().exists()) {
559
			return;
560
		}
561
562
		IRunnableWithProgress op = new IRunnableWithProgress() {
563
			public void run(IProgressMonitor monitor)
564
					throws InvocationTargetException, InterruptedException {
565
				doRemoveProject(monitor);
566
			}
567
		};
568
569
		try {
570
			getContainer().run(true, true,
571
					new WorkspaceModifyDelegatingOperation(op));
572
		} catch (InvocationTargetException e) {
573
			final String title = NewWizardMessages.ScriptProjectWizardSecondPage_error_remove_title;
574
			final String message = NewWizardMessages.ScriptProjectWizardSecondPage_error_remove_message;
575
			ExceptionHandler.handle(e, getShell(), title, message);
576
		} catch (InterruptedException e) {
577
			// cancel pressed
578
		}
579
	}
580
581
	final void doRemoveProject(IProgressMonitor monitor)
582
			throws InvocationTargetException {
583
		final boolean noProgressMonitor = (fCurrProjectLocation == null); // inside
584
		// workspace
585
		if (monitor == null || noProgressMonitor) {
586
			monitor = new NullProgressMonitor();
587
		}
588
		monitor.beginTask(
589
				NewWizardMessages.ScriptProjectWizardSecondPage_operation_remove,
590
				3);
591
		try {
592
			try {
593
				URI projLoc = getProject().getLocationURI();
594
595
				boolean removeContent = !fKeepContent
596
						&& getProject()
597
								.isSynchronized(IResource.DEPTH_INFINITE);
598
				getProject().delete(removeContent, false,
599
						new SubProgressMonitor(monitor, 2));
600
601
			} finally {
602
				CoreUtility.enableAutoBuild(fIsAutobuild.booleanValue()); // fIsAutobuild
603
				// must
604
				// be
605
				// set
606
				fIsAutobuild = null;
607
			}
608
		} catch (CoreException e) {
609
			throw new InvocationTargetException(e);
610
		} finally {
611
			monitor.done();
612
			fKeepContent = false;
613
		}
614
	}
615
616
	/**
395
	/**
617
	 * Helper method to create and open a IProject. The project location is
396
	 * Helper method to create and open a IProject. The project location is
618
	 * configured. No natures are added.
397
	 * configured. No natures are added.
Lines 633-645 Link Here
633
	public void createProject(IProject project, URI locationURI,
412
	public void createProject(IProject project, URI locationURI,
634
			IProgressMonitor monitor) throws CoreException {
413
			IProgressMonitor monitor) throws CoreException {
635
		PHPProjectUtils.createProjectAt(project, locationURI, monitor);
414
		PHPProjectUtils.createProjectAt(project, locationURI, monitor);
636
	}
637
638
	/**
639
	 * Called from the wizard on cancel.
640
	 */
641
	public void performCancel() {
642
		removeProject();
643
	}
415
	}
644
416
645
	public IProject getCurrProject() {
417
	public IProject getCurrProject() {
(-)src/org/eclipse/php/ui/wizards/INewProjectWizardFragementFactory.java (+29 lines)
Added Link Here
1
/*******************************************************************************
2
 * Copyright (c) 2009 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
6
 * http://www.eclipse.org/legal/epl-v10.html
7
 * 
8
 * Contributors:
9
 *     IBM Corporation - initial API and implementation
10
 *     Zend Technologies
11
 *******************************************************************************/
12
package org.eclipse.php.ui.wizards;
13
14
import org.eclipse.php.internal.ui.wizards.WizardFragment;
15
16
/**
17
 * Factory for creating fragments for the new project wizard.
18
 * 
19
 */
20
public interface INewProjectWizardFragementFactory {
21
22
	/**
23
	 * Creates a WizardFragment used for the new project wizard.
24
	 * 
25
	 * @return the wizard fragment
26
	 */
27
	public WizardFragment createWizardFragment();
28
29
}
(-)src/org/eclipse/php/ui/wizards/INewProjectWizardOperation.java (+59 lines)
Added Link Here
1
/*******************************************************************************
2
 * Copyright (c) 2009 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
6
 * http://www.eclipse.org/legal/epl-v10.html
7
 * 
8
 * Contributors:
9
 *     IBM Corporation - initial API and implementation
10
 *     Zend Technologies
11
 *******************************************************************************/
12
package org.eclipse.php.ui.wizards;
13
14
import org.eclipse.core.resources.IProject;
15
import org.eclipse.php.internal.ui.wizards.WizardModel;
16
17
/**
18
 * A single operation for the new project wizard
19
 * 
20
 */
21
public interface INewProjectWizardOperation {
22
23
	/**
24
	 * Invoked before switching from facets page to the php include page. Can be
25
	 * used to preset/manipulate the include path. The given project is already
26
	 * prepared/ the default.
27
	 * 
28
	 * @param projectHandle
29
	 *            The project handle
30
	 * @param model
31
	 *            the wizard data model
32
	 * @param keep
33
	 *            true to keep the sources (overwrite existing project) or false
34
	 *            to create a new project
35
	 */
36
	public void onPreparePhpProject(IProject projectHandle, WizardModel model,
37
			boolean keep);
38
39
	/**
40
	 * Invoked after the user clicks on finish
41
	 * 
42
	 * @param projectHandle
43
	 *            the final php project
44
	 * @param model
45
	 *            the wizard data model
46
	 */
47
	public void onFinish(IProject projectHandle, WizardModel model);
48
49
	/**
50
	 * Invoked after the user clicks on cancel. should be used for cleanup.
51
	 * 
52
	 * @param projectHandle
53
	 *            the temporary php project
54
	 * @param model
55
	 *            the wizard data model
56
	 */
57
	public void onCancel(IProject projectHandle, WizardModel model);
58
59
}

Return to bug 389037