blob: 64ff52d1914b48a34dfa9dfb2a0dba4714ab1756 [file] [log] [blame]
/*******************************************************************************
* Copyright (c) 2000, 2008 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.cdt.ui.wizards;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.cdt.ui.CUIPlugin;
import org.eclipse.cdt.internal.ui.CPluginImages;
import org.eclipse.cdt.internal.ui.wizards.NewElementWizard;
import org.eclipse.cdt.internal.ui.wizards.folderwizard.NewFolderWizardMessages;
import org.eclipse.cdt.internal.ui.wizards.folderwizard.NewSourceFolderWizardPage;
public class NewSourceFolderCreationWizard extends NewElementWizard {
private NewSourceFolderWizardPage fPage;
public NewSourceFolderCreationWizard() {
super();
setDefaultPageImageDescriptor(CPluginImages.DESC_WIZBAN_NEWSRCFOLDR);
setDialogSettings(CUIPlugin.getDefault().getDialogSettings());
setWindowTitle(NewFolderWizardMessages.NewSourceFolderCreationWizard_title);
}
@Override
public void addPages() {
super.addPages();
fPage= new NewSourceFolderWizardPage();
addPage(fPage);
fPage.init(getSelection());
}
@Override
protected void finishPage(IProgressMonitor monitor) throws CoreException {
fPage.createSourceRoot(monitor); // Use the full progress monitor.
}
@Override
public boolean performFinish() {
boolean res= super.performFinish();
if (res) {
selectAndReveal(fPage.getCorrespondingResource());
}
return res;
}
}