blob: ca71933eaab13aa37964db0de28cfb85c5d4079c [file] [log] [blame]
/*******************************************************************************
* Copyright (c) 2000, 2005 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
package org.eclipse.dltk.ui.wizards;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.dltk.core.IModelElement;
import org.eclipse.dltk.internal.ui.wizards.NewWizardMessages;
import org.eclipse.dltk.ui.DLTKPluginImages;
import org.eclipse.dltk.ui.DLTKUIPlugin;
public class NewSourceFolderCreationWizard extends NewElementWizard {
private NewSourceFolderWizardPage fPage;
public NewSourceFolderCreationWizard() {
super();
setDefaultPageImageDescriptor(DLTKPluginImages.DESC_WIZBAN_NEWSRCFOLDR);
setDialogSettings(DLTKUIPlugin.getDefault().getDialogSettings());
setWindowTitle(NewWizardMessages.NewSourceFolderCreationWizard_title);
}
public void addPages() {
super.addPages();
fPage = new NewSourceFolderWizardPage();
addPage(fPage);
fPage.init(getSelection());
}
protected void finishPage(IProgressMonitor monitor)
throws InterruptedException, CoreException {
fPage.createProjectFragment(monitor); // use the full progress monitor
}
public boolean performFinish() {
boolean res = super.performFinish();
if (res) {
selectAndReveal(fPage.getCorrespondingResource());
}
return res;
}
public IModelElement getCreatedElement() {
return fPage.getNewProjectFragment();
}
}