01: /*******************************************************************************
02: * Copyright (c) 2000, 2006 IBM Corporation and others.
03: * All rights reserved. This program and the accompanying materials
04: * are made available under the terms of the Eclipse Public License v1.0
05: * which accompanies this distribution, and is available at
06: * http://www.eclipse.org/legal/epl-v10.html
07: *
08: * Contributors:
09: * IBM Corporation - initial API and implementation
10: *******************************************************************************/package org.eclipse.jdt.internal.ui.refactoring.nls;
11:
12: import org.eclipse.jface.wizard.IWizardPage;
13:
14: import org.eclipse.jdt.internal.corext.refactoring.nls.NLSRefactoring;
15: import org.eclipse.jdt.internal.corext.util.Messages;
16:
17: import org.eclipse.jdt.internal.ui.JavaPluginImages;
18:
19: import org.eclipse.ltk.ui.refactoring.RefactoringWizard;
20:
21: /**
22: * good citizen problems - wizard is only valid after constructor (when the pages toggle
23: * some values and force an validate the validate can't get a wizard)
24: */
25: public class ExternalizeWizard extends RefactoringWizard {
26:
27: public ExternalizeWizard(NLSRefactoring refactoring) {
28: super (refactoring, CHECK_INITIAL_CONDITIONS_ON_OPEN
29: | WIZARD_BASED_USER_INTERFACE);
30: setDefaultPageTitle(Messages.format(
31: NLSUIMessages.ExternalizeWizardPage_title, refactoring
32: .getCu().getElementName()));
33: setWindowTitle(NLSUIMessages.ExternalizeWizard_name);
34: setDefaultPageImageDescriptor(JavaPluginImages.DESC_WIZBAN_EXTERNALIZE_STRINGS);
35: }
36:
37: /**
38: * @see RefactoringWizard#addUserInputPages()
39: */
40: protected void addUserInputPages() {
41:
42: NLSRefactoring nlsRefac = (NLSRefactoring) getRefactoring();
43: ExternalizeWizardPage page = new ExternalizeWizardPage(nlsRefac);
44: page.setMessage(NLSUIMessages.ExternalizeWizard_select);
45: addPage(page);
46:
47: /*ExternalizeWizardPage2 page2= new ExternalizeWizardPage2(nlsRefac);
48: page2.setMessage(NLSUIMessages.getString("wizard.select_values")); //$NON-NLS-1$
49: addPage(page2);*/
50: }
51:
52: public boolean canFinish() {
53: IWizardPage page = getContainer().getCurrentPage();
54: return super .canFinish()
55: && !(page instanceof ExternalizeWizardPage);
56: }
57: }
|