1 /*******************************************************************************
2 * Copyright (c) 2000, 2003 IBM Corporation and others.
3 * All rights reserved. This program and the accompanying materials
4 * are made available under the terms of the Common Public License v1.0
5 * which accompanies this distribution, and is available at
6 * http://www.eclipse.org/legal/cpl-v10.html
9 * IBM Corporation - initial API and implementation
10 *******************************************************************************/
11 package net.sourceforge.phpdt.internal.ui.wizards;
13 import net.sourceforge.phpdt.core.ICompilationUnit;
14 import net.sourceforge.phpdt.internal.corext.util.JavaModelUtil;
15 import net.sourceforge.phpdt.internal.ui.PHPUiImages;
16 import net.sourceforge.phpdt.ui.wizards.NewClassWizardPage;
17 import net.sourceforge.phpeclipse.PHPeclipsePlugin;
19 import org.eclipse.core.resources.IFile;
20 import org.eclipse.core.resources.IResource;
21 import org.eclipse.core.runtime.CoreException;
22 import org.eclipse.core.runtime.IProgressMonitor;
25 public class NewClassCreationWizard extends NewElementWizard {
27 private NewClassWizardPage fPage;
29 public NewClassCreationWizard() {
31 setDefaultPageImageDescriptor(PHPUiImages.DESC_WIZBAN_NEWCLASS);
32 setDialogSettings(PHPeclipsePlugin.getDefault().getDialogSettings());
33 setWindowTitle(NewWizardMessages.getString("NewClassCreationWizard.title")); //$NON-NLS-1$
37 * @see Wizard#createPages
39 public void addPages() {
41 fPage= new NewClassWizardPage();
43 fPage.init(getSelection());
48 * @see net.sourceforge.phpdt.internal.ui.wizards.NewElementWizard#finishPage(org.eclipse.core.runtime.IProgressMonitor)
50 protected void finishPage(IProgressMonitor monitor) throws InterruptedException, CoreException {
51 fPage.createType(monitor); // use the full progress monitor
52 ICompilationUnit cu= JavaModelUtil.toOriginal(fPage.getCreatedType().getCompilationUnit());
54 IResource resource= cu.getResource();
55 selectAndReveal(resource);
56 openResource((IFile) resource);
61 * @see org.eclipse.jface.wizard.IWizard#performFinish()
63 public boolean performFinish() {
64 // warnAboutTypeCommentDeprecation();
65 return super.performFinish();