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