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.pde.internal.ui.wizards;
11:
12: import java.util.Dictionary;
13:
14: import org.eclipse.jface.viewers.IStructuredSelection;
15: import org.eclipse.jface.wizard.Wizard;
16: import org.eclipse.pde.internal.ui.PDEUIMessages;
17: import org.eclipse.ui.INewWizard;
18: import org.eclipse.ui.IWorkbench;
19:
20: public class NewWizard extends Wizard implements INewWizard,
21: IDefaultValueConsumer {
22: private org.eclipse.ui.IWorkbench workbench;
23: private org.eclipse.jface.viewers.IStructuredSelection selection;
24: private Dictionary defaultValues;
25:
26: public NewWizard() {
27: super ();
28: setWindowTitle(PDEUIMessages.NewWizard_wtitle);
29: }
30:
31: public org.eclipse.jface.viewers.IStructuredSelection getSelection() {
32: return selection;
33: }
34:
35: public IWorkbench getWorkbench() {
36: return workbench;
37: }
38:
39: public void init(IWorkbench workbench,
40: IStructuredSelection selection) {
41: this .workbench = workbench;
42: this .selection = selection;
43: }
44:
45: public boolean performFinish() {
46: return true;
47: }
48:
49: /*
50: * (non-Javadoc)
51: *
52: * @see org.eclipse.pde.internal.ui.wizards.IDefaultValueConsumer#getDefaultValue(java.lang.String)
53: */
54: public String getDefaultValue(String key) {
55: if (defaultValues == null)
56: return null;
57: return (String) defaultValues.get(key);
58: }
59:
60: /*
61: * (non-Javadoc)
62: *
63: * @see org.eclipse.pde.internal.ui.wizards.IDefaultValueConsumer#init(java.util.Dictionary)
64: */
65: public void init(Dictionary defaultValues) {
66: this.defaultValues = defaultValues;
67: }
68: }
|