KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > jdt > internal > ui > refactoring > nls > ExternalizeWizard


1 /*******************************************************************************
2  * Copyright (c) 2000, 2006 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 package org.eclipse.jdt.internal.ui.refactoring.nls;
12
13 import org.eclipse.jface.wizard.IWizardPage;
14
15 import org.eclipse.jdt.internal.corext.refactoring.nls.NLSRefactoring;
16 import org.eclipse.jdt.internal.corext.util.Messages;
17
18 import org.eclipse.jdt.internal.ui.JavaPluginImages;
19
20 import org.eclipse.ltk.ui.refactoring.RefactoringWizard;
21
22 /**
23  * good citizen problems - wizard is only valid after constructor (when the pages toggle
24  * some values and force an validate the validate can't get a wizard)
25  */

26 public class ExternalizeWizard extends RefactoringWizard {
27
28     public ExternalizeWizard(NLSRefactoring refactoring) {
29         super(refactoring,CHECK_INITIAL_CONDITIONS_ON_OPEN | WIZARD_BASED_USER_INTERFACE);
30         setDefaultPageTitle(Messages.format(NLSUIMessages.ExternalizeWizardPage_title, refactoring.getCu().getElementName()));
31         setWindowTitle(NLSUIMessages.ExternalizeWizard_name);
32         setDefaultPageImageDescriptor(JavaPluginImages.DESC_WIZBAN_EXTERNALIZE_STRINGS);
33     }
34
35     /**
36      * @see RefactoringWizard#addUserInputPages()
37      */

38     protected void addUserInputPages() {
39
40         NLSRefactoring nlsRefac= (NLSRefactoring) getRefactoring();
41         ExternalizeWizardPage page= new ExternalizeWizardPage(nlsRefac);
42         page.setMessage(NLSUIMessages.ExternalizeWizard_select);
43         addPage(page);
44
45         /*ExternalizeWizardPage2 page2= new ExternalizeWizardPage2(nlsRefac);
46          page2.setMessage(NLSUIMessages.getString("wizard.select_values")); //$NON-NLS-1$
47          addPage(page2);*/

48     }
49
50     public boolean canFinish() {
51         IWizardPage page= getContainer().getCurrentPage();
52         return super.canFinish() && !(page instanceof ExternalizeWizardPage);
53     }
54 }
55
Popular Tags