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;
24 public class NewClassCreationWizard extends NewElementWizard {
26 private NewClassWizardPage fPage;
28 public NewClassCreationWizard() {
30 setDefaultPageImageDescriptor(PHPUiImages.DESC_WIZBAN_NEWCLASS);
31 setDialogSettings(PHPeclipsePlugin.getDefault().getDialogSettings());
32 setWindowTitle(NewWizardMessages
33 .getString("NewClassCreationWizard.title")); //$NON-NLS-1$
37 * @see Wizard#createPages
39 public void addPages() {
41 fPage = new NewClassWizardPage();
43 fPage.init(getSelection());
49 * @see net.sourceforge.phpdt.internal.ui.wizards.NewElementWizard#finishPage(org.eclipse.core.runtime.IProgressMonitor)
51 protected void finishPage(IProgressMonitor monitor)
52 throws InterruptedException, CoreException {
53 fPage.createType(monitor); // use the full progress monitor
54 ICompilationUnit cu = JavaModelUtil.toOriginal(fPage.getCreatedType()
55 .getCompilationUnit());
57 IResource resource = cu.getResource();
58 selectAndReveal(resource);
59 openResource((IFile) resource);
66 * @see org.eclipse.jface.wizard.IWizard#performFinish()
68 public boolean performFinish() {
69 // warnAboutTypeCommentDeprecation();
70 return super.performFinish();