KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > jface > wizard > IWizardNode


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.jface.wizard;
12
13 import org.eclipse.swt.graphics.Point;
14
15 /**
16  * A wizard node acts a placeholder for a real wizard in a wizard
17  * selection page. It is done in such a way that the actual creation
18  * of a wizard can be deferred until the wizard is really needed.
19  * <p>
20  * When a wizard node comes into existence, its wizard may or may
21  * not have been created yet; <code>isContentCreated</code> can
22  * be used to determine which. A node may be asked for its wizard
23  * using <code>getWizard</code>, which will force it to be created
24  * if required. Once the client is done with a wizard node, its
25  * <code>dispose</code>method must be called to free up the wizard;
26  * once disposes, the node should no longer be used.
27  * </p>
28  * <p>
29  * This interface should be implemented by clients wishing to
30  * support this kind of wizard placeholder in a wizard selection page.
31  * </p>
32  *
33  * @see WizardSelectionPage
34  */

35 public interface IWizardNode {
36     /**
37      * Disposes the wizard managed by this node. Does nothing
38      * if the wizard has not been created.
39      * <p>
40      * This is the last message that should ever be sent to this node.
41      * </p>
42      */

43     public void dispose();
44
45     /**
46      * Returns the extent of the wizard for this node.
47      * <p>
48      * If the content has not yet been created, calling this method
49      * does not trigger the creation of the wizard. This allows
50      * this node to suggest an extent in advance of actually creating
51      * the wizard.
52      * </p>
53      *
54      * @return the extent, or <code>(-1, -1)</code> extent is not known
55      */

56     public Point getExtent();
57
58     /**
59      * Returns the wizard this node stands for.
60      * <p>
61      * If the content has not been created beforehand, calling this
62      * method triggers the creation of the wizard and caches it so that
63      * the identical wizard object is returned on subsequent calls.
64      * </p>
65      *
66      * @return the wizard
67      */

68     public IWizard getWizard();
69
70     /**
71      * Returns whether a wizard has been created for this node.
72      *
73      * @return <code>true</code> if a wizard has been created,
74      * and <code>false</code> otherwise
75      */

76     public boolean isContentCreated();
77 }
78
Popular Tags