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.ui.examples.readmetool;
11:
12: import org.eclipse.jface.viewers.IStructuredSelection;
13: import org.eclipse.jface.wizard.Wizard;
14: import org.eclipse.ui.INewWizard;
15: import org.eclipse.ui.IWorkbench;
16:
17: /**
18: * This class implements the interface required by the workbench
19: * for all 'New' wizards. This wizard creates readme files.
20: */
21: public class ReadmeCreationWizard extends Wizard implements INewWizard {
22: private IStructuredSelection selection;
23:
24: private IWorkbench workbench;
25:
26: private ReadmeCreationPage mainPage;
27:
28: /** (non-Javadoc)
29: * Method declared on Wizard.
30: */
31: public void addPages() {
32: mainPage = new ReadmeCreationPage(workbench, selection);
33: addPage(mainPage);
34: }
35:
36: /** (non-Javadoc)
37: * Method declared on IWorkbenchWizard
38: */
39: public void init(IWorkbench workbench,
40: IStructuredSelection selection) {
41: this .workbench = workbench;
42: this .selection = selection;
43: setWindowTitle(MessageUtil.getString("New_Readme_File")); //$NON-NLS-1$
44: setDefaultPageImageDescriptor(ReadmeImages.README_WIZARD_BANNER);
45: }
46:
47: /** (non-Javadoc)
48: * Method declared on IWizard
49: */
50: public boolean performFinish() {
51: return mainPage.finish();
52: }
53: }
|