KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > team > internal > ui > wizards > ConfigurationWizardNode


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

11 package org.eclipse.team.internal.ui.wizards;
12
13
14 import org.eclipse.core.runtime.CoreException;
15 import org.eclipse.jface.wizard.IWizard;
16 import org.eclipse.jface.wizard.IWizardNode;
17 import org.eclipse.swt.graphics.Point;
18 import org.eclipse.team.internal.ui.Policy;
19
20 /**
21  * ConfigurationWizardNode represents the objects in the
22  * table in the Configuration wizard.
23  */

24 public class ConfigurationWizardNode implements IWizardNode {
25     // The element this node represents
26
ConfigurationWizardElement element;
27     // The wizard this node is in
28
IWizard wizard;
29     
30     /**
31      * Create a new ConfigurationWizardNode
32      *
33      * @param element the configuration wizard element for this node
34      */

35     public ConfigurationWizardNode(ConfigurationWizardElement element) {
36         this.element = element;
37     }
38     /*
39      * Method declared on IWizardNode.
40      */

41     public void dispose() {
42         if (wizard != null) {
43             wizard.dispose();
44             wizard = null;
45         }
46     }
47     /*
48      * Method declared on IWizardNode.
49      */

50     public Point getExtent() {
51         return new Point(-1, -1);
52     }
53     /*
54      * Method declared on IWizardNode.
55      */

56     public IWizard getWizard() {
57         if (wizard == null) {
58             try {
59                 wizard = (IWizard)element.createExecutableExtension();
60             } catch (CoreException e) {
61                 System.out.println(Policy.bind("ConfigurationWizard.exceptionCreatingWizard")); //$NON-NLS-1$
62
}
63         }
64         return wizard;
65     }
66     /*
67      * Method declared on IWizardNode.
68      */

69     public boolean isContentCreated() {
70         return wizard != null;
71     }
72 }
73
Popular Tags