KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > jdt > internal > ui > refactoring > code > ExtractMethodWizard


1 /*******************************************************************************
2  * Copyright (c) 2000, 2005 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  * IBM Corporation - initial API and implementation
10  *******************************************************************************/

11
12 package org.eclipse.jdt.internal.ui.refactoring.code;
13
14 import org.eclipse.core.runtime.CoreException;
15 import org.eclipse.core.runtime.NullProgressMonitor;
16
17 import org.eclipse.jdt.internal.corext.refactoring.code.ExtractMethodRefactoring;
18
19 import org.eclipse.jdt.internal.ui.JavaPlugin;
20 import org.eclipse.jdt.internal.ui.refactoring.RefactoringMessages;
21
22 import org.eclipse.ltk.core.refactoring.Change;
23 import org.eclipse.ltk.ui.refactoring.RefactoringWizard;
24
25 public class ExtractMethodWizard extends RefactoringWizard {
26     
27     /* package */ static final String JavaDoc DIALOG_SETTING_SECTION= "ExtractMethodWizard"; //$NON-NLS-1$
28

29     public ExtractMethodWizard(ExtractMethodRefactoring ref){
30         super(ref, DIALOG_BASED_USER_INTERFACE | PREVIEW_EXPAND_FIRST_NODE);
31         setDefaultPageTitle(RefactoringMessages.ExtractMethodWizard_extract_method);
32         setDialogSettings(JavaPlugin.getDefault().getDialogSettings());
33     }
34
35     public Change createChange(){
36         // creating the change is cheap. So we don't need to show progress.
37
try {
38             return getRefactoring().createChange(new NullProgressMonitor());
39         } catch (CoreException e) {
40             JavaPlugin.log(e);
41             return null;
42         }
43     }
44         
45     protected void addUserInputPages(){
46         addPage(new ExtractMethodInputPage());
47     }
48 }
49
Popular Tags