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;
18 import net.sourceforge.phpeclipse.ui.WebUI;
20 import org.eclipse.core.resources.IFile;
21 import org.eclipse.core.resources.IResource;
22 import org.eclipse.core.runtime.CoreException;
23 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(WebUI.getDefault().getDialogSettings());
33 setWindowTitle(NewWizardMessages
34 .getString("NewClassCreationWizard.title")); //$NON-NLS-1$
38 * @see Wizard#createPages
40 public void addPages() {
42 fPage = new NewClassWizardPage();
44 fPage.init(getSelection());
50 * @see net.sourceforge.phpdt.internal.ui.wizards.NewElementWizard#finishPage(org.eclipse.core.runtime.IProgressMonitor)
52 protected void finishPage(IProgressMonitor monitor)
53 throws InterruptedException, CoreException {
54 fPage.createType(monitor); // use the full progress monitor
55 ICompilationUnit cu = JavaModelUtil.toOriginal(fPage.getCreatedType()
56 .getCompilationUnit());
58 IResource resource = cu.getResource();
59 selectAndReveal(resource);
60 openResource((IFile) resource);
67 * @see org.eclipse.jface.wizard.IWizard#performFinish()
69 public boolean performFinish() {
70 // warnAboutTypeCommentDeprecation();
71 return super.performFinish();