blob: fe5a296778d16b0ca340e3422e399039f140461c [file] [log] [blame]
/*******************************************************************************
* Copyright (c) 2000, 2017 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
*
*******************************************************************************/
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);
}
@Override
public void addPages() {
super.addPages();
fPage = new NewSourceFolderWizardPage();
addPage(fPage);
fPage.init(getSelection());
}
@Override
protected void finishPage(IProgressMonitor monitor)
throws InterruptedException, CoreException {
fPage.createProjectFragment(monitor); // use the full progress monitor
}
@Override
public boolean performFinish() {
boolean res = super.performFinish();
if (res) {
selectAndReveal(fPage.getCorrespondingResource());
}
return res;
}
@Override
public IModelElement getCreatedElement() {
return fPage.getNewProjectFragment();
}
}