2 * Copyright 2000-2009 JetBrains s.r.o.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
16 package com
.intellij
.ui
.wizard
;
18 import com
.intellij
.openapi
.util
.IconLoader
;
22 public abstract class WizardStep
<T
extends WizardModel
> {
24 public static final WizardStep FORCED_GOAL_DROPPED
= new Empty();
25 public static final WizardStep FORCED_GOAL_ACHIEVED
= new Empty();
27 private String myTitle
= "";
28 private String myExplanation
= "";
30 private Icon myIcon
= IconLoader
.getIcon("/newprojectwizard.png");
31 private String myHelpId
;
33 protected WizardStep() {
36 public WizardStep(String title
) {
40 public WizardStep(String title
, String explanation
) {
42 myExplanation
= explanation
;
45 public WizardStep(String title
, String explanation
, Icon icon
) {
47 myExplanation
= explanation
;
51 public WizardStep(String title
, String explanation
, Icon icon
, String helpId
) {
53 myExplanation
= explanation
;
58 public String
getTitle() {
62 public String
getExplanation() {
66 public abstract JComponent
prepare(WizardNavigationState state
);
68 public WizardStep
onNext(T model
) {
69 return model
.getNextFor(this);
72 public WizardStep
onPrevious(T model
) {
73 return model
.getPreviousFor(this);
76 public boolean onCancel() {
80 public boolean onFinish() {
84 public Icon
getIcon() {
88 public String
getHelpId() {
92 public static class Empty
extends WizardStep
{
93 public JComponent
prepare(WizardNavigationState state
) {