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.jface.wizard;
11:
12: import org.eclipse.swt.graphics.Point;
13:
14: /**
15: * A wizard node acts a placeholder for a real wizard in a wizard
16: * selection page. It is done in such a way that the actual creation
17: * of a wizard can be deferred until the wizard is really needed.
18: * <p>
19: * When a wizard node comes into existence, its wizard may or may
20: * not have been created yet; <code>isContentCreated</code> can
21: * be used to determine which. A node may be asked for its wizard
22: * using <code>getWizard</code>, which will force it to be created
23: * if required. Once the client is done with a wizard node, its
24: * <code>dispose</code>method must be called to free up the wizard;
25: * once disposes, the node should no longer be used.
26: * </p>
27: * <p>
28: * This interface should be implemented by clients wishing to
29: * support this kind of wizard placeholder in a wizard selection page.
30: * </p>
31: *
32: * @see WizardSelectionPage
33: */
34: public interface IWizardNode {
35: /**
36: * Disposes the wizard managed by this node. Does nothing
37: * if the wizard has not been created.
38: * <p>
39: * This is the last message that should ever be sent to this node.
40: * </p>
41: */
42: public void dispose();
43:
44: /**
45: * Returns the extent of the wizard for this node.
46: * <p>
47: * If the content has not yet been created, calling this method
48: * does not trigger the creation of the wizard. This allows
49: * this node to suggest an extent in advance of actually creating
50: * the wizard.
51: * </p>
52: *
53: * @return the extent, or <code>(-1, -1)</code> extent is not known
54: */
55: public Point getExtent();
56:
57: /**
58: * Returns the wizard this node stands for.
59: * <p>
60: * If the content has not been created beforehand, calling this
61: * method triggers the creation of the wizard and caches it so that
62: * the identical wizard object is returned on subsequent calls.
63: * </p>
64: *
65: * @return the wizard
66: */
67: public IWizard getWizard();
68:
69: /**
70: * Returns whether a wizard has been created for this node.
71: *
72: * @return <code>true</code> if a wizard has been created,
73: * and <code>false</code> otherwise
74: */
75: public boolean isContentCreated();
76: }
|