1 /*
2 * CDDL HEADER START
3 *
4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License, Version 1.0 only
6 * (the "License"). You may not use this file except in compliance
7 * with the License.
8 *
9 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 * or http://www.opensolaris.org/os/licensing.
11 * See the License for the specific language governing permissions
12 * and limitations under the License.
13 *
14 * When distributing Covered Code, include this CDDL HEADER in each
15 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 * If applicable, add the following below this CDDL HEADER, with the
17 * fields enclosed by brackets "[]" replaced with your own identifying
18 * information: Portions Copyright [yyyy] [name of copyright owner]
19 *
20 * CDDL HEADER END
21 */
22 /*
23 * ident "%Z%%M% %I% %E% SMI"
24 *
25 * Copyright (c) 1998-1999 by Sun Microsystems, Inc.
26 * All rights reserved.
27 */
28 package com.sun.dhcpmgr.ui;
29
30 import java.awt.Component;
31
32 /**
33 * The interface implemented by a step in a wizard.
34 *
35 * @see Wizard
36 */
37 public interface WizardStep {
38 /**
39 * Constant for traversing forward.
40 */
41 public static final int FORWARD = 1;
42 /**
43 * Constant for traversing backward.
44 */
45 public static final int BACKWARD = -1;
46 /**
47 * Returns the descriptive text which will be displayed for this step in the
48 * contents pane (i.e. the left side of the wizard). The description must
49 * be unique for each step used in a wizard.
50 * @return a <code>String</code> describing the step
51 */
52 public String getDescription();
53 /**
54 * Returns the component to be displayed when the step is active. Usually
55 * this will be some form of a panel. This is displayed in the right half
56 * of the wizard's display area.
57 * @return a <code>Component</code> to display
58 */
59 public Component getComponent();
60 /**
61 * Called when the step transitions from the inactive to active state.
62 * Use the direction to determine which direction user is traversing to
63 * possibly differentiate the initialization actions needed.
64 * @param direction either <code>FORWARD</code> or <code>BACKWARD</code> to
65 * indicate direction of traversal.
66 */
67 public void setActive(int direction);
68 /**
69 * Called when the step transitions from the active to inactive state.
70 * Use the direction to determine which direction user is traversing to
71 * differentiate the input processing needed. Return false if there is a
72 * problem the user needs to correct before being allowed to proceed to the
73 * next step.
74 * @param direction either <code>FORWARD</code> or <code>BACKWARD</code> to
75 * indicate direction of traversal.
76 * @return <code>true</code> if traversal should proceed,
77 * <code>false</code> if not.
78 */
79 public boolean setInactive(int direction);
80 }